Permalink
Browse files

Fixed compiler warnings when compiling for 64 bit

  • Loading branch information...
1 parent 91e5d46 commit e98040f33fc73131d7b8e67f08348ccaba3c8d84 @ccgus committed Sep 15, 2010
View
@@ -10,7 +10,7 @@
@class NoodleLineNumberView;
-@interface JSTTextView : NSTextView {
+@interface JSTTextView : NSTextView <NSTextStorageDelegate>{
NoodleLineNumberView *_lineNumberView;
NSDictionary *_keywords;
}
View
@@ -373,7 +373,7 @@ static void initBraces() {
if (!openingBraces) {
unichar charBuf[100];
- unsigned defLen;
+ NSUInteger defLen;
defLen = [defaultOpeningBraces length];
[defaultOpeningBraces getCharacters:charBuf];
View
@@ -269,8 +269,7 @@ - (void)include:(NSString*)fileName {
str = [JSTPreprocessor preprocessCode:str];
- #warning fixme: why does withScriptURL take a string path?
- if (![[self jsController] evalJSString:str withScriptURL:[scriptURL path]]) {
+ if (![[self jsController] evalJSString:str withScriptPath:[scriptURL path]]) {
NSLog(@"Could not include '%@'", fileName);
}
}
View
@@ -43,7 +43,7 @@ unsigned TE_numberOfLeadingSpacesFromRangeInString(NSString *string, NSRange *ra
unsigned spaceCount = 0;
BOOL done = NO;
unsigned tabW = tabWidth;
- unsigned endOfWhiteSpaceIndex = NSNotFound;
+ NSUInteger endOfWhiteSpaceIndex = NSNotFound;
if (range->length == 0) {
return 0;
@@ -124,12 +124,13 @@ unsigned TE_numberOfLeadingSpacesFromRangeInString(NSString *string, NSRange *ra
float charWidth;
float widthOfTab;
unsigned i;
-
+
+ /*
if ([font glyphIsEncoded:(NSGlyph)' ']) {
charWidth = [font advancementForGlyph:(NSGlyph)' '].width;
- } else {
+ } else {*/
charWidth = [font maximumAdvancement].width;
- }
+ //}
widthOfTab = (charWidth * tabWidth);
if (!array) {
@@ -153,7 +154,7 @@ unsigned TE_numberOfLeadingSpacesFromRangeInString(NSString *string, NSRange *ra
extern NSRange TE_rangeOfLineWithLeadingWhiteSpace(NSString *string, NSRange startRange, unsigned leadingSpaces, NSComparisonResult matchStyle, BOOL backwardFlag, unsigned tabWidth) {
NSRange searchRange;
NSRange curRange, tempRange;
- unsigned len = [string length];
+ NSUInteger len = [string length];
unsigned curSpaces;
// Expand startRange to paragraph boundaries
@@ -215,7 +216,7 @@ static void indentParagraphRangeInAttributedString(NSRange range, NSMutableAttri
NSRange leadingSpaceRange = range;
unsigned numSpaces = TE_numberOfLeadingSpacesFromRangeInString([attrString string], &leadingSpaceRange, tabWidth);
NSString *newWhitespace;
- unsigned newWhitespaceLength;
+ NSUInteger newWhitespaceLength;
int curLevels;
curLevels = numSpaces / indentWidth;
@@ -327,7 +328,7 @@ static void initBraces() {
if (!openingBraces) {
unichar charBuf[100];
- unsigned defLen;
+ NSUInteger defLen;
defLen = [defaultOpeningBraces length];
[defaultOpeningBraces getCharacters:charBuf];
@@ -344,7 +345,7 @@ static void initBraces() {
unichar TE_matchingDelimiter(unichar delimiter) {
// This is not very efficient or anything, but the list of delimiters is expected to be quite short.
- unsigned i, c;
+ NSUInteger i, c;
initBraces();
@@ -362,7 +363,7 @@ unichar TE_matchingDelimiter(unichar delimiter) {
BOOL TE_isOpeningBrace(unichar delimiter) {
// This is not very efficient or anything, but the list of delimiters is expected to be quite short.
- unsigned i, c = NUM_BRACE_PAIRS;
+ NSUInteger i, c = NUM_BRACE_PAIRS;
initBraces();
@@ -376,7 +377,7 @@ BOOL TE_isOpeningBrace(unichar delimiter) {
BOOL TE_isClosingBrace(unichar delimiter) {
// This is not very efficient or anything, but the list of delimiters is expected to be quite short.
- unsigned i, c = NUM_BRACE_PAIRS;
+ NSUInteger i, c = NUM_BRACE_PAIRS;
initBraces();
@@ -408,10 +409,10 @@ NSRange TE_findMatchingBraceForRangeInString(NSRange origRange, NSString *string
{
unichar delimiterStack[STACK_DEPTH];
- unsigned stackCount = 0;
+ NSUInteger stackCount = 0;
NSRange searchRange, buffRange;
unichar buff[BUFF_SIZE];
- int i;
+ NSInteger i;
BOOL done = NO;
BOOL push = NO, pop = NO;
@@ -17,7 +17,7 @@ + (id)letter {
- (BOOL)qualifies:(id)obj {
NSInteger c = [obj integerValue];
- return isalpha(c);
+ return isalpha((int)c);
}
@end
@@ -88,7 +88,7 @@ - (CGFloat)absorbDigitsFromReader:(TDReader *)r isFraction:(BOOL)isFraction {
CGFloat v = 0.0;
while (1) {
- if (isdigit(c)) {
+ if (isdigit((int)c)) {
[self append:c];
gotADigit = YES;
v = v * 10.0 + (c - '0');
@@ -117,7 +117,7 @@ - (void)parseLeftSideFromReader:(TDReader *)r {
- (void)parseRightSideFromReader:(TDReader *)r {
if ('.' == c) {
NSInteger n = [r read];
- BOOL nextIsDigit = isdigit(n);
+ BOOL nextIsDigit = isdigit((int)n);
if (-1 != n) {
[r unread];
}
@@ -29,13 +29,13 @@ - (void)parseRightSideFromReader:(TDReader *)r {
NSInteger e = c;
c = [r read];
- BOOL hasExp = isdigit(c);
+ BOOL hasExp = isdigit((int)c);
negativeExp = ('-' == c);
BOOL positiveExp = ('+' == c);
if (!hasExp && (negativeExp || positiveExp)) {
c = [r read];
- hasExp = isdigit(c);
+ hasExp = isdigit((int)c);
}
if (-1 != c) {
[r unread];

0 comments on commit e98040f

Please sign in to comment.