# HG changeset patch # User Matti Hamalainen # Date 1579575605 -7200 # Node ID 85b6d7ce8ca55e8b2a128b825826871c8a650662 # Parent 3b28868475e8401262246f8dfd84ef4e62d95e45 Rename some variables. diff -r 3b28868475e8 -r 85b6d7ce8ca5 src/dmargs.c --- a/src/dmargs.c Mon Jan 20 19:29:03 2020 +0200 +++ b/src/dmargs.c Tue Jan 21 05:00:05 2020 +0200 @@ -19,7 +19,7 @@ * @param opts options list array * @param nopts number of elements in options list array * @param handle_option function pointer to callback that handles option arguments - * @param doProcess if TRUE, actually handle the argument, aka call the handle_option() function. if FALSE, only validity of options are checked. + * @param process if TRUE, actually handle the argument, aka call the handle_option() function. if FALSE, only validity of options are checked. * @param isLong TRUE if the option is a --long-format one */ static BOOL dmArgsProcessOpt( @@ -27,13 +27,12 @@ int argc, char *argv[], const DMOptArg opts[], int nopts, BOOL (*handle_option)(int id, char *, char *), - BOOL doProcess, BOOL isLong) + BOOL process, BOOL isLong) { const DMOptArg *opt = NULL; char *optArg = NULL; - int optIndex; - for (optIndex = 0; optIndex < nopts; optIndex++) + for (int optIndex = 0; optIndex < nopts; optIndex++) { const DMOptArg *node = &opts[optIndex]; if (isLong && node->o_long != NULL) @@ -86,7 +85,7 @@ } // Option was given succesfully, try to process it - if (doProcess && !handle_option(opt->id, optArg, currArg)) + if (process && !handle_option(opt->id, optArg, currArg)) return FALSE; } else @@ -121,16 +120,16 @@ BOOL(*handle_option)(int id, char *, char *), BOOL(*handle_other)(char *), const int flags) { - int argIndex, handleFlags = flags & OPTH_ONLY_MASK; + int handleFlags = flags & OPTH_ONLY_MASK; BOOL optionsOK = TRUE, endOfOptions = FALSE; - for (argIndex = 1; argIndex < argc; argIndex++) + for (int argIndex = 1; argIndex < argc; argIndex++) { char *str = argv[argIndex]; if (*str == '-' && !endOfOptions) { // Should we process options? - BOOL doProcess = (handleFlags & OPTH_ONLY_OPTS) || handleFlags == 0; + BOOL process = (handleFlags & OPTH_ONLY_OPTS) || handleFlags == 0; BOOL isLong; str++; @@ -151,7 +150,7 @@ isLong = FALSE; if (!dmArgsProcessOpt(str, &argIndex, argc, argv, - opts, nopts, handle_option, doProcess, isLong)) + opts, nopts, handle_option, process, isLong)) optionsOK = FALSE; } else