info2 = (void*)(mth->method_name);
}
}
- if (cbuf) free(cbuf);
+ if (cbuf != NULL) free(cbuf);
}
// Lookup ivar name
- if (!fptr) {
+ if (fptr == NULL) {
Class class = [instance class];
unsigned clen;
char *cbuf;
[key getCString:cbuf]; cbuf[clen] = '\0';
ckey = cbuf;
- while (class) {
+ while (class != Nil) {
for (i = 0; class->ivars && i < class->ivars->ivar_count; i++) {
if (!Strcmp(ckey, class->ivars->ivar_list[i].ivar_name)) {
switch(*objc_skip_type_qualifiers(class->ivars->ivar_list[i].ivar_type)) {
break;
}
if (fptr) {
- info2 = (void*)(class->ivars->ivar_list[i].ivar_offset);
+ info2 = (void *)(unsigned long)
+ (class->ivars->ivar_list[i].ivar_offset);
break;
}
}
}
class = class->super_class;
}
- if (cbuf) free(cbuf);
+ if (cbuf != NULL) free(cbuf);
}
// Make binding and insert into map
fptr = (void (*)(void*, void*, id, id))doubleIvarSetFunc;
break;
}
- if (fptr) {
- info2 = (void*)(class->ivars->ivar_list[i].ivar_offset);
+ if (fptr != NULL) {
+ info2 = (void *)(unsigned long)
+ (class->ivars->ivar_list[i].ivar_offset);
break;
}
}
*/
static unsigned keyValueMapHash(NSMapTable* table, KeyValueMethod* map) {
- return [map->key hash] + (((int)(map->class)) >> 4);
+ return [map->key hash] + (((unsigned long)(map->class)) >> 4L);
}
static BOOL keyValueMapCompare(NSMapTable* table,
key = (start < i)
? [[StringClass alloc] initWithCString:(const char *)&(buf[start])
length:(i - start)]
- : (NSString *)@"";
+ : (id)@"";
value = [value valueForKey:key];
[key release]; key = nil;
/* ACCESS to keys of id type. */
-static id idMethodGetFunc(void* info1, void* info2, id self) {
+static id idMethodGetFunc(void *info1, void *info2, id self) {
id (*fptr)(id, SEL) = (id(*)(id, SEL))info1;
id val = fptr(self, (SEL)info2);
return val;
}
-static id idIvarGetFunc(void* info1, void* info2, id self) {
- id* ptr = (id*)((char*)self + (int)info2);
+static id idIvarGetFunc(void *info1, void *info2, id self) {
+ id *ptr = (id *)((char *)self + (unsigned long)info2);
return *ptr;
}
static void idIvarSetFunc(void* info1, void* info2, id self, id val)
{
- id* ptr = (id*)((char*)self + (int)info2);
+ id *ptr = (id *)((char*)self + (unsigned long)info2);
ASSIGN(*ptr, val);
}
static id charIvarGetFunc(void* info1, void* info2, id self)
{
- char* ptr = (char*)((char*)self + (int)info2);
+ char *ptr = (char *)((char *)self + (unsigned long)info2);
return [NumberClass numberWithChar:*ptr];
}
-static void charMethodSetFunc(void* info1, void* info2, id self, id val)
+static void charMethodSetFunc(void *info1, void *info2, id self, id val)
{
void (*fptr)(id, SEL, char) = (void(*)(id, SEL, char))info1;
fptr(self, (SEL)info2, [val charValue]);
}
-static void charIvarSetFunc(void* info1, void* info2, id self, id val)
+static void charIvarSetFunc(void *info1, void *info2, id self, id val)
{
- char* ptr = (char*)((char*)self + (int)info2);
+ char *ptr = (char *)((char *)self + (unsigned long)info2);
*ptr = [val charValue];
}
static id unsignedCharIvarGetFunc(void* info1, void* info2, id self)
{
- unsigned char* ptr = (unsigned char*)((char*)self + (int)info2);
+ unsigned char *ptr = (unsigned char *)((char *)self + (unsigned long)info2);
return [NumberClass numberWithUnsignedChar:*ptr];
}
static void unsignedCharIvarSetFunc(void* info1, void* info2, id self, id val)
{
- unsigned char* ptr = (unsigned char*)((char*)self + (int)info2);
+ unsigned char *ptr = (unsigned char *)((char *)self + (unsigned long)info2);
*ptr = [val unsignedCharValue];
}
static id shortIvarGetFunc(void* info1, void* info2, id self)
{
- short* ptr = (short*)((char*)self + (int)info2);
+ short *ptr = (short *)((char *)self + (unsigned long)info2);
return [NumberClass numberWithShort:*ptr];
}
static void shortIvarSetFunc(void* info1, void* info2, id self, id val)
{
- short* ptr = (short*)((char*)self + (int)info2);
+ short *ptr = (short *)((char *)self + (unsigned long)info2);
*ptr = [val shortValue];
}
static id unsignedShortIvarGetFunc(void* info1, void* info2, id self)
{
- unsigned short* ptr = (unsigned short*)((char*)self + (int)info2);
+ unsigned short *ptr = (unsigned short*)((char *)self + (unsigned long)info2);
return [NumberClass numberWithUnsignedShort:*ptr];
}
static void unsignedShortIvarSetFunc(void* info1, void* info2, id self, id val)
{
- unsigned short* ptr = (unsigned short*)((char*)self + (int)info2);
+ unsigned short *ptr = (unsigned short*)((char *)self + (unsigned long)info2);
*ptr = [val unsignedShortValue];
}
return [NumberClass numberWithInt:val];
}
-static id intIvarGetFunc(void* info1, void* info2, id self)
+static id intIvarGetFunc(void *info1, void *info2, id self)
{
- int* ptr = (int*)((char*)self + (int)info2);
+ int *ptr = (int *)((char *)self + (unsigned long)info2);
return [NumberClass numberWithInt:*ptr];
}
static void intIvarSetFunc(void* info1, void* info2, id self, id val)
{
- int* ptr = (int*)((char*)self + (int)info2);
+ int *ptr = (int *)((char *)self + (unsigned long)info2);
*ptr = [val intValue];
}
static id unsignedIntIvarGetFunc(void* info1, void* info2, id self)
{
- unsigned int* ptr = (unsigned int*)((char*)self + (int)info2);
+ unsigned int* ptr = (unsigned int*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithUnsignedInt:*ptr];
}
static void unsignedIntIvarSetFunc(void* info1, void* info2, id self, id val)
{
- unsigned int* ptr = (unsigned int*)((char*)self + (int)info2);
+ unsigned int* ptr = (unsigned int*)((char*)self + (unsigned long)info2);
*ptr = [val unsignedIntValue];
}
static id longIvarGetFunc(void* info1, void* info2, id self)
{
- long* ptr = (long*)((char*)self + (int)info2);
+ long* ptr = (long*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithLong:*ptr];
}
static void longIvarSetFunc(void* info1, void* info2, id self, id val)
{
- long* ptr = (long*)((char*)self + (int)info2);
+ long* ptr = (long*)((char*)self + (unsigned long)info2);
*ptr = [val longValue];
}
}
static id unsignedLongIvarGetFunc(void* info1, void* info2, id self) {
- unsigned long* ptr = (unsigned long*)((char*)self + (int)info2);
+ unsigned long* ptr = (unsigned long*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithUnsignedLong:*ptr];
}
}
static void unsignedLongIvarSetFunc(void* info1, void* info2, id self, id val) {
- unsigned long* ptr = (unsigned long*)((char*)self + (int)info2);
+ unsigned long* ptr = (unsigned long*)((char*)self + (unsigned long)info2);
*ptr = [val unsignedLongValue];
}
}
static id longLongIvarGetFunc(void* info1, void* info2, id self) {
- long long* ptr = (long long*)((char*)self + (int)info2);
+ long long* ptr = (long long*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithLongLong:*ptr];
}
}
static void longLongIvarSetFunc(void* info1, void* info2, id self, id val) {
- long long* ptr = (long long*)((char*)self + (int)info2);
+ long long* ptr = (long long*)((char*)self + (unsigned long)info2);
*ptr = [val longLongValue];
}
}
static id unsignedLongLongIvarGetFunc(void* info1, void* info2, id self) {
- unsigned long long* ptr = (unsigned long long*)((char*)self + (int)info2);
+ unsigned long long* ptr = (unsigned long long*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithUnsignedLongLong:*ptr];
}
}
static void unsignedLongLongIvarSetFunc(void* info1, void* info2, id self, id val) {
- unsigned long long* ptr = (unsigned long long*)((char*)self + (int)info2);
+ unsigned long long* ptr = (unsigned long long*)((char*)self + (unsigned long)info2);
*ptr = [val unsignedLongLongValue];
}
}
static id floatIvarGetFunc(void* info1, void* info2, id self) {
- float* ptr = (float*)((char*)self + (int)info2);
+ float* ptr = (float*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithFloat:*ptr];
}
}
static void floatIvarSetFunc(void* info1, void* info2, id self, id val) {
- float* ptr = (float*)((char*)self + (int)info2);
+ float* ptr = (float*)((char*)self + (unsigned long)info2);
*ptr = [val floatValue];
}
}
static id doubleIvarGetFunc(void* info1, void* info2, id self) {
- double* ptr = (double*)((char*)self + (int)info2);
+ double* ptr = (double*)((char*)self + (unsigned long)info2);
return [NumberClass numberWithDouble:*ptr];
}
}
static void doubleIvarSetFunc(void* info1, void* info2, id self, id val) {
- double* ptr = (double*)((char*)self + (int)info2);
+ double* ptr = (double*)((char*)self + (unsigned long)info2);
*ptr = [val doubleValue];
}