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

ruby-changes:26483

From: usa <ko1@a...>
Date: Fri, 21 Dec 2012 22:06:28 +0900 (JST)
Subject: [ruby-changes:26483] usa:r38534 (trunk): * win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()

usa	2012-12-21 22:06:17 +0900 (Fri, 21 Dec 2012)

  New Revision: 38534

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

  Log:
    * win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()
      and renamed from rb_w32_readdir_with_enc().
      [ruby-core:24864] [Feature #1927]
    
    * dir.c (READDIR): follow above change.

  Modified files:
    trunk/ChangeLog
    trunk/dir.c
    trunk/win32/dir.h
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38533)
+++ ChangeLog	(revision 38534)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Dec 21 22:02:00 2012  NAKAMURA Usaku  <usa@r...>
+
+	* win32/{dir.h,win32.c} (rb_w32_readdir): removed old rb_w32_readdir()
+	  and renamed from rb_w32_readdir_with_enc().
+	  [ruby-core:24864] [Feature #1927]
+
+	* dir.c (READDIR): follow above change.
+
 Fri Dec 21 21:12:54 2012  Masaya Tarui  <tarui@r...>
 
 	* vm_dump.c (rb_vm_bugreport): commentout addr2line call temporarily
Index: dir.c
===================================================================
--- dir.c	(revision 38533)
+++ dir.c	(revision 38534)
@@ -522,7 +522,7 @@ dir_path(VALUE dir) https://github.com/ruby/ruby/blob/trunk/dir.c#L522
 #if defined HAVE_READDIR_R
 # define READDIR(dir, enc, entry, dp) (readdir_r((dir), (entry), &(dp)) == 0 && (dp) != 0)
 #elif defined _WIN32
-# define READDIR(dir, enc, entry, dp) (((dp) = rb_w32_readdir_with_enc((dir), (enc))) != 0)
+# define READDIR(dir, enc, entry, dp) (((dp) = rb_w32_readdir((dir), (enc))) != 0)
 #else
 # define READDIR(dir, enc, entry, dp) (((dp) = readdir(dir)) != 0)
 #endif
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 38533)
+++ win32/win32.c	(revision 38534)
@@ -2025,16 +2025,9 @@ readdir_internal(DIR *dirp, BOOL (*conv) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L2025
 
 /* License: Ruby's */
 struct direct  *
-rb_w32_readdir(DIR *dirp)
+rb_w32_readdir(DIR *dirp, rb_encoding *enc)
 {
-    return readdir_internal(dirp, win32_direct_conv, NULL);
-}
-
-/* License: Ruby's */
-struct direct  *
-rb_w32_readdir_with_enc(DIR *dirp, rb_encoding *enc)
-{
-    if (enc == rb_ascii8bit_encoding())
+    if (!enc || enc == rb_ascii8bit_encoding())
 	return readdir_internal(dirp, win32_direct_conv, NULL);
     else
 	return readdir_internal(dirp, ruby_direct_conv, enc);
Index: win32/dir.h
===================================================================
--- win32/dir.h	(revision 38533)
+++ win32/dir.h	(revision 38534)
@@ -29,18 +29,17 @@ typedef struct { https://github.com/ruby/ruby/blob/trunk/win32/dir.h#L29
 
 DIR*           rb_w32_opendir(const char*);
 DIR*           rb_w32_uopendir(const char*);
-struct direct* rb_w32_readdir(DIR *);
-struct direct* rb_w32_readdir_with_enc(DIR *, rb_encoding *);
+struct direct* rb_w32_readdir(DIR *, rb_encoding *);
 long           rb_w32_telldir(DIR *);
 void           rb_w32_seekdir(DIR *, long);
 void           rb_w32_rewinddir(DIR *);
 void           rb_w32_closedir(DIR *);
 
-#define opendir   rb_w32_opendir
-#define readdir   rb_w32_readdir
-#define telldir   rb_w32_telldir
-#define seekdir   rb_w32_seekdir
-#define rewinddir rb_w32_rewinddir
-#define closedir  rb_w32_closedir
+#define opendir(s)   rb_w32_opendir((s))
+#define readdir(d)   rb_w32_readdir((d), 0)
+#define telldir(d)   rb_w32_telldir((d))
+#define seekdir(d, l)   rb_w32_seekdir((d), (l))
+#define rewinddir(d) rb_w32_rewinddir((d))
+#define closedir(d)  rb_w32_closedir((d))
 
 #endif /* RUBY_WIN32_DIR_H */

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

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