From 599adf7c404d7fd0c396cd3727b87622bf769402 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 1 Aug 2026 22:41:15 -0500 Subject: [PATCH] Minor cleanups. --- main.c | 6 +++--- toys/net/httpd.c | 2 +- toys/other/blkid.c | 2 +- toys/other/sha3sum.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 41728ae1..a573568b 100644 --- a/main.c +++ b/main.c @@ -87,13 +87,13 @@ static const int NEED_TRIMHELP = #if CFG_TOYBOX_ZHELP #include "generated/zhelp.h" -static char *help_data = 0; +static const char *help_data = 0; #else #include "generated/help.h" static const char help_array[] = #include "generated/newtoys.h" ; -static char *help_data = (void *)help_array; +static const char *help_data = help_array; #define zhelp_data 0 #define ZHELP_LEN 0 #endif @@ -115,7 +115,7 @@ void show_help(int flags) : " (see https://landley.net/toybox)"); for (;;) { - for (s = (void *)help_data; i--; s += strlen(s)+1); + for (s = help_data; i--; s += strlen(s)+1); // If it's an alias, restart search for real name if (*s != 255) break; i = toy_find(++s)-toy_list; diff --git a/toys/net/httpd.c b/toys/net/httpd.c index d649b78d..a9646a6e 100644 --- a/toys/net/httpd.c +++ b/toys/net/httpd.c @@ -107,7 +107,7 @@ void handle(int infd, int outfd) if (!s) return; - if (!getsockname(0, (void *)&toybuf, &i)) { + if (!getsockname(0, (void *)toybuf, &i)) { if (FLAG(v)) dprintf(2, "Hello %s\n%s\n", ntop((void *)toybuf), s); } diff --git a/toys/other/blkid.c b/toys/other/blkid.c index 5a5726e9..08c9f473 100644 --- a/toys/other/blkid.c +++ b/toys/other/blkid.c @@ -2,7 +2,7 @@ * * Copyright 2013 Brad Conroy * - * See ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.24/libblkid-docs/api-index-full.html + * See https://man7.org/linux/man-pages/man8/blkid.8.html * TODO: -U and -L should require arguments USE_BLKID(NEWTOY(blkid, "ULo:s*[!LU]", TOYFLAG_BIN|TOYFLAG_LINEBUF)) diff --git a/toys/other/sha3sum.c b/toys/other/sha3sum.c index 9fbb83e9..19d6e9b7 100644 --- a/toys/other/sha3sum.c +++ b/toys/other/sha3sum.c @@ -98,7 +98,7 @@ void sha3sum_main(void) char *s; // Decompress RC table - for (s = (void *)rcpack, i = 127; i; s += 3) for (i>>=1,k = j = 0; k<24; k++) + for (s = rcpack, i = 127; i; s += 3) for (i>>=1,k = j = 0; k<24; k++) if (1&(s[k>>3]>>(7-(k&7)))) TT.rc[k] |= 1ULL<