From 7774c55deea8c219a073d7243051040f475cead0 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 5 Aug 2012 20:19:44 -0700 Subject: [PATCH] cleanup --- args.c | 3 +-- crc32.c | 10 +--------- main.c | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/args.c b/args.c index ab8a14b..4929639 100644 --- a/args.c +++ b/args.c @@ -5,9 +5,8 @@ * copy of the license along with this program; see the file LICENSE. */ -#include "args.h" - #include +#include "args.h" static int argc, argi; static char **argv, *flag; diff --git a/crc32.c b/crc32.c index 9c05f78..865917c 100644 --- a/crc32.c +++ b/crc32.c @@ -8,13 +8,6 @@ typedef unsigned long ulong; #include "crc32.h" -int crc_big_endian = 0; -ulong crc_polynomial = 0x04C11DB7; - -enum { - TABLE_SIZE = 0x100 -}; - ulong crc_reflect(ulong input) { ulong reflected = 0; @@ -27,14 +20,13 @@ ulong crc_reflect(ulong input) return reflected; } -/* TODO: test returning array */ void crc_fill_table(ulong *table, int big, ulong polynomial) { ulong lsb = (big) ? 1 << 31 : 1; /* least significant bit */ ulong poly = (big) ? polynomial : crc_reflect(polynomial); int c, i; - for (c = 0; c < TABLE_SIZE; c++, table++) { + for (c = 0; c < CRC_TABLE_SIZE; c++, table++) { *table = (big) ? c << 24 : c; for (i = 0; i < 8; i++) { if (*table & lsb) { diff --git a/main.c b/main.c index 264e862..9ed737f 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,6 @@ #include #include -#include typedef unsigned long ulong;