1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00

* 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.
This commit is contained in:
Gary Houston 2001-07-22 20:19:12 +00:00
parent b8a42df3f1
commit a6ec2a3cef
3 changed files with 56 additions and 30 deletions

View file

@ -1,3 +1,9 @@
2001-07-22 Gary Houston <ghouston@arglist.com>
* 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 <mgrabmue@cs.tu-berlin.de> 2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
* srfi-11.scm, srfi-8.scm: Update copyright notice. * srfi-11.scm, srfi-8.scm: Update copyright notice.

View file

@ -1070,31 +1070,41 @@ SCM_DEFINE (scm_char_set_union, "char-set-union", 0, 0, 1,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 1, 0, 1, SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 0, 0, 1,
(SCM cs1, SCM rest), (SCM rest),
"Return the intersection of all argument character sets.") "Return the intersection of all argument character sets.")
#define FUNC_NAME s_scm_char_set_intersection #define FUNC_NAME s_scm_char_set_intersection
{ {
int c = 2;
SCM res; SCM res;
long * p;
SCM_VALIDATE_SMOB (1, cs1, charset);
SCM_VALIDATE_REST_ARGUMENT (rest); SCM_VALIDATE_REST_ARGUMENT (rest);
res = scm_char_set_copy (cs1); if (SCM_NULLP (rest))
p = (long *) SCM_SMOB_DATA (res); res = make_char_set (FUNC_NAME);
while (!SCM_NULLP (rest)) else
{ {
int k; long *p;
SCM cs = SCM_CAR (rest); int argnum = 2;
SCM_VALIDATE_SMOB (c, cs, charset);
c++; res = scm_char_set_copy (SCM_CAR (rest));
p = (long *) SCM_SMOB_DATA (res);
rest = SCM_CDR (rest); rest = SCM_CDR (rest);
for (k = 0; k < LONGS_PER_CHARSET; k++) while (SCM_CONSP (rest))
p[k] &= ((long *) SCM_SMOB_DATA (cs))[k]; {
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; return res;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1130,30 +1140,40 @@ SCM_DEFINE (scm_char_set_difference, "char-set-difference", 1, 0, 1,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE (scm_char_set_xor, "char-set-xor", 1, 0, 1, SCM_DEFINE (scm_char_set_xor, "char-set-xor", 0, 0, 1,
(SCM cs1, SCM rest), (SCM rest),
"Return the exclusive-or of all argument character sets.") "Return the exclusive-or of all argument character sets.")
#define FUNC_NAME s_scm_char_set_xor #define FUNC_NAME s_scm_char_set_xor
{ {
int c = 2;
SCM res; SCM res;
long * p;
SCM_VALIDATE_SMOB (1, cs1, charset);
SCM_VALIDATE_REST_ARGUMENT (rest); SCM_VALIDATE_REST_ARGUMENT (rest);
res = scm_char_set_copy (cs1); if (SCM_NULLP (rest))
p = (long *) SCM_SMOB_DATA (res); res = make_char_set (FUNC_NAME);
while (!SCM_NULLP (rest)) else
{ {
int k; long * p;
SCM cs = SCM_CAR (rest); int argnum = 2;
SCM_VALIDATE_SMOB (c, cs, charset);
c++; res = scm_char_set_copy (SCM_CAR (rest));
p = (long *) SCM_SMOB_DATA (res);
rest = SCM_CDR (rest); rest = SCM_CDR (rest);
for (k = 0; k < LONGS_PER_CHARSET; k++) while (SCM_CONSP (rest))
p[k] ^= ((long *) SCM_SMOB_DATA (cs))[k]; {
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; return res;
} }

View file

@ -102,9 +102,9 @@ SCM scm_char_set_adjoin_x (SCM cs, SCM rest);
SCM scm_char_set_delete_x (SCM cs, SCM rest); SCM scm_char_set_delete_x (SCM cs, SCM rest);
SCM scm_char_set_complement (SCM cs); SCM scm_char_set_complement (SCM cs);
SCM scm_char_set_union (SCM rest); 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_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_diff_plus_intersection (SCM cs1, SCM rest);
SCM scm_char_set_complement_x (SCM cs); SCM scm_char_set_complement_x (SCM cs);
SCM scm_char_set_union_x (SCM cs1, SCM rest); SCM scm_char_set_union_x (SCM cs1, SCM rest);