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

ruby-changes:35779

From: nobu <ko1@a...>
Date: Fri, 10 Oct 2014 11:27:59 +0900 (JST)
Subject: [ruby-changes:35779] nobu:r47861 (trunk): ruby/io.h: deprecate old macros

nobu	2014-10-10 11:27:41 +0900 (Fri, 10 Oct 2014)

  New Revision: 47861

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

  Log:
    ruby/io.h: deprecate old macros
    
    * include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags):
      deprecate old macros for compatibility for ruby 1.8 and older.

  Modified files:
    trunk/ChangeLog
    trunk/NEWS
    trunk/ext/pty/pty.c
    trunk/ext/stringio/stringio.c
    trunk/include/ruby/io.h
Index: include/ruby/io.h
===================================================================
--- include/ruby/io.h	(revision 47860)
+++ include/ruby/io.h	(revision 47861)
@@ -188,8 +188,8 @@ int rb_io_extract_encoding_option(VALUE https://github.com/ruby/ruby/blob/trunk/include/ruby/io.h#L188
 ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
 
 /* compatibility for ruby 1.8 and older */
-#define rb_io_mode_flags(modestr) rb_io_modestr_fmode(modestr)
-#define rb_io_modenum_flags(oflags) rb_io_oflags_fmode(oflags)
+#define rb_io_mode_flags(modestr) [<"rb_io_mode_flags() is obsolete; use rb_io_modestr_fmode()">]
+#define rb_io_modenum_flags(oflags) [<"rb_io_modenum_flags() is obsolete; use rb_io_oflags_fmode()">]
 
 VALUE rb_io_taint_check(VALUE);
 NORETURN(void rb_eof_error(void));
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47860)
+++ ChangeLog	(revision 47861)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Oct 10 11:27:49 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags):
+	  deprecate old macros for compatibility for ruby 1.8 and older.
+
 Thu Oct  9 23:31:47 2014  Naohisa Goto  <ngotogenome@g...>
 
 	* bignum.c (absint_numwords_generic): set an array element after
Index: ext/pty/pty.c
===================================================================
--- ext/pty/pty.c	(revision 47860)
+++ ext/pty/pty.c	(revision 47861)
@@ -590,11 +590,11 @@ pty_getpty(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/ext/pty/pty.c#L590
 
     establishShell(argc, argv, &info, SlaveName);
 
-    rfptr->mode = rb_io_mode_flags("r");
+    rfptr->mode = rb_io_modestr_fmode("r");
     rfptr->fd = info.fd;
     rfptr->pathv = rb_obj_freeze(rb_str_new_cstr(SlaveName));
 
-    wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC;
+    wfptr->mode = rb_io_modestr_fmode("w") | FMODE_SYNC;
     wfptr->fd = rb_cloexec_dup(info.fd);
     if (wfptr->fd == -1)
         rb_sys_fail("dup()");
Index: ext/stringio/stringio.c
===================================================================
--- ext/stringio/stringio.c	(revision 47860)
+++ ext/stringio/stringio.c	(revision 47861)
@@ -186,12 +186,12 @@ strio_init(int argc, VALUE *argv, struct https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L186
       case 2:
 	if (FIXNUM_P(mode)) {
 	    int flags = FIX2INT(mode);
-	    ptr->flags = rb_io_modenum_flags(flags);
+	    ptr->flags = rb_io_oflags_fmode(flags);
 	    trunc = flags & O_TRUNC;
 	}
 	else {
 	    const char *m = StringValueCStr(mode);
-	    ptr->flags = rb_io_mode_flags(m);
+	    ptr->flags = rb_io_modestr_fmode(m);
 	    trunc = *m == 'w';
 	}
 	StringValue(string);
Index: NEWS
===================================================================
--- NEWS	(revision 47860)
+++ NEWS	(revision 47861)
@@ -244,6 +244,8 @@ with all sufficient information, see the https://github.com/ruby/ruby/blob/trunk/NEWS#L244
   rb_big2str0 : internal function. no replacement.
   rb_big2ulong_pack -> rb_integer_pack
   rb_gc_set_params : internal function. no replacement.
+  rb_io_mode_flags -> rb_io_modestr_fmode
+  rb_io_modenum_flags -> rb_io_oflags_fmode
 
 * struct RBignum is hidden.  [Feature #6083]
   Use rb_integer_pack and rb_integer_unpack instead.

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

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