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

ruby-changes:39213

From: nobu <ko1@a...>
Date: Sat, 18 Jul 2015 23:47:32 +0900 (JST)
Subject: [ruby-changes:39213] nobu:r51294 (trunk): load.c: use TAG_RETURN

nobu	2015-07-18 23:47:11 +0900 (Sat, 18 Jul 2015)

  New Revision: 51294

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

  Log:
    load.c: use TAG_RETURN
    
    * load.c (rb_require_internal): use TAG_RETURN not a magic number.

  Modified files:
    trunk/load.c
Index: load.c
===================================================================
--- load.c	(revision 51293)
+++ load.c	(revision 51294)
@@ -1007,7 +1007,7 @@ rb_require_internal(VALUE fname, int saf https://github.com/ruby/ruby/blob/trunk/load.c#L1007
 	    }
 	    else if (!*ftptr) {
 		rb_provide_feature(path);
-		result = 1;
+		result = TAG_RETURN;
 	    }
 	    else {
 		switch (found) {
@@ -1022,7 +1022,7 @@ rb_require_internal(VALUE fname, int saf https://github.com/ruby/ruby/blob/trunk/load.c#L1022
 		    break;
 		}
 		rb_provide_feature(path);
-		result = 1;
+		result = TAG_RETURN;
 	    }
 	}
     }
@@ -1052,9 +1052,8 @@ ruby_require_internal(const char *fname, https://github.com/ruby/ruby/blob/trunk/load.c#L1052
     struct RString fake;
     VALUE str = rb_setup_fake_str(&fake, fname, len, 0);
     int result = rb_require_internal(str, 0);
-    if (result > 1) result = -1;
     rb_set_errinfo(Qnil);
-    return result;
+    return result == TAG_RETURN ? 1 : result ? -1 : 0;
 }
 
 VALUE
@@ -1062,7 +1061,7 @@ rb_require_safe(VALUE fname, int safe) https://github.com/ruby/ruby/blob/trunk/load.c#L1061
 {
     int result = rb_require_internal(fname, safe);
 
-    if (result > 1) {
+    if (result > TAG_RETURN) {
 	JUMP_TAG(result);
     }
     if (result < 0) {

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

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