From 1934fddf3eb3a4336d270cc6e7d5cbffe0667c78 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 25 Feb 2020 11:49:49 -0600 Subject: Fix off by one error that treats bit 31 as negative (so ls --color sets all the bits). While we're at it, make LL be ULL so bit 63 doesn't have the same problem. --- scripts/mkflags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mkflags.c b/scripts/mkflags.c index 76827e0f..fff9dd4c 100644 --- a/scripts/mkflags.c +++ b/scripts/mkflags.c @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) if (!(out = outbuf)) return 1; printf("#undef FORCED_FLAG\n#undef FORCED_FLAGLL\n" - "#ifdef FORCE_FLAGS\n#define FORCED_FLAG 1\n#define FORCED_FLAGLL 1LL\n" + "#ifdef FORCE_FLAGS\n#define FORCED_FLAG 1\n#define FORCED_FLAGLL 1ULL\n" "#else\n#define FORCED_FLAG 0\n#define FORCED_FLAGLL 0\n#endif\n\n"); for (;;) { @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) out += strlen(out); while (aflist) { - char *llstr = bit>31 ? "LL" : "", *s = (char []){0, 0, 0, 0}; + char *llstr = bit>30 ? "LL" : "", *s = (char []){0, 0, 0, 0}; int enabled = 0; // Output flag macro for bare longopts -- cgit v1.2.3