add CFLAGS -Wshadow and -funroll-loops, fix related common-test.h

This commit is contained in:
2024-04-17 08:21:20 +02:00
parent 473cc8683e
commit 8b3202fac0
3 changed files with 11 additions and 9 deletions

View File

@@ -1,3 +1,3 @@
((nil . ((compile-command . (concat "make -C "
(vc-root-dir)
" -k -j2 testing")))))
" -k -j4 testing")))))

View File

@@ -97,12 +97,14 @@ CFLAGS += -ginline-points # inlined funcs debu
#CFLAGS += -mno-tbm
# release
CFLAGS += -Ofast
CFLAGS += -O3
CFLAGS += -march=native
CFLAGS += -flto
CFLAGS += -funroll-loops
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wshadow
CFLAGS += -Wmissing-declarations
CFLAGS := $(strip $(CFLAGS))

View File

@@ -412,22 +412,22 @@ struct fentest {
{ __LINE__, 0, NULL, NULL }
};
static int cur = -1;
static int fentest_cur = -1;
static char *next_fen(uint module)
{
cur++;
while (fentest[cur].fen && !(fentest[cur].modules & module))
cur++;
return fentest[cur].fen;
fentest_cur++;
while (fentest[fentest_cur].fen && !(fentest[fentest_cur].modules & module))
fentest_cur++;
return fentest[fentest_cur].fen;
}
static __unused char* cur_comment()
{
return fentest[cur].comment;
return fentest[fentest_cur].comment;
}
static __unused int cur_line()
{
return fentest[cur].line;
return fentest[fentest_cur].line;
}