Revision: 4170
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4170&view=rev
Author:   hofman
Date:     2008-07-09 17:10:25 -0700 (Wed, 09 Jul 2008)

Log Message:
-----------
Improve 64-bit safety. Replace ints with NSInteger and unsigned ints with 
NSUInteger. Check for UINT_MAX when checking for NSNotFound, as unarchiving 
could return the former. Don't archive NSNotFound, replace by 0.

Modified Paths:
--------------
    trunk/SkimNotes/Configurations/SkimNotes-Framework.xcconfig
    trunk/SkimNotes/Configurations/SkimNotes-Tool.xcconfig
    trunk/SkimNotes/NSFileManager_SKNExtensions.m
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
    trunk/SkimNotes/PDFDocument_SKNExtensions.m
    trunk/SkimNotes/SKNAgentListener.h
    trunk/SkimNotes/SKNExtendedAttributeManager.m
    trunk/SkimNotes/SkimNotes.rtf
    trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj
    trunk/SkimNotes/SkimNotes_Prefix.pch
    trunk/SkimNotes/skimnotes.m

Added Paths:
-----------
    trunk/SkimNotes/SkimNotes_Tool_Prefix.pch

Modified: trunk/SkimNotes/Configurations/SkimNotes-Framework.xcconfig
===================================================================
--- trunk/SkimNotes/Configurations/SkimNotes-Framework.xcconfig 2008-07-09 
17:07:14 UTC (rev 4169)
+++ trunk/SkimNotes/Configurations/SkimNotes-Framework.xcconfig 2008-07-10 
00:10:25 UTC (rev 4170)
@@ -1,12 +1,15 @@
 // Framework only
 
 INSTALL_PATH = @executable_path/../Frameworks
+
 DYLIB_COMPATIBILITY_VERSION = 1.1
 DYLIB_CURRENT_VERSION = 1.1
 LD_DYLIB_INSTALL_NAME = @executable_path/../Frameworks/$(EXECUTABLE_PATH)
+
 FRAMEWORK_VERSION = A
 INFOPLIST_FILE = Info.plist
 PRODUCT_NAME = SkimNotes
 WRAPPER_EXTENSION = framework
+
 GCC_PRECOMPILE_PREFIX_HEADER = YES
 GCC_PREFIX_HEADER = SkimNotes_Prefix.pch

Modified: trunk/SkimNotes/Configurations/SkimNotes-Tool.xcconfig
===================================================================
--- trunk/SkimNotes/Configurations/SkimNotes-Tool.xcconfig      2008-07-09 
17:07:14 UTC (rev 4169)
+++ trunk/SkimNotes/Configurations/SkimNotes-Tool.xcconfig      2008-07-10 
00:10:25 UTC (rev 4170)
@@ -2,3 +2,6 @@
 
 INSTALL_PATH = /usr/local/bin
 PRODUCT_NAME = skimnotes
+
+GCC_PRECOMPILE_PREFIX_HEADER = YES
+GCC_PREFIX_HEADER = SkimNotes_Tool_Prefix.pch

Modified: trunk/SkimNotes/NSFileManager_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/NSFileManager_SKNExtensions.m       2008-07-09 17:07:14 UTC 
(rev 4169)
+++ trunk/SkimNotes/NSFileManager_SKNExtensions.m       2008-07-10 00:10:25 UTC 
(rev 4170)
@@ -41,10 +41,6 @@
 #import <SkimNotes/PDFAnnotation_SKNExtensions.h>
 #import <SkimNotes/SKNPDFAnnotationNote.h>
 
-#ifndef SKNLocalizedString
-#define SKNLocalizedString(key, comment) key
-#endif
-
 #define SKIM_NOTES_KEY @"net_sourceforge_skim-app_notes"
 #define SKIM_RTF_NOTES_KEY @"net_sourceforge_skim-app_rtf_notes"
 #define SKIM_TEXT_NOTES_KEY @"net_sourceforge_skim-app_text_notes"
