Browse Source

- fixed shadowed variable warnings

development
Andreas Romeyke 2 years ago
parent
commit
467824caa8
5 changed files with 25 additions and 25 deletions
  1. +4
    -4
      src/checkit_tiff.c
  2. +4
    -4
      src/helper/renderer/check_renderer_ansi.c
  3. +4
    -4
      src/helper/renderer/check_renderer_default.c
  4. +10
    -10
      src/helper/renderer/check_renderer_xml.c
  5. +3
    -3
      src/parser/config_parser.c

+ 4
- 4
src/checkit_tiff.c View File

@ -161,7 +161,7 @@ int main (int argc, char * argv[]) {
}
const char *cfg_file=argv[optind];
printf("cfg_file=%s\n", cfg_file);
int is_valid = 0;
int are_valid = 0;
int index_of_tiff_file_or_dir = optind+1;
do {
const char *tiff_file_or_dir=argv[index_of_tiff_file_or_dir++];
@ -201,7 +201,7 @@ int main (int argc, char * argv[]) {
if(attribute.st_mode & S_IFREG) {
printf ("%s\n", fqname);
parse_plan_via_file(cfg_file);
is_valid += check_specific_tiff_file( fqname, flag_use_memorymapped_io);
are_valid += check_specific_tiff_file( fqname, flag_use_memorymapped_io);
clean_plan();
printf("\n");
@ -216,11 +216,11 @@ int main (int argc, char * argv[]) {
} else {
/* use tiff_file_or_dir */
parse_plan_via_file(cfg_file);
is_valid = check_specific_tiff_file( tiff_file_or_dir, flag_use_memorymapped_io);
are_valid = check_specific_tiff_file( tiff_file_or_dir, flag_use_memorymapped_io);
clean_plan();
}
} while (index_of_tiff_file_or_dir < argc );
if (0 == is_valid) {
if (0 == are_valid) {
exit(EXIT_SUCCESS);
} else {
exit(EXIT_FAILURE);


+ 4
- 4
src/helper/renderer/check_renderer_ansi.c View File

@ -80,7 +80,7 @@ const char * renderer_ansi ( const retmsg_t * ret, short int is_quiet ) {
size_t rendersize_tmp = RENDERSIZE-1;
const retmsg_t * startp = ret;
short int is_valid = 1;
short int rc_is_valid = 1;
while (NULL != startp) {
assert(startp->rm_msg != NULL);
switch (startp->rm_type) {
@ -142,16 +142,16 @@ const char * renderer_ansi ( const retmsg_t * ret, short int is_quiet ) {
tmp=secstrcat(tmp, ANSI_NORMAL, & rendersize_tmp);
tmp=secstrcat(tmp, "\n", & rendersize_tmp);
/* copy tmp to res, reset tmp */
if ((is_valid == 0) && (is_quiet == 0)) {
if ((rc_is_valid == 0) && (is_quiet == 0)) {
} else {
res=secstrcat(res, tmp, & rendersize_res);
}
memset( tmp, '\0', rendersize_tmp);
is_valid =1;
rc_is_valid =1;
break;
case rm_is_valid: tmp=secstrcat(tmp, ANSI_GREEN_BOLD, & rendersize_tmp);
tmp=secstrcat(tmp, "(./)", & rendersize_tmp);
is_valid = 0;
rc_is_valid = 0;
break;
case rm_summary_valid:
tmp=secstrcat(tmp, ANSI_GREEN_BOLD, & rendersize_tmp);


+ 4
- 4
src/helper/renderer/check_renderer_default.c View File

@ -39,7 +39,7 @@ const char * renderer_default ( const retmsg_t * ret, short int is_quiet ) {
size_t rendersize_tmp = RENDERSIZE-1;
const retmsg_t * startp = ret;
short int is_valid = 1;
short int rc_is_valid = 1;
while (NULL != startp) {
assert(startp->rm_msg != NULL);
switch (startp->rm_type) {
@ -86,16 +86,16 @@ const char * renderer_default ( const retmsg_t * ret, short int is_quiet ) {
case rm_endtiff:
tmp=secstrcat(tmp, "\n", & rendersize_tmp);
/* copy tmp to res, reset tmp */
if ((is_valid == 0) && (is_quiet == 0)) {
if ((rc_is_valid == 0) && (is_quiet == 0)) {
} else {
res=secstrcat(res, tmp, & rendersize_res);
}
memset( tmp, '\0', rendersize_tmp);
is_valid =1;
rc_is_valid =1;
break;
case rm_is_valid: tmp=secstrcat(tmp, "(./)", & rendersize_tmp);
is_valid = 0;
rc_is_valid = 0;
break;
case rm_summary_valid:
tmp=secstrcat(tmp, "\n(./)", & rendersize_tmp);


+ 10
- 10
src/helper/renderer/check_renderer_xml.c View File

@ -37,7 +37,7 @@ const char * renderer_xml ( const retmsg_t * ret, const char * xmlfile ) {
const retmsg_t * startp = ret;
res=secstrcat(res, "<checkit_tiff_result>\n", &rendersize_res);
render_context_t is_valid=within_valid;
render_context_t rc_is_valid=within_valid;
while (NULL != startp) {
assert(startp->rm_msg != NULL);
switch (startp->rm_type) {
@ -63,16 +63,16 @@ const char * renderer_xml ( const retmsg_t * ret, const char * xmlfile ) {
break;
case rm_hard_error: res=secstrcat(res, "<error level=\"critical\">", & rendersize_res);
res=secstrcat(res, startp->rm_msg, & rendersize_res);
is_valid = within_harderror;
rc_is_valid = within_harderror;
break;
case rm_error: if (strlen(startp->rm_msg) > 0) {
res=secstrcat(res, "<error level=\"summary\">", & rendersize_res);
res=secstrcat(res, startp->rm_msg, & rendersize_res);
res=secstrcat(res, "</error>", & rendersize_res);
is_valid = within_summaryerror;
rc_is_valid = within_summaryerror;
} else {
res=secstrcat(res, "<error level=\"error\">", & rendersize_res);
is_valid = within_error;
rc_is_valid = within_error;
}
break;
case rm_error_description:
@ -82,11 +82,11 @@ const char * renderer_xml ( const retmsg_t * ret, const char * xmlfile ) {
break;
case rm_warning: res=secstrcat(res, "<error level=\"warning\">", & rendersize_res);
res=secstrcat(res, startp->rm_msg, & rendersize_res);
is_valid = within_error;
rc_is_valid = within_error;
break;
case rm_logicalor_error: res=secstrcat(res, "<error level=\"logical or error\">", & rendersize_res);
res=secstrcat(res, startp->rm_msg, & rendersize_res);
is_valid = within_error;
rc_is_valid = within_error;
break;
case rm_file: res=secstrcat(res, "<file>", & rendersize_res );
res=secstrcat(res, startp->rm_msg, & rendersize_res);
@ -98,17 +98,17 @@ const char * renderer_xml ( const retmsg_t * ret, const char * xmlfile ) {
break;
case rm_endrule:
case rm_endtiff:
if (is_valid == within_valid) {
if (rc_is_valid == within_valid) {
res=secstrcat(res, "</valid>", & rendersize_res);
} else if (is_valid == within_error) {
} else if (rc_is_valid == within_error) {
res=secstrcat(res, "</error>", & rendersize_res);
} else if (is_valid == within_harderror) {
} else if (rc_is_valid == within_harderror) {
res=secstrcat(res, "</error>", & rendersize_res);
}
res=secstrcat(res, "\n", & rendersize_res);
break;
case rm_is_valid: res=secstrcat(res, "<valid>", & rendersize_res);
is_valid = within_valid;
rc_is_valid = within_valid;
break;
case rm_summary_valid:
case rm_summary_invalid: break;


+ 3
- 3
src/parser/config_parser.c View File

@ -369,10 +369,10 @@ ret_t call_exec_function(ctiff_t * ctif, ret_t * retp, internal_entry_t * exep)
case fc_has_only_one_ifd: { ret = check_has_only_one_ifd(ctif); break;}
case fc_tagorder: { ret = check_tagorder(ctif); break;}
case fc_tag_has_valid_asciivalue: { ret = check_tag_has_valid_asciivalue(ctif, exe.tag); break;}
case fc_tag_has_value_matching_regex: { const char * regex = exe_regex_pop( &exe);
case fc_tag_has_value_matching_regex: { const char * regex_string = exe_regex_pop( &exe);
expected_value = __ch_malloc(expected_value);
snprintf(expected_value, VALUESTRLEN, "regex=%s", regex);
ret = check_tag_has_value_matching_regex(ctif, exe.tag, regex);
snprintf(expected_value, VALUESTRLEN, "regex=%s", regex_string);
ret = check_tag_has_value_matching_regex(ctif, exe.tag, regex_string);
break;
}
case fc_all_offsets_are_word_aligned: { ret = check_all_offsets_are_word_aligned(ctif); break;}


Loading…
Cancel
Save