aboutsummaryrefslogtreecommitdiffstats
path: root/gsubr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gsubr.c')
-rw-r--r--gsubr.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/gsubr.c b/gsubr.c
index 96b0f78..5cdaf98 100644
--- a/gsubr.c
+++ b/gsubr.c
@@ -1,18 +1,18 @@
/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ * the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
* As a special exception, the Free Software Foundation gives permission
* for additional uses of the text contained in its release of GUILE.
@@ -36,7 +36,7 @@
*
* If you write modifications of your own for GUILE, it is your choice
* whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
+ * If you do not wish that, delete this exception notice.
*/
/* "gsubr.c" CCLOs taking general number of required, optional, and rest args.
@@ -55,7 +55,7 @@
static SCM f_gsubr_apply;
SCM make_gsubr(name, req, opt, rst, fcn)
- char *name;
+ const char *name;
int req, opt, rst;
SCM (*fcn)();
{
@@ -71,15 +71,10 @@ SCM make_gsubr(name, req, opt, rst, fcn)
default:
{
SCM symcell = sysintern(name, UNDEFINED);
- SCM z, cclo = makcclo(f_gsubr_apply, 3L);
- long tmp = ((((CELLPTR)(CAR(symcell)))-heap_org)<<8);
+ SCM z = scm_maksubr(name, tc7_subr_0, fcn);
+ SCM cclo = makcclo(f_gsubr_apply, 3L);
ASSERT(GSUBR_MAX >= req + opt + rst, MAKINUM(req + opt + rst),
OUTOFRANGE, "make_gsubr");
- if ((tmp>>8) != ((CELLPTR)(CAR(symcell))-heap_org))
- tmp = 0;
- NEWCELL(z);
- SUBRF(z) = fcn;
- CAR(z) = tmp + tc7_subr_0;
GSUBR_PROC(cclo) = z;
GSUBR_TYPE(cclo) = MAKINUM(GSUBR_MAKTYPE(req, opt, rst));
CDR(symcell) = cclo;
@@ -102,7 +97,7 @@ SCM gsubr_apply(args)
for (i = 0; i < GSUBR_REQ(typ); i++) {
#ifndef RECKLESS
if IMP(args)
- wnargs: wta(UNDEFINED, (char *)WNA, CHARS(SNAME(GSUBR_PROC(self))));
+ wnargs: wta(UNDEFINED, (char *)WNA, SNAME(GSUBR_PROC(self)));
#endif
v[i] = CAR(args);
args = CDR(args);