added -Wswitch-default
This commit is contained in:
parent
139a065f2c
commit
19a4f60e9b
10 changed files with 20 additions and 4 deletions
11
avl/avl.c
11
avl/avl.c
|
|
@ -313,11 +313,20 @@ avl_node_t *avl_insert_node(avl_tree_t *avltree, avl_node_t *newnode) {
|
|||
if(!avltree->top)
|
||||
return avl_insert_top(avltree, newnode);
|
||||
|
||||
switch(avl_search_closest(avltree, newnode->item, avltree->cmp, &node)) {
|
||||
switch (avl_search_closest(avltree, newnode->item, avltree->cmp, &node))
|
||||
{
|
||||
case -1:
|
||||
return avl_insert_before(avltree, node, newnode);
|
||||
|
||||
case 1:
|
||||
return avl_insert_after(avltree, node, newnode);
|
||||
|
||||
case 0:
|
||||
break;
|
||||
|
||||
default:
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
-O3
|
||||
|
||||
-std=c17
|
||||
|
||||
-Wall
|
||||
-Werror
|
||||
-Wfatal-errors
|
||||
|
|
@ -25,6 +23,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-override-init
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
-Wnested-externs
|
||||
-Wuninitialized
|
||||
-Wmaybe-uninitialized
|
||||
-Wswitch
|
||||
-Wswitch-default
|
||||
|
||||
-Wno-comment
|
||||
-Wno-unused
|
||||
|
|
|
|||
2
makefile
2
makefile
|
|
@ -21,7 +21,7 @@ include srclist.mk
|
|||
|
||||
${prefix}/%.o ${prefix}/%.d: %.c ${optionset} | ${prefix}/%/
|
||||
@echo "compiling (${buildtype}) ${<} ..."
|
||||
@gcc -c @${optionset} $< -MD -MF ${prefix}/${*}.d -o ${prefix}/${*}.o || (gedit $<; false)
|
||||
@gcc -c @${optionset} $< -MD -MF ${prefix}/${*}.d -o ${prefix}/${*}.o # || (gedit $<; false)
|
||||
|
||||
objs = $(patsubst %.c,${prefix}/%.o,${srcs})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue