Commit d4b13012 by Kresten Krab Thorup

(objc_write_type, objc_write_types): Take take char** args for writing strings…

(objc_write_type, objc_write_types): Take take char** args for writing strings in stead of char* to match NeXT.

(objc_write_type, objc_write_types): Take
       take char** args for writing strings in stead of char* to
       match NeXT.  Also correct some typos in error messages.

From-SVN: r5398
parent 2f2c485a
...@@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License along with ...@@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License along with
#include "typedstream.h" #include "typedstream.h"
#define __objc_fatal(format, args...) \ #define __objc_fatal(format, args...) \
{ fprintf(stderr, "archining: "); \ { fprintf(stderr, "archiving: "); \
fprintf(stderr, format, ## args); \ fprintf(stderr, format, ## args); \
fprintf(stderr, "\n"); abort(); } fprintf(stderr, "\n"); abort(); }
...@@ -854,7 +854,7 @@ objc_sizeof_type(const char* type) ...@@ -854,7 +854,7 @@ objc_sizeof_type(const char* type)
break; break;
default: default:
fprintf(stderr, "objc_write_type: cannot parse typespec: %s\n", type); fprintf(stderr, "objc_sizeof_type: cannot parse typespec: %s\n", type);
abort(); abort();
} }
} }
...@@ -892,7 +892,7 @@ __objc_skip_type (const char* type) ...@@ -892,7 +892,7 @@ __objc_skip_type (const char* type)
break; break;
default: default:
fprintf(stderr, "objc_read_types: cannot parse typespec: %s\n", type); fprintf(stderr, "__objc_skip_type: cannot parse typespec: %s\n", type);
abort(); abort();
} }
} }
...@@ -949,11 +949,11 @@ objc_write_type(TypedStream* stream, const char* type, const void* data) ...@@ -949,11 +949,11 @@ objc_write_type(TypedStream* stream, const char* type, const void* data)
break; break;
case _C_CHARPTR: case _C_CHARPTR:
return objc_write_string (stream, (char*)data, strlen((char*)data)); return objc_write_string (stream, *(char**)data, strlen(*(char**)data));
break; break;
case _C_ATOM: case _C_ATOM:
return objc_write_string_atomic (stream, (char*)data, strlen((char*)data)); return objc_write_string_atomic (stream, *(char**)data, strlen(*(char**)data));
break; break;
case _C_ARY_B: case _C_ARY_B:
...@@ -1034,7 +1034,7 @@ objc_read_type(TypedStream* stream, const char* type, void* data) ...@@ -1034,7 +1034,7 @@ objc_read_type(TypedStream* stream, const char* type, void* data)
break; break;
default: default:
fprintf(stderr, "objc_write_type: cannot parse typespec: %s\n", type); fprintf(stderr, "objc_read_type: cannot parse typespec: %s\n", type);
abort(); abort();
} }
} }
...@@ -1103,15 +1103,15 @@ objc_write_types (TypedStream* stream, const char* type, ...) ...@@ -1103,15 +1103,15 @@ objc_write_types (TypedStream* stream, const char* type, ...)
case _C_CHARPTR: case _C_CHARPTR:
{ {
char* str = va_arg(args, char*); char** str = va_arg(args, char**);
res = objc_write_string (stream, str, strlen(str)); res = objc_write_string (stream, *str, strlen(*str));
} }
break; break;
case _C_ATOM: case _C_ATOM:
{ {
char* str = va_arg(args, char*); char** str = va_arg(args, char**);
res = objc_write_string_atomic (stream, str, strlen(str)); res = objc_write_string_atomic (stream, *str, strlen(*str));
} }
break; break;
...@@ -1128,7 +1128,7 @@ objc_write_types (TypedStream* stream, const char* type, ...) ...@@ -1128,7 +1128,7 @@ objc_write_types (TypedStream* stream, const char* type, ...)
break; break;
default: default:
fprintf(stderr, "objc_write_type: cannot parse typespec: %s\n", type); fprintf(stderr, "objc_write_types: cannot parse typespec: %s\n", type);
abort(); abort();
} }
} }
...@@ -1213,7 +1213,7 @@ objc_read_types(TypedStream* stream, const char* type, ...) ...@@ -1213,7 +1213,7 @@ objc_read_types(TypedStream* stream, const char* type, ...)
break; break;
default: default:
fprintf(stderr, "objc_read_type: cannot parse typespec: %s\n", type); fprintf(stderr, "objc_read_types: cannot parse typespec: %s\n", type);
abort(); abort();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment