aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-01-01 14:05:46 -0600
committerRob Landley <rob@landley.net>2020-01-01 14:05:46 -0600
commit53090cd6c1343954d953625223b50e73abb6b9f3 (patch)
tree679f565000f9f3a448d1b0ff71c0e024a2e9eb5c
parent9c52df1131cf208df3e73cb440485d3673c6491a (diff)
downloadtoybox-53090cd6c1343954d953625223b50e73abb6b9f3.tar.gz
Use FLAG() macros.
-rw-r--r--toys/example/skeleton.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/toys/example/skeleton.c b/toys/example/skeleton.c
index b8dd102a..1796ba1b 100644
--- a/toys/example/skeleton.c
+++ b/toys/example/skeleton.c
@@ -72,9 +72,9 @@ void skeleton_main(void)
// Command line options parsing is done for you by lib/args.c called
// from main.c using the optstring in the NEWTOY macros. Display results.
if (toys.optflags) printf("flags=%llx\n", toys.optflags);
- if (toys.optflags & FLAG_a) printf("Saw a\n");
- if (toys.optflags & FLAG_b) printf("b=%s\n", TT.s.b);
- if (toys.optflags & FLAG_c) printf("c=%ld\n", TT.s.c);
+ if (FLAG(a)) printf("Saw a\n");
+ if (FLAG(b)) printf("b=%s\n", TT.s.b);
+ if (FLAG(c)) printf("c=%ld\n", TT.s.c);
while (TT.s.d) {
printf("d=%s\n", TT.s.d->arg);
TT.s.d = TT.s.d->next;
@@ -82,7 +82,7 @@ void skeleton_main(void)
if (TT.s.e) printf("e was seen %ld times\n", TT.s.e);
for (optargs = toys.optargs; *optargs; optargs++)
printf("optarg=%s\n", *optargs);
- if (toys.optflags & FLAG_walrus) printf("Saw --walrus\n");
+ if (FLAG(walrus)) printf("Saw --walrus\n");
if (TT.s.blubber) printf("--blubber=%s\n", TT.s.blubber);
printf("Other globals should start zeroed: %d\n", TT.more_globals);
@@ -100,5 +100,5 @@ void skeleton_alias_main(void)
// Note, this FLAG_b is a different bit position than the other FLAG_b,
// and fills out a different variable of a different type.
- if (toys.optflags & FLAG_b) printf("b=%ld", TT.a.b);
+ if (FLAG(b)) printf("b=%ld", TT.a.b);
}