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

@ -73,7 +73,7 @@ linenoiseCompletionCallback *lua_repl_completions_callback;
struct linenoiseState *lua_repl_linenoise;
const char *lua_progname;
static lua_State *globalL;
static const char *g_historypath;
static char *g_historypath;
/*
** {==================================================================
@ -105,8 +105,9 @@ void lua_readline_completions (const char *p, linenoiseCompletions *c) {
size_t n;
bool found;
lua_State *L;
const char *a;
const char *name;
char *a, *b, *s, *component;
char *b, *s, *component;
// start searching globals
L = globalL;
@ -318,7 +319,6 @@ static void lstop (lua_State *L, lua_Debug *ar) {
static int multiline (lua_State *L) {
for (;;) { /* repeat until gets a complete statement */
size_t len;
ssize_t rc;
const char *line = lua_tolstring(L, 1, &len); /* get what it has */
int status = luaL_loadbuffer(L, line, len, "=stdin"); /* try it */
if (!incomplete(L, status) || pushline(L, 0) != 1)