Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1016/algebra

Modified Files:
        algebra.c algebra_cse.c algopt.c builtins.c core2alg.brg 
        intro_rec_border.c load_stats.c logical.c ordering.c 
        physical.c planner.c properties.c 
Log Message:
-- The endless Odyssey through the pathfinder code checking
   for correct initialization of global variables (Part 7).

   This time---checking all files in folders:
    o compiler/algebra (no subfolders)


U core2alg.brg
Index: core2alg.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/core2alg.brg,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- core2alg.brg        28 Mar 2008 10:27:01 -0000      1.69
+++ core2alg.brg        3 Apr 2008 09:42:11 -0000       1.70
@@ -329,7 +329,7 @@
                                                             (i)))
 
 /**
- * structure to collect the active recursive functions 
+ * structure to collect the active recursive functions
  * and their current ``unfold'' count
  */
 struct fun_active_t {
@@ -532,7 +532,7 @@
 
         /* CoreExpr:           xrpc (CoreExpr, apply (FunctionArgs)) */
         case 61:
-            
+
         /* FunctionArgs:       arg (FunctionArg, FunctionArgs) */
         case 501:
 
@@ -2236,10 +2236,10 @@
 
                     /* (3) invoke compilation of the function body. */
                     reduce (ctx, p->sem.fun->core, 1);
-                    
+
                     /* remove function from the active ones */
                     PFarray_del (ctx->fun_active);
-                    
+
                     A(p) = A(p->sem.fun->core);
                 }
                 /* cope with recursive functions */
@@ -2277,18 +2277,18 @@
                                                 NULL,
                                                 curr_arg.frag);
                                 break;
-                            } 
+                            }
                     }
 
                     /* add function once more to the active ones */
                     FUN_ACTIVE_AT(i).count += 1;
-                    
+
                     /* (3) Invoke compilation of the function body. */
                     reduce (ctx, p->sem.fun->core, 1);
-                    
+
                     /* remove function once from the active ones */
                     FUN_ACTIVE_AT(i).count -= 1;
-                    
+
                     /* store the resulting algebra expression */
                     PFla_op_t *res_rel  = A(p->sem.fun->core).rel;
                     PFarray_t *res_frag = A(p->sem.fun->core).frag;
@@ -2300,7 +2300,7 @@
                             (struct PFla_pair_t) {
                                 .rel  = CORE2ALG_MAP_AT(j).rel,
                                 .frag = CORE2ALG_MAP_AT(j).frag };
-                            
+
                     CORE2ALG_MAP = old_core2alg_map;
 
                     A(p) = (struct PFla_pair_t) {
@@ -2339,7 +2339,7 @@
             PFalg_schema_t schema;
             PFarray_t     *old_env;
             PFarray_t     *old_fun_args;
-            
+
             /* prepare the standard in/output schema */
             schema.count = 3;
             schema.items = PFmalloc (schema.count *
@@ -2351,12 +2351,12 @@
             schema.items[2].name = att_item;
             /* Note: the item type has to be adjusted for each parameter */
             schema.items[2].type = 0;
-            
+
             PFty_t ty = p->type;
 
             /* Collect the destinations */
             reduce (ctx, kids[0], nts[0]);
-            
+
             /*
              * Function application:
              *
@@ -2396,7 +2396,7 @@
             /* (3) Transform the function parameters into an XRPC function
              *     call.
              */
-            
+
             /* Create a linked list of parameters. */
             for (unsigned int i = R(p)->sem.fun->arity; i > 0; i--) {
                 PFla_pair_t curr_arg
@@ -2406,7 +2406,7 @@
                 schema.items[2].type = PFprop_type_of (curr_arg.rel, att_item);
                 /* create a new parameter */
                 param_list = fun_param (curr_arg.rel, param_list, schema);
-                
+
                 /* create a new fragment parameter if the parameter
                    represents a sequence with nodes */
                 if (schema.items[2].type & aat_node)
@@ -2419,7 +2419,7 @@
             /* As the top-most argument add the XRPC destination strings */
             schema.items[2].type = PFprop_type_of (A(L(p)).rel, att_item);
             param_list = fun_param (A(L(p)).rel, param_list, schema);
-            
+
             /* Collect all result types */
             schema.items[2].type = PFalg_type (ty);
 
@@ -2433,7 +2433,7 @@
                                  att_iter,             /* loop column */
                                  PFalg_type_occ (ty)); /* occurrence
                                                           indicator */
-                
+
             /* To correctly reference the fragment information of
                resulting items of kind node we introduce an additional
                frag_extract operator that refers to column item */
@@ -2450,7 +2450,7 @@
             ENV = old_env;
             FUN_ARGS = old_fun_args;
         } break;
-            
+
         /* FunctionArgs:       nil */
         case 500:
             break;
@@ -2704,7 +2704,7 @@
                                                     old_loop,
                                                     base_loop),
                         .frag = A(RR(p)).frag
