[macruby-changes] [2356] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Aug 21 15:00:45 PDT 2009


Revision: 2356
          http://trac.macosforge.org/projects/ruby/changeset/2356
Author:   pthomson at apple.com
Date:     2009-08-21 15:00:44 -0700 (Fri, 21 Aug 2009)
Log Message:
-----------
Fixed a missing write barrier, corrected indentation, fixed a crash in do_checksum due to its assumption that its input would be a ByteString, and enabled some specs.

Modified Paths:
--------------
    MacRuby/trunk/ext/zlib/zlib.c
    MacRuby/trunk/spec/macruby.mspec

Modified: MacRuby/trunk/ext/zlib/zlib.c
===================================================================
--- MacRuby/trunk/ext/zlib/zlib.c	2009-08-20 20:04:27 UTC (rev 2355)
+++ MacRuby/trunk/ext/zlib/zlib.c	2009-08-21 22:00:44 UTC (rev 2356)
@@ -246,43 +246,43 @@
 /*
  * Returns the string which represents the version of zlib library.
  */
-     static VALUE
-     rb_zlib_version(VALUE klass, SEL sel)
- {
-     VALUE str;
+static VALUE
+rb_zlib_version(VALUE klass, SEL sel)
+{
+    VALUE str;
 
-     str = rb_str_new2(zlibVersion());
-     OBJ_TAINT(str);  /* for safe */
-     return str;
- }
+    str = rb_str_new2(zlibVersion());
+    OBJ_TAINT(str);  /* for safe */
+    return str;
+}
 
- static VALUE
-     do_checksum(argc, argv, func)
-     int argc;
- VALUE *argv;
- uLong (*func) _((uLong, const Bytef*, uInt));
- {
-     VALUE str, vsum;
-     unsigned long sum;
+static VALUE
+do_checksum(argc, argv, func)
+    int argc;
+    VALUE *argv;
+    uLong (*func) _((uLong, const Bytef*, uInt));
+{
+    VALUE str, vsum;
+    unsigned long sum;
 
-     rb_scan_args(argc, argv, "02", &str, &vsum);
+    rb_scan_args(argc, argv, "02", &str, &vsum);
 
-     if (!NIL_P(vsum)) {
-         sum = NUM2ULONG(vsum);
-     } else if (NIL_P(str)) {
-         sum = 0;
-     } else {
-         sum = func(0, Z_NULL, 0);
-     }
+    if (!NIL_P(vsum)) {
+        sum = NUM2ULONG(vsum);
+    } else if (NIL_P(str)) {
+        sum = 0;
+    } else {
+        sum = func(0, Z_NULL, 0);
+    }
 
-     if (NIL_P(str)) {
-         sum = func(sum, Z_NULL, 0);
-     } else {
-         StringValue(str);
-         sum = func(sum, BSTRING_PTR_BYTEF(str), BSTRING_LEN(str));
-     }
-     return rb_uint2inum(sum);
- }
+    if (NIL_P(str)) {
+        sum = func(sum, Z_NULL, 0);
+    } else {
+        StringValue(str);
+        sum = func(sum, (const Bytef*)RSTRING_PTR(str), (uInt)RSTRING_LEN(str));
+    }
+    return rb_uint2inum(sum);
+}
 
 /*
  * call-seq: Zlib.adler32(string, adler)
@@ -535,7 +535,7 @@
     if (len <= 0) return;
 
     if (NIL_P(z->input)) {
-        z->input = rb_bytestring_new_with_data((UInt8*)src, len);
+        GC_WB(&z->input, rb_bytestring_new_with_data((UInt8*)src, len));
     } else {
 	    rb_bytestring_append_bytes(z->input, (const UInt8*)src, len);
     }
@@ -1106,6 +1106,7 @@
     rb_scan_args(argc, argv, "11", &src, &level);
 
     lev = ARG_LEVEL(level);
+    CFShow((CFStringRef)src);
     StringValue(src);
     if (CLASS_OF(src) != rb_cByteString) {
         src = rb_coerce_to_bytestring(src);

Modified: MacRuby/trunk/spec/macruby.mspec
===================================================================
--- MacRuby/trunk/spec/macruby.mspec	2009-08-20 20:04:27 UTC (rev 2355)
+++ MacRuby/trunk/spec/macruby.mspec	2009-08-21 22:00:44 UTC (rev 2356)
@@ -43,6 +43,9 @@
     'library/yaml/load_file.spec',
     'library/yaml/load_spec.rb',
     'library/yaml/tag_class_spec.rb',
+    'library/zlib/adler32_spec.rb',
+    'library/zlib/crc32_spec.rb',
+    'library/zlib/crc_table_spec.rb',
     'library/zlib/deflate'
   ]
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090821/46481e85/attachment.html>


More information about the macruby-changes mailing list