Revision: 447 http://trac.macosforge.org/projects/ruby/changeset/447 Author: lsansonetti@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);
participants (1)
-
source_changes@macosforge.org