* 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.
From-SVN: r54649
+2002-06-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * 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.
+
2002-06-09 Andreas Jaeger <aj@suse.de>
* encoding.c (objc_layout_structure_next_member): Remove unused
+ (BOOL) conformsTo: (Protocol*)aProtocol
{
- int i;
+ size_t i;
struct objc_protocol_list* proto_list;
id parent;
- (BOOL) conformsTo: (Protocol *)aProtocolObject
{
- int i;
+ size_t i;
struct objc_protocol_list* proto_list;
if (!strcmp(aProtocolObject->protocol_name, self->protocol_name))
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
{
- for (i=0; i < proto_list->count; i++)
+ size_t j;
+ for (j=0; j < proto_list->count; j++)
{
- if ((result = [proto_list->list[i]
+ if ((result = [proto_list->list[j]
descriptionForInstanceMethod: aSel]))
return result;
}
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
{
- for (i=0; i < proto_list->count; i++)
+ size_t j;
+ for (j=0; j < proto_list->count; j++)
{
- if ((result = [proto_list->list[i]
+ if ((result = [proto_list->list[j]
descriptionForClassMethod: aSel]))
return result;
}
#include "runtime.h"
#include "typedstream.h"
#include "encoding.h"
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
extern int fflush(FILE*);
{
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);
{
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);
{
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;
{
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;
__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))
__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))
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);
}
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);
}
{
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);
{
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);
}
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;
/* Setup the table. */
static void
-class_table_setup ()
+class_table_setup (void)
{
/* Start - nothing in the table. */
memset (class_table_array, 0, sizeof(class_node_ptr) * CLASS_TABLE_SIZE);
{
int res = 0;
- while (isdigit (*str))
+ while (isdigit ((unsigned char)*str))
res *= 10, res += (*str++ - '0');
return res;
case _C_ARY_B:
{
int len = atoi(type+1);
- while (isdigit(*++type));
+ while (isdigit((unsigned char)*++type));
return len*objc_aligned_size (type);
}
break;
int startByte, endByte;
position = atoi (type + 1);
- while (isdigit (*++type));
+ while (isdigit ((unsigned char)*++type));
size = atoi (type + 1);
startByte = position / BITS_PER_UNIT;
break;
case _C_ARY_B:
- while (isdigit(*++type)) /* do nothing */;
+ while (isdigit((unsigned char)*++type)) /* do nothing */;
return objc_alignof_type (type);
case _C_STRUCT_B:
case _C_ARY_B:
/* skip digits, typespec and closing ']' */
- while(isdigit(*++type));
+ while(isdigit((unsigned char)*++type));
type = objc_skip_typespec(type);
if (*type == _C_ARY_E)
return ++type;
case _C_BFLD:
/* The new encoding of bitfields is: b 'position' 'type' 'size' */
- while (isdigit (*++type)); /* skip position */
- while (isdigit (*++type)); /* skip type and size */
+ while (isdigit ((unsigned char)*++type)); /* skip position */
+ while (isdigit ((unsigned char)*++type)); /* skip type and size */
return type;
case _C_STRUCT_B:
objc_skip_offset (const char* type)
{
if (*type == '+') type++;
- while(isdigit(*++type));
+ while(isdigit((unsigned char)*++type));
return type;
}
register int desired_align = 0;
/* The following are used only if the field is a bitfield */
- register const char *bfld_type;
- register int bfld_type_size, bfld_type_align, bfld_field_size;
+ register const char *bfld_type = 0;
+ register int bfld_type_size, bfld_type_align = 0, bfld_field_size = 0;
/* The current type without the type qualifiers */
const char *type;
else {
/* Get the bitfield's type */
for (bfld_type = type + 1;
- isdigit(*bfld_type);
+ isdigit((unsigned char)*bfld_type);
bfld_type++)
/* do nothing */;
{
desired_align = 1;
/* Skip the bitfield's offset */
- for (bfld_type = type + 1; isdigit(*bfld_type); bfld_type++)
+ for (bfld_type = type + 1; isdigit((unsigned char)*bfld_type); bfld_type++)
/* do nothing */;
bfld_type_size = objc_sizeof_type (bfld_type) * BITS_PER_UNIT;
#else /* !OBJC_WITH_GC */
void
-__objc_generate_gc_type_description (Class class)
+__objc_generate_gc_type_description (Class class __attribute__ ((__unused__)))
{
}
-void class_ivar_set_gcinvisible (Class class,
- const char* ivarname,
- BOOL gc_invisible)
+void class_ivar_set_gcinvisible (Class class __attribute__ ((__unused__)),
+ const char* ivarname __attribute__ ((__unused__)),
+ BOOL gc_invisible __attribute__ ((__unused__)))
{
}
}
static void
-__objc_send_load (objc_class_tree *tree, int level)
+__objc_send_load (objc_class_tree *tree,
+ int level __attribute__ ((__unused__)))
{
static SEL load_sel = 0;
Class class = tree->class;
}
static void
-__objc_destroy_class_tree_node (objc_class_tree *tree, int level)
+__objc_destroy_class_tree_node (objc_class_tree *tree,
+ int level __attribute__ ((__unused__)))
{
objc_free (tree);
}
static void
__objc_init_protocols (struct objc_protocol_list* protos)
{
- int i;
+ size_t i;
static Class proto_class = 0;
if (! protos)
#include "runtime.h"
id
-nil_method(id receiver, SEL op, ...)
+nil_method(id receiver, SEL op __attribute__ ((__unused__)), ...)
{
return receiver;
}
it can be informed; for example, the GNUstep Base Library sets it
so it can implement the NSBecomingMultiThreaded notification.
*/
-typedef void (*objc_thread_callback)();
+typedef void (*objc_thread_callback)(void);
objc_thread_callback objc_set_thread_callback(objc_thread_callback func);
/* Backend initialization functions */
size_t num_indices = ((size-1)/BUCKET_SIZE)+1;
struct sbucket ** new_buckets;
#endif
- int counter;
+ size_t counter;
assert(size > 0);
#endif
- int counter;
+ size_t counter;
assert(newsize > 0);
/* Free a sparse array allocated with sarray_new */
void
-sarray_free(struct sarray* array) {
-
+sarray_free(struct sarray* array)
+{
#ifdef OBJC_SPARSE3
size_t old_max_index = (array->capacity-1)/INDEX_CAPACITY;
struct sindex ** old_indices;
size_t old_max_index = (array->capacity-1)/BUCKET_SIZE;
struct sbucket ** old_buckets;
#endif
- int counter = 0;
+ size_t counter = 0;
assert(array->ref_count != 0); /* Freed multiple times!!! */
{
if (*t1 == '+') t1++;
if (*t2 == '+') t2++;
- while (isdigit(*t1)) t1++;
- while (isdigit(*t2)) t2++;
+ while (isdigit((unsigned char)*t1)) t1++;
+ while (isdigit((unsigned char)*t2)) t2++;
/* xxx Remove these next two lines when qualifiers are put in
all selectors, not just Protocol selectors. */
t1 = objc_skip_type_qualifiers(t1);
dispatch table needs to be installed; thus it is called once
for each class, namely when the very first message is sent to it. */
static void
-__objc_init_install_dtable(id receiver, SEL op)
+__objc_init_install_dtable(id receiver, SEL op __attribute__ ((__unused__)))
{
/* This may happen, if the programmer has taken the address of a
method before the dtable was initialized... too bad for him! */