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

@ -16,9 +16,9 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "tool/plinko/lib/trace.h"
#include "tool/plinko/lib/plinko.h"
#include "tool/plinko/lib/printf.h"
#include "tool/plinko/lib/trace.h"
void EnableTracing(void) {
eval = EvalTrace;
@ -112,7 +112,7 @@ static relegated int Trace(int e, int a, EvalFn *f, bool p(int), const char *s,
}
relegated int RecurseTrace(dword ea, dword p1, dword p2) {
int r, d, S = sp;
int r;
const char *s = "Recurse";
const unsigned short c[5] = u"╔═║╚═";
if (depth < ARRAYLEN(g_depths)) {
@ -143,7 +143,7 @@ relegated int RecurseTrace(dword ea, dword p1, dword p2) {
}
relegated int EvlisTrace(int e, int a, dword p1, dword p2) {
int r, d, S = sp;
int r, d;
const char *s = "Evlis";
const unsigned short c[5] = u"╒─┆╘─";
DCHECK_GE(depth, -1);
@ -177,7 +177,7 @@ relegated int EvlisTrace(int e, int a, dword p1, dword p2) {
relegated int Trace3(int x, int y, int a, PairFn *f, const char *s,
const unsigned short c[5]) {
int r, d, S = sp;
int r;
if (depth < ARRAYLEN(g_depths)) {
if (loga) {
Fprintf(2, "%I%c%c%s[x=%S; y=%S; a=%S] δ %'Rns%n", c[0], c[1], s,
@ -198,7 +198,6 @@ relegated int Trace3(int x, int y, int a, PairFn *f, const char *s,
relegated struct Binding BindTrace(int x, int y, int a, int u, dword p1,
dword p2) {
int d, S = sp;
struct Binding r;
if (depth < ARRAYLEN(g_depths)) {
if (loga) {