[macruby-changes] [5247] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Feb 25 17:26:14 PST 2011


Revision: 5247
          http://trac.macosforge.org/projects/ruby/changeset/5247
Author:   lsansonetti at apple.com
Date:     2011-02-25 17:26:13 -0800 (Fri, 25 Feb 2011)
Log Message:
-----------
increase the max encoding length, because IOKit contains very large structures

Modified Paths:
--------------
    MacRuby/trunk/bs.c
    MacRuby/trunk/include/ruby/defines.h
    MacRuby/trunk/rational.c

Modified: MacRuby/trunk/bs.c
===================================================================
--- MacRuby/trunk/bs.c	2011-02-26 01:08:28 UTC (rev 5246)
+++ MacRuby/trunk/bs.c	2011-02-26 01:26:13 UTC (rev 5247)
@@ -253,7 +253,7 @@
   return ret;
 }
 
-#define MAX_ENCODE_LEN 2048
+#define MAX_ENCODE_LEN 4096
 
 #ifndef MIN
 # define MIN(a, b) (((a) < (b)) ? (a) : (b))

Modified: MacRuby/trunk/include/ruby/defines.h
===================================================================
--- MacRuby/trunk/include/ruby/defines.h	2011-02-26 01:08:28 UTC (rev 5246)
+++ MacRuby/trunk/include/ruby/defines.h	2011-02-26 01:26:13 UTC (rev 5247)
@@ -76,12 +76,7 @@
 
 #include <AvailabilityMacros.h>
 
-#if defined(__LP64__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)
-# define BDIGIT uint64_t
-# define SIZEOF_BDIGITS 8
-# define BDIGIT_DBL __uint128_t
-# define BDIGIT_DBL_SIGNED __int128_t
-#elif SIZEOF_INT*2 <= SIZEOF_LONG_LONG
+#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
 # define BDIGIT unsigned int
 # define SIZEOF_BDIGITS SIZEOF_INT
 # define BDIGIT_DBL unsigned LONG_LONG

Modified: MacRuby/trunk/rational.c
===================================================================
--- MacRuby/trunk/rational.c	2011-02-26 01:08:28 UTC (rev 5246)
+++ MacRuby/trunk/rational.c	2011-02-26 01:26:13 UTC (rev 5247)
@@ -349,8 +349,6 @@
     return nurat_s_new_internal(klass, ZERO, ONE);
 }
 
-#define rb_raise_zerodiv() rb_raise(rb_eZeroDivError, "divided by 0")
-
 #if 0
 static VALUE
 nurat_s_new_bang(int argc, VALUE *argv, VALUE klass)
@@ -375,7 +373,7 @@
 	    den = f_negate(den);
 	    break;
 	  case 0:
-	    rb_raise_zerodiv();
+	    rb_num_zerodiv();
 	    break;
 	}
 	break;
@@ -446,7 +444,7 @@
 	den = f_negate(den);
 	break;
       case 0:
-	rb_raise_zerodiv();
+	rb_num_zerodiv();
 	break;
     }
 
@@ -470,7 +468,7 @@
 	den = f_negate(den);
 	break;
       case 0:
-	rb_raise_zerodiv();
+	rb_num_zerodiv();
 	break;
     }
 
@@ -854,9 +852,10 @@
     switch (TYPE(other)) {
       case T_FIXNUM:
       case T_BIGNUM:
-	if (f_zero_p(other))
-	    rb_raise_zerodiv();
 	{
+	    if (f_zero_p(other)) {
+		rb_num_zerodiv();
+	    }
 	    get_dat1(self);
 
 	    return f_muldiv(self,
@@ -866,9 +865,10 @@
       case T_FLOAT:
 	return rb_funcall(f_to_f(self), '/', 1, other);
       case T_RATIONAL:
-	if (f_zero_p(other))
-	    rb_raise_zerodiv();
 	{
+	    if (f_zero_p(other)) {
+		rb_num_zerodiv();
+	    }
 	    get_dat2(self, other);
 
 	    if (f_one_p(self))
@@ -1587,7 +1587,7 @@
     dat->den = RARRAY_AT(ary ,1);
     rb_copy_generic_ivar(self, ary);
     if (f_zero_p(dat->den)) {
-	rb_raise_zerodiv();
+	rb_num_zerodiv();
     }
     return self;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110225/3adf4e7f/attachment-0001.html>


More information about the macruby-changes mailing list