diff options
author | Andrew Morton <akpm@osdl.org> | 2004-02-03 18:32:27 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-02-03 18:32:27 -0800 |
commit | d75cb1840b2c95fcfa740a9e6b350ae44c9fbb46 (patch) | |
tree | 05efcddd2d34b6af38fac0df418d4069dae2ec0a /lib | |
parent | 6067797897b65d169561e66a4f01ac9030d4bbee (diff) | |
download | history-d75cb1840b2c95fcfa740a9e6b350ae44c9fbb46.tar.gz |
[PATCH] Fix more gcc 3.4 warnings
From: Andi Kleen <ak@muc.de>
Just many more warning fixes for a gcc 3.4 snapshot.
It warns for a lot of things now, e.g. for ?: and ({ ... }) and casts as
lvalues. And for functions marked inline in headers, but no body.
Actually there are more warnings, i stopped fixing at some point. Some of
the warnings seem to be dubious (e.g. the binfmt_elf.c one, which looks
more like a compiler bug to me)
I also fixed the _exit() prototype to be void because gcc was complaining
about this.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crc32.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/crc32.c b/lib/crc32.c index 86d8670569a75e..2783fa38af65c1 100644 --- a/lib/crc32.c +++ b/lib/crc32.c @@ -99,7 +99,9 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) /* Align it */ if(unlikely(((long)b)&3 && len)){ do { - DO_CRC(*((u8 *)b)++); + u8 *p = (u8 *)b; + DO_CRC(*p++); + b = (void *)p; } while ((--len) && ((long)b)&3 ); } if(likely(len >= 4)){ @@ -120,7 +122,9 @@ u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) /* And the last few bytes */ if(len){ do { - DO_CRC(*((u8 *)b)++); + u8 *p = (u8 *)b; + DO_CRC(*p++); + b = (void *)p; } while (--len); } @@ -200,7 +204,9 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) /* Align it */ if(unlikely(((long)b)&3 && len)){ do { - DO_CRC(*((u8 *)b)++); + u8 *p = (u8 *)b; + DO_CRC(*p++); + b = (u32 *)p; } while ((--len) && ((long)b)&3 ); } if(likely(len >= 4)){ @@ -221,7 +227,9 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len) /* And the last few bytes */ if(len){ do { - DO_CRC(*((u8 *)b)++); + u8 *p = (u8 *)b; + DO_CRC(*p++); + b = (void *)p; } while (--len); } return __be32_to_cpu(crc); |