summaryrefslogtreecommitdiff
path: root/tikzit/src/common/TikzGraphAssembler.m
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2013-03-25 15:28:37 +0000
committerAlex Merry <dev@randomguy3.me.uk>2013-03-25 15:28:37 +0000
commitc0137b33c535eb04f5e7d5628e9a225e226c5b34 (patch)
tree2c05887762404d569e1bc3546c8b775a7ae72d01 /tikzit/src/common/TikzGraphAssembler.m
parentabf06ae3a0bd6475856688ade788559c8e0901ff (diff)
Fix clang warnings
Diffstat (limited to 'tikzit/src/common/TikzGraphAssembler.m')
-rw-r--r--tikzit/src/common/TikzGraphAssembler.m13
1 files changed, 4 insertions, 9 deletions
diff --git a/tikzit/src/common/TikzGraphAssembler.m b/tikzit/src/common/TikzGraphAssembler.m
index b2c372a..0c24b7c 100644
--- a/tikzit/src/common/TikzGraphAssembler.m
+++ b/tikzit/src/common/TikzGraphAssembler.m
@@ -169,15 +169,12 @@
if (token_offset + token_len > context_len) {
// error position state is corrupted
- NSLog(@"Got bad error state for error \"%s\": start(%i,%i), end(%i,%i)\n context_len = %d; token_offset = %d; token_len = %d",
+ NSLog(@"Got bad error state for error \"%s\": start(%i,%i), end(%i,%i)",
message,
yylloc->first_line,
yylloc->first_column,
yylloc->last_line,
- yylloc->last_column,
- context_len,
- token_offset,
- token_len);
+ yylloc->last_column);
[self setLastError:[NSError errorWithMessage:nsmsg
code:TZ_ERR_PARSE]];
} else {
@@ -216,10 +213,8 @@
if (nlp) {
*nlp = '\0';
context_len = nlp - context;
- if (token_offset >= context_len) {
- NSLog(@"token_offset (%d) >= context_len (%d) -- what?", token_offset, context_len);
- return;
- } else if (token_offset + token_len > context_len) {
+ NSAssert2(token_offset < context_len, @"token_offset (%lu) < context_len (%lu)", token_offset, context_len);
+ if (token_offset + token_len > context_len) {
token_len = context_len - token_offset;
}
} else {