diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2010-07-26 11:37:19 -0700 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-07-30 09:01:44 +0300 |
commit | 07a87aa599a8fc32e938d9987bd2b59eebcfcb76 (patch) | |
tree | fdb1161f478f0deacf47de3df9aee4bba69aa4b7 /lib | |
parent | 5dd7d09648bd4c1c87e7c155b960e500925571db (diff) |
mtd-utils: clean up compile warnings
gcc 4.4.3 on x86_64:
libcrc32.c:42: warning: ‘static’ is not at beginning of declaration
libfec.c:120: warning: initialization discards qualifiers from pointer target type
libfec.c:121: warning: initialization discards qualifiers from pointer target type
libfec.c:417: warning: passing argument 2 of ‘my_malloc’ discards qualifiers from pointer target type
recv_image.c:164: warning: comparison of unsigned expression < 0 is always false
recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
And many more along the same lines.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrc32.c | 2 | ||||
-rw-r--r-- | lib/libfec.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcrc32.c b/lib/libcrc32.c index d556e91..d47a842 100644 --- a/lib/libcrc32.c +++ b/lib/libcrc32.c @@ -39,7 +39,7 @@ #include <stdint.h> -const static uint32_t crc32_table[256] = { +static const uint32_t crc32_table[256] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, diff --git a/lib/libfec.c b/lib/libfec.c index 6d9020f..adf2bba 100644 --- a/lib/libfec.c +++ b/lib/libfec.c @@ -114,7 +114,7 @@ typedef unsigned short gf; * Primitive polynomials - see Lin & Costello, Appendix A, * and Lee & Messerschmitt, p. 453. */ -static char *allPp[] = { /* GF_BITS polynomial */ +static const char *allPp[] = { /* GF_BITS polynomial */ NULL, /* 0 no code */ NULL, /* 1 no code */ "111", /* 2 1+x+x^2 */ @@ -226,7 +226,7 @@ gf_mul(x,y) * one place. */ static void * -my_malloc(int sz, char *err_string) +my_malloc(int sz, const char *err_string) { void *p = malloc( sz ); if (p == NULL) { @@ -247,7 +247,7 @@ generate_gf(void) { int i; gf mask; - char *Pp = allPp[GF_BITS] ; + const char *Pp = allPp[GF_BITS] ; mask = 1; /* x ** 0 = 1 */ gf_exp[GF_BITS] = 0; /* will be updated at the end of the 1st loop */ |