Rename _i,_argused to i_,argused_ - farbfeld - suckless image format with conversion tools
HTML git clone git://git.suckless.org/farbfeld
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 0af2542eeb1b579af1a465279fe9a5d9a53c80e0
DIR parent 191ea09f29ff2d450e7622c7f4d80b0c60232219
HTML Author: Laslo Hunhold <dev@frign.de>
Date: Fri, 4 Aug 2017 17:53:43 +0200
Rename _i,_argused to i_,argused_
Thanks Michael Forney for reporting this! We cannot use identifiers
beginning with an underscore, says the C99-standard, section 7.1.3:
"All identifiers that begin with an underscore are always reserved for
use as identifiers with file scope in both the ordinary and tag name
spaces."
We go around this by putting the underscore at the end.
Diffstat:
M arg.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
---
DIR diff --git a/arg.h b/arg.h
@@ -23,15 +23,15 @@ extern char *argv0;
/* int main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, *argv ? (argc--, argv++) : ((void *)0); \
*argv && (*argv)[0] == '-' && (*argv)[1]; argc--, argv++) { \
- int _i, _argused; \
+ int i_, argused_; \
if ((*argv)[1] == '-' && !(*argv)[2]) { \
argc--, argv++; \
break; \
} \
- for (_i = 1, _argused = 0; (*argv)[_i]; _i++) { \
- switch((*argv)[_i])
-#define ARGEND if (_argused) { \
- if ((*argv)[_i + 1]) { \
+ for (i_ = 1, argused_ = 0; (*argv)[i_]; i_++) { \
+ switch((*argv)[i_])
+#define ARGEND if (argused_) { \
+ if ((*argv)[i_ + 1]) { \
break; \
} else { \
argc--, argv++; \
@@ -40,9 +40,9 @@ extern char *argv0;
} \
} \
}
-#define ARGC() ((*argv)[_i])
-#define ARGF_(x) (((*argv)[_i + 1]) ? (_argused = 1, &((*argv)[_i + 1])) : \
- (*(argv + 1)) ? (_argused = 1, *(argv + 1)) : (x))
+#define ARGC() ((*argv)[i_])
+#define ARGF_(x) (((*argv)[i_ + 1]) ? (argused_ = 1, &((*argv)[i_ + 1])) : \
+ (*(argv + 1)) ? (argused_ = 1, *(argv + 1)) : (x))
#define EARGF(x) ARGF_(((x), exit(1), (char *)0))
#define ARGF() ARGF_((char *)0)