diff src/defun-int.h @ 1488:89c587478067

[project @ 1995-09-26 22:49:48 by jwe]
author jwe
date Tue, 26 Sep 1995 22:49:48 +0000
parents 611d403c7f3d
children 3a9462b655f1
line wrap: on
line diff
--- a/src/defun-int.h
+++ b/src/defun-int.h
@@ -34,12 +34,11 @@
 // mkdefs will create a .def file for every .cc file that uses DEFUN,
 // DEFUN_TEXT, or DEFUN_DLD.
 
-#define DEFUN_INTERNAL(name, fname, sname, nargin_max, nargout_max, \
+#define DEFUN_INTERNAL(name, fname, sname, unused_arg_flags, \
 		       is_text_fcn, doc) \
   BEGIN_INSTALL_BUILTIN \
-    extern DECLARE_FUN (fname); \
-    DEFINE_FUN_STRUCT (name, fname, sname, nargin_max, nargout_max, \
-		       is_text_fcn, doc); \
+    extern DECLARE_FUN_ ## unused_arg_flags (fname); \
+    DEFINE_FUN_STRUCT (name, fname, sname, is_text_fcn, doc); \
     install_builtin_function (&sname); \
   END_INSTALL_BUILTIN
 
@@ -55,9 +54,9 @@
 // Generate the first line of the function definition.  This ensures
 // that the internal functions all have the same signature.
 
-#define DEFUN_INTERNAL(name, fname, sname, nargin_max, nargout_max, \
+#define DEFUN_INTERNAL(name, fname, sname, unused_arg_flags, \
 		       is_text_fcn, doc) \
-  DECLARE_FUN (fname)
+  DECLARE_FUN_ ## unused_arg_flags (fname)
 
 // No definition is required for an alias.
 
@@ -68,10 +67,9 @@
 // Define the structure that will be used to insert this function into
 // the symbol table.
 
-#define DEFINE_FUN_STRUCT(name, fname, sname, nargin_max, \
-			  nargout_max, is_text_fcn, doc) \
+#define DEFINE_FUN_STRUCT(name, fname, sname, is_text_fcn, doc) \
   static builtin_function sname = \
-    { name, nargin_max, nargout_max, is_text_fcn, fname, doc }
+    { name, is_text_fcn, fname, doc }
 
 #define DEFINE_FUN_STRUCT_FUN(sname, fsname) \
   builtin_function * \
@@ -82,11 +80,22 @@
 
 // Declare an internal function named fname.  This is the interface
 // used by all internal functions in Octave that are also callable
-// from the Octave language.
+// from the Octave language.  The funny suffixes are used to help us
+// avoid warnings from g++ about unused arguments.
+
+#define DECLARE_FUN_00(fname) \
+  Octave_object fname (const Octave_object&, int)
 
-#define DECLARE_FUN(fname) \
-  Octave_object \
-  fname (const Octave_object& args, int nargout)
+#define DECLARE_FUN_01(fname) \
+  Octave_object fname (const Octave_object&, int nargout)
+
+#define DECLARE_FUN_10(fname) \
+  Octave_object fname (const Octave_object& args, int)
+
+#define DECLARE_FUN_11(fname) \
+  Octave_object fname (const Octave_object& args, int nargout)
+
+#define DECLARE_FUN_(fname) DECLARE_FUN_11 (fname)
 
 // XXX FIXME XXX -- eliminate the need for these in the functions that
 // use them?