@@ -58,10 +54,13 @@
     
     while (dict = [dictEnum nextObject]) {
         NSString *type = [dict objectForKey:SKNPDFAnnotationTypeKey];
-        NSUInteger pageIndex = SKNUnsignedIntegerValue([dict 
objectForKey:SKNPDFAnnotationPageIndexKey]);
+        NSUInteger pageIndex = [[dict 
objectForKey:SKNPDFAnnotationPageIndexKey] unsignedIntValue];
         NSString *string = [dict objectForKey:SKNPDFAnnotationTypeKey];
         NSAttributedString *text = [dict objectForKey:SKNPDFAnnotationTextKey];
         
+        if (pageIndex == NSNotFound || pageIndex == UINT_MAX)
+            pageIndex = 0;
+        
         [textString appendFormat:@"* %@, page %lu\n\n", type, (long)pageIndex 
+ 1];
         if ([string length]) {
             [textString appendString:string];
@@ -82,10 +81,13 @@
     
     while (dict = [dictEnum nextObject]) {
         NSString *type = [dict objectForKey:SKNPDFAnnotationTypeKey];
-        NSUInteger pageIndex = SKNUnsignedIntegerValue([dict 
objectForKey:SKNPDFAnnotationPageIndexKey]);
+        NSUInteger pageIndex = [[dict 
objectForKey:SKNPDFAnnotationPageIndexKey] unsignedIntValue];
         NSString *string = [dict objectForKey:SKNPDFAnnotationTypeKey];
         NSAttributedString *text = [dict objectForKey:SKNPDFAnnotationTextKey];
         
+        if (pageIndex == NSNotFound || pageIndex == UINT_MAX)
+            pageIndex = 0;
+        
         [attrString replaceCharactersInRange:NSMakeRange([attrString length], 
0) withString:[NSString stringWithFormat:@"* %@, page %lu\n\n", type, 
(long)pageIndex + 1]];
         if ([string length]) {
             [attrString replaceCharactersInRange:NSMakeRange([attrString 
length], 0) withString:string];

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2008-07-09 17:07:14 UTC 
(rev 4169)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2008-07-10 00:10:25 UTC 
(rev 4170)
@@ -214,7 +214,7 @@
     @discussion This optional method can be implemented in another category to 
provide a default color for Skim notes that have no color set in the properties 
dictionary.  This method is not implemented by default.
     @result     The default color for an annotation with the passed in markup 
style.
 */
-+ (NSColor *)defaultSkimNoteColorForMarkupType:(PDFMarkupType)markupType;
++ (NSColor *)defaultSkimNoteColorForMarkupType:(int)markupType;
 @end
 
 #pragma mark -

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2008-07-09 17:07:14 UTC 
(rev 4169)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2008-07-10 00:10:25 UTC 
(rev 4170)
@@ -202,7 +202,7 @@
     [dict setValue:[self string] forKey:SKNPDFAnnotationContentsKey];
     [dict setValue:[self color] forKey:SKNPDFAnnotationColorKey];
     [dict setValue:NSStringFromRect([self bounds]) 
forKey:SKNPDFAnnotationBoundsKey];
-    [dict setValue:SKNNumberWithUnsignedInteger(pageIndex) 
forKey:SKNPDFAnnotationPageIndexKey];
+    [dict setValue:[NSNumber numberWithUnsignedInt:pageIndex == NSNotFound ? 0 
: pageIndex] forKey:SKNPDFAnnotationPageIndexKey];
     if ([self border]) {
         [dict setValue:[NSNumber numberWithFloat:[[self border] lineWidth]] 
forKey:SKNPDFAnnotationLineWidthKey];
         [dict setValue:[NSNumber numberWithInt:[[self border] style]] 
forKey:SKNPDFAnnotationBorderStyleKey];
@@ -358,7 +358,7 @@
         Class stringClass = [NSString class];
         NSString *type = [dict objectForKey:SKNPDFAnnotationTypeKey];
         if ([type isKindOfClass:stringClass]) {
-            PDFMarkupType markupType = kPDFMarkupTypeHighlight;
+            NSInteger markupType = kPDFMarkupTypeHighlight;
             if ([type isEqualToString:SKNUnderlineString])
                 markupType = kPDFMarkupTypeUnderline;
             else if ([type isKindOfClass:stringClass] && [type 
isEqualToString:SKNStrikeOutString])

Modified: trunk/SkimNotes/PDFDocument_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFDocument_SKNExtensions.m 2008-07-09 17:07:14 UTC (rev 
4169)
+++ trunk/SkimNotes/PDFDocument_SKNExtensions.m 2008-07-10 00:10:25 UTC (rev 
4170)
@@ -73,11 +73,13 @@
     NSDictionary *dict;
     NSMutableArray *notes = [NSMutableArray array];
     
+    if ([self pageCount] == 0) return nil;
+    
     // create new annotations from the dictionary and add them to their page 
and to the document
     while (dict = [e nextObject]) {
-        NSUInteger pageIndex = SKNUnsignedIntegerValue([dict 
objectForKey:SKNPDFAnnotationPageIndexKey]);
+        NSUInteger pageIndex = [[dict 
objectForKey:SKNPDFAnnotationPageIndexKey] unsignedIntValue];
         if (annotation = [[PDFAnnotation alloc] 
initSkimNoteWithProperties:dict]) {
-            if (pageIndex == NSNotFound)
+            if (pageIndex == NSNotFound || pageIndex == UINT_MAX)
                 pageIndex = 0;
             else if (pageIndex >= [self pageCount])
                 pageIndex = [self pageCount] - 1;

Modified: trunk/SkimNotes/SKNAgentListener.h
===================================================================
--- trunk/SkimNotes/SKNAgentListener.h  2008-07-09 17:07:14 UTC (rev 4169)
+++ trunk/SkimNotes/SKNAgentListener.h  2008-07-10 00:10:25 UTC (rev 4170)
@@ -37,19 +37,6 @@
 
 #import <Cocoa/Cocoa.h>
 
-#ifndef NSINTEGER_DEFINED
-    #ifdef NS_BUILD_32_LIKE_64
-        typedef long NSInteger;
-        typedef unsigned long NSUInteger;
-    #else
-        typedef int NSInteger;
-        typedef unsigned int NSUInteger;
-    #endif
-    #define NSIntegerMax    LONG_MAX
-    #define NSIntegerMin    LONG_MIN
-    #define NSUIntegerMax   ULONG_MAX
-    #define NSINTEGER_DEFINED 1
-#endif
 
 @interface SKNAgentListener : NSObject {
     NSConnection *connection;

Modified: trunk/SkimNotes/SKNExtendedAttributeManager.m
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.m       2008-07-09 17:07:14 UTC 
(rev 4169)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.m       2008-07-10 00:10:25 UTC 
(rev 4170)
@@ -32,10 +32,6 @@
 #include <sys/xattr.h>
 #import "bzlib.h"
 
-#ifndef SKNLocalizedString
-#define SKNLocalizedString(key, comment) key
-#endif
-
 #define MAX_XATTR_LENGTH        2048
 #define UNIQUE_VALUE            [[NSProcessInfo processInfo] 
globallyUniqueString]
 #define PREFIX                  @"net_sourceforge_skim-app"
@@ -49,7 +45,7 @@
 - (BOOL)isBzipData:(NSData *)data;
 - (BOOL)isPlistData:(NSData *)data;
 // private method to print error messages
-- (NSError *)xattrError:(int)err forPath:(NSString *)path;
+- (NSError *)xattrError:(NSInteger)err forPath:(NSString *)path;
 @end
 
 
@@ -145,7 +141,7 @@
         return nil;
     }
     
-    unsigned int idx, start = 0;
+    NSUInteger idx, start = 0;
 
     NSString *attribute = nil;
     NSMutableArray *attrs = [NSMutableArray array];
@@ -243,7 +239,7 @@
     if (plist && [plist respondsToSelector:@selector(objectForKey:)] && 
[[plist objectForKey:wrapperKey] boolValue]) {
         
         NSString *uniqueValue = [plist objectForKey:uniqueKey];
-        unsigned int i, numberOfFragments = [[plist objectForKey:fragmentsKey] 
unsignedIntValue];
+        NSUInteger i, numberOfFragments = [[plist objectForKey:fragmentsKey] 
unsignedIntValue];
         NSString *name;
 
         NSMutableData *buffer = [NSMutableData data];
@@ -325,7 +321,7 @@
         
         // this will be a unique identifier for the set of keys we're about to 
write (appending a counter to the UUID)
         NSString *uniqueValue = [namePrefix 
stringByAppendingString:UNIQUE_VALUE];
-        unsigned int numberOfFragments = ([value length] / MAX_XATTR_LENGTH) + 
([value length] % MAX_XATTR_LENGTH ? 1 : 0);
+        NSUInteger numberOfFragments = ([value length] / MAX_XATTR_LENGTH) + 
([value length] % MAX_XATTR_LENGTH ? 1 : 0);
         NSDictionary *wrapper = [NSDictionary 
dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], wrapperKey, 
uniqueValue, uniqueKey, [NSNumber numberWithUnsignedInt:numberOfFragments], 
fragmentsKey, nil];
         NSData *wrapperData = [NSPropertyListSerialization 
dataFromPropertyList:wrapper format:NSPropertyListBinaryFormat_v1_0 
errorDescription:NULL];
         NSParameterAssert([wrapperData length] < MAX_XATTR_LENGTH && 
[wrapperData length] > 0);
@@ -338,14 +334,14 @@
         
         // now split the original data value into multiple segments
         NSString *name;
-        unsigned int j;
+        NSUInteger j;
         const char *valuePtr = [value bytes];
         
         for (j = 0; success && j < numberOfFragments; j++) {
             name = [[NSString alloc] initWithFormat:@"[EMAIL PROTECTED]", 
uniqueValue, j];
             
             char *subdataPtr = (char *)&valuePtr[j * MAX_XATTR_LENGTH];
-            unsigned int subdataLen = j == numberOfFragments - 1 ? ([value 
length] - j * MAX_XATTR_LENGTH) : MAX_XATTR_LENGTH;
+            size_t subdataLen = j == numberOfFragments - 1 ? ([value length] - 
j * MAX_XATTR_LENGTH) : MAX_XATTR_LENGTH;
             
             // could recurse here, but it's more efficient to use the 
variables we already have
             if (setxattr(fsPath, [name UTF8String], subdataPtr, subdataLen, 0, 
xopts)) {
@@ -426,7 +422,7 @@
             if (plist && [plist respondsToSelector:@selector(objectForKey:)] 
&& [[plist objectForKey:wrapperKey] boolValue]) {
                 
                 NSString *uniqueValue = [plist objectForKey:uniqueKey];
-                unsigned int i, numberOfFragments = [[plist 
objectForKey:fragmentsKey] unsignedIntValue];
+                NSUInteger i, numberOfFragments = [[plist 
objectForKey:fragmentsKey] unsignedIntValue];
                 NSString *name;
                 
                 // remove the sub attributes
@@ -483,7 +479,7 @@
 }
 
 // guaranteed to return non-nil
-- (NSError *)xattrError:(int)err forPath:(NSString *)path;
+- (NSError *)xattrError:(NSInteger)err forPath:(NSString *)path;
 {
     NSString *errMsg = nil;
     switch (err)
@@ -546,8 +542,8 @@
 
 - (NSData *)bzipData:(NSData *)data;
 {
-       int compression = 5;
-    int bzret, buffer_size = 1000000;
+       NSInteger compression = 5;
+    NSInteger bzret, buffer_size = 1000000;
        bz_stream stream = { 0 };
        stream.next_in = (char *)[data bytes];
        stream.avail_in = [data length];
@@ -580,12 +576,12 @@
 
 - (NSData *)bunzipData:(NSData *)data;
 {
-       int bzret;
+       NSInteger bzret;
        bz_stream stream = { 0 };
        stream.next_in = (char *)[data bytes];
        stream.avail_in = [data length];
        
-       const int buffer_size = 10000;
+       const NSInteger buffer_size = 10000;
        NSMutableData *buffer = [[NSMutableData alloc] 
initWithLength:buffer_size];
        stream.next_out = [buffer mutableBytes];
        stream.avail_out = buffer_size;
@@ -615,7 +611,7 @@
 - (BOOL)isBzipData:(NSData *)data;
 {
     static NSData *bzipHeaderData = nil;
-    static unsigned int bzipHeaderDataLength = 0;
+    static NSUInteger bzipHeaderDataLength = 0;
     if (nil == bzipHeaderData) {
         char *h = "BZh";
         bzipHeaderData = [[NSData alloc] initWithBytes:h length:strlen(h)];
@@ -628,7 +624,7 @@
 - (BOOL)isPlistData:(NSData *)data;
 {
     static NSData *plistHeaderData = nil;
-    static unsigned int plistHeaderDataLength = 0;
+    static NSUInteger plistHeaderDataLength = 0;
     if (nil == plistHeaderData) {
         char *h = "bplist00";
         plistHeaderData = [[NSData alloc] initWithBytes:h length:strlen(h)];

Modified: trunk/SkimNotes/SkimNotes.rtf
===================================================================
--- trunk/SkimNotes/SkimNotes.rtf       2008-07-09 17:07:14 UTC (rev 4169)
+++ trunk/SkimNotes/SkimNotes.rtf       2008-07-10 00:10:25 UTC (rev 4170)
@@ -113,7 +113,7 @@
 {\listtext     \'95    }Select the "External Frameworks and Libraries" group 
and uncheck the checkbox after Quartz.framework.\
 {\listtext     \'95    }Edit SkimNotes.h and delete the 3 #import lines for 
the files with PDF in the filename.\
 
\pard\tx220\tx720\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\li720\fi-720\ql\qnatural\pardirnatural
-\ls2\ilvl0\cf0 {\listtext      \'95    }Edit SkimNotes_Prefix.pch and delete 
the Quartz #import line and the PDFMarkupType typedef line.\
+\ls2\ilvl0\cf0 {\listtext      \'95    }Edit SkimNotes_Prefix.pch and delete 
the Quartz #import line.\
 
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
 
 \b \cf0 \

Modified: trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj
===================================================================
--- trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj 2008-07-09 17:07:14 UTC 
(rev 4169)
+++ trunk/SkimNotes/SkimNotes.xcodeproj/project.pbxproj 2008-07-10 00:10:25 UTC 
(rev 4170)
@@ -86,6 +86,7 @@
                CE17EF870E250E8A00DE06EA /* 
SkimNotes-Release-GCSupport.xcconfig */ = {isa = PBXFileReference; fileEncoding 
= 4; lastKnownFileType = text.xcconfig; name = 
"SkimNotes-Release-GCSupport.xcconfig"; path = 
"Configurations/SkimNotes-Release-GCSupport.xcconfig"; sourceTree = "<group>"; 
};
                CE17EF880E250E8A00DE06EA /* SkimNotes-Release.xcconfig */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; 
name = "SkimNotes-Release.xcconfig"; path = 
"Configurations/SkimNotes-Release.xcconfig"; sourceTree = "<group>"; };
                CE17EF890E250E8A00DE06EA /* SkimNotes-Tool.xcconfig */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = 
"SkimNotes-Tool.xcconfig"; path = "Configurations/SkimNotes-Tool.xcconfig"; 
sourceTree = "<group>"; };
+               CE17F1BB0E25861700DE06EA /* SkimNotes_Tool_Prefix.pch */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path 
= SkimNotes_Tool_Prefix.pch; sourceTree = "<group>"; };
                CE3907AD0E082C2D0015B0B7 /* English */ = {isa = 
PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; 
name = English; path = English.lproj/SkimNotes.strings; sourceTree = "<group>"; 
};
                CE3907B40E082C900015B0B7 /* Dutch */ = {isa = PBXFileReference; 
lastKnownFileType = text.plist.strings; name = Dutch; path = 
Dutch.lproj/SkimNotes.strings; sourceTree = "<group>"; };
                CE3907B50E082C930015B0B7 /* French */ = {isa = 
PBXFileReference; lastKnownFileType = text.plist.strings; name = French; path = 
French.lproj/SkimNotes.strings; sourceTree = "<group>"; };
@@ -224,6 +225,7 @@
                        isa = PBXGroup;
                        children = (
                                32DBCF5E0370ADEE00C91783 /* 
SkimNotes_Prefix.pch */,
+                               CE17F1BB0E25861700DE06EA /* 
SkimNotes_Tool_Prefix.pch */,
                        );
                        name = "Other Sources";
                        sourceTree = "<group>";

Modified: trunk/SkimNotes/SkimNotes_Prefix.pch
===================================================================
--- trunk/SkimNotes/SkimNotes_Prefix.pch        2008-07-09 17:07:14 UTC (rev 
4169)
+++ trunk/SkimNotes/SkimNotes_Prefix.pch        2008-07-10 00:10:25 UTC (rev 
4170)
@@ -9,7 +9,6 @@
     #define SKNLocalizedString(key, comment) 
NSLocalizedStringFromTableInBundle(key, @"SkimNotes", [NSBundle 
bundleWithIdentifier:@"net.sourceforge.skim-app.framework.skimnotes"], comment)
     
     #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_5
-        
         #ifndef NSINTEGER_DEFINED
             #ifdef NS_BUILD_32_LIKE_64
                 typedef long NSInteger;
@@ -23,21 +22,5 @@
             #define NSUIntegerMax   ULONG_MAX
             #define NSINTEGER_DEFINED 1
         #endif
-        
-        typedef NSInteger PDFMarkupType;
-        
-        #define SKNUnsignedIntegerValue(number) [number unsignedIntValue]
-        #define SKNNumberWithUnsignedInteger(value) [NSNumber 
numberWithUnsignedInt:value]
-        
-    #elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
-        
-        #define SKNUnsignedIntegerValue(number) ([number 
respondsToSelector:@selector(unsignedIntegerValue)] ? [number 
unsignedIntegerValue] : [number unsignedIntValue])
-        #define SKNNumberWithUnsignedInteger(value) ([NSNumber 
respondsToSelector:@selector(numberWithUnsignedInteger:)] ? [NSNumber 
numberWithUnsignedInteger:value] : [NSNumber numberWithUnsignedInt:value])
-        
-    #else
-        
-        #define SKNUnsignedIntegerValue(number) [number unsignedIntegerValue]
-        #define SKNNumberWithUnsignedInteger(value) [NSNumber 
numberWithUnsignedInteger:value]
-            
     #endif
 #endif

Added: trunk/SkimNotes/SkimNotes_Tool_Prefix.pch
===================================================================
--- trunk/SkimNotes/SkimNotes_Tool_Prefix.pch                           (rev 0)
+++ trunk/SkimNotes/SkimNotes_Tool_Prefix.pch   2008-07-10 00:10:25 UTC (rev 
4170)
@@ -0,0 +1,25 @@
+//
+// Prefix header for all source files of the 'skimnotes' target in the 
'SkimNotes' project.
+//
+
+#ifdef __OBJC__
+    #import <Cocoa/Cocoa.h>
+    
+    #define SKNLocalizedString(key, comment) key
+    
+    #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < 
MAC_OS_X_VERSION_10_5
+        #ifndef NSINTEGER_DEFINED
+            #ifdef NS_BUILD_32_LIKE_64
+                typedef long NSInteger;
+                typedef unsigned long NSUInteger;
+            #else
+                typedef int NSInteger;
+                typedef unsigned int NSUInteger;
+            #endif
+            #define NSIntegerMax    LONG_MAX
+            #define NSIntegerMin    LONG_MIN
+            #define NSUIntegerMax   ULONG_MAX
+            #define NSINTEGER_DEFINED 1
+        #endif
+    #endif
+#endif

Modified: trunk/SkimNotes/skimnotes.m
===================================================================
--- trunk/SkimNotes/skimnotes.m 2008-07-09 17:07:14 UTC (rev 4169)
+++ trunk/SkimNotes/skimnotes.m 2008-07-10 00:10:25 UTC (rev 4170)
@@ -37,7 +37,7 @@
     SKNFormatRTF
 };
 
-static int SKNActionForName(NSString *actionString) {
+static NSInteger SKNActionForName(NSString *actionString) {
     if ([actionString caseInsensitiveCompare:@"get"] == NSOrderedSame)
         return SKNActionGet;
     else if ([actionString caseInsensitiveCompare:@"set"] == NSOrderedSame)
@@ -79,7 +79,7 @@
         exit (1);
     }
     
-    int action = SKNActionForName([args objectAtIndex:1]);
+    NSInteger action = SKNActionForName([args objectAtIndex:1]);
     
     BOOL success = NO;
     
@@ -108,7 +108,7 @@
         
     } else if (action == SKNActionHelp) {
         
-        int helpAction = SKNActionForName([args count] > 2 ? [args 
objectAtIndex:2] : @"");
+        NSInteger helpAction = SKNActionForName([args count] > 2 ? [args 
objectAtIndex:2] : @"");
         
         switch (helpAction) {
             case SKNActionUnknown:
@@ -151,7 +151,7 @@
         }
         
         NSString *formatString = nil;
-        int format = SKNFormatAuto;
+        NSInteger format = SKNFormatAuto;
         int offset = 2;
         
         if ([[args objectAtIndex:2] isEqualToString:@"-format"]) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to