]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Some fixes
authorDale Weiler <weilercdale@gmail.com>
Sun, 25 May 2014 06:27:02 +0000 (02:27 -0400)
committerDale Weiler <weilercdale@gmail.com>
Sun, 25 May 2014 06:27:02 +0000 (02:27 -0400)
BSDmakefile
Makefile
exec.c
include.mk

index 584c2f19c719a1ff066517df9280782a9bffa364..b34cb1e7610c11a4215f29cbce9ff119d5a19e8e 100644 (file)
@@ -11,8 +11,6 @@ GITINFO  :=
     GITINFO != git describe --always
 .endif
 
-CFLAGS   +=  -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes
-
 .if $(CC) == clang
     CFLAGS +=   -Weverything\
                 -Wno-padded\
index 6f8eb9a82732f86b3ebc2619a6ec461eb3fe819b..f6a21ffe301305671fd17ea32fc945fa0f5f41c9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,7 @@ UNAME  ?= $(shell uname)
 CYGWIN  = $(findstring CYGWIN, $(UNAME))
 MINGW   = $(findstring MINGW,  $(UNAME))
 
-CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes -O3
-#turn on tons of warnings if clang is present
+# turn on tons of warnings if clang is present
 # but also turn off the STUPID ONES
 ifeq ($(CC), clang)
        CFLAGS +=                              \
diff --git a/exec.c b/exec.c
index 29a04a3fcc689f8faeabd40264e4876a9ce2acce..3c36e11eedbebf44cb3a2d9ef208c5aac4bea75b 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -912,7 +912,7 @@ static void prog_main_setparams(qc_program_t *prog) {
     }
 }
 
-void prog_disasm_function(qc_program_t *prog, size_t id);
+static void prog_disasm_function(qc_program_t *prog, size_t id);
 
 int main(int argc, char **argv) {
     size_t      i;
@@ -1227,7 +1227,7 @@ int main(int argc, char **argv) {
     return 0;
 }
 
-void prog_disasm_function(qc_program_t *prog, size_t id) {
+static void prog_disasm_function(qc_program_t *prog, size_t id) {
     prog_section_function_t *fdef = prog->functions + id;
     prog_section_statement_t *st;
 
index 23c3fb94c45d7562a8deb1670db3e8e19c0e81be..081ce3b6c03f7760af4c41675461b7c4a3a3642a 100644 (file)
@@ -5,6 +5,9 @@ BINDIR  := $(PREFIX)/bin
 DATADIR := $(PREFIX)/share
 MANDIR  := $(DATADIR)/man
 
+# default flags
+CFLAGS  += -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes -O2
+
 # compiler
 CC      ?= clang
 
@@ -101,7 +104,12 @@ SPLINTFLAGS =                 \
     -observertrans            \
     -abstract                 \
     -statictrans              \
-    -castfcnptr
+    -castfcnptr               \
+    -shiftimplementation      \
+    -shiftnegative            \
+    -boolcompare              \
+    -infloops                 \
+    -sysunrecog
 
 #always the right rule
 default: all
@@ -118,13 +126,16 @@ uninstall:
 #style rule
 STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \)
 
+# splint cannot parse the MSVC source
+SPLINT_MATCH = \( -name '*.[ch]' -and ! -name 'msvc.c' -and ! -path './doc/*' \)
+
 style:
        find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';'
        find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';'
        find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/    /g' '{}' ';'
 
 splint:
-       @splint $(SPLINTFLAGS) *.c *.h
+       @splint $(SPLINTFLAGS) `find . -type f $(SPLINT_MATCH)`
 
 gource:
        @gource $(GOURCEFLAGS)