comparison src/lisp.h @ 109154:6f7fb6d5f0f9

Make the function member of Lisp_Subr use standard C prototypes. * src/lisp.h (struct Lisp_Subr): Use a union for the function member. (DECL_ALIGN): Add a cast for the function. * src/eval.c (Feval, Ffuncall): Use the proper type for each type function call.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 06 Jul 2010 19:49:37 -0700
parents 004119b4b62e
children 750db9f3e6d8
comparison
equal deleted inserted replaced
109153:978941230a7c 109154:6f7fb6d5f0f9
963 we don't need a next-vector field. */ 963 we don't need a next-vector field. */
964 964
965 struct Lisp_Subr 965 struct Lisp_Subr
966 { 966 {
967 EMACS_UINT size; 967 EMACS_UINT size;
968 Lisp_Object (*function) (); 968 union {
969 Lisp_Object (*a0) (void);
970 Lisp_Object (*a1) (Lisp_Object);
971 Lisp_Object (*a2) (Lisp_Object, Lisp_Object);
972 Lisp_Object (*a3) (Lisp_Object, Lisp_Object, Lisp_Object);
973 Lisp_Object (*a4) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
974 Lisp_Object (*a5) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
975 Lisp_Object (*a6) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
976 Lisp_Object (*a7) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
977 Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
978 Lisp_Object (*am) (int, Lisp_Object *);
979 } function;
969 short min_args, max_args; 980 short min_args, max_args;
970 const char *symbol_name; 981 const char *symbol_name;
971 char *intspec; 982 char *intspec;
972 char *doc; 983 char *doc;
973 }; 984 };
1766 arguments, so we can catch errors with maxargs at compile-time. */ 1777 arguments, so we can catch errors with maxargs at compile-time. */
1767 #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ 1778 #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
1768 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ 1779 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1769 DECL_ALIGN (struct Lisp_Subr, sname) = \ 1780 DECL_ALIGN (struct Lisp_Subr, sname) = \
1770 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ 1781 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
1771 fnname, minargs, maxargs, lname, intspec, 0}; \ 1782 (Lisp_Object(*)(void)) fnname, minargs, maxargs, lname, intspec, 0}; \
1772 Lisp_Object fnname 1783 Lisp_Object fnname
1773 1784
1774 /* Note that the weird token-substitution semantics of ANSI C makes 1785 /* Note that the weird token-substitution semantics of ANSI C makes
1775 this work for MANY and UNEVALLED. */ 1786 this work for MANY and UNEVALLED. */
1776 #define DEFUN_ARGS_MANY (int, Lisp_Object *) 1787 #define DEFUN_ARGS_MANY (int, Lisp_Object *)