@@ -233,8 +233,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
233
233
avail = dbc -> alen - dbc -> apos ;
234
234
have = size * nmemb ;
235
235
236
- DBGH (dbc , "libcurl: new data chunk of size [%zd ] x %zd arrived; "
237
- "available buffer: %zd/%zd ." , nmemb , size , avail , dbc -> alen );
236
+ DBGH (dbc , "libcurl: new data chunk of size [%zu ] x %zu arrived; "
237
+ "available buffer: %zu/%zu ." , nmemb , size , avail , dbc -> alen );
238
238
239
239
/* do I need to grow the existing buffer? */
240
240
if (avail < have ) {
@@ -244,14 +244,14 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
244
244
while (need < dbc -> apos + have ) {
245
245
need *= 2 ;
246
246
}
247
- DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zd "
248
- "from %zd to %zd bytes." , have , dbc -> alen , need );
247
+ DBGH (dbc , "libcurl: need to grow buffer for new chunk of %zu "
248
+ "from %zu to %zu bytes." , have , dbc -> alen , need );
249
249
if (dbc -> amax && (dbc -> amax < need )) { /* do I need more than max? */
250
250
if (dbc -> amax <= (size_t )dbc -> alen ) { /* am I at max already? */
251
251
goto too_large ;
252
252
} else { /* am not: alloc max possible (if that's enough) */
253
253
need = dbc -> amax ;
254
- WARNH (dbc , "libcurl: capped buffer to max: %zd " , need );
254
+ WARNH (dbc , "libcurl: capped buffer to max: %zu " , need );
255
255
/* re'eval what I have available... */
256
256
avail = dbc -> amax - dbc -> apos ;
257
257
if (avail < have ) {
@@ -267,7 +267,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
267
267
* the chunk right past the indicated JSON length.) */
268
268
wbuf = realloc (dbc -> abuff , need + /*\0*/ 1 );
269
269
if (! wbuf ) {
270
- ERRNH (dbc , "libcurl: failed to realloc to %zdB ." , need );
270
+ ERRNH (dbc , "libcurl: failed to realloc to %zuB ." , need );
271
271
return 0 ;
272
272
}
273
273
dbc -> abuff = wbuf ;
@@ -278,7 +278,7 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
278
278
dbc -> apos += have ;
279
279
/* Add the 0-term for UJSON4C (but don't count it - see above) */
280
280
dbc -> abuff [dbc -> apos ] = '\0' ;
281
- DBGH (dbc , "libcurl: copied %zdB : `%.*s`." , have , have , ptr );
281
+ DBGH (dbc , "libcurl: copied %zuB : `%.*s`." , have , have , ptr );
282
282
283
283
/*
284
284
* "Your callback should return the number of bytes actually taken care
@@ -293,8 +293,8 @@ static size_t write_callback(char *ptr, size_t size, size_t nmemb,
293
293
return have ;
294
294
295
295
too_large :
296
- ERRH (dbc , "libcurl: at %zd and can't grow past max %zd for new chunk of "
297
- "%zd bytes." , dbc -> apos , dbc -> amax , have );
296
+ ERRH (dbc , "libcurl: at %zu and can't grow past max %zu for new chunk of "
297
+ "%zu bytes." , dbc -> apos , dbc -> amax , have );
298
298
return 0 ;
299
299
}
300
300
@@ -1093,9 +1093,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
1093
1093
ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
1094
1094
LWSTR (& attrs -> port ));
1095
1095
if (cnt <= 0 ) {
1096
- ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "` [%zd], "
1097
- "port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
1098
- LWSTR (& attrs -> port ));
1096
+ ERRNH (dbc , "failed to print SQL URL out of server: `" LWPDL "`, "
1097
+ "port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
1099
1098
SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's SQL URL failed" , 0 );
1100
1099
goto err ;
1101
1100
} else {
@@ -1130,9 +1129,8 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
1130
1129
ipv6 ? "[" : "" , LWSTR (& attrs -> server ), ipv6 ? "]" : "" ,
1131
1130
LWSTR (& attrs -> port ));
1132
1131
if (cnt <= 0 ) {
1133
- ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "` [%zd],"
1134
- " port: `" LWPDL "` [%zd]." , LWSTR (& attrs -> server ),
1135
- LWSTR (& attrs -> port ));
1132
+ ERRNH (dbc , "failed to print root URL out of server: `" LWPDL "`,"
1133
+ " port: `" LWPDL "`." , LWSTR (& attrs -> server ), LWSTR (& attrs -> port ));
1136
1134
SET_HDIAG (dbc , SQL_STATE_HY000 , "printing server's URL failed" , 0 );
1137
1135
goto err ;
1138
1136
} else {
@@ -1151,16 +1149,16 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
1151
1149
*/
1152
1150
if (attrs -> uid .cnt ) {
1153
1151
if (! wstr_to_utf8 (& attrs -> uid , & dbc -> uid )) {
1154
- ERRH (dbc , "failed to convert username [%zd ] `" LWPDL "` to UTF8." ,
1152
+ ERRH (dbc , "failed to convert username [%zu ] `" LWPDL "` to UTF8." ,
1155
1153
attrs -> uid .cnt , LWSTR (& attrs -> uid ));
1156
1154
SET_HDIAG (dbc , SQL_STATE_HY000 , "username UTF8 conversion "
1157
1155
"failed" , 0 );
1158
1156
goto err ;
1159
1157
}
1160
1158
if (attrs -> pwd .cnt ) {
1161
1159
if (! wstr_to_utf8 (& attrs -> pwd , & dbc -> pwd )) {
1162
- ERRH (dbc , "failed to convert password [%zd] (-not shown-) to "
1163
- "UTF8." , attrs -> pwd .cnt );
1160
+ ERRH (dbc , "failed to convert password [%zu] `%s` to "
1161
+ "UTF8." , attrs -> pwd .cnt , ESODBC_PWD_VAL_SUBST );
1164
1162
SET_HDIAG (dbc , SQL_STATE_HY000 , "password UTF8 "
1165
1163
"conversion failed" , 0 );
1166
1164
goto err ;
@@ -1213,7 +1211,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
1213
1211
WARNH (dbc , "no reply body limit set." );
1214
1212
}
1215
1213
}
1216
- INFOH (dbc , "max body size: %zd ." , dbc -> amax );
1214
+ INFOH (dbc , "max body size: %zu ." , dbc -> amax );
1217
1215
1218
1216
/*
1219
1217
* set max fetch size
@@ -1240,7 +1238,7 @@ SQLRETURN config_dbc(esodbc_dbc_st *dbc, esodbc_dsn_attrs_st *attrs)
1240
1238
dbc -> fetch .slen = (char )attrs -> max_fetch_size .cnt ;
1241
1239
dbc -> fetch .str = malloc (dbc -> fetch .slen + /*\0*/ 1 );
1242
1240
if (! dbc -> fetch .str ) {
1243
- ERRNH (dbc , "failed to alloc %zdB ." , dbc -> fetch .slen );
1241
+ ERRNH (dbc , "failed to alloc %cB ." , dbc -> fetch .slen );
1244
1242
RET_HDIAGS (dbc , SQL_STATE_HY001 );
1245
1243
}
1246
1244
dbc -> fetch .str [dbc -> fetch .slen ] = 0 ;
@@ -1729,8 +1727,8 @@ static BOOL elastic_intervals_name2types(wstr_st *type_name,
1729
1727
break ;
1730
1728
}
1731
1729
1732
- ERR ("unrecognized Elastic type `" LWPDL "` (%zd) ." , LWSTR ( type_name ) ,
1733
- type_name -> cnt );
1730
+ ERR ("unrecognized Elastic type: [%zu] `" LWPDL "`." , type_name -> cnt ,
1731
+ LWSTR ( type_name ) );
1734
1732
return FALSE;
1735
1733
}
1736
1734
@@ -2409,7 +2407,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
2409
2407
ERRH (stmt , "Elasticsearch returned no type as supported." );
2410
2408
goto end ;
2411
2409
} else if (ESODBC_MAX_NO_TYPES < row_cnt ) {
2412
- ERRH (stmt , "Elasticsearch returned too many types (%d vs limit %zd )." ,
2410
+ ERRH (stmt , "Elasticsearch returned too many types (%ld vs limit %d )." ,
2413
2411
row_cnt , ESODBC_MAX_NO_TYPES );
2414
2412
goto end ;
2415
2413
} else {
@@ -2425,7 +2423,7 @@ static BOOL load_es_types(esodbc_dbc_st *dbc)
2425
2423
/* indicate rowset size */
2426
2424
if (! SQL_SUCCEEDED (EsSQLSetStmtAttrW (stmt , SQL_ATTR_ROW_ARRAY_SIZE ,
2427
2425
(SQLPOINTER )ESODBC_MAX_NO_TYPES , 0 ))) {
2428
- ERRH (stmt , "failed to set rowset size (%zd )." ,
2426
+ ERRH (stmt , "failed to set rowset size (%d )." ,
2429
2427
ESODBC_MAX_NO_TYPES );
2430
2428
goto end ;
2431
2429
}
@@ -2724,7 +2722,7 @@ SQLRETURN EsSQLDriverConnectW
2724
2722
cnt += attrs .server .cnt + /*\0*/ 1 ;
2725
2723
dbc -> dsn .str = malloc (cnt * sizeof (SQLWCHAR )); /* alloc for both */
2726
2724
if (! dbc -> dsn .str ) {
2727
- ERRNH (dbc , "OOM for %zdB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
2725
+ ERRNH (dbc , "OOM for %zuB ." , (orig_dsn .cnt + 1 ) * sizeof (SQLWCHAR ));
2728
2726
RET_HDIAGS (dbc , SQL_STATE_HY001 );
2729
2727
}
2730
2728
/* copy DSN */
0 commit comments