summaryrefslogtreecommitdiff
path: root/libobjc/encoding.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/encoding.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/encoding.c')
-rw-r--r--libobjc/encoding.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/libobjc/encoding.c b/libobjc/encoding.c
index b30626f4135..956ca16e76d 100644
--- a/libobjc/encoding.c
+++ b/libobjc/encoding.c
@@ -87,7 +87,7 @@ atoi (const char* str)
{
int res = 0;
- while (isdigit (*str))
+ while (isdigit ((unsigned char)*str))
res *= 10, res += (*str++ - '0');
return res;
@@ -180,7 +180,7 @@ objc_sizeof_type (const char* type)
case _C_ARY_B:
{
int len = atoi(type+1);
- while (isdigit(*++type));
+ while (isdigit((unsigned char)*++type));
return len*objc_aligned_size (type);
}
break;
@@ -192,7 +192,7 @@ objc_sizeof_type (const char* type)
int startByte, endByte;
position = atoi (type + 1);
- while (isdigit (*++type));
+ while (isdigit ((unsigned char)*++type));
size = atoi (type + 1);
startByte = position / BITS_PER_UNIT;
@@ -321,7 +321,7 @@ objc_alignof_type(const char* type)
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:
@@ -487,7 +487,7 @@ objc_skip_typespec (const char* type)
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;
@@ -499,8 +499,8 @@ objc_skip_typespec (const char* 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:
@@ -538,7 +538,7 @@ inline const char*
objc_skip_offset (const char* type)
{
if (*type == '+') type++;
- while(isdigit(*++type));
+ while(isdigit((unsigned char)*++type));
return type;
}
@@ -753,8 +753,8 @@ objc_layout_structure_next_member (struct objc_struct_layout *layout)
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;
@@ -769,7 +769,7 @@ objc_layout_structure_next_member (struct objc_struct_layout *layout)
else {
/* Get the bitfield's type */
for (bfld_type = type + 1;
- isdigit(*bfld_type);
+ isdigit((unsigned char)*bfld_type);
bfld_type++)
/* do nothing */;
@@ -798,7 +798,7 @@ objc_layout_structure_next_member (struct objc_struct_layout *layout)
{
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;