From b213f91a0031da91eb6d3b86c7e724a0f7725d3e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 13 Nov 2019 21:26:26 -0600 Subject: Pedantic constant annotations to shut up older toolchains. --- toys/net/sntp.c | 2 +- toys/posix/file.c | 2 +- toys/posix/tar.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toys/net/sntp.c b/toys/net/sntp.c index 15e74440..ab6a6031 100644 --- a/toys/net/sntp.c +++ b/toys/net/sntp.c @@ -39,7 +39,7 @@ GLOBALS( ) // Seconds from 1900 to 1970, including appropriate leap days -#define SEVENTIES 2208988800L +#define SEVENTIES 2208988800UL // Get time and return ntptime (saving timespec in pointer if not null) // NTP time is high 32 bits = seconds since 1970 (blame RFC 868), low 32 bits diff --git a/toys/posix/file.c b/toys/posix/file.c index 063397ce..5d6eef12 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -284,7 +284,7 @@ static void do_regular_file(int fd, char *name) xputc('\n'); } else if (len>4 && strstart(&s, "BZh") && isdigit(*s)) xprintf("bzip2 compressed data, block size = %c00k\n", *s); - else if (len > 31 && peek_be(s, 7) == 0xfd377a585a0000) + else if (len > 31 && peek_be(s, 7) == 0xfd377a585a0000UL) xputs("xz compressed data"); else if (len>10 && strstart(&s, "\x1f\x8b")) xputs("gzip compressed data"); else if (len>32 && !memcmp(s+1, "\xfa\xed\xfe", 3)) { diff --git a/toys/posix/tar.c b/toys/posix/tar.c index ff129819..1e662589 100644 --- a/toys/posix/tar.c +++ b/toys/posix/tar.c @@ -848,7 +848,7 @@ void tar_main(void) // detect gzip and bzip signatures if (SWAP_BE16(*(short *)hdr)==0x1f8b) toys.optflags |= FLAG_z; else if (!memcmp(hdr, "BZh", 3)) toys.optflags |= FLAG_j; - else if (peek_be(hdr, 7) == 0xfd377a585a0000) toys.optflags |= FLAG_J; + else if (peek_be(hdr, 7) == 0xfd377a585a0000UL) toys.optflags |= FLAG_J; else error_exit("Not tar"); // if we can seek back we don't need to loop and copy data -- cgit v1.2.3