[macruby-changes] [447] MacRuby/branches/lrz_unstable/bs.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 14 23:08:01 PDT 2008


Revision: 447
          http://trac.macosforge.org/projects/ruby/changeset/447
Author:   lsansonetti at apple.com
Date:     2008-08-14 23:08:01 -0700 (Thu, 14 Aug 2008)
Log Message:
-----------
increate max encoding len, to make sure IOBluetooth can be parsed

Modified Paths:
--------------
    MacRuby/branches/lrz_unstable/bs.c

Modified: MacRuby/branches/lrz_unstable/bs.c
===================================================================
--- MacRuby/branches/lrz_unstable/bs.c	2008-08-15 04:43:28 UTC (rev 446)
+++ MacRuby/branches/lrz_unstable/bs.c	2008-08-15 06:08:01 UTC (rev 447)
@@ -205,7 +205,7 @@
   return ret;
 }
 
-#define MAX_ENCODE_LEN 1024
+#define MAX_ENCODE_LEN 2048
 
 #ifndef MIN
 # define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -252,7 +252,7 @@
     p_src = pos + 1;
     pos = strchr(p_src, '"');
     if (pos == NULL) {
-      // XXX NSLog("Can't find the end of field delimiter starting at %d", p_src - src);
+      fprintf(stderr, "Can't find the end of field delimiter starting at %d\n", p_src - src);
       goto bails; 
     }
     if (field != NULL) {
@@ -307,19 +307,19 @@
       }
 
       if (ok == false) {
-        //XXX DLOG("MDLOSX", "Can't find the field encoding starting at %d", p_src - src);
+        fprintf(stderr, "Can't find the field encoding starting at %d\n", p_src - src);
         goto bails;
       }
 
       if (opposite == '}' || opposite == ')') {
         char buf[MAX_ENCODE_LEN];
         char buf2[MAX_ENCODE_LEN];
-   
+ 
         strncpy(buf, p_src, MIN(sizeof buf, i));
         buf[MIN(sizeof buf, i)] = '\0';        
      
         if (!undecorate_struct_type(buf, buf2, sizeof buf2, NULL, 0, NULL)) {
-          // XXX DLOG("MDLOSX", "Can't un-decode the field encoding '%s'", buf);
+          fprintf(stderr, "Can't un-decode the field encoding '%s'\n", buf);
           goto bails;
         }
 
@@ -597,10 +597,10 @@
           CHECK_ATTRIBUTE(struct_name, "name");
 
           if (!undecorate_struct_type(struct_decorated_type, type, 
-                                      MAX_ENCODE_LEN, fields, 128, 
+                                      sizeof type, fields, 128, 
                                       &field_count)) {
             BAIL("Can't handle structure '%s' with type '%s'", 
-                 name, struct_decorated_type);
+                 struct_name, struct_decorated_type);
           }
 
           free(struct_decorated_type);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080814/c87a4498/attachment.html 


More information about the macruby-changes mailing list