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

ruby-changes:5982

From: akr <ko1@a...>
Date: Fri, 20 Jun 2008 23:00:57 +0900 (JST)
Subject: [ruby-changes:5982] Ruby:r17490 (trunk): * process.c (Init_process): Process::Status#to_int removed.

akr	2008-06-20 23:00:35 +0900 (Fri, 20 Jun 2008)

  New Revision: 17490

  Modified files:
    trunk/ChangeLog
    trunk/process.c

  Log:
    * process.c (Init_process): Process::Status#to_int removed.
      (PST2INT): defined.
      (pst_to_s): use PST2INT.
      (pst_inspect): ditto.
      (pst_equal): ditto.
      (pst_bitand): ditto.
      (pst_rshift): ditto.
      (pst_wifstopped): ditto.
      (pst_wstopsig): ditto.
      (pst_wifsignaled): ditto.
      (pst_wtermsig): ditto.
      (pst_wifexited): ditto.
      (pst_wexitstatus): ditto.
      (pst_success_p): ditto.
      (pst_wcoredump): ditto.
      (rb_f_system): ditto.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17490&r2=17489&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/process.c?r1=17490&r2=17489&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17489)
+++ ChangeLog	(revision 17490)
@@ -1,3 +1,22 @@
+Fri Jun 20 16:34:14 2008  Tanaka Akira  <akr@f...>
+
+	* process.c (Init_process): Process::Status#to_int removed.
+	  (PST2INT): defined.
+	  (pst_to_s): use PST2INT.
+	  (pst_inspect): ditto.
+	  (pst_equal): ditto.
+	  (pst_bitand): ditto.
+	  (pst_rshift): ditto.
+	  (pst_wifstopped): ditto.
+	  (pst_wstopsig): ditto.
+	  (pst_wifsignaled): ditto.
+	  (pst_wtermsig): ditto.
+	  (pst_wifexited): ditto.
+	  (pst_wexitstatus): ditto.
+	  (pst_success_p): ditto.
+	  (pst_wcoredump): ditto.
+	  (rb_f_system): ditto.
+
 Fri Jun 20 15:40:02 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* array.c (rb_ary_store, rb_ary_splice): not depend on unspecified
Index: process.c
===================================================================
--- process.c	(revision 17489)
+++ process.c	(revision 17490)
@@ -260,6 +260,7 @@
     return rb_iv_get(st, "status");
 }
 
+#define PST2INT(st) NUM2INT(pst_to_i(st))
 
 /*
  *  call-seq:
@@ -333,7 +334,7 @@
     VALUE str;
 
     pid = NUM2LONG(pst_pid(st));
-    status = NUM2INT(pst_to_i(st));
+    status = PST2INT(st);
 
     str = rb_str_buf_new(0);
     pst_message(str, pid, status);
@@ -356,7 +357,7 @@
     VALUE str;
 
     pid = NUM2LONG(pst_pid(st));
-    status = NUM2INT(pst_to_i(st));
+    status = PST2INT(st);
 
     str = rb_sprintf("#<%s: ", rb_class2name(CLASS_OF(st)));
     pst_message(str, pid, status);
@@ -396,7 +397,7 @@
 static VALUE
 pst_bitand(VALUE st1, VALUE st2)
 {
-    int status = NUM2INT(st1) & NUM2INT(st2);
+    int status = PST2INT(st1) & NUM2INT(st2);
 
     return INT2NUM(status);
 }
@@ -417,7 +418,7 @@
 static VALUE
 pst_rshift(VALUE st1, VALUE st2)
 {
-    int status = NUM2INT(st1) >> NUM2INT(st2);
+    int status = PST2INT(st1) >> NUM2INT(st2);
 
     return INT2NUM(status);
 }
@@ -435,7 +436,7 @@
 static VALUE
 pst_wifstopped(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WIFSTOPPED(status))
 	return Qtrue;
@@ -455,7 +456,7 @@
 static VALUE
 pst_wstopsig(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WIFSTOPPED(status))
 	return INT2NUM(WSTOPSIG(status));
@@ -474,7 +475,7 @@
 static VALUE
 pst_wifsignaled(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WIFSIGNALED(status))
 	return Qtrue;
@@ -495,7 +496,7 @@
 static VALUE
 pst_wtermsig(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WIFSIGNALED(status))
 	return INT2NUM(WTERMSIG(status));
@@ -515,7 +516,7 @@
 static VALUE
 pst_wifexited(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WIFEXITED(status))
 	return Qtrue;
@@ -546,7 +547,7 @@
 static VALUE
 pst_wexitstatus(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WIFEXITED(status))
 	return INT2NUM(WEXITSTATUS(status));
@@ -565,7 +566,7 @@
 static VALUE
 pst_success_p(VALUE st)
 {
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (!WIFEXITED(status))
 	return Qnil;
@@ -585,7 +586,7 @@
 pst_wcoredump(VALUE st)
 {
 #ifdef WCOREDUMP
-    int status = NUM2INT(st);
+    int status = PST2INT(st);
 
     if (WCOREDUMP(status))
 	return Qtrue;
@@ -2766,7 +2767,7 @@
     if (status < 0) {
 	return Qnil;
     }
-    status = NUM2INT(rb_last_status_get());
+    status = PST2INT(rb_last_status_get());
     if (status == EXIT_SUCCESS) return Qtrue;
     return Qfalse;
 }
@@ -5118,7 +5119,6 @@
     rb_define_method(rb_cProcessStatus, "&", pst_bitand, 1);
     rb_define_method(rb_cProcessStatus, ">>", pst_rshift, 1);
     rb_define_method(rb_cProcessStatus, "to_i", pst_to_i, 0);
-    rb_define_method(rb_cProcessStatus, "to_int", pst_to_i, 0);
     rb_define_method(rb_cProcessStatus, "to_s", pst_to_s, 0);
     rb_define_method(rb_cProcessStatus, "inspect", pst_inspect, 0);
 

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

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