StepTalk framework: int->NSInteger transition

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@36657 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2013-05-26 15:35:06 +00:00
parent ba12bd3874
commit 7532ab371a
13 changed files with 86 additions and 61 deletions

View file

@ -1,3 +1,19 @@
2013-05-26 Wolfgang Lux <wolfgang.lux@gmail.com>
* Frameworks/StepTalk/NSInvocation+additions.h:
* Frameworks/StepTalk/NSInvocation+additions.m:
* Frameworks/StepTalk/NSNumber+additions.h:
* Frameworks/StepTalk/NSNumber+additions.m:
* Frameworks/StepTalk/STActor.m:
* Frameworks/StepTalk/STEnvironmentDescription.h:
* Frameworks/StepTalk/STEnvironmentDescription.m:
* Frameworks/StepTalk/STLanguageManager.m:
* Frameworks/StepTalk/STObjCRuntime.m:
* Frameworks/StepTalk/STScriptObject.m:
* Frameworks/StepTalk/STStructure.h:
* Frameworks/StepTalk/STStructure.m:
int->NSInteger transition
2013-04-06 Wolfgang Lux <wolfgang.lux@gmail.com>
* Frameworks/StepTalk/STActor.m (-setValue:forKey:): Fix bug where

View file

@ -34,8 +34,8 @@ id STObjectFromValueOfType(void *value, const char *type);
+ invocationWithTarget:(id)target selectorName:(NSString *)selectorName;
+ invocationWithTarget:(id)target selector:(SEL)selector;
- (void)setArgumentAsObject:(id)anObject atIndex:(int)anIndex;
- (id)getArgumentAsObjectAtIndex:(int)anIndex;
- (void)setArgumentAsObject:(id)anObject atIndex:(NSInteger)anIndex;
- (id)getArgumentAsObjectAtIndex:(NSInteger)anIndex;
- (id)returnValueAsObject;
@end

View file

@ -283,7 +283,7 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject)
return invocation;
}
- (void)setArgumentAsObject:(id)anObject atIndex:(int)anIndex
- (void)setArgumentAsObject:(id)anObject atIndex:(NSInteger)anIndex
{
const char *type;
NSUInteger size;
@ -300,7 +300,7 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject)
}
- (id)getArgumentAsObjectAtIndex:(int)anIndex
- (id)getArgumentAsObjectAtIndex:(NSInteger)anIndex
{
const char *type;
NSUInteger size;
@ -321,7 +321,7 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject)
- (id)returnValueAsObject
{
const char *type;
int returnLength;
NSUInteger returnLength;
void *value;
id returnObject = nil;
@ -331,7 +331,8 @@ void STGetValueOfTypeFromObject(void *value, const char *type, id anObject)
returnLength = [signature methodReturnLength];
NSDebugLLog(@"STSending",
@" return type '%s', buffer length %i",type,returnLength);
@" return type '%s', buffer length %lu",
type,(unsigned long)returnLength);
if(returnLength!=0)
{

View file

@ -32,7 +32,7 @@
- subtract:(NSNumber *)number;
- multiply:(NSNumber *)number;
- divide:(NSNumber *)number;
- (unsigned int)isLessThan:(NSNumber *)number;
- (BOOL)isLessThan:(NSNumber *)number;
- (BOOL)isGreatherThan:(NSNumber *)number;
- (BOOL)isLessOrEqualThan:(NSNumber *)number;
- (BOOL)isGreatherOrEqualThan:(NSNumber *)number;
@ -40,13 +40,13 @@
@interface NSNumber (STLogicOperations)
- (unsigned int)or:(NSNumber *)number;
- (unsigned int)and:(NSNumber *)number;
- (unsigned int)not;
- (NSUInteger)or:(NSNumber *)number;
- (NSUInteger)and:(NSNumber *)number;
- (NSUInteger)not;
@end
@interface NSNumber (STStructure)
- rangeWith:(int)length;
- rangeWith:(NSUInteger)length;
- pointWith:(float)y;
- sizeWith:(float)h;
@end

View file

@ -77,7 +77,7 @@
return [NSNumber numberWithDouble:(fmod([self doubleValue],
[number doubleValue]))];
}
- (unsigned int)isLessThan:(NSNumber *)number
- (BOOL)isLessThan:(NSNumber *)number
{
return ([self doubleValue] < [number doubleValue]);
}
@ -99,28 +99,29 @@
@implementation NSNumber (STLogicOperations)
- (unsigned int)or:(NSNumber *)number
- (NSUInteger)or:(NSNumber *)number
{
return ([self intValue] | [number intValue]);
return ([self integerValue] | [number integerValue]);
}
- (unsigned int)and:(NSNumber *)number
- (NSUInteger)and:(NSNumber *)number
{
return ([self intValue] & [number intValue]);
return ([self integerValue] & [number integerValue]);
}
- (unsigned int)not
- (NSUInteger)not
{
/* FIXME */
return ![self intValue];
return ![self integerValue];
}
@end
@implementation NSNumber (STStructure)
- rangeWith:(int)length
- rangeWith:(NSUInteger)length
{
return [STStructure structureWithRange:NSMakeRange([self intValue], length)];
NSRange r = NSMakeRange([self unsignedIntegerValue], length);
return [STStructure structureWithRange:r];
}
- pointWith:(float)y
{

View file

@ -169,8 +169,8 @@ some other, more clever mechanism. */
NSString *methodName = NSStringFromSelector([invocation selector]);
NSMutableArray *args;
id arg;
int index;
int count;
NSUInteger index;
NSUInteger count;
id retval = nil;
method = [methodDictionary objectForKey:methodName];

View file

@ -47,7 +47,7 @@ enum
NSMutableArray *frameworks;
NSMutableArray *finders;
int restriction;
NSInteger restriction;
}
+ (NSString *)defaultDescriptionName;

