From f2b6d100d8958a9c811c950f113a0ce38a25d484 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 6 Dec 2016 22:06:26 +0200 Subject: Add min_required and max_expected arg counts to API. --- extension/time.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'extension/time.c') diff --git a/extension/time.c b/extension/time.c index e6b2b39f..67002752 100644 --- a/extension/time.c +++ b/extension/time.c @@ -109,9 +109,6 @@ do_gettimeofday(int nargs, awk_value_t *result) assert(result != NULL); - if (do_lint && nargs > 0) - lintwarn(ext_id, _("gettimeofday: ignoring arguments")); - #if defined(HAVE_GETTIMEOFDAY) { struct timeval tv; @@ -161,9 +158,6 @@ do_sleep(int nargs, awk_value_t *result) assert(result != NULL); - if (do_lint && nargs > 1) - lintwarn(ext_id, _("sleep: called with too many arguments")); - if (! get_argument(0, AWK_NUMBER, &num)) { update_ERRNO_string(_("sleep: missing required numeric argument")); return make_number(-1, result); @@ -212,8 +206,8 @@ do_sleep(int nargs, awk_value_t *result) } static awk_ext_func_t func_table[] = { - { "gettimeofday", do_gettimeofday, 0 }, - { "sleep", do_sleep, 1 }, + { "gettimeofday", do_gettimeofday, 0, 0 }, + { "sleep", do_sleep, 1, 1 }, }; /* define the dl_load function using the boilerplate macro */ -- cgit v1.2.3 From 0855ef4db6d8e0d1d57776eb273c9de321bfd6cf Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 14 Dec 2016 21:25:20 +0200 Subject: Fix lint stuff, arg checking. Add a data pointer. Pass finfo to functions. --- extension/time.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'extension/time.c') diff --git a/extension/time.c b/extension/time.c index 67002752..01be7784 100644 --- a/extension/time.c +++ b/extension/time.c @@ -103,7 +103,7 @@ int plugin_is_GPL_compatible; * on the platform */ static awk_value_t * -do_gettimeofday(int nargs, awk_value_t *result) +do_gettimeofday(int nargs, awk_value_t *result, struct awk_ext_func *unused) { double curtime; @@ -150,7 +150,7 @@ do_gettimeofday(int nargs, awk_value_t *result) * did not complete successfully (perhaps interrupted) */ static awk_value_t * -do_sleep(int nargs, awk_value_t *result) +do_sleep(int nargs, awk_value_t *result, struct awk_ext_func *unused) { awk_value_t num; double secs; @@ -206,8 +206,8 @@ do_sleep(int nargs, awk_value_t *result) } static awk_ext_func_t func_table[] = { - { "gettimeofday", do_gettimeofday, 0, 0 }, - { "sleep", do_sleep, 1, 1 }, + { "gettimeofday", do_gettimeofday, 0, 0, awk_false, NULL }, + { "sleep", do_sleep, 1, 1, awk_false, NULL }, }; /* define the dl_load function using the boilerplate macro */ -- cgit v1.2.3