]> Dogcows Code - chaz/thecheat/blobdiff - Variable.m
Remove support of Mac OS X 10.3 and earlier system, change codes for Mac OS X 10.7.
[chaz/thecheat] / Variable.m
index b3d21422eb025d02d827434d52781bceb115bc0d..4630ad02c614ceb44d34336e499a212a2c78d78e 100644 (file)
@@ -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.
        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;
        }
        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 ) {
                }
                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;
 }
This page took 0.021788 seconds and 4 git commands to generate.