View file

@ -159,7 +159,7 @@ static NSDictionary *dictForDescriptionWithName(NSString *defName)
{
NSAutoreleasePool *pool;
NSString *str;
BOOL saveFlag = restriction;
NSInteger saveFlag = restriction;
if(!def)
{
@ -417,8 +417,8 @@ static NSDictionary *dictForDescriptionWithName(NSString *defName)
flag = [def objectForKey:@"Restriction"];
NSDebugLLog(@"STEnvironment", @"Class %@ restriction %@ (default %i)",
className, flag, restriction);
NSDebugLLog(@"STEnvironment", @"Class %@ restriction %@ (default %li)",
className, flag, (long)restriction);
if(flag)
{

View file

@ -148,7 +148,7 @@ static STLanguageManager *defaultManager = nil;
NSDictionary *langDict;
NSEnumerator *enumerator;
NSString *language;
int foundLanguages = 0;
NSUInteger foundLanguages = 0;
/*
StepTalkLanguages = { Smalltalk = { EngineClass = SmalltalkEngine} };

View file

@ -58,7 +58,7 @@ static const char *selector_types[] =
NSMutableDictionary *STAllObjectiveCClasses(void)
{
int i, numClasses;
NSInteger i, numClasses;
NSString *name;
NSMutableDictionary *dict;
Class *classes;
@ -68,7 +68,7 @@ NSMutableDictionary *STAllObjectiveCClasses(void)
numClasses = objc_getClassList(NULL, 0);
classes = (Class *)NSZoneMalloc(STMallocZone, numClasses * sizeof(Class));
numClasses = objc_getClassList(classes, numClasses);
// NSLog(@"%i Objective-C classes found", numClasses);
// NSLog(@"%li Objective-C classes found", (unsigned long)numClasses);
for(i = 0; i < numClasses; i++)
{
@ -120,7 +120,7 @@ static const char *STSelectorTypes(const char *name)
{
const char *ptr;
const char *types = 0;
unsigned argc = 0;
NSUInteger argc = 0;
for (ptr = name; *ptr; ptr++)
if (*ptr == ':')
@ -140,8 +140,8 @@ static const char *STSelectorTypes(const char *name)
0, 0, 0, 0, 0x46, 0x3d, 0, 0x0f,
0x80, 0, 0, 0x08, 0, 0, 0, 0x0a
};
unsigned ofs = (unsigned)*ptr >> 3;
unsigned mask = *ptr & 7;
NSUInteger ofs = (NSUInteger)*ptr >> 3;
NSUInteger mask = *ptr & 7;
if (!(binaryCharset[ofs] & mask))
break;
}
@ -153,8 +153,8 @@ static const char *STSelectorTypes(const char *name)
{
NSDebugLLog(@"STSending",
@"registering selector '%s' "
@"with %i arguments, types:'%s'",
name,argc,selector_types[argc]);
@"with %lu arguments, types:'%s'",
name,(unsigned long)argc,selector_types[argc]);
types = selector_types[argc];
}
@ -237,10 +237,10 @@ NSMethodSignature *STMethodSignatureForSelector(SEL sel)
}
static NSArray *selectors_from_list(Method *methods, unsigned int numMethods)
static NSArray *selectors_from_list(Method *methods, NSUInteger numMethods)
{
NSMutableArray *array = [NSMutableArray array];
unsigned int i;
NSUInteger i;
for (i = 0; i < numMethods; i++)
{
@ -253,7 +253,7 @@ static NSArray *selectors_from_list(Method *methods, unsigned int numMethods)
NSArray *STAllObjectiveCSelectors(void)
{
int i, numClasses;
NSInteger i, numClasses;
unsigned int numMethods;
NSMutableArray *array;
NSArray *selectors;

View file

@ -120,8 +120,8 @@ some other, more clever mechanism. */
NSString *methodName = NSStringFromSelector([invocation selector]);
NSMutableArray *args;
id arg;
int index;
int count;
NSUInteger index;
NSUInteger count;
id retval = nil;
method = [methodDictionary objectForKey:methodName];

View file

@ -57,11 +57,12 @@
- (NSRect)rectValue;
- (NSSize)sizeValue;
- valueAtIndex:(unsigned)index;
- (void)setValue:anObject atIndex:(unsigned)index;
- valueAtIndex:(NSUInteger)index;
- (void)setValue:anObject atIndex:(NSUInteger)index;
- (int)intValueAtIndex:(unsigned)index;
- (float)floatValueAtIndex:(unsigned)index;
- (int)intValueAtIndex:(NSUInteger)index;
- (NSInteger)integerValueAtIndex:(NSUInteger)index;
- (float)floatValueAtIndex:(NSUInteger)index;
- extent:(NSSize)size;
- corner:(NSPoint)corner;
@ -69,9 +70,9 @@
/*
@interface STRange:STStructure
- rangeWithLocation:(int)loc length:(int)length;
- (int)location;
- (int)length;
- rangeWithLocation:(NSUInteger)loc length:(NSUInteger)length;
- (NSUInteger)location;
- (NSUInteger)length;
@end
@interface STPoint:STStructure

View file

@ -166,7 +166,7 @@
{
return name;
}
- (const char *)typeOfFieldAtIndex:(unsigned)index
- (const char *)typeOfFieldAtIndex:(NSUInteger)index
{
const char *type = [structType cString];
@ -186,7 +186,7 @@
- (NSRange)rangeValue
{
/* FIXME: do some checking */
return NSMakeRange([self intValueAtIndex:0],[self intValueAtIndex:1]);
return NSMakeRange([self integerValueAtIndex:0],[self integerValueAtIndex:1]);
}
- (NSPoint)pointValue
@ -213,44 +213,50 @@
return rect;
}
- valueAtIndex:(unsigned)index
- valueAtIndex:(NSUInteger)index
{
return [fields objectAtIndex:index];
}
- (void)setValue:anObject atIndex:(unsigned)index
- (void)setValue:anObject atIndex:(NSUInteger)index
{
[fields replaceObjectAtIndex:index withObject:anObject];
}
- (int)intValueAtIndex:(unsigned)index
- (int)intValueAtIndex:(NSUInteger)index
{
return (int)[[fields objectAtIndex:index] intValue];
return [[fields objectAtIndex:index] intValue];
}
- (float)floatValueAtIndex:(unsigned)index
- (NSInteger)integerValueAtIndex:(NSUInteger)index
{
return [[fields objectAtIndex:index] integerValue];
}
- (float)floatValueAtIndex:(NSUInteger)index
{
return (float)[[fields objectAtIndex:index] floatValue];
}
/* NSRange */
- (int)location
- (NSUInteger)location
{
return [[fields objectAtIndex:0] intValue];
return [[fields objectAtIndex:0] integerValue];
}
- (int)length
- (NSUInteger)length
{
return [[fields objectAtIndex:1] intValue];
return [[fields objectAtIndex:1] integerValue];
}
- (void)setLocation:(int)location
- (void)setLocation:(NSUInteger)location
{
[fields replaceObjectAtIndex:0 withObject: [NSNumber numberWithInt:location]];
NSNumber *n = [NSNumber numberWithUnsignedInteger:location];
[fields replaceObjectAtIndex:0 withObject:n];
}
- (void)setLength:(int)length
- (void)setLength:(NSUInteger)length
{
[fields replaceObjectAtIndex:1 withObject: [NSNumber numberWithInt:length]];
NSNumber *n = [NSNumber numberWithUnsignedInteger:length];
[fields replaceObjectAtIndex:1 withObject: n];
}
/* NSPoint */