| From 2b9a68b2a714f3cfa791e2dcb6b928b1b3a270a1 Mon Sep 17 00:00:00 2001 |
| From: Alexey Pavlov <alexpux@gmail.com> |
| Date: Fri, 9 Jun 2017 15:01:35 +0300 |
| Subject: [PATCH 29/29] Fix format warnings |
| |
| --- |
| src/gpre/c_cxx.cpp | 90 +++++++++++++++++++++++++++--------------------------- |
| 1 file changed, 45 insertions(+), 45 deletions(-) |
| |
| diff --git a/src/gpre/c_cxx.cpp b/src/gpre/c_cxx.cpp |
| index f8fe95964a..efff81cc68 100644 |
| --- a/src/gpre/c_cxx.cpp |
| +++ b/src/gpre/c_cxx.cpp |
| @@ -1226,7 +1226,7 @@ static void gen_compile( const act* action, int column) |
| fprintf(gpreGlob.out_file, "\n"); |
| align(column - INDENT); |
| for (; blob; blob = blob->blb_next) |
| - fprintf(gpreGlob.out_file, "isc_%d = ", blob->blb_ident); |
| + fprintf(gpreGlob.out_file, "isc_%zu = ", blob->blb_ident); |
| fprintf(gpreGlob.out_file, "0;"); |
| } |
| } |
| @@ -1246,14 +1246,14 @@ static void gen_create_database( const act* action, int column) |
| const gpre_req* request = ((const mdbb*) action->act_object)->mdbb_dpb_request; |
| const gpre_dbb* db = request->req_database; |
| |
| - sprintf(s1, "isc_%dl", request->req_ident); |
| - sprintf(trname, "isc_%dt", request->req_ident); |
| + sprintf(s1, "isc_%zul", request->req_ident); |
| + sprintf(trname, "isc_%zut", request->req_ident); |
| |
| if (request->req_flags & REQ_extend_dpb) |
| { |
| - sprintf(s2, "isc_%dp", request->req_ident); |
| + sprintf(s2, "isc_%zup", request->req_ident); |
| if (request->req_length) |
| - printa(column, "%s = isc_%d;", s2, request->req_ident); |
| + printa(column, "%s = isc_%zu;", s2, request->req_ident); |
| else |
| printa(column, "%s = (char*) 0;", s2); |
| |
| @@ -1267,7 +1267,7 @@ static void gen_create_database( const act* action, int column) |
| db->dbb_r_lc_ctype ? db->dbb_r_lc_ctype : "(char*) 0"); |
| } |
| else |
| - sprintf(s2, "isc_%d", request->req_ident); |
| + sprintf(s2, "isc_%zu", request->req_ident); |
| |
| PAT args; |
| args.pat_vector1 = status_vector(action); |
| @@ -1285,7 +1285,7 @@ static void gen_create_database( const act* action, int column) |
| if (request->req_flags & REQ_extend_dpb) |
| { |
| if (request->req_length) |
| - printa(column, "if (%s != isc_%d)", s2, request->req_ident); |
| + printa(column, "if (%s != isc_%zu)", s2, request->req_ident); |
| printa(column + (request->req_length ? INDENT : 0), "isc_free ((char*) %s);", s2); |
| |
| // reset the length of the dpb |
| @@ -1303,7 +1303,7 @@ static void gen_create_database( const act* action, int column) |
| printa(column, "if (%s)", trname); |
| column += INDENT; |
| align(column); |
| - fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%d);", |
| + fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%zu);", |
| status_vector(action), request->req_database->dbb_name->sym_string, |
| trname, request->req_length, request->req_ident); |
| column -= INDENT; |
| @@ -1356,7 +1356,7 @@ static void gen_cursor_init( const act* action, int column) |
| |
| if (action->act_request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create)) |
| { |
| - printa(column, "isc_%d = 0;", action->act_request->req_blobs->blb_ident); |
| + printa(column, "isc_%zu = 0;", action->act_request->req_blobs->blb_ident); |
| } |
| } |
| |
| @@ -1547,7 +1547,7 @@ static void gen_ddl( const act* action, int column) |
| } |
| |
| align(column); |
| - fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%d);", |
| + fprintf(gpreGlob.out_file, "isc_ddl (%s, &%s, &%s, (short) %d, isc_%zu);", |
| status_vector(action), |
| request->req_database->dbb_name->sym_string, |
| gpreGlob.transaction_name, request->req_length, request->req_ident); |
| @@ -2457,7 +2457,7 @@ static void gen_get_or_put_slice(const act* action, const ref* reference, bool g |
| gen_name(s1, reference, true); // blob handle |
| args.pat_string2 = s1; |
| args.pat_value1 = reference->ref_sdl_length; // slice description length |
| - sprintf(s2, "isc_%d", reference->ref_sdl_ident); // slice description |
| + sprintf(s2, "isc_%zu", reference->ref_sdl_ident); // slice description |
| args.pat_string3 = s2; |
| |
| args.pat_long1 = reference->ref_field->fld_array_info->ary_size; |
| @@ -2468,7 +2468,7 @@ static void gen_get_or_put_slice(const act* action, const ref* reference, bool g |
| args.pat_string5 = reference->ref_value; |
| else |
| { |
| - sprintf(s4, "isc_%d", reference->ref_field->fld_array_info->ary_ident); |
| + sprintf(s4, "isc_%zu", reference->ref_field->fld_array_info->ary_ident); |
| args.pat_string5 = s4; // array name |
| } |
| |
| @@ -2518,13 +2518,13 @@ static void gen_get_segment( const act* action, int column) |
| column += INDENT; |
| begin(column); |
| align(column); |
| - fprintf(gpreGlob.out_file, "isc_ftof (isc_%d, isc_%d, %s, isc_%d);", |
| + fprintf(gpreGlob.out_file, "isc_ftof (isc_%zu, isc_%zu, %s, isc_%zu);", |
| blob->blb_buff_ident, blob->blb_len_ident, |
| into->ref_value, blob->blb_len_ident); |
| if (into->ref_null_value) |
| { |
| align(column); |
| - fprintf(gpreGlob.out_file, "%s = isc_%d;", into->ref_null_value, blob->blb_len_ident); |
| + fprintf(gpreGlob.out_file, "%s = isc_%zu;", into->ref_null_value, blob->blb_len_ident); |
| } |
| endp(column); |
| column -= INDENT; |
| @@ -2696,9 +2696,9 @@ static void gen_put_segment( const act* action, int column) |
| blob = (blb*) action->act_request->req_blobs; |
| const ref* from = action->act_object; |
| align(column); |
| - fprintf(gpreGlob.out_file, "isc_%d = %s;", blob->blb_len_ident, from->ref_null_value); |
| + fprintf(gpreGlob.out_file, "isc_%zu = %s;", blob->blb_len_ident, from->ref_null_value); |
| align(column); |
| - fprintf(gpreGlob.out_file, "isc_ftof (%s, isc_%d, isc_%d, isc_%d);", |
| + fprintf(gpreGlob.out_file, "isc_ftof (%s, isc_%zu, isc_%zu, isc_%zu);", |
| from->ref_value, blob->blb_len_ident, |
| blob->blb_buff_ident, blob->blb_len_ident); |
| } |
| @@ -2857,32 +2857,32 @@ static void gen_request(const gpre_req* request) |
| |
| if (request->req_flags & REQ_extend_dpb) |
| { |
| - printa(0, "static char\n *isc_%dp;", request->req_ident); |
| + printa(0, "static char\n *isc_%zup;", request->req_ident); |
| if (!request->req_length) |
| - printa(0, "static short\n isc_%dl = %d;", request->req_ident, request->req_length); |
| + printa(0, "static short\n isc_%zul = %d;", request->req_ident, request->req_length); |
| } |
| |
| if (request->req_type == REQ_create_database) |
| - printa(0, "static %s\n *isc_%dt;", DCL_LONG, request->req_ident); |
| + printa(0, "static %s\n *isc_%zut;", DCL_LONG, request->req_ident); |
| |
| if (request->req_flags & (REQ_sql_blob_open | REQ_sql_blob_create)) |
| - printa(0, "static isc_stmt_handle\n isc_%ds;\t\t/* sql statement handle */", |
| + printa(0, "static isc_stmt_handle\n isc_%zus;\t\t/* sql statement handle */", |
| request->req_ident); |
| |
| if (request->req_length) |
| { |
| if (request->req_flags & REQ_sql_cursor) |
| - printa(0, "static isc_stmt_handle\n isc_%ds;\t\t/* sql statement handle */", |
| + printa(0, "static isc_stmt_handle\n isc_%zus;\t\t/* sql statement handle */", |
| request->req_ident); |
| #ifdef SCROLLABLE_CURSORS |
| if (request->req_flags & REQ_scroll) |
| printa(0, "static short\n isc_%ddirection;\t\t/* last direction sent to engine */", |
| request->req_ident); |
| #endif |
| - printa(0, "static %sshort\n isc_%dl = %d;", |
| + printa(0, "static %sshort\n isc_%zul = %d;", |
| (request->req_flags & REQ_extend_dpb) ? "" : CONST_STR, |
| request->req_ident, request->req_length); |
| - printa(0, "static %schar\n isc_%d [] = {", CONST_STR, request->req_ident); |
| + printa(0, "static %schar\n isc_%zu [] = {", CONST_STR, request->req_ident); |
| |
| const TEXT* string_type = "blr"; |
| if (gpreGlob.sw_raw) |
| @@ -2939,7 +2939,7 @@ static void gen_request(const gpre_req* request) |
| if (fb_print_blr(request->req_blr, request->req_length, gen_blr, 0, 0)) |
| CPR_error("internal error during BLR generation"); |
| } |
| - printa(INDENT, "};\t/* end of %s string for request isc_%d */\n", |
| + printa(INDENT, "};\t/* end of %s string for request isc_%zu */\n", |
| string_type, request->req_ident); |
| } |
| |
| @@ -2951,15 +2951,15 @@ static void gen_request(const gpre_req* request) |
| { |
| if (reference->ref_sdl) |
| { |
| - printa(0, "static %sshort\n isc_%dl = %d;", CONST_STR, |
| + printa(0, "static %sshort\n isc_%zul = %d;", CONST_STR, |
| reference->ref_sdl_ident, reference->ref_sdl_length); |
| - printa(0, "static %schar\n isc_%d [] = {", CONST_STR, reference->ref_sdl_ident); |
| + printa(0, "static %schar\n isc_%zu [] = {", CONST_STR, reference->ref_sdl_ident); |
| if (gpreGlob.sw_raw) |
| gen_raw(reference->ref_sdl, reference->ref_sdl_length); |
| else if (PRETTY_print_sdl(reference->ref_sdl, gen_blr, 0, 0)) |
| CPR_error("internal error during SDL generation"); |
| |
| - printa(INDENT, "};\t/* end of sdl string for request isc_%d */\n", |
| + printa(INDENT, "};\t/* end of sdl string for request isc_%zu */\n", |
| reference->ref_sdl_ident); |
| } |
| } |
| @@ -2982,9 +2982,9 @@ static void gen_request(const gpre_req* request) |
| if (request->req_type == REQ_slice) |
| { |
| printa(0, "static %s", DCL_LONG); |
| - printa(INDENT, "isc_%dv [%d],", request->req_ident, |
| + printa(INDENT, "isc_%zuv [%d],", request->req_ident, |
| MAX(request->req_slice->slc_parameters, 1)); |
| - printa(INDENT, "isc_%ds;", request->req_ident); |
| + printa(INDENT, "isc_%zus;", request->req_ident); |
| } |
| } |
| |
| @@ -3027,10 +3027,10 @@ static void gen_routine( const act* action, int column) |
| make_port(port, column); |
| for (const blb* blob = request->req_blobs; blob; blob = blob->blb_next) |
| { |
| - printa(column, "isc_blob_handle\t\tisc_%d;\t\t/* blob handle */", blob->blb_ident); |
| - printa(column, "char\t\t\tisc_%d [%d];\t/* blob segment */", |
| + printa(column, "isc_blob_handle\t\tisc_%zu;\t\t/* blob handle */", blob->blb_ident); |
| + printa(column, "char\t\t\tisc_%zu [%d];\t/* blob segment */", |
| blob->blb_buff_ident, blob->blb_seg_length); |
| - printa(column, "unsigned short\tisc_%d;\t\t/* segment length */", blob->blb_len_ident); |
| + printa(column, "unsigned short\tisc_%zu;\t\t/* segment length */", blob->blb_len_ident); |
| } |
| } |
| } |
| @@ -3163,7 +3163,7 @@ static void gen_segment( const act* action, int column) |
| { |
| const blb* blob = (blb*) action->act_object; |
| |
| - printa(column, "isc_%d", |
| + printa(column, "isc_%zu", |
| (action->act_type == ACT_segment) ? blob->blb_buff_ident : |
| (action->act_type == ACT_segment_length) ? blob->blb_len_ident : blob->blb_ident); |
| } |
| @@ -3254,7 +3254,7 @@ static void gen_slice( const act* action, const ref* var_reference, int column) |
| |
| // Compute array size |
| |
| - printa(column, "isc_%ds = %d", request->req_ident, slice->slc_field->fld_array->fld_length); |
| + printa(column, "isc_%zus = %d", request->req_ident, slice->slc_field->fld_array->fld_length); |
| |
| const slc::slc_repeat* tail = slice->slc_rpt; |
| for (const slc::slc_repeat* const end = tail + slice->slc_dimensions; tail < end; ++tail) |
| @@ -3277,7 +3277,7 @@ static void gen_slice( const act* action, const ref* var_reference, int column) |
| const ref* reference; |
| for (reference = request->req_values; reference; reference = reference->ref_next) |
| { |
| - printa(column, "isc_%dv [%d] = %s;", |
| + printa(column, "isc_%zuv [%d] = %s;", |
| request->req_ident, reference->ref_id, reference->ref_value); |
| } |
| |
| @@ -3422,7 +3422,7 @@ static void gen_t_start( const act* action, int column) |
| remaining = 256 - column - INDENT; |
| } |
| remaining -= length; |
| - fprintf(gpreGlob.out_file, ", &%s, (short) %d, isc_tpb_%d", |
| + fprintf(gpreGlob.out_file, ", &%s, (short) %d, isc_tpb_%zu", |
| tpb_iterator->tpb_database->dbb_name->sym_string, |
| tpb_iterator->tpb_length, tpb_iterator->tpb_ident); |
| } |
| @@ -3450,7 +3450,7 @@ static void gen_tpb(const tpb* tpb_buffer, int column) |
| for (length = 0; length < column; length++) |
| *p++ = ' '; |
| |
| - sprintf(p, "isc_tpb_%d [%d] = {", tpb_buffer->tpb_ident, tpb_buffer->tpb_length); |
| + sprintf(p, "isc_tpb_%zu [%d] = {", tpb_buffer->tpb_ident, tpb_buffer->tpb_length); |
| while (*p) |
| p++; |
| |
| @@ -3666,7 +3666,7 @@ static void make_array_declaration(ref* reference) |
| } |
| } |
| |
| - fprintf(gpreGlob.out_file, "static %s isc_%d", dtype, field->fld_array_info->ary_ident); |
| + fprintf(gpreGlob.out_file, "static %s isc_%zu", dtype, field->fld_array_info->ary_ident); |
| |
| // Print out the dimension part of the declaration |
| |
| @@ -3748,7 +3748,7 @@ static void make_ok_test( const act* action, const gpre_req* request, int column |
| |
| static void make_port(const gpre_port* port, int column) |
| { |
| - printa(column, "struct isc_%d_struct {", port->por_ident); |
| + printa(column, "struct isc_%zu_struct {", port->por_ident); |
| |
| for (const ref* reference = port->por_references; reference; reference = reference->ref_next) |
| { |
| @@ -3832,7 +3832,7 @@ static void make_port(const gpre_port* port, int column) |
| fprintf(gpreGlob.out_file, " %s isc_%d;\t/* %s */", dtype, reference->ref_ident, name); |
| } |
| |
| - printa(column, "} isc_%d;", port->por_ident); |
| + printa(column, "} isc_%zu;", port->por_ident); |
| } |
| |
| |
| @@ -3851,12 +3851,12 @@ static void make_ready(const gpre_dbb* db, |
| |
| if (request) |
| { |
| - sprintf(s1, "isc_%dl", request->req_ident); |
| + sprintf(s1, "isc_%zul", request->req_ident); |
| |
| if (request->req_flags & REQ_extend_dpb) |
| - sprintf(s2, "isc_%dp", request->req_ident); |
| + sprintf(s2, "isc_%zup", request->req_ident); |
| else |
| - sprintf(s2, "isc_%d", request->req_ident); |
| + sprintf(s2, "isc_%zu", request->req_ident); |
| |
| // if the dpb needs to be extended at runtime to include items |
| // in host variables, do so here; this assumes that there is |
| @@ -3865,7 +3865,7 @@ static void make_ready(const gpre_dbb* db, |
| if (request->req_flags & REQ_extend_dpb) |
| { |
| if (request->req_length) |
| - printa(column, "%s = isc_%d;", s2, request->req_ident); |
| + printa(column, "%s = isc_%zu;", s2, request->req_ident); |
| else |
| printa(column, "%s = (char*) 0;", s2); |
| |
| @@ -3900,7 +3900,7 @@ static void make_ready(const gpre_dbb* db, |
| if (request && request->req_flags & REQ_extend_dpb) |
| { |
| if (request->req_length) |
| - printa(column, "if (%s != isc_%d)", s2, request->req_ident); |
| + printa(column, "if (%s != isc_%zu)", s2, request->req_ident); |
| printa(column + (request->req_length ? INDENT : 0), "isc_free ((char*) %s);", s2); |
| |
| // reset the length of the dpb |
| -- |
| 2.13.0 |
| |