Browse Source

Cleanup the global variable definitions a bit

This was inspired by the issue reported in SourceForge #3382125.
Richard Laager 13 years ago
parent
commit
a5ff29da33
3 changed files with 7 additions and 5 deletions
  1. 3 2
      src/docsis.c
  2. 1 1
      src/docsis_decode.c
  3. 3 2
      src/docsis_globals.h

+ 3 - 2
src/docsis.c

@@ -37,12 +37,13 @@
 #include <net-snmp/mib_api.h>
 
 #include "docsis.h"
-#include "docsis_symtable.h"
 #include "docsis_globals.h"
+#include "docsis_symtable.h"
 #include "ethermac.h"
 #include "md5.h"
 
-extern unsigned int line;	/* defined in docsis_lex.l */
+struct tlv *global_tlvtree_head;
+symbol_type *global_symtable;
 
 static void setup_mib_flags(void);
 

+ 1 - 1
src/docsis_decode.c

@@ -25,10 +25,10 @@
 
 /* #include "docsis.h" */
 #include "docsis_decode.h"
+#include "docsis_globals.h"
 #include "docsis_snmp.h"
 #include "ethermac.h"
 
-extern symbol_type *global_symtable;
 
 struct symbol_entry *
 find_symbol_by_code_and_pid (unsigned char code, unsigned int pid)

+ 3 - 2
src/docsis_globals.h

@@ -23,7 +23,8 @@
 #ifndef _DOCSIS_GLOBALS_H
 #define _DOCSIS_GLOBALS_H
 
-struct tlv *global_tlvtree_head;
-symbol_type *global_symtable;
+extern struct tlv *global_tlvtree_head;
+extern symbol_type *global_symtable;
+extern unsigned int line;	/* defined in docsis_lex.l */
 
 #endif /* _DOCSIS_GLOBALS_H */