[前][次][番号順一覧][スレッド一覧]

ruby-changes:6450

From: nobu <ko1@a...>
Date: Wed, 9 Jul 2008 11:11:36 +0900 (JST)
Subject: [ruby-changes:6450] Ruby:r17966 (trunk): * dir.c (struct glob_args, rb_glob_caller, rb_glob2, push_pattern),

nobu	2008-07-09 11:11:21 +0900 (Wed, 09 Jul 2008)

  New Revision: 17966

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=17966

  Log:
    * dir.c (struct glob_args, rb_glob_caller, rb_glob2, push_pattern),
      (glob_brace): make consistent prototypes.
    
    * dir.c (push_glob): set enc in the caller of rb_glob_caller as well
      as rb_glob2.

  Modified files:
    trunk/ChangeLog
    trunk/dir.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17965)
+++ ChangeLog	(revision 17966)
@@ -1,3 +1,11 @@
+Wed Jul  9 11:11:18 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* dir.c (struct glob_args, rb_glob_caller, rb_glob2, push_pattern),
+	  (glob_brace): make consistent prototypes.
+
+	* dir.c (push_glob): set enc in the caller of rb_glob_caller as well
+	  as rb_glob2.
+
 Wed Jul  9 09:12:11 2008  NARUSE, Yui  <naruse@r...>
 
 	* ext/nkf/nkf-utf8/nkf.c (options): use input_endian.
@@ -135,7 +143,7 @@
 Sun Jul  6 10:12:21 2008  Kouhei Sutou  <kou@c...>
 
 	* lib/test/unit/collector/objectspace.rb
-	(Test::Unit::Collector::ObjectSpace::NAME): fix a typo.
+	  (Test::Unit::Collector::ObjectSpace::NAME): fix a typo.
 
 Sun Jul  6 00:56:51 2008  Tanaka Akira  <akr@f...>
 
Index: dir.c
===================================================================
--- dir.c	(revision 17965)
+++ dir.c	(revision 17966)
@@ -1181,7 +1181,7 @@
 #endif
 
 struct glob_args {
-    void (*func)(const char *, VALUE, rb_encoding *);
+    void (*func)(const char *, VALUE, void *);
     const char *path;
     VALUE value;
     rb_encoding *enc;
@@ -1429,20 +1429,19 @@
 }
 
 static int
-rb_glob_caller(const char *path, VALUE a, rb_encoding *enc)
+rb_glob_caller(const char *path, VALUE a, void *enc)
 {
     int status;
     struct glob_args *args = (struct glob_args *)a;
 
     args->path = path;
-    args->enc = enc;
     rb_protect(glob_func_caller, a, &status);
     return status;
 }
 
 static int
 rb_glob2(const char *path, int flags,
-	 void (*func)(const char *, VALUE, rb_encoding *), VALUE arg,
+	 void (*func)(const char *, VALUE, void *), VALUE arg,
 	 rb_encoding* enc)
 {
     struct glob_args args;
@@ -1467,7 +1466,7 @@
 }
 
 static void
-push_pattern(const char *path, VALUE ary, rb_encoding *enc)
+push_pattern(const char *path, VALUE ary, void *enc)
 {
     VALUE vpath = rb_tainted_str_new2(path);
     rb_enc_associate(vpath, enc);
@@ -1539,7 +1538,7 @@
 };
 
 static int
-glob_brace(const char *path, VALUE val, rb_encoding *enc)
+glob_brace(const char *path, VALUE val, void *enc)
 {
     struct brace_args *arg = (struct brace_args *)val;
 
@@ -1569,11 +1568,14 @@
 push_glob(VALUE ary, VALUE str, int flags)
 {
     struct glob_args args;
+    rb_encoding *enc = rb_enc_get(str);
 
     args.func = push_pattern;
     args.value = ary;
+    args.enc = enc;
+
     return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
-			    rb_glob_caller, (VALUE)&args, rb_enc_get(str));
+			    rb_glob_caller, (VALUE)&args, enc);
 }
 
 static VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]