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:
Justine Tunney 2023-09-01 20:49:13 -07:00
parent e2b3c3618e
commit 0d748ad58e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
571 changed files with 1306 additions and 1888 deletions

View file

@ -413,9 +413,9 @@ void editorUpdateSyntax(erow *row) {
int i, prev_sep, in_string, in_comment;
char *p;
const char *const *keywords = E.syntax->keywords;
char *scs = E.syntax->singleline_comment_start;
char *mcs = E.syntax->multiline_comment_start;
char *mce = E.syntax->multiline_comment_end;
const char *scs = E.syntax->singleline_comment_start;
const char *mcs = E.syntax->multiline_comment_start;
const char *mce = E.syntax->multiline_comment_end;
/* Point to the first non-space char. */
p = row->render;
@ -575,7 +575,7 @@ int editorSyntaxToColor(int hl) {
* setting it in the global state E.syntax. */
void editorSelectSyntaxHighlight(char *filename) {
for (unsigned j = 0; j < HLDB_ENTRIES; j++) {
struct editorSyntax *s = HLDB + j;
const struct editorSyntax *s = HLDB + j;
unsigned i = 0;
while (s->filematch[i]) {
char *p;
@ -898,7 +898,7 @@ struct abuf {
};
static void abAppend(struct abuf *ab, const char *s, int len) {
CONCAT(&ab->p, &ab->i, &ab->n, s, len);
CONCAT(&ab->p, &ab->i, &ab->n, (void *)s, len);
}
/* This function writes the whole screen using VT100 escape characters