mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Fix warnings
This change fixes Cosmopolitan so it has fewer opinions about compiler warnings. The whole repository had to be cleaned up to be buildable in -Werror -Wall mode. This lets us benefit from things like strict const checking. Some actual bugs might have been caught too.
This commit is contained in:
parent
e2b3c3618e
commit
0d748ad58e
571 changed files with 1306 additions and 1888 deletions
|
@ -220,7 +220,7 @@ static void put_16(unsigned char *s, unsigned c, int e)
|
|||
static unsigned get_32(const unsigned char *s, int e)
|
||||
{
|
||||
e &= 3;
|
||||
return s[e]+0U<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
|
||||
return (s[e]+0U)<<24 | s[e^1]<<16 | s[e^2]<<8 | s[e^3];
|
||||
}
|
||||
|
||||
static void put_32(unsigned char *s, unsigned c, int e)
|
||||
|
@ -240,7 +240,7 @@ static unsigned legacy_map(const unsigned char *map, unsigned c)
|
|||
{
|
||||
if (c < 4*map[-1]) return c;
|
||||
unsigned x = c - 4*map[-1];
|
||||
x = map[x*5/4]>>2*x%8 | map[x*5/4+1]<<8-2*x%8 & 1023;
|
||||
x = (map[x*5/4]>>(2*x%8)) | ((map[x*5/4+1]<<(8-(2*x%8))) & 1023);
|
||||
return x < 256 ? x : legacy_chars[x-256];
|
||||
}
|
||||
|
||||
|
@ -535,7 +535,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
|
|||
if (c >= 93 || d >= 94) {
|
||||
c += (0xa1-0x81);
|
||||
d += 0xa1;
|
||||
if (c >= 93 || c>=0xc6-0x81 && d>0x52)
|
||||
if (c >= 93 || ((c>=0xc6-0x81) && d>0x52))
|
||||
goto ilseq;
|
||||
if (d-'A'<26) d = d-'A';
|
||||
else if (d-'a'<26) d = d-'a'+26;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue