From 331e05094e11c15750b3a6aa1f5abb8359483e43 Mon Sep 17 00:00:00 2001 From: sf-mensch Date: Wed, 15 May 2024 20:22:44 +0000 Subject: [PATCH] more warning fixes, additional improvement to build_windopws * makedist.cmd: cater for new different library names * version_cobc.rc, version_libcob.rc: updated date + rev --- build_windows/ChangeLog.txt | 7 ++- build_windows/makedist.cmd | 13 +++-- build_windows/version_cobc.rc | 6 +-- build_windows/version_libcob.rc | 6 +-- cobc/cobc.c | 88 +++++++++++++++++---------------- cobc/codegen.c | 4 +- cobc/error.c | 9 ++-- cobc/replace.c | 6 ++- cobc/typeck.c | 40 +++++++-------- 9 files changed, 92 insertions(+), 87 deletions(-) diff --git a/build_windows/ChangeLog.txt b/build_windows/ChangeLog.txt index d5ed12ec0..a4b7b78dc 100644 --- a/build_windows/ChangeLog.txt +++ b/build_windows/ChangeLog.txt @@ -1,4 +1,9 @@ +2024-05-15 Simon Sobisch + + * makedist.cmd: cater for new different library names + * version_cobc.rc, version_libcob.rc: updated date + rev + 2024-05-14 David Declerck * general for libcob: add missing profiling.c @@ -328,7 +333,7 @@ version_libcob.rc, version_cobcrun.rc provided by Simon) -Copyright 2014-2023 Free Software Foundation, Inc. +Copyright 2014-2024 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. diff --git a/build_windows/makedist.cmd b/build_windows/makedist.cmd index 3f0fcb962..65a9c0282 100644 --- a/build_windows/makedist.cmd +++ b/build_windows/makedist.cmd @@ -1,4 +1,4 @@ -:: Copyright (C) 2014-2023 Free Software Foundation, Inc. +:: Copyright (C) 2014-2024 Free Software Foundation, Inc. :: Written by Simon Sobisch, Edward Hart :: :: This file is part of GnuCOBOL. @@ -347,13 +347,12 @@ if exist "%copy_from%\libvbisam.dll" ( echo No ISAM handler found. ) -:: Copy the intl libraries. +:: Copy the intl library. call :copy_lib_if_exists "intl" %copy_to_bin% "libintl.dll" -call :copy_lib_if_exists "intl" %copy_to_bin% "libiconv.dll" :: Copy the cJSON library. -call :copy_lib_if_exists "cJSON" %copy_to_bin% "cjson.dll" -call :copy_lib_if_exists "cJSON" %copy_to_bin% "json-c.dll" +call :copy_lib_if_exists "cJSON" %copy_to_bin% "*cjson.dll" +call :copy_lib_if_exists "JSON-c" %copy_to_bin% "*json-c.dll" :: Copy the curses library. call :copy_lib_if_exists "curses" %copy_to_bin% "pdcurses*.dll" @@ -362,10 +361,10 @@ call :copy_lib_if_exists "curses" %copy_to_bin% "pdcurses*.dll" call :copy_lib_if_exists "XML" %copy_to_bin% "libxml2.dll" call :copy_lib_if_exists "zlib" %copy_to_bin% "zlib*.dll" call :copy_lib_if_exists "charset" %copy_to_bin% "libcharset.dll" -call :copy_lib_if_exists "lzma" %copy_to_bin% "lzma*.dll" +call :copy_lib_if_exists "lzma" %copy_to_bin% "*lzma*.dll" :: Copy the iconv library. -call :copy_lib_if_exists "libiconv.dll" %copy_to_bin% "iconv" +call :copy_lib_if_exists "iconv" %copy_to_bin% "libiconv.dll" goto :eof diff --git a/build_windows/version_cobc.rc b/build_windows/version_cobc.rc index ecef7b3f0..11a77fddb 100644 --- a/build_windows/version_cobc.rc +++ b/build_windows/version_cobc.rc @@ -4,7 +4,7 @@ #include "config.h" #include "../libcob/version.h" -#define VCS_REF 5112 +#define VCS_REF 5257 #define STRINGIZE_DETAIL_(v) #v #define STRINGIZE(v) STRINGIZE_DETAIL_(v) @@ -44,7 +44,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", PACKAGE_NAME " compiler, supporting most COBOL dialects with lots of extensions" VALUE "FileVersion", STRINGIZE(__LIBCOB_VERSION)"."STRINGIZE(__LIBCOB_VERSION_MINOR)"."STRINGIZE(__LIBCOB_VERSION_PATCHLEVEL)"."STRINGIZE(VCS_REF) VALUE "InternalName", "cobc" - VALUE "LegalCopyright", "Copyright (C) 2001-2023 Free Software Foundation, Inc." + VALUE "LegalCopyright", "Copyright (C) 2001-2024 Free Software Foundation, Inc." VALUE "LegalTrademarks", "Compiler: GNU General Public License v3 - see COPYING,\x0ADocumentation: GNU Free Documentation License." VALUE "OriginalFilename", "cobc.exe" VALUE "ProductName", PACKAGE_NAME " compiler" @@ -55,7 +55,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "SpecialBuild", "" /* Non-Standard entries */ - VALUE "Build", "July 2023" + VALUE "Build", "May 2024" VALUE "Developer", "Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart and many others (see AUTHORS and THANKS)" VALUE "Support", "https://www.gnu.org/software/gnucobol/" VALUE "Users", "Unlimited." diff --git a/build_windows/version_libcob.rc b/build_windows/version_libcob.rc index 29baa915b..dcc5cf227 100644 --- a/build_windows/version_libcob.rc +++ b/build_windows/version_libcob.rc @@ -4,7 +4,7 @@ #include "config.h" #include "../libcob/version.h" -#define VCS_REF 5059 +#define VCS_REF 5257 #define STRINGIZE_DETAIL_(v) #v #define STRINGIZE(v) STRINGIZE_DETAIL_(v) @@ -44,7 +44,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "FileDescription", PACKAGE_NAME " runtime, supporting most COBOL dialects with lots of extensions" VALUE "FileVersion", STRINGIZE(__LIBCOB_VERSION)"."STRINGIZE(__LIBCOB_VERSION_MINOR)"."STRINGIZE(__LIBCOB_VERSION_PATCHLEVEL)"."STRINGIZE(VCS_REF) VALUE "InternalName", "libcob" - VALUE "LegalCopyright", "Copyright (C) 2001-2023 Free Software Foundation, Inc." + VALUE "LegalCopyright", "Copyright (C) 2001-2024 Free Software Foundation, Inc." VALUE "LegalTrademarks", "Runtime: GNU Lesser General Public License v3 - see COPYING.LESSER,\x0ADocumentation: GNU Free Documentation License." VALUE "OriginalFilename", "libcob.dll" VALUE "ProductName", PACKAGE_NAME " runtime library" @@ -55,7 +55,7 @@ VS_VERSION_INFO VERSIONINFO VALUE "SpecialBuild", "" /* Non-Standard entries */ - VALUE "Build", "May 2023" + VALUE "Build", "May 2024" VALUE "Developer", "Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart and many others (see AUTHORS and THANKS)" VALUE "Support", "https://www.gnu.org/software/gnucobol/" VALUE "Users", "Unlimited." diff --git a/cobc/cobc.c b/cobc/cobc.c index b9aa4174d..43140878c 100644 --- a/cobc/cobc.c +++ b/cobc/cobc.c @@ -3006,10 +3006,8 @@ static int process_command_line (const int argc, char **argv) { struct cb_define_struct *p; - size_t osize; int c; int idx; - int n; int exit_option = 0; int list_reserved = 0; int list_registers = 0; @@ -3017,7 +3015,6 @@ process_command_line (const int argc, char **argv) int list_system_names = 0; int list_exceptions = 0; int list_system_routines = 0; - enum cob_exception_id i; char ext[COB_MINI_BUFF]; char *conf_label; /* we want a dynamic address for error.c, not a static one */ char *conf_entry; @@ -3197,7 +3194,7 @@ process_command_line (const int argc, char **argv) /* output version information when running very verbose -vv */ /* pass verbose switch to invoked commands when running very very verbose -vvv */ if (cob_optarg) { - n = cobc_deciph_optarg (cob_optarg, 0); + const int n = cobc_deciph_optarg (cob_optarg, 0); if (n == -1) { cobc_err_exit (COBC_INV_PAR, "--verbose"); } @@ -3289,12 +3286,12 @@ process_command_line (const int argc, char **argv) cobc_wants_debug = 1; break; - case CB_FLAG_GETOPT_DUMP: /* 8 */ + case CB_FLAG_GETOPT_DUMP: /* -fdump= : Add sections for dump code generation */ cobc_def_dump_opts (cob_optarg, 1); break; - case CB_FLAG_GETOPT_NO_DUMP: /* 13 */ + case CB_FLAG_GETOPT_NO_DUMP: /* -fno-dump= : Suppress sections in dump code generation */ if (cob_optarg) { cobc_def_dump_opts (cob_optarg, 0); @@ -3329,6 +3326,7 @@ process_command_line (const int argc, char **argv) /* debug: Turn on all exception conditions */ if (cobc_wants_debug) { + enum cob_exception_id i; for (i = (enum cob_exception_id)1; i < COB_EC_MAX; ++i) { CB_EXCEPTION_ENABLE (i) = 1; } @@ -3481,9 +3479,9 @@ process_command_line (const int argc, char **argv) /* these options were processed in the first getopt-run */ break; - case 'o': + case 'o': { /* -o : Output file */ - osize = strlen (cob_optarg); + const size_t osize = strlen (cob_optarg); if (osize > COB_SMALL_MAX) { cobc_err_exit (_("invalid output file name")); } @@ -3495,6 +3493,7 @@ process_command_line (const int argc, char **argv) /* Allocate buffer plus extension reserve */ output_name_buff = cobc_main_malloc (osize + 32U); break; + } case '0': /* -O0 : disable optimizations (or at least minimize them) */ @@ -3778,27 +3777,29 @@ process_command_line (const int argc, char **argv) CB_TEXT_LIST_ADD (cb_early_exit_list, cob_optarg); break; - case CB_FLAG_GETOPT_STACK_SIZE: /* 1 */ + case CB_FLAG_GETOPT_STACK_SIZE: { /* -fstack-size= : Specify stack (perform) size */ - n = cobc_deciph_optarg (cob_optarg, 0); + const int n = cobc_deciph_optarg (cob_optarg, 0); if (n < 16 || n > 512) { cobc_err_exit (COBC_INV_PAR, "-fstack-size"); } cb_stack_size = n; break; + } #ifdef COBC_HAS_CUTOFF_FLAG /* CHECKME: to be removed in 4.0 */ - case CB_FLAG_GETOPT_IF_CUTOFF: /* 2 */ + case CB_FLAG_GETOPT_IF_CUTOFF: { /* -fif-cutoff= : Specify IF cutoff level */ - n = cobc_deciph_optarg (cob_optarg, 0); + const int n = cobc_deciph_optarg (cob_optarg, 0); if (n < 1 || n > 512) { cobc_err_exit (COBC_INV_PAR, "-fif-cutoff"); } cb_if_cutoff = n; break; + } #endif - case CB_FLAG_GETOPT_SIGN: /* 3 */ + case CB_FLAG_GETOPT_SIGN: /* -fsign= : Specify display sign */ if (!cb_strcasecmp (cob_optarg, "EBCDIC")) { cb_ebcdic_sign = 1; @@ -3809,25 +3810,25 @@ process_command_line (const int argc, char **argv) } break; - case CB_FLAG_GETOPT_EBCDIC_TABLE: /* 14 */ + case CB_FLAG_GETOPT_EBCDIC_TABLE: cb_ebcdic_table = cobc_main_strdup (cob_optarg); break; - case CB_FLAG_GETOPT_DEFAULT_COLSEQ: /* 15 */ + case CB_FLAG_GETOPT_DEFAULT_COLSEQ: /* -fdefault-colseq= */ if (cb_deciph_default_colseq_name (cob_optarg)) { cobc_err_exit (COBC_INV_PAR, "-fdefault-colseq"); } break; - case CB_FLAG_GETOPT_DEFAULT_FILE_COLSEQ: /* 16 */ + case CB_FLAG_GETOPT_DEFAULT_FILE_COLSEQ: /* -fdefault-file-colseq= */ if (cb_deciph_default_file_colseq_name (cob_optarg)) { cobc_err_exit (COBC_INV_PAR, "-fdefault-file-colseq"); } break; - case CB_FLAG_GETOPT_FOLD_COPY: /* 4 */ + case CB_FLAG_GETOPT_FOLD_COPY: /* -ffold-copy= : COPY fold case */ if (!cb_strcasecmp (cob_optarg, "UPPER")) { cb_fold_copy = COB_FOLD_UPPER; @@ -3838,7 +3839,7 @@ process_command_line (const int argc, char **argv) } break; - case CB_FLAG_GETOPT_FOLD_CALL: /* 5 */ + case CB_FLAG_GETOPT_FOLD_CALL: /* -ffold-call= : CALL/PROG-ID fold case */ if (!cb_strcasecmp (cob_optarg, "UPPER")) { cb_fold_call = COB_FOLD_UPPER; @@ -3849,48 +3850,48 @@ process_command_line (const int argc, char **argv) } break; - case CB_FLAG_GETOPT_TTITLE: /* 6 */ + case CB_FLAG_GETOPT_TTITLE: { /* -fttitle= : Title for listing */ - { - const size_t len = strlen (cob_optarg); - size_t i; - if (cb_listing_with_title) - cobc_main_free (cb_listing_with_title); - cb_listing_with_title = cobc_main_strdup (cob_optarg); - for (i = 0; i < len; i++) { - if (cb_listing_with_title[i] == '_') - cb_listing_with_title[i] = ' '; - } + const size_t len = strlen (cob_optarg); + size_t i; + if (cb_listing_with_title) + cobc_main_free (cb_listing_with_title); + cb_listing_with_title = cobc_main_strdup (cob_optarg); + for (i = 0; i < len; i++) { + if (cb_listing_with_title[i] == '_') + cb_listing_with_title[i] = ' '; } break; + } - case CB_FLAG_GETOPT_MAX_ERRORS: /* 7 */ + case CB_FLAG_GETOPT_MAX_ERRORS: { /* -fmax-errors=<xx> : Maximum errors until abort */ - n = cobc_deciph_optarg (cob_optarg, 0); + const int n = cobc_deciph_optarg (cob_optarg, 0); if (n < 0) { cobc_err_exit (COBC_INV_PAR, "-fmax-errors"); } cb_max_errors = n; break; + } - case CB_FLAG_GETOPT_DUMP: /* 8 */ + case CB_FLAG_GETOPT_DUMP: /* -fdump=<scope> : Add sections for dump code generation */ - case CB_FLAG_GETOPT_NO_DUMP: /* 13 */ + case CB_FLAG_GETOPT_NO_DUMP: /* -fno-dump=<scope> : Suppress sections in dump code generation */ /* These options were all processed in the first getopt-run */ break; - case CB_FLAG_GETOPT_CALLFH: /* 9 */ + case CB_FLAG_GETOPT_CALLFH: /* -fcallfh=<func> : Function-name for EXTFH */ cb_call_extfh = cobc_main_strdup (cob_optarg); break; - case CB_FLAG_GETOPT_INTRINSICS: /* 10 */ + case CB_FLAG_GETOPT_INTRINSICS: /* -fintrinsics=<xx> : Intrinsic name or ALL */ cobc_deciph_funcs (cob_optarg); break; - case CB_FLAG_GETOPT_EC: /* 11 */ + case CB_FLAG_GETOPT_EC: /* -fec=<xx> : COBOL exception-name, e.g. EC-BOUND-OVERFLOW, also allows to skip the prefix e.g. BOUND-OVERFLOW */ if (cobc_deciph_ec (cob_optarg, 1U)) { @@ -3898,15 +3899,15 @@ process_command_line (const int argc, char **argv) } break; - case CB_FLAG_GETOPT_NO_EC: /* 12 */ + case CB_FLAG_GETOPT_NO_EC: /* -fno-ec=<xx> : COBOL exception-name, e.g. EC-BOUND-OVERFLOW */ if (cobc_deciph_ec (cob_optarg, 0)) { cobc_err_exit (COBC_INV_PAR, "-fno-ec"); } break; - case CB_FLAG_GETOPT_MEMORY_CHECK: /* 17 */ - /* -fmemory-check=<scope> : */ + case CB_FLAG_GETOPT_MEMORY_CHECK: + /* -fmemory-check=<scope> : extra memcmp for memory-guard */ if (!cob_optarg) { cb_flag_memory_check = CB_MEMCHK_ALL; } else if (cobc_deciph_memory_check (cob_optarg)) { @@ -3914,7 +3915,7 @@ process_command_line (const int argc, char **argv) } break; - case CB_FLAG_GETOPT_COPY_FILE: /* 18 */ + case CB_FLAG_GETOPT_COPY_FILE: /* --copy=<file> : COPY file at beginning */ if (strlen (cob_optarg) > (COB_MINI_MAX)) { cobc_err_exit (COBC_INV_PAR, "--copy"); @@ -3922,8 +3923,8 @@ process_command_line (const int argc, char **argv) CB_TEXT_LIST_ADD (cb_copy_list, cobc_strdup (cob_optarg)); break; - case CB_FLAG_GETOPT_INCLUDE_FILE: /* 19 */ - /* -include=<file.h> : add #include "file.h" to + case CB_FLAG_GETOPT_INCLUDE_FILE: + /* -include=<file.h> : add #include "file.h" to generated C file */ if (strlen (cob_optarg) > (COB_MINI_MAX)) { cobc_err_exit (COBC_INV_PAR, "--include"); @@ -4048,7 +4049,8 @@ process_command_line (const int argc, char **argv) /* LCOV_EXCL_START */ default: - cobc_err_msg ("missing evaluation of command line option '%c'", c); /* not translated as unlikely */ + /* not translated as unlikely */ + cobc_err_msg ("missing evaluation of command line option '%c'", c); COBC_ABORT (); /* LCOV_EXCL_STOP */ diff --git a/cobc/codegen.c b/cobc/codegen.c index 3c1474bae..a99bbbba0 100644 --- a/cobc/codegen.c +++ b/cobc/codegen.c @@ -13949,8 +13949,6 @@ codegen_internal (struct cb_program *prog, const int subsequent_call) cb_tree l; int i; - int comment_gen; - struct cb_report *rep; /* skip prototypes */ @@ -14089,7 +14087,7 @@ codegen_internal (struct cb_program *prog, const int subsequent_call) /* Report data fields */ if (prog->report_storage) { - comment_gen = 0; + int comment_gen = 0; for (l = prog->report_list; l; l = CB_CHAIN (l)) { if (!CB_VALUE (l)) { continue; diff --git a/cobc/error.c b/cobc/error.c index 5e26c6634..97a57cd96 100644 --- a/cobc/error.c +++ b/cobc/error.c @@ -120,12 +120,13 @@ diagnostics_show_caret (FILE *fd, const int line) const int line_start = line > CARET_CONTEXT_LINES ? line - CARET_CONTEXT_LINES : 1; const int line_end = line + CARET_CONTEXT_LINES; const int max_pos = cb_diagnostics_show_line_numbers ? CARET_MAX_COLS - 5 : CARET_MAX_COLS; - char buffer[ CARET_MAX_COLS + 1 ]; + unsigned char buffer[ CARET_MAX_COLS + 1 ]; int line_pos = 1; int char_pos = 0; int c = 0; while (c != EOF) { - buffer[char_pos] = c = fgetc (fd);; + c = fgetc (fd); + buffer[char_pos] = c; if (c == '\n' || c == EOF || char_pos == max_pos) { if (line_pos >= line_start) { /* prefix */ @@ -142,8 +143,8 @@ diagnostics_show_caret (FILE *fd, const int line) || buffer[char_pos] == '\t' || buffer[char_pos] == '\r' || buffer[char_pos] == '\n' - || buffer[char_pos] == EOF - || char_pos == max_pos)) { + || buffer[char_pos] == (unsigned char)EOF + || char_pos == max_pos)) { buffer[char_pos--] = 0; } /* print it */ diff --git a/cobc/replace.c b/cobc/replace.c index 982f3e302..4e03a8d64 100644 --- a/cobc/replace.c +++ b/cobc/replace.c @@ -879,14 +879,16 @@ cb_ppecho_copy_replace (const char *text, const char *token) && token_queue_is_empty(copy_repls->token_queue) && replace_repls->text_prequeue == NULL && token_queue_is_empty(replace_repls->token_queue)) { - return cb_ppecho_direct (text, token); + cb_ppecho_direct (text, token); + return; } if (copy_repls->replace_list == NULL && copy_repls->current_list == NULL && replace_repls->replace_list == NULL && replace_repls->current_list == NULL) { - return cb_ppecho_direct (text, token); + cb_ppecho_direct (text, token); + return; } add_text_to_replace (INIT_DEPTH copy_repls, 0, text, token); diff --git a/cobc/typeck.c b/cobc/typeck.c index 2f4204146..3a086add4 100644 --- a/cobc/typeck.c +++ b/cobc/typeck.c @@ -4707,11 +4707,7 @@ validate_assign_name (struct cb_file * const f, void cb_validate_program_data (struct cb_program *prog) { - cb_tree l, x; - struct cb_field *p; - struct cb_field *q; - struct cb_field *field; - char buff[COB_MINI_BUFF]; + cb_tree l, x; prog->report_list = cb_list_reverse (prog->report_list); @@ -4719,6 +4715,7 @@ cb_validate_program_data (struct cb_program *prog) /* Set up LINE-COUNTER / PAGE-COUNTER */ struct cb_report *rep = CB_REPORT (CB_VALUE (l)); if (rep->line_counter == NULL) { + char buff[COB_MINI_BUFF]; snprintf (buff, (size_t)COB_MINI_MAX, "LINE-COUNTER %s", rep->cname); x = cb_build_field (cb_build_reference (buff)); @@ -4730,6 +4727,7 @@ cb_validate_program_data (struct cb_program *prog) CB_FIELD_ADD (prog->working_storage, CB_FIELD (x)); } if (rep->page_counter == NULL) { + char buff[COB_MINI_BUFF]; snprintf (buff, (size_t)COB_MINI_MAX, "PAGE-COUNTER %s", rep->cname); x = cb_build_field (cb_build_reference (buff)); @@ -4777,7 +4775,7 @@ cb_validate_program_data (struct cb_program *prog) l = cb_build_reference ("COB-CRT-STATUS"); x = cb_try_ref (l); if (x == cb_error_node) { - p = CB_FIELD (cb_build_field (l)); + struct cb_field *p = CB_FIELD (cb_build_field (l)); p->usage = CB_USAGE_DISPLAY; p->pic = cb_build_picture ("9(4)"); cb_validate_field (p); @@ -4803,6 +4801,7 @@ cb_validate_program_data (struct cb_program *prog) /* Check ODO items */ for (l = cb_depend_check; l; l = CB_CHAIN (l)) { struct cb_field *depfld = NULL; + struct cb_field *p, *q; unsigned int odo_level = 0, parent_is_pic_l; cb_tree xerr = NULL; x = CB_VALUE (l); @@ -4901,11 +4900,11 @@ cb_validate_program_data (struct cb_program *prog) } /* check alphabets */ - for (l = current_program->alphabet_name_list; l; l = CB_CHAIN(l)) { - struct cb_alphabet_name *alphabet = CB_ALPHABET_NAME (CB_VALUE(l)); + for (l = current_program->alphabet_name_list; l; l = CB_CHAIN (l)) { + struct cb_alphabet_name *alphabet = CB_ALPHABET_NAME (CB_VALUE (l)); if (alphabet->alphabet_type == CB_ALPHABET_LOCALE) { x = cb_ref (alphabet->custom_list); - if (x != cb_error_node && !CB_LOCALE_NAME_P(x)) { + if (x != cb_error_node && !CB_LOCALE_NAME_P (x)) { cb_error_x (alphabet->custom_list, _("'%s' is not a locale-name"), cb_name(x)); alphabet->custom_list = cb_error_node; @@ -4913,13 +4912,13 @@ cb_validate_program_data (struct cb_program *prog) } } - /* Resolve APPLY COMMIT */ - if (CB_VALID_TREE(prog->apply_commit)) { - for (l = prog->apply_commit; l; l = CB_CHAIN(l)) { + /* Resolve APPLY COMMIT */ + if (CB_VALID_TREE (prog->apply_commit)) { + for (l = prog->apply_commit; l; l = CB_CHAIN (l)) { cb_tree l2 = CB_VALUE (l); x = cb_ref (l2); if (x != cb_error_node) { - for (l2 = prog->apply_commit; l2 != l; l2 = CB_CHAIN(l2)) { + for (l2 = prog->apply_commit; l2 != l; l2 = CB_CHAIN (l2)) { if (cb_ref (CB_VALUE (l2)) == x) { cb_error_x (l, _("duplicate APPLY COMMIT target: '%s'"), @@ -4942,7 +4941,7 @@ cb_validate_program_data (struct cb_program *prog) _("APPLY COMMIT statement invalid for REPORT file")); } } else if (CB_FIELD_P (x)) { - field = CB_FIELD (x); + struct cb_field *field = CB_FIELD (x); if (field->storage != CB_STORAGE_WORKING && field->storage != CB_STORAGE_LOCAL) { cb_error_x (l, @@ -12339,7 +12338,7 @@ cb_build_move_literal (cb_tree src, cb_tree dst) p = buff + f->size - 1; } #if 0 /* Simon: negative zero back by disabling the following code -ยด included without documentation by Roger in 2.0 */ + included without documentation by Roger in 2.0 */ if (!n) { /* Zeros */ /* EBCDIC - store sign otherwise nothing */ @@ -12476,7 +12475,6 @@ cb_build_move_literal (cb_tree src, cb_tree dst) /* early check for unsigned zero or non-signed field */ if (l->sign == 0 || !f->pic->have_sign) { - int i; for (i = 0; i < l->size; i++) { if (l->data[i] != '0') { break; @@ -12530,8 +12528,8 @@ cb_build_move_field (cb_tree src, cb_tree dst) { const struct cb_field *src_f = CB_FIELD_PTR (src); const struct cb_field *dst_f = CB_FIELD_PTR (dst); - int src_size; - int dst_size; + int src_size; + int dst_size; if (dst_f->flag_any_length || src_f->flag_any_length) { return CB_BUILD_FUNCALL_2 ("cob_move", src, dst); @@ -12616,9 +12614,9 @@ cb_tree cb_build_move (cb_tree src, cb_tree dst) { struct cb_reference *src_ref, *dst_ref, *x; - cb_tree chks = NULL; - cb_tree ret; - int move_zero; + cb_tree chks = NULL; + cb_tree ret; + int move_zero; if (CB_INVALID_TREE (src) || CB_INVALID_TREE (dst)) {