@@ -447,7 +447,7 @@ inline void *deferred_address(SQLSMALLINT field_id, size_t pos,
447447#undef ROW_OFFSETS
448448
449449 DBGH (desc -> hdr .stmt , "rec@0x%p, field_id:%hd, pos: %zu : base@0x%p, "
450- "offset=%lld, elem_size=%zu" , rec , field_id , pos , base , offt ,
450+ "offset=%lld, elem_size=%zu" , rec , field_id , pos , base , ( int64_t ) offt ,
451451 elem_size );
452452
453453 return base ? (char * )base + offt + pos * elem_size : NULL ;
@@ -600,7 +600,7 @@ static inline void gd_offset_apply(esodbc_stmt_st *stmt, xstr_st *xstr)
600600 xstr -> c .cnt -= stmt -> gd_offt ;
601601 }
602602
603- DBGH (stmt , "applied an offset of %lld." , stmt -> gd_offt );
603+ DBGH (stmt , "applied an offset of %lld." , ( int64_t ) stmt -> gd_offt );
604604}
605605
606606/*
@@ -622,7 +622,7 @@ static inline void gd_offset_update(esodbc_stmt_st *stmt, size_t cnt,
622622 }
623623
624624 DBGH (stmt , "offset updated with %zu to new value of %lld." , xfed ,
625- stmt -> gd_offt );
625+ ( int64_t ) stmt -> gd_offt );
626626}
627627
628628
@@ -990,7 +990,7 @@ SQLRETURN sql2c_longlong(esodbc_rec_st *arec, esodbc_rec_st *irec,
990990 *(_sqlctype *)data_ptr = (_sqlctype)_ll; \
991991 write_out_octets(octet_len_ptr, sizeof(_sqlctype), irec); \
992992 DBGH(stmt, "converted long long %lld to " STR(_sqlctype) " 0x%llx.", \
993- _ll, (intptr_t )*(_sqlctype *)data_ptr); \
993+ _ll, (uint64_t )*(_sqlctype *)data_ptr); \
994994 } while (0)
995995
996996 switch ((ctype = get_rec_c_type (arec , irec ))) {
@@ -3812,7 +3812,8 @@ SQLRETURN c2sql_boolean(esodbc_rec_st *arec, esodbc_rec_st *irec,
38123812 }
38133813 /*INDENT-ON*/
38143814
3815- DBGH (stmt , "parameter (pos#%lld) converted to boolean: %d." , pos , val );
3815+ DBGH (stmt , "parameter (pos#%llu) converted to boolean: %d." ,
3816+ (uint64_t )pos , val );
38163817
38173818 if (val ) {
38183819 memcpy (dest , JSON_VAL_TRUE , sizeof (JSON_VAL_TRUE ) - /*\0*/ 1 );
@@ -4064,7 +4065,7 @@ static SQLRETURN binary_to_number(esodbc_rec_st *arec, esodbc_rec_st *irec,
40644065 if (osize != sizeof(_sqlc_type)) { \
40654066 ERRH(stmt, "binary data length (%zu) misaligned with target" \
40664067 " data type (%hd) size (%lld)", sizeof(_sqlc_type), \
4067- irec->es_type->data_type, osize); \
4068+ irec->es_type->data_type, (int64_t) osize); \
40684069 RET_HDIAGS(stmt, SQL_STATE_HY090); \
40694070 } \
40704071 } while (0)
@@ -4322,10 +4323,10 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
43224323 esodbc_stmt_st * stmt = HDRH (irec -> desc )-> stmt ;
43234324
43244325 colsize = get_param_size (irec );
4325- DBGH (stmt , "requested column size: %llu." , colsize );
4326+ DBGH (stmt , "requested column size: %llu." , ( uint64_t ) colsize );
43264327
43274328 decdigits = get_param_decdigits (irec );
4328- DBGH (stmt , "requested decimal digits: %llu ." , decdigits );
4329+ DBGH (stmt , "requested decimal digits: %hd ." , decdigits );
43294330 if (ESODBC_MAX_SEC_PRECISION < decdigits ) {
43304331 WARNH (stmt , "requested decimal digits adjusted from %hd to %d (max)." ,
43314332 decdigits , ESODBC_MAX_SEC_PRECISION );
@@ -4338,7 +4339,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
43384339 if (colsize < TIME_TEMPLATE_LEN (0 ) ||
43394340 colsize == TIME_TEMPLATE_LEN (1 ) - 1 /* `:ss.`*/ ) {
43404341 ERRH (stmt , "invalid column size value: %llu; allowed: "
4341- "8 or 9 + fractions count." , colsize );
4342+ "8 or 9 + fractions count." , ( uint64_t ) colsize );
43424343 RET_HDIAGS (stmt , SQL_STATE_HY104 );
43434344 }
43444345 colsize += DATE_TEMPLATE_LEN + /* ` `/`T` */ 1 ;
@@ -4350,7 +4351,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
43504351 if (colsize ) {
43514352 if (colsize != DATE_TEMPLATE_LEN ) {
43524353 ERRH (stmt , "invalid column size value: %llu; allowed: "
4353- "%zu." , colsize , DATE_TEMPLATE_LEN );
4354+ "%zu." , ( uint64_t ) colsize , DATE_TEMPLATE_LEN );
43544355 RET_HDIAGS (stmt , SQL_STATE_HY104 );
43554356 }
43564357 colsize += /* ` `/`T` */ 1 + TIME_TEMPLATE_LEN (0 );
@@ -4365,7 +4366,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
43654366 if (colsize && (colsize < TIMESTAMP_NOSEC_TEMPLATE_LEN ||
43664367 colsize == 17 || colsize == 18 )) {
43674368 ERRH (stmt , "invalid column size value: %llu; allowed: "
4368- "16, 19 or 20 + fractions count." , colsize );
4369+ "16, 19 or 20 + fractions count." , ( uint64_t ) colsize );
43694370 RET_HDIAGS (stmt , SQL_STATE_HY104 );
43704371 }
43714372 break ;
@@ -4374,7 +4375,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
43744375 }
43754376
43764377 DBGH (stmt , "applying: column size: %llu, decimal digits: %hd." ,
4377- colsize , decdigits );
4378+ ( uint64_t ) colsize , decdigits );
43784379 * _colsize = colsize ;
43794380 * _decdigits = decdigits ;
43804381 return SQL_SUCCESS ;
@@ -4514,21 +4515,22 @@ static SQLRETURN c2sql_str2interval(esodbc_rec_st *arec, esodbc_rec_st *irec,
45144515 } else {
45154516 octet_len = * octet_len_ptr ;
45164517 if (octet_len <= 0 ) {
4517- ERRH (stmt , "invalid interval buffer length: %llu." , octet_len );
4518+ ERRH (stmt , "invalid interval buffer length: %lld." ,
4519+ (int64_t )octet_len );
45184520 RET_HDIAGS (stmt , SQL_STATE_HY090 );
45194521 }
45204522 }
45214523
45224524 if (ctype == SQL_C_CHAR ) {
45234525 if (sizeof (wbuff )/sizeof (wbuff [0 ]) < (size_t )octet_len ) {
4524- INFOH (stmt , "translation buffer too small (%zu < %lld ), "
4526+ INFOH (stmt , "translation buffer too small (%zu < %zu ), "
45254527 "allocation needed." , sizeof (wbuff )/sizeof (wbuff [0 ]),
45264528 (size_t )octet_len );
45274529 /* 0-term is most of the time not counted in input str and
45284530 * ascii_c2w() writes it -> always allocate space for it */
45294531 wptr = malloc ((octet_len + 1 ) * sizeof (SQLWCHAR ));
45304532 if (! wptr ) {
4531- ERRNH (stmt , "OOM for %lld x SQLWCHAR" , octet_len );
4533+ ERRNH (stmt , "OOM for %lld x SQLWCHAR" , ( int64_t ) octet_len );
45324534 RET_HDIAGS (stmt , SQL_STATE_HY001 );
45334535 }
45344536 } else {
@@ -4537,7 +4539,7 @@ static SQLRETURN c2sql_str2interval(esodbc_rec_st *arec, esodbc_rec_st *irec,
45374539 ret = ascii_c2w ((SQLCHAR * )data_ptr , wptr , octet_len );
45384540 if (ret <= 0 ) {
45394541 ERRH (stmt , "SQLCHAR-to-SQLWCHAR conversion failed for "
4540- "[%lld] `" LCPDL "`." , octet_len , octet_len ,
4542+ "[%lld] `" LCPDL "`." , ( int64_t ) octet_len , octet_len ,
45414543 (char * )data_ptr );
45424544 if (wptr != wbuff ) {
45434545 free (wptr );
@@ -4780,7 +4782,7 @@ static SQLRETURN c2sql_cstr2qstr(esodbc_rec_st *arec, esodbc_rec_st *irec,
47804782 * dest = '"' ;
47814783 } else if ((SQLLEN )get_param_size (irec ) < cnt ) {
47824784 ERRH (stmt , "string's length (%lld) longer than parameter size (%llu)." ,
4783- cnt , get_param_size (irec ));
4785+ ( int64_t ) cnt , ( uint64_t ) get_param_size (irec ));
47844786 RET_HDIAGS (stmt , SQL_STATE_22001 );
47854787 }
47864788
@@ -4815,13 +4817,13 @@ static SQLRETURN c2sql_wstr2qstr(esodbc_rec_st *arec, esodbc_rec_st *irec,
48154817 } else {
48164818 if ((SQLLEN )get_param_size (irec ) < cnt ) {
48174819 ERRH (stmt , "string's length (%lld) longer than parameter "
4818- "size (%llu)." , cnt , get_param_size (irec ));
4820+ "size (%llu)." , ( int64_t ) cnt , ( uint64_t ) get_param_size (irec ));
48194821 RET_HDIAGS (stmt , SQL_STATE_22001 );
48204822 }
48214823 }
48224824
48234825 DBGH (stmt , "converting w-string [%lld] `" LWPDL "`; target@0x%p." ,
4824- cnt , cnt , (wchar_t * )data_ptr , dest );
4826+ ( int64_t ) cnt , cnt , (wchar_t * )data_ptr , dest );
48254827 if (cnt ) { /* U16WC_TO_MBU8 will fail with empty string, but set no err */
48264828 WAPI_CLR_ERRNO ();
48274829 octets = U16WC_TO_MBU8 ((wchar_t * )data_ptr , cnt , dest + !!dest ,
@@ -4869,7 +4871,7 @@ static SQLRETURN c2sql_number2qstr(esodbc_rec_st *arec, esodbc_rec_st *irec,
48694871 /* compare lengths only once number has actually been converted */
48704872 if (get_param_size (irec ) < * len ) {
48714873 ERRH (stmt , "converted number length (%zu) larger than parameter "
4872- "size (%llu)" , * len , get_param_size (irec ));
4874+ "size (%llu)" , * len , ( uint64_t ) get_param_size (irec ));
48734875 RET_HDIAGS (stmt , SQL_STATE_22003 );
48744876 }
48754877 dest [* len + /*1st `"`*/ 1 ] = '"' ;
0 commit comments