guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/srfi ChangeLog srfi-14.h srfi-...


From: Gary Houston
Subject: guile/guile-core/srfi ChangeLog srfi-14.h srfi-...
Date: Sun, 22 Jul 2001 13:19:13 -0700

CVSROOT:        /cvs
Module name:    guile
Branch:         branch_release-1-6
Changes by:     Gary Houston <address@hidden>   01/07/22 13:19:13

Modified files:
        guile-core/srfi: ChangeLog srfi-14.h srfi-14.c 

Log message:
        * srfi-14.c (scm_char_set_intersection, scm_char_set_xor): remove
        the compulsory cs1 arguments: all args are optional in final spec.
        * srfi-14.h: declarations updated.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/srfi/ChangeLog.diff?cvsroot=OldCVS&only_with_tag=branch_release-1-6&tr1=1.44.2.12&tr2=1.44.2.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/srfi/srfi-14.h.diff?cvsroot=OldCVS&only_with_tag=branch_release-1-6&tr1=1.3.2.3&tr2=1.3.2.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/srfi/srfi-14.c.diff?cvsroot=OldCVS&only_with_tag=branch_release-1-6&tr1=1.9.2.9&tr2=1.9.2.10&r1=text&r2=text

Patches:
Index: guile/guile-core/srfi/ChangeLog
diff -u guile/guile-core/srfi/ChangeLog:1.56 
guile/guile-core/srfi/ChangeLog:1.57
--- guile/guile-core/srfi/ChangeLog:1.56        Thu Jul 19 13:28:33 2001
+++ guile/guile-core/srfi/ChangeLog     Sun Jul 22 13:17:28 2001
@@ -1,3 +1,9 @@
+2001-07-22  Gary Houston  <address@hidden>
+
+       * srfi-14.c (scm_char_set_intersection, scm_char_set_xor): remove
+       the compulsory cs1 arguments: all args are optional in final spec.
+       * srfi-14.h: declarations updated.
+
 2001-07-18  Martin Grabmueller  <address@hidden>
 
        * srfi-11.scm, srfi-8.scm: Update copyright notice.
Index: guile/guile-core/srfi/srfi-14.c
diff -u guile/guile-core/srfi/srfi-14.c:1.18 
guile/guile-core/srfi/srfi-14.c:1.19
--- guile/guile-core/srfi/srfi-14.c:1.18        Tue Jul 17 12:41:49 2001
+++ guile/guile-core/srfi/srfi-14.c     Sun Jul 22 13:17:28 2001
@@ -1070,31 +1070,41 @@
 #undef FUNC_NAME
 
 
-SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 1, 0, 1,
-           (SCM cs1, SCM rest),
+SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 0, 0, 1,
+           (SCM rest),
            "Return the intersection of all argument character sets.")
 #define FUNC_NAME s_scm_char_set_intersection
 {
-  int c = 2;
   SCM res;
-  long * p;
 
-  SCM_VALIDATE_SMOB (1, cs1, charset);
   SCM_VALIDATE_REST_ARGUMENT (rest);
 
-  res = scm_char_set_copy (cs1);
-  p = (long *) SCM_SMOB_DATA (res);
-  while (!SCM_NULLP (rest))
+  if (SCM_NULLP (rest))
+    res = make_char_set (FUNC_NAME);
+  else
     {
-      int k;
-      SCM cs = SCM_CAR (rest);
-      SCM_VALIDATE_SMOB (c, cs, charset);
-      c++;
+      long *p;
+      int argnum = 2;
+
+      res = scm_char_set_copy (SCM_CAR (rest));
+      p = (long *) SCM_SMOB_DATA (res);
       rest = SCM_CDR (rest);
 
-      for (k = 0; k < LONGS_PER_CHARSET; k++)
-       p[k] &= ((long *) SCM_SMOB_DATA (cs))[k];
+      while (SCM_CONSP (rest))
+       {
+         int k;
+         SCM cs = SCM_CAR (rest);
+         long *cs_data;
+
+         SCM_VALIDATE_SMOB (argnum, cs, charset);
+         argnum++;
+         cs_data = (long *) SCM_SMOB_DATA (cs);
+         rest = SCM_CDR (rest);
+         for (k = 0; k < LONGS_PER_CHARSET; k++)
+           p[k] &= cs_data[k];
+       }
     }
+
   return res;
 }
 #undef FUNC_NAME
@@ -1130,30 +1140,40 @@
 #undef FUNC_NAME
 
 
-SCM_DEFINE (scm_char_set_xor, "char-set-xor", 1, 0, 1,
-           (SCM cs1, SCM rest),
+SCM_DEFINE (scm_char_set_xor, "char-set-xor", 0, 0, 1,
+           (SCM rest),
            "Return the exclusive-or of all argument character sets.")
 #define FUNC_NAME s_scm_char_set_xor
 {
-  int c = 2;
   SCM res;
-  long * p;
 
-  SCM_VALIDATE_SMOB (1, cs1, charset);
   SCM_VALIDATE_REST_ARGUMENT (rest);
 
-  res = scm_char_set_copy (cs1);
-  p = (long *) SCM_SMOB_DATA (res);
-  while (!SCM_NULLP (rest))
+  if (SCM_NULLP (rest))
+    res = make_char_set (FUNC_NAME);
+  else
     {
-      int k;
-      SCM cs = SCM_CAR (rest);
-      SCM_VALIDATE_SMOB (c, cs, charset);
-      c++;
+      long * p;
+      int argnum = 2;
+
+      res = scm_char_set_copy (SCM_CAR (rest));
+      p = (long *) SCM_SMOB_DATA (res);
       rest = SCM_CDR (rest);
 
-      for (k = 0; k < LONGS_PER_CHARSET; k++)
-       p[k] ^= ((long *) SCM_SMOB_DATA (cs))[k];
+      while (SCM_CONSP (rest))
+       {
+         int k;
+         SCM cs = SCM_CAR (rest);
+         long *cs_data; 
+
+         SCM_VALIDATE_SMOB (argnum, cs, charset);
+         argnum++;
+         cs_data = (long *) SCM_SMOB_DATA (cs);
+         rest = SCM_CDR (rest);
+
+         for (k = 0; k < LONGS_PER_CHARSET; k++)
+           p[k] ^= cs_data[k];
+       }
     }
   return res;
 }
Index: guile/guile-core/srfi/srfi-14.h
diff -u guile/guile-core/srfi/srfi-14.h:1.6 guile/guile-core/srfi/srfi-14.h:1.7
--- guile/guile-core/srfi/srfi-14.h:1.6 Mon Jul 16 22:35:51 2001
+++ guile/guile-core/srfi/srfi-14.h     Sun Jul 22 13:17:28 2001
@@ -102,9 +102,9 @@
 SCM scm_char_set_delete_x (SCM cs, SCM rest);
 SCM scm_char_set_complement (SCM cs);
 SCM scm_char_set_union (SCM rest);
-SCM scm_char_set_intersection (SCM cs1, SCM rest);
+SCM scm_char_set_intersection (SCM rest);
 SCM scm_char_set_difference (SCM cs1, SCM rest);
-SCM scm_char_set_xor (SCM cs1, SCM rest);
+SCM scm_char_set_xor (SCM rest);
 SCM scm_char_set_diff_plus_intersection (SCM cs1, SCM rest);
 SCM scm_char_set_complement_x (SCM cs);
 SCM scm_char_set_union_x (SCM cs1, SCM rest);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]