[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: crc
From: |
Paul Eggert |
Subject: |
Re: crc |
Date: |
Fri, 07 Oct 2005 10:16:26 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Simon Josefsson <address@hidden> writes:
> I'm not sure whether the extract from RFC 1952 (a two line function)
> warrant the big copyright comment, or whether borrowing that code is
> OK.
No, it's OK to borrow two lines of code. However it would be polite
to have a one- or two-line comment giving the reference.
> +static unsigned long crc32_table[256] = {
> + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
The usual GNU style is to say 'unsigned long int' rather than 'unsigned long'.
But shouldn't you be using uint32_t rather than unsigned long int,
both here and elsewhere? AC_REQUIRE([gl_AC_TYPE_UINT32_T]), and then
put this in your C file:
##if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
and you can use uint32_t. I suggest using it in both the .h and the
.c file, since it makes things clearer.
- crc, Simon Josefsson, 2005/10/07
- Re: crc, Ralf Wildenhues, 2005/10/07
- Re: crc, Simon Josefsson, 2005/10/07
- Re: crc,
Paul Eggert <=
- Re: crc, Simon Josefsson, 2005/10/08
- Re: crc, Simon Josefsson, 2005/10/08
Re: [bug-gnulib] crc, Bruno Haible, 2005/10/07
- Re: crc, Simon Josefsson, 2005/10/08