]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Apply some static where it belongs
authorDale Weiler <killfieldengine@gmail.com>
Thu, 25 Apr 2013 03:34:42 +0000 (03:34 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 25 Apr 2013 03:34:42 +0000 (03:34 +0000)
Makefile
code.c
exec.c
ir.c
lexer.c
test.c
util.c

index b96168d49209314327533312f2062fa4dcbed186..667dfe63ac35d76b0401c7b1f8126d4bf4b33738 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,6 @@ ifeq ($(CC), clang)
            -Wno-conversion                    \
            -Wno-missing-prototypes            \
            -Wno-float-equal                   \
-           -Wno-missing-variable-declarations \
            -Wno-unknown-warning-option
 else
        #Tiny C Compiler doesn't know what -pedantic-errors is
diff --git a/code.c b/code.c
index 5728a8db425f7b724a44717ba8510b400654637e..eabc50c458a77fff4dfdc7e8b05ce82b63d3b981 100644 (file)
--- a/code.c
+++ b/code.c
@@ -31,7 +31,7 @@ prog_section_function  *code_functions;
 int                    *code_globals;
 char                   *code_chars;
 uint16_t                code_crc;
-uint32_t                code_entfields;
+static uint32_t         code_entfields;
 
 /* This is outrageous! */
 #define QCINT_ENTRY void*
diff --git a/exec.c b/exec.c
index dff388bed961c9c9a17e4caa5697f4227c1dc962..0ef32119a0a475a3c9446b314c423ea2f2152622 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -625,7 +625,7 @@ typedef struct {
     const char *value;
 } qcvm_parameter;
 
-qcvm_parameter *main_params = NULL;
+static qcvm_parameter *main_params = NULL;
 
 #define CheckArgs(num) do {                                                    \
     if (prog->argc != (num)) {                                                 \
diff --git a/ir.c b/ir.c
index 255251022d660541897f23e578ea6393af8a0d39..68186dc3dfa5cfcc5bb6d8fc6e2935913aaf6f6e 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -48,7 +48,7 @@ const char *type_name[TYPE_COUNT] = {
     "<no-expression>"
 };
 
-size_t type_sizeof_[TYPE_COUNT] = {
+static size_t type_sizeof_[TYPE_COUNT] = {
     1, /* TYPE_VOID     */
     1, /* TYPE_STRING   */
     1, /* TYPE_FLOAT    */
diff --git a/lexer.c b/lexer.c
index db0a8f4d9bf541bdd25597c5047e040d7dc36fc5..7722f4f5795f02ee6c355aa6ea1b172c89948440 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -58,7 +58,7 @@ static size_t num_keywords_fg = sizeof(keywords_fg) / sizeof(keywords_fg[0]);
  * Lexer code
  */
 
-char* *lex_filenames;
+static char* *lex_filenames;
 
 void lexerror(lex_file *lex, const char *fmt, ...)
 {
diff --git a/test.c b/test.c
index f263cea0e8e4bb1f302b06da370f6b901840e1f2..0af74771cda014922689192acba012216030c2fa 100644 (file)
--- a/test.c
+++ b/test.c
@@ -26,7 +26,7 @@
 
 opts_cmd_t opts;
 
-const char *task_bins[] = {
+static const char *task_bins[] = {
     "./gmqcc",
     "./qcvm"
 };
@@ -654,7 +654,7 @@ typedef struct {
     bool             compiled;
 } task_t;
 
-task_t *task_tasks = NULL;
+static task_t *task_tasks = NULL;
 
 /*
  * Read a directory and searches for all template files in it
diff --git a/util.c b/util.c
index fa6e79772662e0d24765f6970632491690aa2fdf..c8d50f5b5fbc15fbff326efbaa45a40f4f734d49 100644 (file)
--- a/util.c
+++ b/util.c
 #include "gmqcc.h"
 
 /* TODO: remove globals ... */
-uint64_t mem_ab = 0;
-uint64_t mem_db = 0;
-uint64_t mem_at = 0;
-uint64_t mem_dt = 0;
-uint64_t mem_pk = 0;
-uint64_t mem_hw = 0;
+static uint64_t mem_ab = 0;
+static uint64_t mem_db = 0;
+static uint64_t mem_at = 0;
+static uint64_t mem_dt = 0;
+static uint64_t mem_pk = 0;
+static uint64_t mem_hw = 0;
 
 struct memblock_t {
     const char  *file;