changeset 5280:59a6419f7504

Use GET_DEFUN_LISP_OBJECT() in PARSE_KEYWORDS(), fix former under NEW_GC. 2010-09-20 Aidan Kehoe <kehoea@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.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 20 Sep 2010 23:22:50 +0100
parents d0bc331e433f
children aa20a889ff14 308d34e9f07d
files src/ChangeLog src/lisp.h src/symeval.h
diffstat 3 files changed, 31 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- 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@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@parhasard.net>
 
 	* lisp.h (PARSE_KEYWORDS):
--- 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
--- 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)