Update of /cvsroot/monetdb/pathfinder/compiler/parser
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5571/parser
Modified Files:
parser.y
Log Message:
-- The endless Odyssey through the pathfinder code checking
for correct initialization of global variables (Part 8).
This time---checking all files in folders:
o compiler/parser
U parser.y
Index: parser.y
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/parser/parser.y,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- parser.y 17 Mar 2008 17:41:27 -0000 1.66
+++ parser.y 3 Apr 2008 09:48:32 -0000 1.67
@@ -109,7 +109,7 @@
* the parser for each imported module. In that case we _only_ allow
* modules to be read and refuse query scripts.
*/
-static bool module_only = false;
+static bool module_only;
#ifdef ENABLE_MILPRINT_SUMMER
@@ -118,14 +118,14 @@
* and variable numbers in milprint_summer (so scope numbers of
* different modules that are compiled separately don't collide).
*/
-static unsigned int module_base = 0;
+static unsigned int module_base;
/*
* the number of functions declared in a query. Used in milprint_summer to
* be able to suppress code generation for all functions defined
* in modules;
*/
-static int num_fun = 0;
+static int num_fun;
#endif
@@ -136,14 +136,14 @@
* namespace given in the "import module" statement. If this variable
* is != NULL, we only accept modules with the given namespace.
*/
-static char *req_module_ns = NULL;
+static char *req_module_ns;
/**
* URI of the module that we are currently parsing.
*
* Only set for imported modules, NULL otherwise.
*/
-static char *current_uri = NULL;
+static char *current_uri;
/**
* Work list of modules that we have to load.
@@ -152,7 +152,7 @@
* the list (if it is not in there already). We process the work list
* after parsing the main query file.
*/
-static PFarray_t *modules = NULL;
+static PFarray_t *modules;
/**
* Each item in the work list is a id/namespace/URI triple. The URI
@@ -2950,6 +2950,22 @@
return root;
}
+/* initialize global variables */
+void
+PFparser_init (void)
+{
+ module_only = false;
+
+#ifdef ENABLE_MILPRINT_SUMMER
+ module_base = 0;
+ num_fun = 0;
+#endif
+
+ req_module_ns = NULL;
+ current_uri = NULL;
+ modules = NULL;
+}
+
/**
* Load and parse modules listed in working list and put them into
* the parse tree @a r.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins