Warning different width?
Warning different width?
- Subject: Warning different width?
- From: Hans van der Meer <email@hidden>
- Date: Mon, 24 Dec 2007 12:19:37 +0100
I made a category on NSNumber for working with unichar's:
.... NSHMNumberAdditions.h ....
#import <Foundation/Foundation.h>
/*!
@method numberWithUnichar:
@abstract ....
*/
+ (NSNumber *) numberWithUnichar: (unichar) character;
.... NSHMNumberAdditions.c ....
#import "NSHMNumberAdditions.h"
@implementation NSNumber (NSHMNumberAdditions)
+ (NSNumber *) numberWithUnichar: (unichar) character; {
return [NSNumber numberWithUnsignedShort: character];
}
....
But then XCode gives me the following WARNING on the line with the
return:
warning: passing argument 1 of 'numberWithUnsignedShort:' with
different width due to prototype
In the documentation I read for NSNumber:
Creates and returns an NSNumber object containing a given value,
treating it as an unsigned short.
+ (NSNumber *)numberWithUnsignedShort:(unsigned short)value
while in NSString.h (included through Foundation.h) the unichar is
defined by:
typedef unsigned short unichar;
It escapes me what is wrong here. Do I miss something or is perhaps
the compiler overcautious here?
Hans van der Meer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden