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

Modified Files:
      Tag: XQuery_0-18
        xquery_fo.c 
Log Message:
Experiment: split up declaration of xquery_fo into smaller pieces to
see whether it then compiles with icc on Linux.


Index: xquery_fo.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/xquery_fo.c,v
retrieving revision 1.129
retrieving revision 1.129.2.1
diff -u -d -r1.129 -r1.129.2.1
--- xquery_fo.c 31 May 2007 12:08:02 -0000      1.129
+++ xquery_fo.c 7 Jun 2007 14:07:00 -0000       1.129.2.1
@@ -60,10 +60,7 @@
 /**
  * Load XQuery built-in function signatures into function environment.
  */
-void
-PFfun_xquery_fo (void)
-{
-    struct {
+struct xquery_fo {
         PFns_t ns;
         char *loc;
         unsigned int arity;
@@ -72,7 +69,38 @@
         struct PFla_pair_t (*alg) (const struct PFla_op_t *,
                                    bool,
                                    struct PFla_pair_t *);
-    } xquery_fo[] =
+};
+
+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));
+    }
+}
+
+void
+PFfun_xquery_fo (void)
+{
+    struct xquery_fo xquery_fo1[] =
     /**
      * List all XQuery built-in functions here.
      *
@@ -927,7 +955,9 @@
             .par_ty = (PFty_t[]) { PFty_xs_double () },
             .ret_ty = PFty_xs_double () } },
         .alg = PFbui_fn_floor_dbl }
-    , /* fn:floor (integer?) as integer? */
+    , { .loc = 0 }
+    },  xquery_fo2[] = {
+      /* 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 ()) },
@@ -1615,7 +1645,9 @@
             .par_ty = (PFty_t[]) { PFty_opt (PFty_xs_string ()) },
             .ret_ty = PFty_opt (PFty_doc (PFty_xs_anyNode ())) } },
         .alg = PFbui_fn_doc }
-    , /* fn:collection (string) as node* */
+    , { .loc = 0 }
+    }, xquery_fo3[] = {
+      /* fn:collection (string) as node* */
       { .ns = PFns_fn, .loc = "collection",
         .arity = 1, .sig_count = 1, .sigs = { {
             .par_ty = (PFty_t[]) { PFty_xs_string () },
@@ -2209,29 +2241,11 @@
     , { .loc = 0 }
     };
 
-    PFqname_t    qn;
-    unsigned int n;
-
     PFfun_env = PFenv ();
 
-    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));
-    }
+    xquery_fo_initiaze(xquery_fo1);
+    xquery_fo_initiaze(xquery_fo2);
+    xquery_fo_initiaze(xquery_fo3);
 }
 
 /* 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