cepheid

An Aurora 4X clone
Log | Files | Refs | README

commit d785673e22e18324fc9af869a64a2136c0a2df87
parent 72655e549f6fd17bf592243fa70649051da33ed6
Author: hhvn <dev@hhvn.uk>
Date:   Tue, 15 Nov 2022 16:06:55 +0000

Shut up, compiler

Diffstat:
M.gitignore | 1+
Dconfig.mk | 6------
Msrc/db.c | 8+++++++-
Msrc/save.c | 2+-
Msrc/system.c | 1+
Msrc/ui.c | 2+-
Msrc/views/bodies.c | 5-----
7 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -9,3 +9,4 @@ saves/ core.* tags perf.* +config.mk diff --git a/config.mk b/config.mk @@ -1,6 +0,0 @@ -STYLE = aurora -SAVEDIR = saves - -# Uncomment when developing: -# CFLAGS += -Wall -Wno-discarded-qualifiers -g3 -O0 -DDEBUG -# all: tags diff --git a/src/db.c b/src/db.c @@ -146,6 +146,7 @@ dbgettree(char *dir, Tree *r, Treegetter func) { int index; int i, j; Tree *t, *p; + int ret = 0; glen = dblistgroups(&groups, dir); slen = 0; @@ -197,9 +198,14 @@ nchild: * therefore responsible for allocating the name * and returning it */ t = tree_add_child(t, name, 0, NULL, NULL); - dbtree_concat(split, j, group, index || j != slen - 1); + if (dbtree_concat(split, j, group, index || j != slen - 1) == -1) { + ret = -1; + continue; + } if (!t->data) t->name = func(dir, group, name, j + 1, t); } } + + return ret; } diff --git a/src/save.c b/src/save.c @@ -26,7 +26,7 @@ save_free(void) { void save_read(char *name) { char dir[PATH_MAX]; - char *str; + /* char *str; */ if (save) save_free(); diff --git a/src/system.c b/src/system.c @@ -167,6 +167,7 @@ sys_tree_getter(char *dir, char *group, char *name, int depth, Tree *t) { case BODY_ASTEROID: s->num.asteroids++; break; case BODY_COMET: s->num.comets++; break; case BODY_MOON: s->num.moons++; break; + case BODY_LAST: /* shut up compiler */ break; } b->radius = dbgetfloat(dir, group, "radius"); diff --git a/src/ui.c b/src/ui.c @@ -257,7 +257,7 @@ ui_draw_expander(int x, int y, int w, int expanded) { if (!pane_visible(y, y + w)) return; - if (w-1 & 1) warning("drawing plus with even width\n"); + if ((w-1) & 1) warning("drawing plus with even width\n"); DrawRectangle(x, y, w, w, col_altbg); DrawRectangle(x + 1, y + p + 1, w - 2, 1, col_fg); diff --git a/src/views/bodies.c b/src/views/bodies.c @@ -80,10 +80,6 @@ tree_printer(int x, int y, Treeview *tv, Tree *t) { void ui_handle_view_bodies(int nowsel) { - Tree *t; - Body *body; - int pos, i; - v->prevframe.sel = v->sel; if (!v->sys) @@ -103,7 +99,6 @@ ui_handle_view_bodies(int nowsel) { void ui_draw_view_bodies(void) { int x, y; - Body *body; v->disp = RECT(PAD, VIEWS_HEIGHT + FONT_SIZE, screen.w - PAD * 2, FONT_SIZE + PAD);