mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-31 09:42:27 +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
|
@ -72,7 +72,6 @@ TEST(strchrnul, notFound_returnsPointerToNulByte) {
|
|||
}
|
||||
|
||||
char *strchr_pure(const char *s, int c) {
|
||||
char *r;
|
||||
for (c &= 0xff;; ++s) {
|
||||
if ((*s & 0xff) == c) return (char *)s;
|
||||
if (!*s) return NULL;
|
||||
|
@ -108,7 +107,7 @@ BENCH(strchr, bench) {
|
|||
char *memchr_pure(const char *m, int c, size_t n) {
|
||||
const unsigned char *p, *pe;
|
||||
for (c &= 0xff, p = (const unsigned char *)m, pe = p + n; p < pe; ++p) {
|
||||
if (*p == c) return p;
|
||||
if (*p == c) return (void *)p;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -127,10 +126,9 @@ TEST(memchr, fuzz) {
|
|||
}
|
||||
|
||||
char *strchrnul_pure(const char *s, int c) {
|
||||
char *r;
|
||||
for (c &= 0xff;; ++s) {
|
||||
if ((*s & 0xff) == c) return (char *)s;
|
||||
if (!*s) return s;
|
||||
if (!*s) return (void *)s;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +148,7 @@ TEST(strchrnul, fuzz) {
|
|||
void *rawmemchr_pure(const void *m, int c) {
|
||||
const unsigned char *s;
|
||||
for (c &= 255, s = m;; ++s) {
|
||||
if (*s == c) return s;
|
||||
if (*s == c) return (void *)s;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue