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

Modified Files:
      Tag: XQuery_0-18
        xquery_fo.c 
Log Message:
Revert experimental changes: they did not have the desired effect.

Index: xquery_fo.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/xquery_fo.c,v
retrieving revision 1.129.2.2
retrieving revision 1.129.2.3
diff -u -d -r1.129.2.2 -r1.129.2.3
--- xquery_fo.c 7 Jun 2007 20:01:49 -0000       1.129.2.2
+++ xquery_fo.c 8 Jun 2007 06:49:53 -0000       1.129.2.3
@@ -60,7 +60,10 @@
 /**
  * Load XQuery built-in function signatures into function environment.
  */
-struct xquery_fo {
+void
+PFfun_xquery_fo (void)
+{
+    struct {
         PFns_t ns;
         char *loc;
         unsigned int arity;
@@ -69,38 +72,7 @@
         struct PFla_pair_t (*alg) (const struct PFla_op_t *,
                                    bool,
                                    struct PFla_pair_t *);
-};
-
-static void
-xquery_fo_initiaze(struct xquery_fo *xquery_fo)
-{
-    PFqname_t    qn;
-    unsigned int n;
-
-    for (n = 0; xquery_fo[n].loc; n++) {
-        assert (xquery_fo[n].sig_count <= XQUERY_FO_MAX_SIGS);
-
-        /* construct function name */
-        qn = PFqname (xquery_fo[n].ns, xquery_fo[n].loc);
-
-        /* insert built-in XQuery F&O into function environment */
-        PFenv_bind (PFfun_env,
-                    qn,
-                    (void *) PFfun_new (qn,
-                                        xquery_fo[n].arity,
-                                        true,
-                                        xquery_fo[n].sig_count,
-                                        xquery_fo[n].sigs,
-                                        xquery_fo[n].alg,
-                                        NULL,
-                                        NULL));
-    }
-}
-
-static void
-PFfun_xquery_fo1 (void)
-{
-    struct xquery_fo xquery_fo1[] =
+    } xquery_fo[] =
     /**
      * List all XQuery built-in functions here.
      *
@@ -955,17 +927,7 @@
             .par_ty = (PFty_t[]) { PFty_xs_double () },
             .ret_ty = PFty_xs_double () } },
         .alg = PFbui_fn_floor_dbl }
-    , { .loc = 0 }
-    };
-
-    xquery_fo_initiaze(xquery_fo1);
-}
-
-static void
-PFfun_xquery_fo2 (void)
-{
-    struct xquery_fo xquery_fo2[] = {
-      /* fn:floor (integer?) as integer? */
+    , /* fn:floor (integer?) as integer? */
       { .ns = PFns_fn, .loc = "floor",
         .arity = 1, .sig_count = 1, .sigs = { {
             .par_ty = (PFty_t[]) { PFty_opt (PFty_xs_integer ()) },
@@ -1653,17 +1615,7 @@
             .par_ty = (PFty_t[]) { PFty_opt (PFty_xs_string ()) },
             .ret_ty = PFty_opt (PFty_doc (PFty_xs_anyNode ())) } },
         .alg = PFbui_fn_doc }
-    , { .loc = 0 }
-    };
-
-    xquery_fo_initiaze(xquery_fo2);
-}
-
-static void
-PFfun_xquery_fo3 (void)
-{
-    struct xquery_fo xquery_fo3[] = {
-      /* fn:collection (string) as node* */
+    , /* fn:collection (string) as node* */
       { .ns = PFns_fn, .loc = "collection",
         .arity = 1, .sig_count = 1, .sigs = { {
             .par_ty = (PFty_t[]) { PFty_xs_string () },
@@ -2257,17 +2209,29 @@
     , { .loc = 0 }
     };
 
-    xquery_fo_initiaze(xquery_fo3);
-}
+    PFqname_t    qn;
+    unsigned int n;
 
-void
-PFfun_xquery_fo (void)
-{
     PFfun_env = PFenv ();
 
-    PFfun_xquery_fo1 ();
-    PFfun_xquery_fo2 ();
-    PFfun_xquery_fo3 ();
+    for (n = 0; xquery_fo[n].loc; n++) {
+        assert (xquery_fo[n].sig_count <= XQUERY_FO_MAX_SIGS);
+
+        /* construct function name */
+        qn = PFqname (xquery_fo[n].ns, xquery_fo[n].loc);
+
+        /* insert built-in XQuery F&O into function environment */
+        PFenv_bind (PFfun_env,
+                    qn,
+                    (void *) PFfun_new (qn,
+                                        xquery_fo[n].arity,
+                                        true,
+                                        xquery_fo[n].sig_count,
+                                        xquery_fo[n].sigs,
+                                        xquery_fo[n].alg,
+                                        NULL,
+                                        NULL));
+    }
 }
 
 /* vim:set shiftwidth=4 expandtab: */


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to