From 7a7ac9419c042d860204bb74137e37745d713a52 Mon Sep 17 00:00:00 2001 From: brodsom Date: Tue, 1 Apr 2003 21:59:31 +0000 Subject: [PATCH] Correct formats --- src/jrd/codes.epp | 12 ++++++------ src/jrd/dpm.epp | 5 +++-- src/jrd/functions.cpp | 2 +- src/jrd/isc_sync.cpp | 4 ++-- src/jrd/perf.cpp | 6 +++--- src/wal/walw.cpp | 8 +++++--- src/wal/wstatus.cpp | 3 ++- 7 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/jrd/codes.epp b/src/jrd/codes.epp index 69c828a34d..bc3b0cf139 100644 --- a/src/jrd/codes.epp +++ b/src/jrd/codes.epp @@ -377,7 +377,7 @@ static void build_iberror_h(void) last_code = N.CODE; new_code = ENCODE_ISC_MSG(S.NUMBER, N.FAC_CODE); - ib_fprintf(iberror, "#define isc_%-32.32s %dL\n", S.GDS_SYMBOL, + ib_fprintf(iberror, "#define isc_%-32.32s %luL\n", S.GDS_SYMBOL, new_code); ++code; END_FOR; @@ -442,7 +442,7 @@ static void build_codes_h(void) last_code = N.CODE; new_code = ENCODE_ISC_MSG(S.NUMBER, N.FAC_CODE); - ib_fprintf(c_codes, "const SLONG gds_%-32.32s = %dL;\n", S.GDS_SYMBOL, + ib_fprintf(c_codes, "const SLONG gds_%-32.32s = %luL;\n", S.GDS_SYMBOL, new_code); ++code; @@ -514,7 +514,7 @@ static void build_codes_h(void) last_code = N.CODE; new_code = ENCODE_ISC_MSG(S.NUMBER, N.FAC_CODE); - ib_fprintf(c_codes, "#define gds__%-32.32s %dL\n", S.GDS_SYMBOL, + ib_fprintf(c_codes, "#define gds__%-32.32s %luL\n", S.GDS_SYMBOL, new_code); ++code; @@ -674,10 +674,10 @@ const\n\ last_code = N.CODE; new_code = ENCODE_ISC_MSG(N.NUMBER, N.FAC_CODE); - ib_fprintf(pas_codes, "\tgds_%-32.32s = %d;\n", S.GDS_SYMBOL, + ib_fprintf(pas_codes, "\tgds_%-32.32s = %lu;\n", S.GDS_SYMBOL, new_code); ib_fprintf(ftn_codes, - " INTEGER*4 GDS__%-32.32s\n PARAMETER (GDS__%-32.32s = %d)\n", + " INTEGER*4 GDS__%-32.32s\n PARAMETER (GDS__%-32.32s = %lu)\n", S.GDS_SYMBOL, S.GDS_SYMBOL, new_code); ib_fprintf(rdbcodes, "%d,\n", S.VMS_CODE); @@ -697,7 +697,7 @@ const\n\ *p && *p != ' ' && p < S.GDS_SYMBOL + sizeof(S.GDS_SYMBOL) - 1; p++); *p = 0; - ib_fprintf(code_text, "{\"%s\", %d},\n", S.GDS_SYMBOL, new_code); + ib_fprintf(code_text, "{\"%s\", %lu},\n", S.GDS_SYMBOL, new_code); ++code; END_FOR; diff --git a/src/jrd/dpm.epp b/src/jrd/dpm.epp index 6671fe4810..7cac1b26c4 100644 --- a/src/jrd/dpm.epp +++ b/src/jrd/dpm.epp @@ -2101,7 +2101,7 @@ void DPM_update( TDBB tdbb, RPB * rpb, LLS * stack, JRD_TRA transaction) #ifdef VIO_DEBUG if (debug_flag > DEBUG_WRITES) - ib_printf("DPM_update (rpb %"SLONGFORMAT", stack, transaction %d)\n", + ib_printf("DPM_update (rpb %"SLONGFORMAT", stack, transaction %"SLONGFORMAT")\n", rpb->rpb_number, transaction ? transaction->tra_number : 0); if (debug_flag > DEBUG_WRITES_INFO) ib_printf @@ -2350,7 +2350,8 @@ static void fragment( if (debug_flag > DEBUG_WRITES) ib_printf ("fragment (rpb %"SLONGFORMAT - ", available_space %d, dcc, length %d, transaction %d)\n", + ", available_space %d, dcc, length %d, transaction %" + SLONGFORMAT")\n", rpb->rpb_number, available_space, length, transaction ? transaction->tra_number : 0); if (debug_flag > DEBUG_WRITES_INFO) diff --git a/src/jrd/functions.cpp b/src/jrd/functions.cpp index 2a65e4753d..178831fa3e 100644 --- a/src/jrd/functions.cpp +++ b/src/jrd/functions.cpp @@ -120,7 +120,7 @@ static int test(long n, char *result) * **************************************/ - sprintf(result, "%d is a number", n); + sprintf(result, "%ld is a number", n); const char *end = result + 20; while (*result) diff --git a/src/jrd/isc_sync.cpp b/src/jrd/isc_sync.cpp index 6a258a46fa..f6b268ba06 100644 --- a/src/jrd/isc_sync.cpp +++ b/src/jrd/isc_sync.cpp @@ -2774,7 +2774,7 @@ UCHAR *DLL_EXPORT ISC_map_file( /* Create the real file mapping object. */ for (p = expanded_filename; *p; p++); - sprintf(p, "%d", header_address[1]); + sprintf(p, "%"SLONGFORMAT, header_address[1]); HANDLE file_obj = CreateFileMapping(file_handle, @@ -3676,7 +3676,7 @@ UCHAR *DLL_EXPORT ISC_remap_file(STATUS * status_vector, while (1) { TEXT expanded_filename[MAXPATHLEN]; - sprintf(expanded_filename, "%s%d", shmem_data->sh_mem_name, + sprintf(expanded_filename, "%s%"SLONGFORMAT, shmem_data->sh_mem_name, shmem_data->sh_mem_hdr_address[1] + 1); file_obj = CreateFileMapping(shmem_data->sh_mem_handle, diff --git a/src/jrd/perf.cpp b/src/jrd/perf.cpp index 60104260ce..723b5fca8b 100644 --- a/src/jrd/perf.cpp +++ b/src/jrd/perf.cpp @@ -177,9 +177,9 @@ int API_ROUTINE perf_format( case 'u': case 's': #ifdef VMS - sprintf(p, "%d.%.2d", delta / 100, (delta % 100)); + sprintf(p, "%"SLONGFORMAT".%.2"SLONGFORMAT, delta / 100, (delta % 100)); #else - sprintf(p, "%d.%.2d", delta / TICK, + sprintf(p, "%"SLONGFORMAT".%.2"SLONGFORMAT, delta / TICK, (delta % TICK) * 100 / TICK); #endif while (*p) @@ -187,7 +187,7 @@ int API_ROUTINE perf_format( break; case 'e': - sprintf(p, "%d.%.2d", delta / 100, delta % 100); + sprintf(p, "%"SLONGFORMAT".%.2"SLONGFORMAT, delta / 100, delta % 100); while (*p) p++; break; diff --git a/src/wal/walw.cpp b/src/wal/walw.cpp index 2855d4807e..098ad6d8ec 100644 --- a/src/wal/walw.cpp +++ b/src/wal/walw.cpp @@ -1752,7 +1752,7 @@ static void report_walw_bug_or_error( if (PRINT_DEBUG_MSGS) { PRINT_TIME(DEBUG_FD, LOCAL_TIME); - ib_fprintf(DEBUG_FD, "WAL writer encountered error, code=%d\n", code); + ib_fprintf(DEBUG_FD, "WAL writer encountered error, code=%ld\n", code); } Firebird::status_exception::raise(status_vector[1]); @@ -2300,7 +2300,8 @@ static void write_wal_statistics( WAL WAL_handle) WAL_segment->wals_acquire_count, WAL_segment->wals_put_count); ib_fprintf(stat_file, - "Total IOs=%ld, Avg IO size=%d, last blk_seqno=%ld\n", + "Total IOs=%"SLONGFORMAT", Avg IO size=%"SLONGFORMAT + ", last blk_seqno=%"SLONGFORMAT"\n", WAL_segment->wals_IO_count, WAL_segment->wals_total_IO_bytes / (WAL_segment->wals_IO_count ? WAL_segment-> @@ -2318,7 +2319,8 @@ static void write_wal_statistics( WAL WAL_handle) ib_fprintf(stat_file, "current log seqno=%ld, logfile=%s\n", WAL_segment->wals_log_seqno, WAL_segment->wals_logname); ib_fprintf(stat_file, - "log partition offset=%ld, current offset=%ld\n", + "log partition offset=%"SLONGFORMAT", current offset=%" + SLONGFORMAT"\n", WAL_segment->wals_log_partition_offset, WAL_segment->wals_buf_offset); ib_fprintf(stat_file, diff --git a/src/wal/wstatus.cpp b/src/wal/wstatus.cpp index df2e4781b8..00dd027431 100644 --- a/src/wal/wstatus.cpp +++ b/src/wal/wstatus.cpp @@ -129,7 +129,8 @@ void WSTATUS_dump_wal_segment( WAL WAL_handle, int acquire_flag, FPRINTF(outfile, "---------------------------------------------------------\n"); FPRINTF(outfile, - "Total WAL IOs=%ld, Avg IO size=%d, next block seqno=%ld\n", + "Total WAL IOs=%"SLONGFORMAT", Avg IO size=%"SLONGFORMAT + ", next block seqno=%"SLONGFORMAT"\n", WAL_segment->wals_IO_count, WAL_segment->wals_total_IO_bytes / (WAL_segment->wals_IO_count ? WAL_segment->wals_IO_count : 1),