From 03bf343a9f2d773dc3ff866d2ad180d3491745ad Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 10 Apr 2016 21:54:41 +0000 Subject: file.c: apply to argv * file.c (apply2files): apply to a VALUE vector instead of a temporary array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ file.c | 59 ++++++++++++++++++++++++++++------------------------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index f80a876ace..3c91eafbcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 11 06:54:39 2016 Nobuyoshi Nakada + + * file.c (apply2files): apply to a VALUE vector instead of a + temporary array. + Sun Apr 10 20:54:16 2016 Joe Swatosh * ext/win32/lib/win32/registry.rb (DeleteValue, DeleteKey): fix diff --git a/file.c b/file.c index 901e46a0c2..32add8c056 100644 --- a/file.c +++ b/file.c @@ -334,21 +334,23 @@ ignored_char_p(const char *p, const char *e, rb_encoding *enc) } #endif +#define apply2args(n) (rb_check_arity(argc, n, UNLIMITED_ARGUMENTS), argc-=n) + static long -apply2files(void (*func)(const char *, VALUE, void *), VALUE vargs, void *arg) +apply2files(void (*func)(const char *, VALUE, void *), int argc, VALUE *argv, void *arg) { long i; volatile VALUE path; - for (i=0; i