[gnumeric] Docs: check argument count.



commit 8c22db1792dfe383d983acdb2c5e8b7a7bca93fd
Author: Morten Welinder <terra gnome org>
Date:   Fri Aug 14 10:30:43 2009 -0400

    Docs: check argument count.

 ChangeLog  |    2 ++
 src/func.c |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ec8c2c2..8ab649f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2009-08-14  Morten Welinder  <terra gnome org>
 
+	* src/func.c (gnm_func_sanity_check1): Check argument count too.
+
 	* src/main-application.c (main): Add new --func-sanity-check
 	option.
 
diff --git a/src/func.c b/src/func.c
index 4a76782..96a7345 100644
--- a/src/func.c
+++ b/src/func.c
@@ -552,6 +552,16 @@ gnm_func_sanity_check1 (GnmFunc const *fd)
 		}
 	}
 
+	if (fd->fn_type == GNM_FUNC_TYPE_ARGS) {
+		int n = counts[GNM_FUNC_HELP_ARG];
+		if (n != fd->fn.args.max_args) {
+			g_printerr ("%s: Help for %d args, but takes %d-%d\n",
+				    fd->name, n,
+				    fd->fn.args.min_args, fd->fn.args.max_args);
+			res = 1;
+		}
+	}
+
 	return res;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]