From d09d2d7c72aa4ba784c8321ca75d6cea52bcc959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20BRAMI?= Date: Thu, 14 Oct 2021 00:25:58 +0200 Subject: [PATCH] fix(build): Fix others -Werror=discarded-qualifiers --- libc/alg/bisect.internal.h | 2 +- libc/alg/critbit0_emplace.c | 2 +- libc/alg/critbit0_get.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/alg/bisect.internal.h b/libc/alg/bisect.internal.h index 242d50668..0616a859d 100644 --- a/libc/alg/bisect.internal.h +++ b/libc/alg/bisect.internal.h @@ -21,7 +21,7 @@ forceinline void *bisect(const void *k, const void *data, size_t n, size_t size, } else if (c < 0) { r = m - 1; } else { - return p + m * size; + return (char *)p + m * size; } } } diff --git a/libc/alg/critbit0_emplace.c b/libc/alg/critbit0_emplace.c index aacee5120..9be59c55d 100644 --- a/libc/alg/critbit0_emplace.c +++ b/libc/alg/critbit0_emplace.c @@ -67,7 +67,7 @@ different_byte_found: struct CritbitNode *newnode = malloc(sizeof(struct CritbitNode)); newnode->byte = newbyte; newnode->otherbits = newotherbits; - newnode->child[1 - newdirection] = ubytes; + newnode->child[1 - newdirection] = (void*)ubytes; void **wherep = &t->root; for (;;) { unsigned char *wp = *wherep; diff --git a/libc/alg/critbit0_get.c b/libc/alg/critbit0_get.c index 523916f81..a395b2e4e 100644 --- a/libc/alg/critbit0_get.c +++ b/libc/alg/critbit0_get.c @@ -39,5 +39,5 @@ char *critbit0_get(struct critbit0 *t, const char *u) { const int direction = (1 + (q->otherbits | c)) >> 8; p = q->child[direction]; } - return strncmp(u, (const char *)p, ulen) == 0 ? (const char *)p : NULL; + return strncmp(u, (char *)p, ulen) == 0 ? (char *)p : NULL; }