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

ruby-changes:6612

From: usa <ko1@a...>
Date: Sat, 19 Jul 2008 00:32:43 +0900 (JST)
Subject: [ruby-changes:6612] Ruby:r18128 (trunk): * numeric.c (check_uint): fix wrong message.

usa	2008-07-19 00:32:36 +0900 (Sat, 19 Jul 2008)

  New Revision: 18128

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

  Log:
    * numeric.c (check_uint): fix wrong message.

  Modified files:
    trunk/numeric.c

Index: numeric.c
===================================================================
--- numeric.c	(revision 18127)
+++ numeric.c	(revision 18128)
@@ -1588,23 +1588,17 @@
 check_uint(VALUE num, VALUE sign)
 {
     static const VALUE mask = ~(VALUE)UINT_MAX;
-    const char *s;
 
     if (RTEST(sign)) {
 	/* minus */
 	if ((num & mask) != mask || (num & ~mask) <= INT_MAX + 1UL)
-	    s = "small";
-	else
-	    return;
+	    rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too small to convert to `unsigned int'", num);
     }
     else {
 	/* plus */
 	if ((num & mask) != 0)
-	    s = "big";
-	else
-	    return;
+	    rb_raise(rb_eRangeError, "integer %"PRIuVALUE " too big to convert to `unsigned int'", num);
     }
-    rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too %s to convert to `unsigned int'", num, s);
 }
 
 long

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

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