X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=Variable.m;h=4630ad02c614ceb44d34336e499a212a2c78d78e;hb=refs%2Fheads%2Fyishen;hp=b3d21422eb025d02d827434d52781bceb115bc0d;hpb=556707a7a26ac2dc4d10eff8e4b2abcc893cfce3;p=chaz%2Fthecheat diff --git a/Variable.m b/Variable.m index b3d2142..4630ad0 100644 --- a/Variable.m +++ b/Variable.m @@ -1,9 +1,9 @@ /* * The Cheat - The legendary universal game trainer for Mac OS X. - * http://www.dogcows.com/chaz/wiki/TheCheat + * http://www.brokenzipper.com/trac/wiki/TheCheat * - * Copyright (c) 2003-2010, Charles McGarvey et al. + * Copyright (c) 2003-2011, Charles McGarvey et al. * * Distributable under the terms and conditions of the 2-clause BSD * license; see the file COPYING for the legal text of the license. @@ -274,11 +274,7 @@ NSScanner *scanner = [NSScanner scannerWithString:string]; TCAddress address; -#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED if ( [scanner scanHexLongLong:(unsigned long long *)(&address)] ) { -#else - if ( [scanner scanHexInt:(unsigned *)(&address)] ) { -#endif [self setAddress:address]; return YES; } @@ -324,7 +320,7 @@ switch ( _type ) { case TCDouble: return [NSString stringWithFormat:@"%.1lf", *(double *)[self value]]; case TCFloat: return [NSString stringWithFormat:@"%.1f", *(float *)[self value]]; - case TCString: return [NSString stringWithCString:[self value] length:[self valueSize]]; + case TCString: return [[[NSString alloc] initWithBytes:[self value] length:[self valueSize] encoding:NSUTF8StringEncoding] autorelease]; } if ( _integerSign == TCUnsigned ) { switch ( _type ) { @@ -394,7 +390,7 @@ } case TCString: { - char *str = (char *)[string lossyCString]; + char *str = (char *)[string cStringUsingEncoding:NSUTF8StringEncoding]; unsigned len = strlen( str ); [self setValue:str size:len]; break; @@ -474,21 +470,13 @@ void bigEndianValue(void *buffer, Variable *variable) _enabled = enabled; } - -#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED - (NSInteger)tag -#else -- (int)tag -#endif { return _tag; } -#if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED + - (void)setTag:(NSInteger)tag -#else -- (void)setTag:(int)tag -#endif { _tag = tag; }