Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Got rid of "assignment as a condition without parentheses" warnings #5

Closed
wants to merge 2 commits into from

2 participants

@drjokepu

As discussed in #4

@itod
Owner

at some point i fixed this myself. sorry, I'm not good at Git.

@itod itod closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 9, 2011
  1. @drjokepu

    got rid of 'assignment as a condition without parentheses' warnings'

    drjokepu authored Tamas Czinege committed
  2. @drjokepu
This page is out of date. Refresh to see the latest.
View
2  src/PKAssembly.m
@@ -45,7 +45,7 @@ - (id)init {
- (id)initWithString:(NSString *)s {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.stack = [NSMutableArray array];
self.string = s;
}
View
6 src/PKCollectionParser.m
@@ -29,7 +29,7 @@ + (PKCollectionParser *)collectionParserWithFirst:(PKParser *)p1 rest:(va_list)r
[cp add:p1];
PKParser *p = nil;
- while (p = va_arg(rest, PKParser *)) {
+ while ((p = va_arg(rest, PKParser *))) {
[cp add:p];
}
}
@@ -44,7 +44,7 @@ - (id)init {
- (id)initWithSubparsers:(PKParser *)p1, ... {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.subparsers = [NSMutableArray array];
if (p1) {
@@ -54,7 +54,7 @@ - (id)initWithSubparsers:(PKParser *)p1, ... {
va_start(vargs, p1);
PKParser *p = nil;
- while (p = va_arg(vargs, PKParser *)) {
+ while ((p = va_arg(vargs, PKParser *))) {
[subparsers addObject:p];
}
View
2  src/PKCommentState.m
@@ -53,7 +53,7 @@ - (void)removeStartMarker:(NSString *)start;
@implementation PKCommentState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.rootNode = [[[PKSymbolRootNode alloc] init] autorelease];
self.singleLineState = [[[PKSingleLineCommentState alloc] init] autorelease];
self.multiLineState = [[[PKMultiLineCommentState alloc] init] autorelease];
View
2  src/PKDelimitState.m
@@ -44,7 +44,7 @@ - (NSCharacterSet *)allowedCharacterSetForStartMarker:(NSString *)startMarker;
@implementation PKDelimitState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.rootNode = [[[PKSymbolRootNode alloc] init] autorelease];
self.startMarkers = [NSMutableArray array];
self.endMarkers = [NSMutableArray array];
View
2  src/PKDifference.m
@@ -50,7 +50,7 @@ + (PKDifference *)differenceWithSubparser:(PKParser *)s minus:(PKParser *)m {
- (id)initWithSubparser:(PKParser *)s minus:(PKParser *)m {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.subparser = s;
self.minus = m;
}
View
2  src/PKGrammarParser.m
@@ -47,7 +47,7 @@ - (PKSequence *)oneOrMore:(PKParser *)p;
@implementation PKGrammarParser
- (id)initWithAssembler:(id)a {
- if (self = [super init]) {
+ if ((self = [super init])) {
assembler = a;
}
return self;
View
2  src/PKMultiLineCommentState.m
@@ -46,7 +46,7 @@ - (void)removeStartMarker:(NSString *)start;
@implementation PKMultiLineCommentState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.startMarkers = [NSMutableArray array];
self.endMarkers = [NSMutableArray array];
}
View
2  src/PKNegation.m
@@ -34,7 +34,7 @@ + (PKNegation *)negationWithSubparser:(PKParser *)s {
- (id)initWithSubparser:(PKParser *)s {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.subparser = s;
self.difference = [PKDifference differenceWithSubparser:[PKAny any] minus:subparser];
}
View
11 src/PKParserFactory.m
@@ -6,7 +6,6 @@
// Copyright 2009 Todd Ditchendorf All rights reserved.
//
-#import "PKParserFactory.h"
#import <ParseKit/ParseKit.h>
#import "PKGrammarParser.h"
#import "NSString+ParseKitAdditions.h"
@@ -152,7 +151,7 @@ + (PKParserFactory *)factory {
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.grammarParser = [[[PKGrammarParser alloc] initWithAssembler:self] autorelease];
self.equals = [PKToken tokenWithTokenType:PKTokenTypeSymbol stringValue:@"=" floatValue:0.0];
self.curly = [PKToken tokenWithTokenType:PKTokenTypeSymbol stringValue:@"{" floatValue:0.0];
@@ -346,7 +345,7 @@ - (PKTokenizer *)tokenizerFromGrammarSettings {
if (tok.isQuotedString) {
NSString *s = [tok.stringValue stringByTrimmingQuotes];
if ([s length]) {
- NSInteger c = [s characterAtIndex:0];
+ PKUniChar c = [s characterAtIndex:0];
[t.wordState setWordChars:YES from:c to:c];
}
}
@@ -361,9 +360,9 @@ - (PKTokenizer *)tokenizerFromGrammarSettings {
if (tok.isQuotedString) {
NSString *s = [tok.stringValue stringByTrimmingQuotes];
if ([s length]) {
- NSInteger c = 0;
+ PKUniChar c = 0;
if ([s hasPrefix:@"#x"]) {
- c = [s integerValue];
+ c = (PKUniChar)[s integerValue];
} else {
c = [s characterAtIndex:0];
}
@@ -451,7 +450,7 @@ - (void)setTokenizerState:(PKTokenizerState *)state onTokenizer:(PKTokenizer *)t
if (tok.isQuotedString) {
NSString *s = [tok.stringValue stringByTrimmingQuotes];
if (1 == [s length]) {
- NSInteger c = [s characterAtIndex:0];
+ PKUniChar c = [s characterAtIndex:0];
[t setTokenizerState:state from:c to:c];
}
}
View
2  src/PKPattern.m
@@ -33,7 +33,7 @@ - (id)initWithString:(NSString *)s {
- (id)initWithString:(NSString *)s options:(PKPatternOptions)opts {
- if (self = [super initWithString:s]) {
+ if ((self = [super initWithString:s])) {
options = opts;
}
return self;
View
2  src/PKQuoteState.m
@@ -31,7 +31,7 @@ - (PKTokenizerState *)nextTokenizerStateFor:(PKUniChar)c tokenizer:(PKTokenizer
@implementation PKQuoteState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.allowsEOFTerminatedQuotes = YES;
}
return self;
View
2  src/PKReader.m
@@ -22,7 +22,7 @@ - (id)init {
- (id)initWithString:(NSString *)s {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.string = s;
}
return self;
View
2  src/PKRepetition.m
@@ -37,7 +37,7 @@ - (id)init {
- (id)initWithSubparser:(PKParser *)p {
//NSParameterAssert(p);
- if (self = [super init]) {
+ if ((self = [super init])) {
self.subparser = p;
}
return self;
View
2  src/PKSingleLineCommentState.m
@@ -40,7 +40,7 @@ - (void)removeStartMarker:(NSString *)start;
@implementation PKSingleLineCommentState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.startMarkers = [NSMutableArray array];
}
return self;
View
2  src/PKSymbolNode.m
@@ -28,7 +28,7 @@ - (void)determineAncestry;
@implementation PKSymbolNode
- (id)initWithParent:(PKSymbolNode *)p character:(PKUniChar)c {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.parent = p;
self.character = c;
self.children = [NSMutableDictionary dictionary];
View
2  src/PKSymbolRootNode.m
@@ -28,7 +28,7 @@ - (NSString *)nextWithFirst:(PKUniChar)c rest:(PKReader *)r parent:(PKSymbolNode
@implementation PKSymbolRootNode
- (id)init {
- if (self = [super initWithParent:nil character:PKEOF]) {
+ if ((self = [super initWithParent:nil character:PKEOF])) {
}
return self;
View
2  src/PKSymbolState.m
@@ -38,7 +38,7 @@ - (PKToken *)symbolTokenWithSymbol:(NSString *)s;
@implementation PKSymbolState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.rootNode = [[[PKSymbolRootNode alloc] init] autorelease];
self.addedSymbols = [NSMutableArray array];
}
View
2  src/PKTerminal.m
@@ -38,7 +38,7 @@ - (id)init {
- (id)initWithString:(NSString *)s {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.string = s;
}
return self;
View
2  src/PKToken.m
@@ -122,7 +122,7 @@ + (PKToken *)tokenWithTokenType:(PKTokenType)t stringValue:(NSString *)s floatVa
// designated initializer
- (id)initWithTokenType:(PKTokenType)t stringValue:(NSString *)s floatValue:(CGFloat)n {
//NSParameterAssert(s);
- if (self = [super init]) {
+ if ((self = [super init])) {
self.tokenType = t;
self.stringValue = s;
self.floatValue = n;
View
2  src/PKTokenArraySource.m
@@ -32,7 +32,7 @@ - (id)init {
- (id)initWithTokenizer:(PKTokenizer *)t delimiter:(NSString *)s {
NSParameterAssert(t);
NSParameterAssert(s);
- if (self = [super init]) {
+ if ((self = [super init])) {
self.tokenizer = t;
self.delimiter = s;
}
View
2  src/PKTokenizer.m
@@ -46,7 +46,7 @@ - (id)init {
- (id)initWithString:(NSString *)s {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.string = s;
self.reader = [[[PKReader alloc] init] autorelease];
View
2  src/PKTwitterState.m
@@ -30,7 +30,7 @@ @interface PKTwitterState ()
@implementation PKTwitterState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
}
return self;
View
2  src/PKURLState.m
@@ -36,7 +36,7 @@ - (void)parsePathFromReader:(PKReader *)r;
@implementation PKURLState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.allowsWWWPrefix = YES;
}
return self;
View
2  src/PKWhitespaceState.m
@@ -38,7 +38,7 @@ @interface PKWhitespaceState ()
@implementation PKWhitespaceState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
const NSUInteger len = 255;
self.whitespaceChars = [NSMutableArray arrayWithCapacity:len];
NSUInteger i = 0;
View
2  src/PKWordState.m
@@ -40,7 +40,7 @@ - (BOOL)isWordChar:(PKUniChar)c;
@implementation PKWordState
- (id)init {
- if (self = [super init]) {
+ if ((self = [super init])) {
self.wordChars = [NSMutableArray arrayWithCapacity:256];
NSInteger i = 0;
for ( ; i < 256; i++) {
Something went wrong with that request. Please try again.