-                   }; 
+                   };
 
             /* clean up environment and loop relation */
             if (strategy != IFP) {
@@ -2783,7 +2783,7 @@
                         p->kind);
         }
     }
-    
+
     /* In case we recursively generate the algebra plan
        we need to record the mappings that have changed
        to ensure that we are able to clean up the side
@@ -2796,7 +2796,7 @@
 }
 
 /* recursion strategy for SQL */
-static PFla_op_t * 
+static PFla_op_t *
 recursion_sql (int strategy,
                PFla_op_t *body,
                PFla_op_t *seed,
@@ -2818,9 +2818,9 @@
     /* check whether we may modify the strategy and
        if the DELTA approach is allowed */
     if (!PFprop_check_rec_delta (body))
-        PFoops (OOPS_FATAL, "SQL cannot cope with this query"); 
+        PFoops (OOPS_FATAL, "SQL cannot cope with this query");
 
-    PFla_op_t *res_body = NULL;    
+    PFla_op_t *res_body = NULL;
     PFla_op_t *res_rec_param = NULL;
     PFla_op_t *loop_rec_param = NULL;
 
@@ -2830,7 +2830,7 @@
                        proj (att_iter, att_iter),
                        proj (att_item, att_item)));
 
-    /* ------------------- BODY ----------------- */ 
+    /* ------------------- BODY ----------------- */
 
     res_rec_param = rec_param (
                         rec_arg (
@@ -2855,8 +2855,8 @@
                             res_rec_param);
     else
         loop_rec_param = res_rec_param;
-                                  
-    /* ---------------RECURSION ---------------- */ 
+
+    /* ---------------RECURSION ---------------- */
     return rank (
                project (
                    rec_fix (
@@ -3018,7 +3018,7 @@
     spec.axis = axis;
     /* missing QName */
     spec.qname = PFqname (PFns_wild, NULL);
-    
+
     if (PFty_subtype (ty, PFty_xs_anyAttribute ())) {
         /* This is a test for attribute nodes */
         spec.kind = node_kind_attr;
@@ -3389,7 +3389,7 @@
             enum PFoutput_format_t output_format)
 {
     PFarray_t *options = NULL;
-    
+
     /* create a new context */
     core2alg_ctx_t ctx;
 
@@ -3423,7 +3423,7 @@
 
         ctx.recursion_depth = atoi (*((char **) PFarray_top (options)));
     }
-    
+
     /* Initialize stack recording the active user-defined functions */
     ctx.fun_active = PFarray (sizeof (fun_active_t), 50);
 
@@ -3440,5 +3440,4 @@
     return A(r).rel;
 }
 
-
 /* vim:set shiftwidth=4 expandtab filetype=c: */

U algopt.c
Index: algopt.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algopt.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- algopt.c    1 Apr 2008 16:37:11 -0000       1.31
+++ algopt.c    3 Apr 2008 09:42:10 -0000       1.32
@@ -102,7 +102,7 @@
         root = PFmap_ori_names (root);
 
     }
-    
+
     if (debug_opt)
         fprintf (stderr, "-o");
 
@@ -116,9 +116,9 @@
             case 'A': /* disabled */
                 /*
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_card (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   cardinality optimization:\t    %s",
@@ -131,9 +131,9 @@
                 REMOVE_PROXIES("complex optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_complex (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   complex optimization:\t    %s",
@@ -158,9 +158,9 @@
                 REMOVE_PROXIES("constant optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_const (root, const_no_attach);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   constant optimization:\t    %s",
@@ -174,9 +174,9 @@
                 REMOVE_PROXIES("domain optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_dom (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   domain optimization:\t\t    %s",
@@ -187,9 +187,9 @@
                 REMOVE_PROXIES("general optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_general (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   general optimization:\t    %s",
@@ -200,9 +200,9 @@
                 MAP_ORI_NAMES("icol optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_icol (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   icol optimization:\t\t    %s",
@@ -220,9 +220,9 @@
                 REMOVE_PROXIES("equi-join pushdown")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_join_pd (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   equi-join pushdown:\t\t    %s",
@@ -234,9 +234,9 @@
                 REMOVE_PROXIES("key optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_key (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   key optimization:\t\t    %s",
@@ -251,7 +251,7 @@
                 /* give up rewriting after 20 noneffective
                    cross product - cross product rewrites. */
                 root = PFalgopt_mvd (root, 20);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   mvd optimization:\t\t    %s",
@@ -265,7 +265,7 @@
                 tm = PFtimer_start ();
 
                 root = PFalgopt_join_graph (root, guide_tree);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   join-graph optimization:\t    %s",
@@ -273,14 +273,14 @@
                 break;
 
             case 'S':
-                /* we need the icols property and thus cannot 
+                /* we need the icols property and thus cannot
                    apply the optimization if our names are unique */
                 MAP_ORI_NAMES("set optimization")
-                    
+
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_set (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   set optimization:\t\t    %s",
@@ -289,12 +289,12 @@
 
             case 'T':
                 MAP_ORI_NAMES("thetajoin optimization")
-                    
+
                 tm = PFtimer_start ();
-                
+
                 root = PFintro_thetajoins (root);
                 root = PFalgopt_thetajoin (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   thetajoin optimization:\t    %s",
@@ -306,7 +306,7 @@
                 tm = PFtimer_start ();
 
                 root = PFalgopt_guide (root, guide_tree);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   guide optimization:\t    %s",
@@ -318,9 +318,9 @@
                 REMOVE_PROXIES("required value optimization")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFalgopt_reqval (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   required value optimization:\t    %s",
@@ -329,7 +329,7 @@
 
             case 'P':
                 tm = PFtimer_start ();
-                
+
                 if (unq_names)
                     PFprop_infer (true  /* card */,
                                   true  /* const */,
@@ -338,7 +338,7 @@
                                   false /* icol */,
                                   false /* composite key */,
                                   true  /* key */,
-                                  false /* ocols */, 
+                                  false /* ocols */,
                                   true  /* req_node */,
                                   false /* reqval */,
                                   true  /* level */,
@@ -347,7 +347,7 @@
                                   true  /* original names */,
                                   false /* unique names */,
                                   root, guide_tree);
-                
+
                 else
                     PFprop_infer (true  /* card */,
                                   true  /* const */,
@@ -356,7 +356,7 @@
                                   true  /* icol */,
                                   true  /* composite key */,
                                   true  /* key */,
-                                  true  /* ocols */, 
+                                  true  /* ocols */,
                                   true  /* req_node */,
                                   true  /* reqval */,
                                   true  /* level */,
@@ -365,7 +365,7 @@
                                   false /* original names */,
                                   true  /* unique names */,
                                   root, guide_tree);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   complete property inference:\t    %s",
@@ -381,9 +381,9 @@
                 REMOVE_PROXIES("variable name mapping")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFmap_unq_names (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   map to unique attribute names:   %s",
@@ -401,9 +401,9 @@
                 REMOVE_PROXIES("variable name mapping")
 
                 tm = PFtimer_start ();
-                
+
                 root = PFmap_ori_names (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   map to original attribute names: %s",
@@ -418,9 +418,9 @@
                 proxies_involved = true;
 
                 tm = PFtimer_start ();
-                
+
                 root = PFintro_proxies (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   introduce proxy operators:\t    %s",
@@ -431,9 +431,9 @@
                 proxies_involved = false;
 
                 tm = PFtimer_start ();
-                
+
                 root = PFresolve_proxies (root);
-                
+
                 tm = PFtimer_stop (tm);
                 if (timing)
                     PFlog ("   resolve proxy operators:\t    %s",

U ordering.c
Index: ordering.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/ordering.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ordering.c  17 Mar 2008 17:41:11 -0000      1.11
+++ ordering.c  3 Apr 2008 09:42:13 -0000       1.12
@@ -72,7 +72,7 @@
 }
 
 PFord_ordering_t
-PFord_refine (const PFord_ordering_t ordering, 
+PFord_refine (const PFord_ordering_t ordering,
               const PFalg_att_t attribute,
               const bool direction)
 {
@@ -84,7 +84,7 @@
         *((PFalg_order_item_t *) PFarray_add (ret))
             = *((PFalg_order_item_t *) PFarray_at (ordering, i));
 
-    *((PFalg_order_item_t *) PFarray_add (ret)) 
+    *((PFalg_order_item_t *) PFarray_add (ret))
         = (PFalg_order_item_t) { .name = attribute, .dir = direction };
 
     return ret;
@@ -162,7 +162,7 @@
     PFarray_printf (a, "<");
 
     for (unsigned int i = 0; i < PFord_count (o); i++)
-        PFarray_printf (a, "%s%s (%s)", i ? "," : "", 
+        PFarray_printf (a, "%s%s (%s)", i ? "," : "",
                         PFatt_str (PFord_order_col_at (o, i)),
                         PFord_order_dir_at (o, i) == DIR_ASC
                         ? "asc" : "desc");
@@ -344,7 +344,7 @@
      */
     if (PFord_count (ordering) == 0)
         return PFord_set_add (ret, PFordering ());
-    
+
     for (unsigned int i = 0; i < PFord_count (ordering); i++) {
 
         /* Compute all permutations with attribute at position i removed. */

U physical.c
Index: physical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/physical.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- physical.c  26 Mar 2008 11:28:25 -0000      1.63
+++ physical.c  3 Apr 2008 09:42:13 -0000       1.64
@@ -924,7 +924,7 @@
 
         /* did we find the attribute? */
         if (j >= n->schema.count)
-            PFoops (OOPS_FATAL,
+             PFoops (OOPS_FATAL,
                     "attribute `%s' referenced in projection not found",
                     PFatt_str (ret->sem.proj.items[i].old));
     }

U planner.c
Index: planner.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/planner.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- planner.c   1 Apr 2008 16:37:13 -0000       1.57
+++ planner.c   3 Apr 2008 09:42:13 -0000       1.58
@@ -724,19 +724,19 @@
             att1 = att2;
             att2 = res;
         }
-        
+
         for (unsigned int i = 0; i < op->sem.proj.count; i++)
             if (sel_att == op->sem.proj.items[i].new)
                 sel_att = op->sem.proj.items[i].old;
             else if (op->sem.proj.items[i].old == att2)
                 val_ref = true;
-        
+
         /* no match -- bail out */
         if (sel_att != L(op)->sem.binary.res ||
             val_ref ||
             LL(op)->sem.attach.value.type == aat_qname)
             return ret;
-            
+
         for (unsigned int r = 0; r < PFarray_last (L(LL(op))->plans); r++)
             add_plan (ret,
                       project (
@@ -750,7 +750,7 @@
                           op->sem.proj.count,
                           op->sem.proj.items));
     }
-        
+
     return ret;
 }
 
@@ -1985,13 +1985,13 @@
     for (i = 0; i < n->schema.count; i++)
         if (n->schema.items[i].type & aat_node)
             break;
-    
+
     if (i == n->schema.count)
         return ret;
     else {
         PFplanlist_t  *single_plan   = new_planlist ();
         plan_t        *cheapest_plan = NULL;
-        
+
         /* find the cheapest plan */
         for (unsigned int i = 0; i < PFarray_last (ret); i++)
             if (!cheapest_plan
@@ -2831,14 +2831,14 @@
             plan_subexpression (L(n));
             plan_subexpression (R(n));
             plans = plan_fun_call (n);
-            
+
             fun_call_kind = old_fun_call_kind;
         } break;
 
-        case la_fun_param:      plans = plan_fun_param (n);    break;  
+        case la_fun_param:      plans = plan_fun_param (n);    break;
         /* copy the plans from the rest of the list */
-        case la_fun_frag_param: plans = R(n)->plans;           break;  
-        
+        case la_fun_frag_param: plans = R(n)->plans;           break;
+
         case la_string_join:    plans = plan_string_join (n);  break;
 
         default:

U load_stats.c
Index: load_stats.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/load_stats.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- load_stats.c        26 Mar 2008 11:41:15 -0000      1.14
+++ load_stats.c        3 Apr 2008 09:42:12 -0000       1.15
@@ -2,8 +2,8 @@
 
 /**
  * @file
- * Create a guide tree from a given file. The DTD of the guide tree is 
- * hardcoded in this file and is: 
+ * Create a guide tree from a given file. The DTD of the guide tree is
+ * hardcoded in this file and is:
  *      <!ELEMENT node (EMPTY | node*)>
  *      <!ATTLIST node guide CDATA #REQUIRED>
  *      <!ATTLIST node count CDATA #REQUIRED>
@@ -40,7 +40,7 @@
  */
 
 
-#include "pathfinder.h"        
+#include "pathfinder.h" 
 
 #include <stdio.h>
 #ifdef HAVE_STDBOOL_H
@@ -59,12 +59,12 @@
 #include "options.h"
 
 /* Current node in the XML file */
-PFguide_tree_t  *current_guide_node;
+static PFguide_tree_t *current_guide_node;
 
 /* Root guide node in the XML file */
-PFguide_tree_t  *root_guide_node;
+static PFguide_tree_t *root_guide_node;
 
-int level;
+static int level;
 
 /* start of a XML element */
 static void
@@ -82,29 +82,29 @@
     PFguide_kind_t kind     = text; /* kind if the guide node */
     char          *tag_uri  = NULL; /* tag uri of the guide node */
     char          *tag_name = NULL; /* tag name of the guide node */
-    char          *attribute_name; 
+    char          *attribute_name;
 
     (void) ctx;                 /* pacify compiler */
     (void) tagname;             /* pacify compiler */
-    
+
     /* get attributes */
     if ((atts != NULL) && *atts) {
         while (*atts) {
-            /* get attribute name */ 
+            /* get attribute name */
             attribute_name = (char*)atts[0];
-     
+
             if (strcmp (attribute_name, "guide") == 0)
                 guide = (unsigned int) atoi((char *)atts[1]);
-    
+
             if (strcmp (attribute_name, "count") == 0)
-                count = (unsigned int) atoi((char *)atts[1]); 
-    
+                count = (unsigned int) atoi((char *)atts[1]);
+
             if (strcmp (attribute_name, "min") == 0)
-                min = (unsigned int) atoi((char *)atts[1]); 
-    
+                min = (unsigned int) atoi((char *)atts[1]);
+
             if (strcmp (attribute_name, "max") == 0)
-                max = (unsigned int) atoi((char *)atts[1]); 
-    
+                max = (unsigned int) atoi((char *)atts[1]);
+
             if (strcmp (attribute_name, "kind") == 0) {
                 kind_int = (unsigned int) atoi ((char *) atts[1]);
                 switch(kind_int) {
@@ -117,17 +117,17 @@
                     default: assert (0); break;
                 }
             }
-    
+
             if (strcmp (attribute_name, "uri") == 0)
                 tag_uri = (char*) atts[1];
-    
+
             if (strcmp (attribute_name, "name") == 0)
                 tag_name = (char*) atts[1];
-    
+
             atts += 2;
         }
     }
-    
+
     /* consistency checks */
     switch (kind) {
         case elem:
@@ -176,7 +176,7 @@
         }
         else
             ns = PFns_wild;
-    
+
         new_guide_node->name = PFqname (ns, name_copy);
     }
 
@@ -186,9 +186,9 @@
 
         /* insert new guide node in the child list */
         if (!current_guide_node->child_list)
-            current_guide_node->child_list = 
+            current_guide_node->child_list =
                 PFarray (sizeof (PFguide_tree_t**), 10);
-        
+
         *(PFguide_tree_t**)
             PFarray_add (current_guide_node->child_list) =
                 new_guide_node;
@@ -197,7 +197,7 @@
     }
 
     /* set actual node as current node */
-    current_guide_node = new_guide_node;        
+    current_guide_node = new_guide_node;
     /* increase level */
     level++;
 }
@@ -247,7 +247,7 @@
 };
 
 /* create the guide tree and return it */
-PFguide_tree_t* 
+PFguide_tree_t*
 PFguide_tree()
 {
 
@@ -255,7 +255,7 @@
     char  *filename = NULL;
     /* Read guide filename as option */
     PFarray_t *options = NULL;
-    
+
     /* get the filename */
     options = PFenv_lookup (PFoptions,
         PFqname (PFns_lib, "guide"));
@@ -265,7 +265,7 @@
     } else {
         /* it will be used the first item only to create the guide */
         filename = *((char **) PFarray_at (options, 0));
-    } 
+    }
 
     /* DTD of the guide XML file */
     char *dtd = "<!ELEMENT node (EMPTY | node*)>"
@@ -283,8 +283,8 @@
     xmlDtdPtr                dtdPtr;
     /* to read the DTD from memory */
     xmlParserInputBufferPtr  inputBuffer;
-    /* the resulting document tree */    
-    xmlDocPtr doc;  
+    /* the resulting document tree */
+    xmlDocPtr doc;
     /* result of parsing */
     int result = 0;
 
@@ -295,18 +295,18 @@
     doc = xmlRecoverFile(filename);
 
     /* Create a buffered parser input from memory */
-    inputBuffer = xmlParserInputBufferCreateMem(dtd, strlen(dtd), 
+    inputBuffer = xmlParserInputBufferCreateMem(dtd, strlen(dtd),
         XML_CHAR_ENCODING_NONE);
 
     /* Load and parse a DTD */
-    dtdPtr = xmlIOParseDTD(NULL, inputBuffer, 
+    dtdPtr = xmlIOParseDTD(NULL, inputBuffer,
         XML_CHAR_ENCODING_NONE);
 
     /* Try to validate the document against the dtd */
     result = xmlValidateDtd(validCtxt, doc, dtdPtr);
-    
+
     if (!result)
-        PFoops (OOPS_FATAL, "Guide optimization - XML input is invalid.\n");  
+        PFoops (OOPS_FATAL, "Guide optimization - XML input is invalid.\n");
 
     /* start XML parsing */
     xmlParserCtxtPtr   ctx;
@@ -314,6 +314,7 @@
     ctx = xmlCreateFileParserCtxt (filename);
     ctx->sax = &saxhandler;
 
+    /* initialize global variables */
     current_guide_node = NULL;
     root_guide_node    = NULL;
     level              = 0;
@@ -322,7 +323,7 @@
 
     /* Document is not well-formed */
     if (!ctx->wellFormed)
-        PFoops (OOPS_FATAL, "Guide optimization - " 
+        PFoops (OOPS_FATAL, "Guide optimization - "
                 "XML input is not well-formed.\n");
 
     return root_guide_node;

U properties.c
Index: properties.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/properties.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- properties.c        1 Apr 2008 16:37:14 -0000       1.35
+++ properties.c        3 Apr 2008 09:42:14 -0000       1.36
@@ -61,9 +61,9 @@
     PFprop_t *ret = PFmalloc (sizeof (PFprop_t));
 
     /* initialize different slots for constant property*/
-    ret->constants   = NULL; 
-    ret->l_constants = NULL; 
-    ret->r_constants = NULL; 
+    ret->constants   = NULL;
+    ret->l_constants = NULL;
+    ret->r_constants = NULL;
 
     /* initialize set property */
     ret->set      = false;
@@ -105,7 +105,7 @@
     ret->level_mapping = NULL;
     ret->l_level_mapping = NULL;
     ret->r_level_mapping = NULL;
-    
+
     /* initialize guide mapping list */
     ret->guide_mapping_list = NULL;
 
@@ -176,7 +176,7 @@
         return;
     else
         SEEN(n) = true;
-    
+
     reset_fun (n);
 
     for (unsigned int i = 0; i < PFLA_OP_MAXCHILD && n->child[i]; i++)
@@ -210,7 +210,7 @@
 
 /**
  * Create new property fields for a DAG rooted in @a root.
- * 
+ *
  * This is required if the property of copied nodes
  * is not copied in place (e.g. '*p = *L(p);').
  */
@@ -240,7 +240,7 @@
         SEEN(n) = true;
         n->refctr = 1;
     }
-    
+
     for (unsigned int i = 0; i < PFLA_OP_MAXCHILD && n->child[i]; i++)
         prop_infer_refctr (n->child[i]);
 }

U algebra.c
Index: algebra.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- algebra.c   1 Mar 2008 11:46:55 -0000       1.75
+++ algebra.c   3 Apr 2008 09:42:10 -0000       1.76
@@ -719,7 +719,7 @@
         case aat_node:  return "node";
         case aat_anode: return "attr";
         case aat_pnode: return "pnode";
-                        
+
         /* the bit representation */
         case aat_qname_id:   return "qname_id";
         case aat_qname_cont: return "qname_cont";

U algebra_cse.c
Index: algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra_cse.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- algebra_cse.c       17 Mar 2008 17:41:08 -0000      1.71
+++ algebra_cse.c       3 Apr 2008 09:42:10 -0000       1.72
@@ -178,7 +178,7 @@
 
 
         case la_ref_tbl:
-    
+
             return  (strcmp(a->sem.ref_tbl.name, b->sem.ref_tbl.name) == 0);
             break;
 
@@ -492,7 +492,7 @@
              */
             return false;
             break;
-            
+
         case la_proxy:
         case la_proxy_base:
             /* we assume that we do not split up proxy nodes */

U logical.c
Index: logical.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/logical.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- logical.c   26 Mar 2008 11:28:25 -0000      1.87
+++ logical.c   3 Apr 2008 09:42:12 -0000       1.88
@@ -152,7 +152,8 @@
  * is an already existing node that may not be split into multiple
  * operators (e.g. a number operator).
  */
-PFla_op_t * PFla_dummy (PFla_op_t *n)
+PFla_op_t *
+PFla_dummy (PFla_op_t *n)
 {
     /* always create the dummy node as otherwise
        the general optimization will relabel quite
@@ -1219,7 +1220,8 @@
 
 
 /** Constructor for duplicate elimination operators. */
-PFla_op_t * PFla_distinct (const PFla_op_t *n)
+PFla_op_t *
+PFla_distinct (const PFla_op_t *n)
 {
     PFla_op_t    *ret = la_op_wire1 (la_distinct, n);
     unsigned int  i;
@@ -1954,8 +1956,9 @@
  * The partitioning (group by) attribute is represented by @a part.
  * The result is stored in attribute @a res.
  */
-PFla_op_t * PFla_aggr (PFla_op_kind_t kind, const PFla_op_t *n, PFalg_att_t 
res,
-                      PFalg_att_t att, PFalg_att_t part)
+PFla_op_t *
+PFla_aggr (PFla_op_kind_t kind, const PFla_op_t *n, PFalg_att_t res,
+           PFalg_att_t att, PFalg_att_t part)
 {
     /* build a new aggr node */
     PFla_op_t    *ret = la_op_wire1 (kind, n);
@@ -3034,9 +3037,8 @@
 /**
  * Constructor for twig root operators.
  */
-PFla_op_t * PFla_twig (const PFla_op_t *n,
-                       PFalg_att_t iter,
-                       PFalg_att_t item)
+PFla_op_t *
+PFla_twig (const PFla_op_t *n, PFalg_att_t iter, PFalg_att_t item)
 {
     PFalg_simple_type_t iter_type = 0;
     PFla_op_t *ret = la_op_wire1 (la_twig, n);
@@ -3097,8 +3099,8 @@
  * @a fc is the next 'first' child operator and @a ns is the
  * next sibling in the constructor sequence operator list.
  */
-PFla_op_t * PFla_fcns (const PFla_op_t *fc,
-                       const PFla_op_t *ns)
+PFla_op_t *
+PFla_fcns (const PFla_op_t *fc, const PFla_op_t *ns)
 {
     PFla_op_t *ret = la_op_wire2 (la_fcns, fc, ns);
 
@@ -3116,8 +3118,8 @@
  * @a scope is the current scope the document node is constructed in
  * and @a fcns is the content of the node.
  */
-PFla_op_t * PFla_docnode (const PFla_op_t *scope, const PFla_op_t *fcns,
-                          PFalg_att_t iter)
+PFla_op_t *
+PFla_docnode (const PFla_op_t *scope, const PFla_op_t *fcns, PFalg_att_t iter)
 {
     PFla_op_t *ret = la_op_wire2 (la_docnode, scope, fcns);
 
@@ -3138,10 +3140,9 @@
  * @a tag constructs the elements' tag names, and @a fcns
  * is the content of the new elements.
  */
-PFla_op_t * PFla_element (const PFla_op_t *tag,
-                          const PFla_op_t *fcns,
-                          PFalg_att_t iter,
-                          PFalg_att_t item)
+PFla_op_t *
+PFla_element (const PFla_op_t *tag, const PFla_op_t *fcns,
+              PFalg_att_t iter, PFalg_att_t item)
 {
     PFla_op_t *ret = la_op_wire2 (la_element, tag, fcns);
 
@@ -3163,8 +3164,9 @@
  * @a cont stores the name-value relation of the attribute. @a iter, @a qn,
  * and @a val reference the iter, qname, and value input columns, respectively.
  */
-PFla_op_t * PFla_attribute (const PFla_op_t *cont,
-                            PFalg_att_t iter, PFalg_att_t qn, PFalg_att_t val)
+PFla_op_t *
+PFla_attribute (const PFla_op_t *cont,
+                PFalg_att_t iter, PFalg_att_t qn, PFalg_att_t val)
 {
     PFla_op_t *ret = la_op_wire1 (la_attribute, cont);
 
@@ -3236,10 +3238,9 @@
  * @a iter, @a target, and @a val reference the iter, target, and value
  * input columns, respectively.
  */
-PFla_op_t * PFla_processi (const PFla_op_t *cont,
-                           PFalg_att_t iter,
-                           PFalg_att_t target,
-                           PFalg_att_t val)
+PFla_op_t *
+PFla_processi (const PFla_op_t *cont,
+               PFalg_att_t iter, PFalg_att_t target, PFalg_att_t val)
 {
     PFla_op_t *ret = la_op_wire1 (la_processi, cont);
 
@@ -3267,11 +3268,9 @@
  * - @a doc:  none (as it is a node fragment)
  * - @a cont: iter | pos | item
  */
-PFla_op_t * PFla_content (const PFla_op_t *doc,
-                          const PFla_op_t *cont,
-                          PFalg_att_t iter,
-                          PFalg_att_t pos,
-                          PFalg_att_t item)
+PFla_op_t *
+PFla_content (const PFla_op_t *doc, const PFla_op_t *cont,
+              PFalg_att_t iter, PFalg_att_t pos, PFalg_att_t item)
 {
     PFla_op_t *ret = la_op_wire2 (la_content, doc, cont);
 
@@ -3761,7 +3760,8 @@
 /**
  * Constructor for the last item of a parameter list
  */
-PFla_op_t *PFla_nil (void)
+PFla_op_t *
+PFla_nil (void)
 {
     PFla_op_t     *ret;
 
@@ -3779,8 +3779,8 @@
 /**
  * Constructor for a tail recursion operator
  */
-PFla_op_t *PFla_rec_fix (const PFla_op_t *paramList,
-                         const PFla_op_t *res)
+PFla_op_t *
+PFla_rec_fix (const PFla_op_t *paramList, const PFla_op_t *res)
 {
     PFla_op_t     *ret;
     unsigned int   i;
@@ -3808,8 +3808,8 @@
  * Constructor for a list item of a parameter list
  * related to recursion
  */
-PFla_op_t *PFla_rec_param (const PFla_op_t *arguments,
-                           const PFla_op_t *paramList)
+PFla_op_t *
+PFla_rec_param (const PFla_op_t *arguments, const PFla_op_t *paramList)
 {
     PFla_op_t     *ret;
 
@@ -3833,9 +3833,9 @@
  * Constructor for the arguments of a parameter (seed and recursion
  * will be the input relations for the base operator)
  */
-PFla_op_t *PFla_rec_arg (const PFla_op_t *seed,
-                         const PFla_op_t *recursion,
-                         const PFla_op_t *base)
+PFla_op_t *
+PFla_rec_arg (const PFla_op_t *seed, const PFla_op_t *recursion,
+              const PFla_op_t *base)
 {
     PFla_op_t     *ret;
     unsigned int   i, j;
@@ -3901,7 +3901,8 @@
  * operator representing the seed relation as well as the argument
  * computed in the recursion).
  */
-PFla_op_t *PFla_rec_base (PFalg_schema_t schema)
+PFla_op_t *
+PFla_rec_base (PFalg_schema_t schema)
 {
     PFla_op_t     *ret;
     unsigned int   i;

U builtins.c
Index: builtins.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/builtins.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- builtins.c  1 Mar 2008 11:47:00 -0000       1.83
+++ builtins.c  3 Apr 2008 09:42:11 -0000       1.84
@@ -2434,7 +2434,7 @@
                              proj (att_iter, att_iter),
                              proj (att_pos, att_pos),
                              proj (att_item, att_res));
-    
+
     PFla_op_t *res = disjunion (
                          strings,
                          attach (
@@ -2472,7 +2472,7 @@
                              proj (att_iter, att_iter),
                              proj (att_pos, att_pos),
                              proj (att_item, att_res));
-    
+
     PFla_op_t *res = disjunion (
                          strings,
                          attach (
@@ -2510,7 +2510,7 @@
                              proj (att_iter, att_iter),
                              proj (att_pos, att_pos),
                              proj (att_item, att_res));
-    
+
     PFla_op_t *res = disjunion (
                          strings,
                          attach (

U intro_rec_border.c
Index: intro_rec_border.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/intro_rec_border.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- intro_rec_border.c  17 Mar 2008 17:41:09 -0000      1.10
+++ intro_rec_border.c  3 Apr 2008 09:42:11 -0000       1.11
@@ -77,7 +77,7 @@
         case pa_rec_arg:
             base_path = introduce_rec_borders_worker (L(n), bases);
             break;
-            
+
         /* if the base operator belongs to the currently searched
            recursion mark the node as inside the recursion */
         case pa_rec_base:
@@ -110,12 +110,12 @@
              }
              break;
 
-        case pa_fun_param:             
+        case pa_fun_param:
              /* only collect the base paths */
              base_path = introduce_rec_borders_worker (L(n), bases) ||
                          introduce_rec_borders_worker (R(n), bases);
              break;
-            
+
         case pa_fcns:
             /* this also skips the introduction of a rec_border
                operator for the content of an empty elements:
@@ -166,17 +166,17 @@
         return;
     else
         pfIN(n) = false;
-    
+
     for (i = 0; i < PFPA_OP_MAXCHILD && n->child[i]; i++)
         in_reset (n->child[i]);
 }
 
 /**
- * Walk down the DAG and for each recursion operator 
+ * Walk down the DAG and for each recursion operator
  * introduce border operators.
  *
  * We mark all operators that lie on the path from the
- * result (or the recursion arguments) to the base 
+ * result (or the recursion arguments) to the base
  * operators of the recursion as inside the recursion body.
  *
  * A border is introduced between nodes (a) and (b) where
@@ -202,14 +202,14 @@
             /* collect base operators */
             cur = L(n);
             while (cur->kind != pa_nil) {
-                assert (cur->kind == pa_rec_param && 
+                assert (cur->kind == pa_rec_param &&
                         L(cur)->kind == pa_rec_arg);
                 *(PFpa_op_t **) PFarray_add (bases) = L(cur)->sem.rec_arg.base;
                 cur = R(cur);
             }
 
-            /* call the path traversal worker, that introduces 
-               the border operator and marks all 'inside' nodes, 
+            /* call the path traversal worker, that introduces
+               the border operator and marks all 'inside' nodes,
                for all recursion arguments as well as the result */
             cur = L(n);
             while (cur->kind != pa_nil) {


-------------------------------------------------------------------------
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

Reply via email to