summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-04-17 21:44:54 -0400
committerJakob Kaivo <jkk@ung.org>2022-04-17 21:44:54 -0400
commit02d1614c7263ba547df253e7e7885174b843a5c9 (patch)
tree370538b94d7ec5a497a67dd8561b9a8eaf6ffde2
parent05f7f67009c7aa605d1ec55a9df33f8ca250d584 (diff)
clean up some cruft from cksum
-rw-r--r--sum.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/sum.c b/sum.c
index 08f510f..ec38012 100644
--- a/sum.c
+++ b/sum.c
@@ -27,8 +27,6 @@
#include <string.h>
#include <unistd.h>
-#define MAX_SUM_WIDTH (32)
-#define UINT32_BIT (32)
#define UINT16_BIT (16)
#define BLOCK_SIZE (512)
@@ -39,18 +37,6 @@ struct sum {
uintmax_t sum;
};
-static char *progname = NULL;
-
-static uint32_t reverse(uint32_t n, int width)
-{
- uint32_t r = 0;
- for (int i = 0; i < width; i++) {
- r |= (n & 0x1) << ((width - 1) - i);
- n >>= 1;
- }
- return r;
-}
-
static struct sum sum_obsolete(FILE *f, int alt)
{
struct sum sum = { 0 };
@@ -100,7 +86,7 @@ int cksum(const char *path, enum algorithm alg)
}
if (f == NULL) {
- fprintf(stderr, "%s: %s: %s\n", progname, path, strerror(errno));
+ fprintf(stderr, "sum: %s: %s\n", path, strerror(errno));
return 1;
}