summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-02 20:23:47 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-02 20:23:47 (GMT)
commitf2980e3e2050f21273bfc8412e83adef5f75b1f0 (patch)
tree567b8001811a2396a9746d9f2332dbeab08f158d /dir.c
parentb875b4a6d9fd3a025bffc77c5c265e746614ee2d (diff)
encoding.h: constify rb_encoding
* include/ruby/encoding.h: constify `rb_encoding` itself, not only arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index c7bddf4..c784a6f 100644
--- a/dir.c
+++ b/dir.c
@@ -1307,17 +1307,17 @@ struct glob_args {
rb_encoding *enc;
};
+#define glob_call_func(func, path, arg, enc) (*(func))((path), (arg), (void *)(enc))
+
static VALUE
glob_func_caller(VALUE val)
{
struct glob_args *args = (struct glob_args *)val;
- (*args->func)(args->path, args->value, args->enc);
+ glob_call_func(args->func, args->path, args->value, args->enc);
return Qnil;
}
-#define glob_call_func(func, path, arg, enc) (*(func))((path), (arg), (enc))
-
static int
glob_helper(
const char *path,
@@ -1724,7 +1724,7 @@ ruby_brace_expand(const char *str, int flags, ruby_glob_func *func, VALUE arg,
GLOB_FREE(buf);
}
else if (!lbrace && !rbrace) {
- status = (*func)(s, arg, enc);
+ status = glob_call_func(func, s, arg, enc);
}
return status;