summaryrefslogtreecommitdiff
path: root/crc24q.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2008-07-10 12:20:40 +0000
committerEric S. Raymond <esr@thyrsus.com>2008-07-10 12:20:40 +0000
commit588464026d2f9da393fc8233a18b88b5c050e8cb (patch)
tree868f221f6bdb51759bba46ae5246c5b2f7ac4dc8 /crc24q.c
parentb156c0599ffac902a30e76ad0de34bf2df6ea1b3 (diff)
downloadgpsd-588464026d2f9da393fc8233a18b88b5c050e8cb.tar.gz
Minor polishing for possible future code reuse.
Diffstat (limited to 'crc24q.c')
-rw-r--r--crc24q.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crc24q.c b/crc24q.c
index a429de9d..73e43d90 100644
--- a/crc24q.c
+++ b/crc24q.c
@@ -35,7 +35,8 @@
unsigned table[25];
-#define CRCPOLY 0x1864CFB
+#define CRCSEED 0 /* could be NZ to detect leading zeros */
+#define CRCPOLY 0x1864CFB /* encodes all info about the polynomial */
static void
crc_init(unsigned table[256])
@@ -43,7 +44,7 @@ crc_init(unsigned table[256])
unsigned i, j;
unsigned h;
- table[0] = 0;
+ table[0] = CRCSEED;
table[1] = h = CRCPOLY;
for (i = 2; i < 256; i *= 2) {