]> git.draconx.ca Git - dxcommon.git/commitdiff
copysym: Improve compatibility with old compilers.
authorNick Bowler <nbowler@draconx.ca>
Sat, 6 Jan 2024 21:51:25 +0000 (16:51 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 7 Jan 2024 01:46:42 +0000 (20:46 -0500)
Some C89 compilers with 32-bit longs won't automatically widen integer
constants to (unsigned) long long in order to represent values that
don't fit in an (unsigned) long, even if those compilers otherwise
support 64-bit long long.

The "ll" and "ull" suffixes seem to get things working.

src/copysym.c

index 6ff93f35eb821a0f1af7c99a3aa6d1c455992cb9..3128c3e92d9da790ce77a995a502901f3fdf0562 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2023 Nick Bowler
+ * Copyright © 2023-2024 Nick Bowler
  *
  * Helper function to output the copyright symbol in a specified encoding.
  *
@@ -137,7 +137,7 @@ const char *copyright_symbol(const char *charset)
         * codes array for the corresponding index in t1, except that
         * ISO-8859 matches the special value '2' (handled below).
         */
-       dx_u64 results = 0x001921fb13777511;
+       dx_u64 results = 0x001921fb13777511ull;
        const char (*m1)[sizeof *t1];
        unsigned x, cindex;