@@ -447,7 +447,7 @@ inline void *deferred_address(SQLSMALLINT field_id, size_t pos,
447
447
#undef ROW_OFFSETS
448
448
449
449
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 ,
451
451
elem_size );
452
452
453
453
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)
600
600
xstr -> c .cnt -= stmt -> gd_offt ;
601
601
}
602
602
603
- DBGH (stmt , "applied an offset of %lld." , stmt -> gd_offt );
603
+ DBGH (stmt , "applied an offset of %lld." , ( int64_t ) stmt -> gd_offt );
604
604
}
605
605
606
606
/*
@@ -622,7 +622,7 @@ static inline void gd_offset_update(esodbc_stmt_st *stmt, size_t cnt,
622
622
}
623
623
624
624
DBGH (stmt , "offset updated with %zu to new value of %lld." , xfed ,
625
- stmt -> gd_offt );
625
+ ( int64_t ) stmt -> gd_offt );
626
626
}
627
627
628
628
@@ -990,7 +990,7 @@ SQLRETURN sql2c_longlong(esodbc_rec_st *arec, esodbc_rec_st *irec,
990
990
*(_sqlctype *)data_ptr = (_sqlctype)_ll; \
991
991
write_out_octets(octet_len_ptr, sizeof(_sqlctype), irec); \
992
992
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); \
994
994
} while (0)
995
995
996
996
switch ((ctype = get_rec_c_type (arec , irec ))) {
@@ -3812,7 +3812,8 @@ SQLRETURN c2sql_boolean(esodbc_rec_st *arec, esodbc_rec_st *irec,
3812
3812
}
3813
3813
/*INDENT-ON*/
3814
3814
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 );
3816
3817
3817
3818
if (val ) {
3818
3819
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,
4064
4065
if (osize != sizeof(_sqlc_type)) { \
4065
4066
ERRH(stmt, "binary data length (%zu) misaligned with target" \
4066
4067
" data type (%hd) size (%lld)", sizeof(_sqlc_type), \
4067
- irec->es_type->data_type, osize); \
4068
+ irec->es_type->data_type, (int64_t) osize); \
4068
4069
RET_HDIAGS(stmt, SQL_STATE_HY090); \
4069
4070
} \
4070
4071
} while (0)
@@ -4322,10 +4323,10 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
4322
4323
esodbc_stmt_st * stmt = HDRH (irec -> desc )-> stmt ;
4323
4324
4324
4325
colsize = get_param_size (irec );
4325
- DBGH (stmt , "requested column size: %llu." , colsize );
4326
+ DBGH (stmt , "requested column size: %llu." , ( uint64_t ) colsize );
4326
4327
4327
4328
decdigits = get_param_decdigits (irec );
4328
- DBGH (stmt , "requested decimal digits: %llu ." , decdigits );
4329
+ DBGH (stmt , "requested decimal digits: %hd ." , decdigits );
4329
4330
if (ESODBC_MAX_SEC_PRECISION < decdigits ) {
4330
4331
WARNH (stmt , "requested decimal digits adjusted from %hd to %d (max)." ,
4331
4332
decdigits , ESODBC_MAX_SEC_PRECISION );
@@ -4338,7 +4339,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
4338
4339
if (colsize < TIME_TEMPLATE_LEN (0 ) ||
4339
4340
colsize == TIME_TEMPLATE_LEN (1 ) - 1 /* `:ss.`*/ ) {
4340
4341
ERRH (stmt , "invalid column size value: %llu; allowed: "
4341
- "8 or 9 + fractions count." , colsize );
4342
+ "8 or 9 + fractions count." , ( uint64_t ) colsize );
4342
4343
RET_HDIAGS (stmt , SQL_STATE_HY104 );
4343
4344
}
4344
4345
colsize += DATE_TEMPLATE_LEN + /* ` `/`T` */ 1 ;
@@ -4350,7 +4351,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
4350
4351
if (colsize ) {
4351
4352
if (colsize != DATE_TEMPLATE_LEN ) {
4352
4353
ERRH (stmt , "invalid column size value: %llu; allowed: "
4353
- "%zu." , colsize , DATE_TEMPLATE_LEN );
4354
+ "%zu." , ( uint64_t ) colsize , DATE_TEMPLATE_LEN );
4354
4355
RET_HDIAGS (stmt , SQL_STATE_HY104 );
4355
4356
}
4356
4357
colsize += /* ` `/`T` */ 1 + TIME_TEMPLATE_LEN (0 );
@@ -4365,7 +4366,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
4365
4366
if (colsize && (colsize < TIMESTAMP_NOSEC_TEMPLATE_LEN ||
4366
4367
colsize == 17 || colsize == 18 )) {
4367
4368
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 );
4369
4370
RET_HDIAGS (stmt , SQL_STATE_HY104 );
4370
4371
}
4371
4372
break ;
@@ -4374,7 +4375,7 @@ static SQLRETURN size_decdigits_for_iso8601(esodbc_rec_st *irec,
4374
4375
}
4375
4376
4376
4377
DBGH (stmt , "applying: column size: %llu, decimal digits: %hd." ,
4377
- colsize , decdigits );
4378
+ ( uint64_t ) colsize , decdigits );
4378
4379
* _colsize = colsize ;
4379
4380
* _decdigits = decdigits ;
4380
4381
return SQL_SUCCESS ;
@@ -4514,21 +4515,22 @@ static SQLRETURN c2sql_str2interval(esodbc_rec_st *arec, esodbc_rec_st *irec,
4514
4515
} else {
4515
4516
octet_len = * octet_len_ptr ;
4516
4517
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 );
4518
4520
RET_HDIAGS (stmt , SQL_STATE_HY090 );
4519
4521
}
4520
4522
}
4521
4523
4522
4524
if (ctype == SQL_C_CHAR ) {
4523
4525
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 ), "
4525
4527
"allocation needed." , sizeof (wbuff )/sizeof (wbuff [0 ]),
4526
4528
(size_t )octet_len );
4527
4529
/* 0-term is most of the time not counted in input str and
4528
4530
* ascii_c2w() writes it -> always allocate space for it */
4529
4531
wptr = malloc ((octet_len + 1 ) * sizeof (SQLWCHAR ));
4530
4532
if (! wptr ) {
4531
- ERRNH (stmt , "OOM for %lld x SQLWCHAR" , octet_len );
4533
+ ERRNH (stmt , "OOM for %lld x SQLWCHAR" , ( int64_t ) octet_len );
4532
4534
RET_HDIAGS (stmt , SQL_STATE_HY001 );
4533
4535
}
4534
4536
} else {
@@ -4537,7 +4539,7 @@ static SQLRETURN c2sql_str2interval(esodbc_rec_st *arec, esodbc_rec_st *irec,
4537
4539
ret = ascii_c2w ((SQLCHAR * )data_ptr , wptr , octet_len );
4538
4540
if (ret <= 0 ) {
4539
4541
ERRH (stmt , "SQLCHAR-to-SQLWCHAR conversion failed for "
4540
- "[%lld] `" LCPDL "`." , octet_len , octet_len ,
4542
+ "[%lld] `" LCPDL "`." , ( int64_t ) octet_len , octet_len ,
4541
4543
(char * )data_ptr );
4542
4544
if (wptr != wbuff ) {
4543
4545
free (wptr );
@@ -4780,7 +4782,7 @@ static SQLRETURN c2sql_cstr2qstr(esodbc_rec_st *arec, esodbc_rec_st *irec,
4780
4782
* dest = '"' ;
4781
4783
} else if ((SQLLEN )get_param_size (irec ) < cnt ) {
4782
4784
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 ));
4784
4786
RET_HDIAGS (stmt , SQL_STATE_22001 );
4785
4787
}
4786
4788
@@ -4815,13 +4817,13 @@ static SQLRETURN c2sql_wstr2qstr(esodbc_rec_st *arec, esodbc_rec_st *irec,
4815
4817
} else {
4816
4818
if ((SQLLEN )get_param_size (irec ) < cnt ) {
4817
4819
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 ));
4819
4821
RET_HDIAGS (stmt , SQL_STATE_22001 );
4820
4822
}
4821
4823
}
4822
4824
4823
4825
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 );
4825
4827
if (cnt ) { /* U16WC_TO_MBU8 will fail with empty string, but set no err */
4826
4828
WAPI_CLR_ERRNO ();
4827
4829
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,
4869
4871
/* compare lengths only once number has actually been converted */
4870
4872
if (get_param_size (irec ) < * len ) {
4871
4873
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 ));
4873
4875
RET_HDIAGS (stmt , SQL_STATE_22003 );
4874
4876
}
4875
4877
dest [* len + /*1st `"`*/ 1 ] = '"' ;
0 commit comments