summaryrefslogtreecommitdiff
path: root/libobjc/archive.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-15 17:50:14 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-15 17:50:14 +0000
commitadff42e6a4389342740fc2ffe1a9e71798c87423 (patch)
treecd175472b2e9e3cb8c294184c253b7e74efaff38 /libobjc/archive.c
parent8d4f8d462b6fbc77613f48e7f490f6b27a2f7b8f (diff)
downloadgcc-adff42e6a4389342740fc2ffe1a9e71798c87423.tar.gz
* Object.m: Fix signed/unsigned warning.
* Protocol.m: Likewise. * archive.c: Always include stdlib.h. (objc_read_short, objc_read_unsigned_short, objc_read_int, objc_read_long, __objc_read_nbyte_uint, __objc_read_nbyte_ulong): Fix signed/unsigned warning. (objc_write_type, objc_read_type, objc_write_types, objc_read_types): Ensure ctype 8-bit safety. (__objc_no_write, __objc_no_read): Mark unused parameters. * class.c (class_table_setup): Specify void arg. * encoding.c (atoi, objc_sizeof_type, objc_alignof_type, objc_skip_typespec, objc_skip_offset, objc_layout_structure_next_member): Ensure ctype 8-bit safety. (objc_layout_structure_next_member): Ensure variables are initialized. * gc.c (__objc_generate_gc_type_description, class_ivar_set_gcinvisible): Mark unused parameters. * init.c (__objc_send_load, __objc_destroy_class_tree_node): Mark unused parameters. (__objc_init_protocols) Fix signed/unsigned warning. * nil_method.c (nil_method): Mark unused parameters. * thr.h (objc_thread_callback): Specify void arg. * sarray.c (sarray_new, sarray_realloc, sarray_free): Fix signed/unsigned warning. (sarray_free): Fix formatting. * selector.c (sel_types_match): Ensure ctype 8-bit safety. * sendmsg.c (__objc_init_install_dtable) Mark unused parameters. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54649 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc/archive.c')
-rw-r--r--libobjc/archive.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/libobjc/archive.c b/libobjc/archive.c
index 10106c1145e..e6b6d2f946d 100644
--- a/libobjc/archive.c
+++ b/libobjc/archive.c
@@ -28,10 +28,7 @@ Boston, MA 02111-1307, USA. */
#include "runtime.h"
#include "typedstream.h"
#include "encoding.h"
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
extern int fflush(FILE*);
@@ -566,7 +563,7 @@ objc_read_short (struct objc_typed_stream* stream, short* value)
{
int pos = 1;
int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (short))
+ if (nbytes > (int) sizeof (short))
objc_error(nil, OBJC_ERR_BAD_DATA,
"expected short, got bigger (%dbits)", nbytes*8);
len = (*stream->read)(stream->physical, buf+1, nbytes);
@@ -595,7 +592,7 @@ objc_read_unsigned_short (struct objc_typed_stream* stream,
{
int pos = 1;
int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (short))
+ if (nbytes > (int) sizeof (short))
objc_error(nil, OBJC_ERR_BAD_DATA,
"expected short, got int or bigger");
len = (*stream->read)(stream->physical, buf+1, nbytes);
@@ -622,7 +619,7 @@ objc_read_int (struct objc_typed_stream* stream, int* value)
{
int pos = 1;
int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (int))
+ if (nbytes > (int) sizeof (int))
objc_error(nil, OBJC_ERR_BAD_DATA, "expected int, got bigger");
len = (*stream->read)(stream->physical, buf+1, nbytes);
(*value) = 0;
@@ -649,7 +646,7 @@ objc_read_long (struct objc_typed_stream* stream, long* value)
{
int pos = 1;
int nbytes = buf[0] & _B_NUMBER;
- if (nbytes > sizeof (long))
+ if (nbytes > (int) sizeof (long))
objc_error(nil, OBJC_ERR_BAD_DATA, "expected long, got bigger");
len = (*stream->read)(stream->physical, buf+1, nbytes);
(*value) = 0;
@@ -666,7 +663,8 @@ __inline__ int
__objc_read_nbyte_uint (struct objc_typed_stream* stream,
unsigned int nbytes, unsigned int* val)
{
- int len, pos = 0;
+ int len;
+ unsigned int pos = 0;
unsigned char buf[sizeof(unsigned int)+1];
if (nbytes > sizeof (int))
@@ -702,7 +700,8 @@ int
__objc_read_nbyte_ulong (struct objc_typed_stream* stream,
unsigned int nbytes, unsigned long* val)
{
- int len, pos = 0;
+ int len;
+ unsigned int pos = 0;
unsigned char buf[sizeof(unsigned long)+1];
if (nbytes > sizeof (long))
@@ -1043,7 +1042,7 @@ objc_write_type(TypedStream* stream, const char* type, const void* data)
case _C_ARY_B:
{
int len = atoi(type+1);
- while (isdigit(*++type))
+ while (isdigit((unsigned char)*++type))
;
return objc_write_array (stream, type, len, data);
}
@@ -1139,7 +1138,7 @@ objc_read_type(TypedStream* stream, const char* type, void* data)
case _C_ARY_B:
{
int len = atoi(type+1);
- while (isdigit(*++type))
+ while (isdigit((unsigned char)*++type))
;
return objc_read_array (stream, type, len, data);
}
@@ -1257,7 +1256,7 @@ objc_write_types (TypedStream* stream, const char* type, ...)
{
int len = atoi(c+1);
const char* t = c;
- while (isdigit(*++t))
+ while (isdigit((unsigned char)*++t))
;
res = objc_write_array (stream, t, len, va_arg(args, void*));
t = objc_skip_typespec (t);
@@ -1349,7 +1348,7 @@ objc_read_types(TypedStream* stream, const char* type, ...)
{
int len = atoi(c+1);
const char* t = c;
- while (isdigit(*++t))
+ while (isdigit((unsigned char)*++t))
;
res = objc_read_array (stream, t, len, va_arg(args, void*));
t = objc_skip_typespec (t);
@@ -1428,14 +1427,18 @@ __objc_feof(FILE* file)
}
static int
-__objc_no_write(FILE* file, char* data, int len)
+__objc_no_write(FILE* file __attribute__ ((__unused__)),
+ const char *data __attribute__ ((__unused__)),
+ int len __attribute__ ((__unused__)))
{
objc_error (nil, OBJC_ERR_NO_WRITE, "TypedStream not open for writing");
return 0;
}
static int
-__objc_no_read(FILE* file, char* data, int len)
+__objc_no_read(FILE* file __attribute__ ((__unused__)),
+ const char *data __attribute__ ((__unused__)),
+ int len __attribute__ ((__unused__)))
{
objc_error (nil, OBJC_ERR_NO_READ, "TypedStream not open for reading");
return 0;