From 05019d688c0bdfdf00776f88d24a3b9bed27d96c Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Mon, 1 Jan 2024 13:37:43 +0100 Subject: [PATCH] Rename some variables to use English abbreviations --- src/boxes.in.h | 4 ++-- src/input.c | 12 ++++++------ src/list.c | 12 ++++++------ src/parser.y | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/boxes.in.h b/src/boxes.in.h index 6205f8db..6ab74b71 100644 --- a/src/boxes.in.h +++ b/src/boxes.in.h @@ -126,9 +126,9 @@ typedef struct { reprule_t *current_rule; reprule_t *reprules; /* applied when drawing a box */ - size_t anz_reprules; + size_t num_reprules; reprule_t *revrules; /* applied upon removal of a box */ - size_t anz_revrules; + size_t num_revrules; } design_t; extern design_t *designs; diff --git a/src/input.c b/src/input.c index 20cab704..d4da0e5d 100644 --- a/src/input.c +++ b/src/input.c @@ -95,7 +95,7 @@ static int get_indent(const line_t *lines, const size_t lines_size) int apply_substitutions(input_t *result, const int mode) { - size_t anz_rules; + size_t num_rules; reprule_t *rules; size_t j, k; @@ -104,11 +104,11 @@ int apply_substitutions(input_t *result, const int mode) } if (mode == 0) { - anz_rules = opt.design->anz_reprules; + num_rules = opt.design->num_reprules; rules = opt.design->reprules; } else if (mode == 1) { - anz_rules = opt.design->anz_revrules; + num_rules = opt.design->num_revrules; rules = opt.design->revrules; } else { @@ -120,11 +120,11 @@ int apply_substitutions(input_t *result, const int mode) * Compile regular expressions */ #ifdef REGEXP_DEBUG - fprintf(stderr, "Compiling %d %s rule patterns\n", (int) anz_rules, mode ? "reversion" : "replacement"); + fprintf(stderr, "Compiling %d %s rule patterns\n", (int) num_rules, mode ? "reversion" : "replacement"); #endif errno = 0; opt.design->current_rule = rules; - for (j = 0; j < anz_rules; ++j, ++(opt.design->current_rule)) { + for (j = 0; j < num_rules; ++j, ++(opt.design->current_rule)) { rules[j].prog = u32_compile_pattern(rules[j].search->memory); if (rules[j].prog == NULL) { return 5; @@ -140,7 +140,7 @@ int apply_substitutions(input_t *result, const int mode) */ for (k = 0; k < result->num_lines; ++k) { opt.design->current_rule = rules; - for (j = 0; j < anz_rules; ++j, ++(opt.design->current_rule)) { + for (j = 0; j < num_rules; ++j, ++(opt.design->current_rule)) { #ifdef REGEXP_DEBUG char *outtext = bxs_to_output(result->lines[k].text); char *outrepstr = bxs_to_output(rules[j].repstr); diff --git a/src/list.c b/src/list.c index 21f68e97..5dbdf6a5 100644 --- a/src/list.c +++ b/src/list.c @@ -239,12 +239,12 @@ static void print_design_details(design_t *d) } fprintf(opt.outfile, "Replacement Rules: "); - if (d->anz_reprules > 0) { - for (int i = 0; i < (int) d->anz_reprules; ++i) { + if (d->num_reprules > 0) { + for (int i = 0; i < (int) d->num_reprules; ++i) { fprintf(opt.outfile, "%d. (%s) \"%s\" WITH \"%s\"%s", i + 1, d->reprules[i].mode == 'g' ? "glob" : "once", bxs_to_output(d->reprules[i].search), bxs_to_output(d->reprules[i].repstr), opt.eol); - if (i < (int) d->anz_reprules - 1) { + if (i < (int) d->num_reprules - 1) { fprintf(opt.outfile, " "); } } @@ -253,12 +253,12 @@ static void print_design_details(design_t *d) fprintf(opt.outfile, "none%s", opt.eol); } fprintf(opt.outfile, "Reversion Rules: "); - if (d->anz_revrules > 0) { - for (int i = 0; i < (int) d->anz_revrules; ++i) { + if (d->num_revrules > 0) { + for (int i = 0; i < (int) d->num_revrules; ++i) { fprintf(opt.outfile, "%d. (%s) \"%s\" TO \"%s\"%s", i + 1, d->revrules[i].mode == 'g' ? "glob" : "once", bxs_to_output(d->revrules[i].search), bxs_to_output(d->revrules[i].repstr), opt.eol); - if (i < (int) d->anz_revrules - 1) { + if (i < (int) d->num_revrules - 1) { fprintf(opt.outfile, " "); } } diff --git a/src/parser.y b/src/parser.y index 73718d29..b60b9e78 100644 --- a/src/parser.y +++ b/src/parser.y @@ -313,12 +313,12 @@ block: YSAMPLE STRING YENDSAMPLE | YREPLACE rflag STRING YWITH STRING { - invoke_action(action_add_regex_rule(bison_args, "rep", &curdes.reprules, &curdes.anz_reprules, $3, $5, $2)); + invoke_action(action_add_regex_rule(bison_args, "rep", &curdes.reprules, &curdes.num_reprules, $3, $5, $2)); } | YREVERSE rflag STRING YTO STRING { - invoke_action(action_add_regex_rule(bison_args, "rev", &curdes.revrules, &curdes.anz_revrules, $3, $5, $2)); + invoke_action(action_add_regex_rule(bison_args, "rev", &curdes.revrules, &curdes.num_revrules, $3, $5, $2)); } | YPADDING '{' wlist '}'