* ports.c (scm_char_ready_p): bug fix: in SCM_PROC char-ready's
[bpt/guile.git] / libguile / ramap.c
index 7d721bd..370dfd9 100644 (file)
@@ -64,8 +64,32 @@ typedef struct
   int (*vproc) ();
 } ra_iproc;
 
-static ra_iproc ra_rpsubrs[];
-static ra_iproc ra_asubrs[];
+
+/* These tables are a kluge that will not scale well when more
+ * vectorized subrs are added.  It is tempting to steal some bits from
+ * the SCM_CAR of all subrs (like those selected by SCM_SMOBNUM) to hold an
+ * offset into a table of vectorized subrs.  
+ */
+
+static ra_iproc ra_rpsubrs[] =
+{
+  {"=", SCM_UNDEFINED, scm_ra_eqp},
+  {"<", SCM_UNDEFINED, scm_ra_lessp},
+  {"<=", SCM_UNDEFINED, scm_ra_leqp},
+  {">", SCM_UNDEFINED, scm_ra_grp},
+  {">=", SCM_UNDEFINED, scm_ra_greqp},
+  {0, 0, 0}
+};
+
+static ra_iproc ra_asubrs[] =
+{
+  {"+", SCM_UNDEFINED, scm_ra_sum},
+  {"-", SCM_UNDEFINED, scm_ra_difference},
+  {"*", SCM_UNDEFINED, scm_ra_product},
+  {"/", SCM_UNDEFINED, scm_ra_divide},
+  {0, 0, 0}
+};
+
 
 #define BVE_REF(a, i) ((SCM_VELTS(a)[(i)/SCM_LONG_BIT] & (1L<<((i)%SCM_LONG_BIT))) ? 1 : 0)
 #define BVE_SET(a, i) (SCM_VELTS(a)[(i)/SCM_LONG_BIT] |= (1L<<((i)%SCM_LONG_BIT)))
@@ -373,7 +397,17 @@ scm_ramapc (cproc, data, ra0, lra, what)
 }
 
 
-static char s_array_fill_x[];
+SCM_PROC(s_array_fill_x, "array-fill!", 2, 0, 0, scm_array_fill_x);
+
+SCM 
+scm_array_fill_x (ra, fill)
+     SCM ra;
+     SCM fill;
+{
+  scm_ramapc (scm_array_fill_int, fill, ra, SCM_EOL, s_array_fill_x);
+  return SCM_UNSPECIFIED;
+}
+
 
 int 
 scm_array_fill_int (ra, fill, ignore)
@@ -491,17 +525,6 @@ scm_array_fill_int (ra, fill, ignore)
   return 1;
 }
 
-SCM_PROC(s_array_fill_x, "array-fill!", 2, 0, 0, scm_array_fill_x);
-
-SCM 
-scm_array_fill_x (ra, fill)
-     SCM ra;
-     SCM fill;
-{
-  scm_ramapc (scm_array_fill_int, fill, ra, SCM_EOL, s_array_fill_x);
-  return SCM_UNSPECIFIED;
-}
-
 
 
 
@@ -923,7 +946,7 @@ scm_ra_sum (ra0, ras)
              long *v1 = SCM_VELTS (ra1);
              IVDEP (ra0 != ra1,
                     for (; n-- > 0; i0 += inc0, i1 += inc1)
-                    v0[i0] += v1[i1]);
+                    v0[i0] += v1[i1];)
              break;
            }
 #ifdef SCM_FLOATS
@@ -934,7 +957,7 @@ scm_ra_sum (ra0, ras)
              float *v1 = (float *) SCM_VELTS (ra1);
              IVDEP (ra0 != ra1,
                     for (; n-- > 0; i0 += inc0, i1 += inc1)
-                    v0[i0] += v1[i1]);
+                    v0[i0] += v1[i1];)
              break;
            }
 #endif /* SCM_SINGLES */
@@ -944,7 +967,7 @@ scm_ra_sum (ra0, ras)
              double *v1 = (double *) SCM_VELTS (ra1);
              IVDEP (ra0 != ra1,
                     for (; n-- > 0; i0 += inc0, i1 += inc1)
-                    v0[i0] += v1[i1]);
+                    v0[i0] += v1[i1];)
              break;
            }
          case scm_tc7_cvect:
