Update of /cvsroot/monetdb/pathfinder/compiler/semantics
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9535/semantics
Modified Files:
functions.c heuristic.c ns.c options.c varscope.c
Log Message:
-- The endless Odyssey through the pathfinder code checking
for correct initialization of global variables (Part 4).
This time---checking all files in folders:
o compiler/semantics
U ns.c
Index: ns.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/ns.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- ns.c 28 Mar 2008 20:47:54 -0000 1.41
+++ ns.c 3 Apr 2008 09:06:36 -0000 1.42
@@ -1068,5 +1068,4 @@
ns_resolve (root);
}
-
/* vim:set shiftwidth=4 expandtab: */
U heuristic.c
Index: heuristic.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/heuristic.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- heuristic.c 24 Feb 2008 17:22:28 -0000 1.12
+++ heuristic.c 3 Apr 2008 09:06:35 -0000 1.13
@@ -411,13 +411,13 @@
PFpaxis_t id;
} rev_axis_t;
-rev_axis_t rev_axis[] = {
- { -8, p_descendant },
- { -8, p_descendant_or_self },
+static rev_axis_t rev_axis[] = {
+ { -8, p_descendant },
+ { -8, p_descendant_or_self },
{ 0, p_attribute },
{ 2, p_parent },
{ 8, p_ancestor },
- { 8, p_ancestor_or_self },
+ { 8, p_ancestor_or_self },
{ -8, p_preceding },
{ -4, p_preceding_sibling },
{ -2, p_child },
@@ -427,7 +427,7 @@
{ 0, p_attribute },
{ 0, p_attribute },
{ 0, p_attribute },
- { 0, p_attribute }
+ { 0, p_attribute }
};
#define skip_over_emptyseq(p) skip(p,0)
@@ -731,4 +731,5 @@
}
return root;
}
-/* vim:set shiftwidth=4 expandtab filetype=c: */
+
+/* vim:set shiftwidth=4 expandtab: */
U varscope.c
Index: varscope.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/varscope.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- varscope.c 11 Jan 2008 10:47:16 -0000 1.19
+++ varscope.c 3 Apr 2008 09:06:39 -0000 1.20
@@ -104,7 +104,7 @@
*
* global (TODO: remove)
*/
-static bool scoping_failed = false;
+static bool scoping_failed;
static void scope_var_decls (PFpnode_t *n);
@@ -660,5 +660,13 @@
"erroneous variable references reported above");
}
+/* initialize global variables */
+void
+PFvarscope_init (void)
+{
+ /* initialize with empty scope */
+ var_env = PFscope ();
+ scoping_failed = false;
+}
/* vim:set shiftwidth=4 expandtab: */
U options.c
Index: options.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/options.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- options.c 17 Mar 2008 17:41:29 -0000 1.4
+++ options.c 3 Apr 2008 09:06:37 -0000 1.5
@@ -105,4 +105,11 @@
return;
}
+/* initialize global variables */
+void
+PFoptions_init (void)
+{
+ PFoptions = NULL;
+}
+
/* vim:set shiftwidth=4 expandtab: */
U functions.c
Index: functions.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/functions.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- functions.c 11 Jan 2008 10:47:16 -0000 1.33
+++ functions.c 3 Apr 2008 09:06:34 -0000 1.34
@@ -50,7 +50,7 @@
#include "mem.h"
/* "at"-hint of the module that we are currently checking */
-static char *current_atURI = NULL;
+static char *current_atURI;
/* add a single user-defined function definition to the list */
static void add_ufun (PFpnode_t *n);
@@ -63,7 +63,7 @@
/**
* Environment of functions known to Pathfinder.
*/
-PFenv_t *PFfun_env = NULL;
+PFenv_t *PFfun_env;
/* activate debugging code */
/* #define DEBUG_FUNCTIONS */
@@ -575,4 +575,13 @@
check_fun_usage (root);
}
+/* initialize global variables */
+void
+PFfunctions_init (void)
+{
+ current_atURI = NULL;
+
+ PFfun_env = NULL;
+}
+
/* vim:set shiftwidth=4 expandtab: */
-------------------------------------------------------------------------
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