changeset: 5280:59a6419f7504
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Mon Sep 20 23:22:50 2010 +0100
files: src/ChangeLog src/lisp.h src/symeval.h
description:
Use GET_DEFUN_LISP_OBJECT() in PARSE_KEYWORDS(), fix former under NEW_GC.
2010-09-20 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h (GET_DEFUN_LISP_OBJECT): Make the NEW_GC version of this
work, remove a needless and unhelpful semicolon.
(GET_DEFUN_LISP_OBJECT): Remove a needless semicolon from the
non-NEW_GC version of this.
(PARSE_KEYWORDS): Fix the indentation for the DEBUG_XEMACS
version of this macro.
(PARSE_KEYWORDS): Use GET_DEFUN_LISP_OBJECT() for both the NEW_GC
and non-NEW_GC versions of this macro, when working out the
function's min args.
diff -r d0bc331e433f -r 59a6419f7504 src/ChangeLog
--- a/src/ChangeLog Sat Sep 18 18:02:28 2010 +0100
+++ b/src/ChangeLog Mon Sep 20 23:22:50 2010 +0100
@@ -1,3 +1,15 @@
+2010-09-20 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * lisp.h (GET_DEFUN_LISP_OBJECT): Make the NEW_GC version of this
+ work, remove a needless and unhelpful semicolon.
+ (GET_DEFUN_LISP_OBJECT): Remove a needless semicolon from the
+ non-NEW_GC version of this.
+ (PARSE_KEYWORDS): Fix the indentation for the DEBUG_XEMACS
+ version of this macro.
+ (PARSE_KEYWORDS): Use GET_DEFUN_LISP_OBJECT() for both the NEW_GC
+ and non-NEW_GC versions of this macro, when working out the
+ function's min args.
+
2010-09-18 Aidan Kehoe <kehoea(a)parhasard.net>
* lisp.h (PARSE_KEYWORDS):
diff -r d0bc331e433f -r 59a6419f7504 src/lisp.h
--- a/src/lisp.h Sat Sep 18 18:02:28 2010 +0100
+++ b/src/lisp.h Mon Sep 20 23:22:50 2010 +0100
@@ -3404,7 +3404,7 @@
static struct Lisp_Subr *S##Fname; \
DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist)
#define GET_DEFUN_LISP_OBJECT(Fname) \
- wrap_subr (S##Fname);
+ wrap_subr (&MC_ALLOC_S##Fname)
#else /* not NEW_GC */
#define DEFUN(lname, Fname, min_args, max_args, prompt, arglist) \
Lisp_Object Fname (EXFUN_##max_args); \
@@ -3444,7 +3444,7 @@
}; \
DOESNT_RETURN_TYPE (Lisp_Object) Fname (DEFUN_##max_args arglist)
#define GET_DEFUN_LISP_OBJECT(Fname) \
- wrap_subr (&S##Fname);
+ wrap_subr (&S##Fname)
#endif /* not NEW_GC */
/* Heavy ANSI C preprocessor hackery to get DEFUN to declare a
@@ -3544,30 +3544,23 @@
#define PARSE_KEYWORDS(function, nargs, args, keyword_count, keywords, \
keyword_defaults) \
- PARSE_KEYWORDS_8 (intern_massaging_name (1 + #function), \
- nargs, args, \
- keyword_count, keywords, \
- keyword_defaults, \
- /* Can't XSUBR (Fsymbol_function (...))->min_args, \
- the function may be advised. */ \
- XINT (Ffunction_min_args \
- (intern_massaging_name (1 + #function))), \
- 0); \
- assert (0 == strcmp (__func__, #function))
+ PARSE_KEYWORDS_8 (intern_massaging_name (1 + #function), nargs, args, \
+ keyword_count, keywords, keyword_defaults, \
+ /* Can't XSUBR (Fsymbol_function (...))->min_args, \
+ the function may be advised. */ \
+ XINT (Ffunction_min_args \
+ (intern_massaging_name (1 + #function))), \
+ 0); \
+ assert (0 == strcmp (__func__, #function))
#else /* defined (DEBUG_XEMACS) && ... */
-#ifdef NEW_GC
#define PARSE_KEYWORDS(function, nargs, args, keyword_count, keywords, \
keyword_defaults) \
- PARSE_KEYWORDS_8 (intern (S##function->name), nargs, args, \
- keyword_count, keywords, \
- keyword_defaults, S##function->min_args, 0)
-#else /* NEW_GC */
-#define PARSE_KEYWORDS(function, nargs, args, keyword_count, keywords, \
- keyword_defaults) \
- PARSE_KEYWORDS_8 (intern (S##function.name), nargs, args, \
- keyword_count, keywords, \
- keyword_defaults, S##function.min_args, 0)
-#endif /* NEW_GC */
+ PARSE_KEYWORDS_8 (intern (subr_name (XSUBR \
+ (GET_DEFUN_LISP_OBJECT (function)))), \
+ nargs, args, keyword_count, keywords, \
+ keyword_defaults, \
+ XSUBR (GET_DEFUN_LISP_OBJECT (function))->min_args, \
+ 0)
#endif /* defined (DEBUG_XEMACS) && defined (__STDC_VERSION__) ... */
/* PARSE_KEYWORDS_8 is a more fine-grained version of PARSE_KEYWORDS. The
diff -r d0bc331e433f -r 59a6419f7504 src/symeval.h
--- a/src/symeval.h Sat Sep 18 18:02:28 2010 +0100
+++ b/src/symeval.h Mon Sep 20 23:22:50 2010 +0100
@@ -294,6 +294,9 @@
#define DEFSUBR(Fname) \
do { \
+ /* #### As far as I can see, this has no upside compared to the non-NEW_GC \
+ code. The MC_ALLOC_S##Fname structure is also in the dumped \
+ XEmacs. Aidan Kehoe, Mon Sep 20 23:14:01 IST 2010 */ \
DEFSUBR_MC_ALLOC (Fname); \
defsubr (S##Fname); \
} while (0)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/mailman/listinfo/xemacs-patches