@@ -1043,7 +1066,7 @@ scm_ra_difference (ra0, ras)
            float *v1 = (float *) SCM_VELTS (ra1);
            IVDEP (ra0 != ra1,
                   for (; n-- > 0; i0 += inc0, i1 += inc1)
-                  v0[i0] -= v1[i1]);
+                  v0[i0] -= v1[i1];)
            break;
          }
 #endif /* SCM_SINGLES */
@@ -1053,7 +1076,7 @@ scm_ra_difference (ra0, ras)
            double *v1 = (double *) SCM_VELTS (ra1);
            IVDEP (ra0 != ra1,
                   for (; n-- > 0; i0 += inc0, i1 += inc1)
-                  v0[i0] -= v1[i1]);
+                  v0[i0] -= v1[i1];)
            break;
          }
        case scm_tc7_cvect:
@@ -1110,7 +1133,7 @@ scm_ra_product (ra0, ras)
              long *v1 = SCM_VELTS (ra1);
              IVDEP (ra0 != ra1,
                     for (; n-- > 0; i0 += inc0, i1 += inc1)
-                    v0[i0] *= v1[i1]);
+                    v0[i0] *= v1[i1];)
              break;
            }
 #ifdef SCM_FLOATS
@@ -1121,7 +1144,7 @@ scm_ra_product (ra0, ras)
              float *v1 = (float *) SCM_VELTS (ra1);
              IVDEP (ra0 != ra1,
                     for (; n-- > 0; i0 += inc0, i1 += inc1)
-                    v0[i0] *= v1[i1]);
+                    v0[i0] *= v1[i1];)
              break;
            }
 #endif /* SCM_SINGLES */
@@ -1131,7 +1154,7 @@ scm_ra_product (ra0, ras)
              double *v1 = (double *) SCM_VELTS (ra1);
              IVDEP (ra0 != ra1,
                     for (; n-- > 0; i0 += inc0, i1 += inc1)
-                    v0[i0] *= v1[i1]);
+                    v0[i0] *= v1[i1];)
              break;
            }
          case scm_tc7_cvect:
@@ -1233,7 +1256,7 @@ scm_ra_divide (ra0, ras)
            float *v1 = (float *) SCM_VELTS (ra1);
            IVDEP (ra0 != ra1,
                   for (; n-- > 0; i0 += inc0, i1 += inc1)
-                  v0[i0] /= v1[i1]);
+                  v0[i0] /= v1[i1];)
            break;
          }
 #endif /* SCM_SINGLES */
@@ -1243,7 +1266,7 @@ scm_ra_divide (ra0, ras)
            double *v1 = (double *) SCM_VELTS (ra1);
            IVDEP (ra0 != ra1,
                   for (; n-- > 0; i0 += inc0, i1 += inc1)
-                  v0[i0] /= v1[i1]);
+                  v0[i0] /= v1[i1];)
            break;
          }
        case scm_tc7_cvect:
@@ -2078,32 +2101,6 @@ scm_array_equal_p (ra0, ra1)
 
 
 
-
-/* These tables are a kluge that will not scale well when more
- * vectorized subrs are added.  It is tempting to steal some bits from
- * the SCM_CAR of all subrs (like those selected by SCM_SMOBNUM) to hold an
- * offset into a table of vectorized subrs.  
- */
-
-static ra_iproc ra_rpsubrs[] =
-{
-  {"=", SCM_UNDEFINED, scm_ra_eqp},
-  {"<", SCM_UNDEFINED, scm_ra_lessp},
-  {"<=", SCM_UNDEFINED, scm_ra_leqp},
-  {">", SCM_UNDEFINED, scm_ra_grp},
-  {">=", SCM_UNDEFINED, scm_ra_greqp},
-  {0, 0, 0}
-};
-
-static ra_iproc ra_asubrs[] =
-{
-  {"+", SCM_UNDEFINED, scm_ra_sum},
-  {"-", SCM_UNDEFINED, scm_ra_difference},
-  {"*", SCM_UNDEFINED, scm_ra_product},
-  {"/", SCM_UNDEFINED, scm_ra_divide},
-  {0, 0, 0}
-};
-
 static void
 init_raprocs (subra)
      ra_iproc *subra;