Skip to content

Commit

Permalink
Pedantic warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Oct 21, 2015
1 parent ae78b47 commit 0f0d126
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/QiParsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ inline bool parseNumber(char decimalMark, char groupingMark, Iterator& first,
if (first == last)
return false;

int sign = 1;
double sum = 0, denom = 1;
NumberState state = STATE_INIT;

Expand All @@ -59,7 +58,6 @@ inline bool parseNumber(char decimalMark, char groupingMark, Iterator& first,
case STATE_INIT:
if (*cur == '-') {
state = STATE_LHS;
sign = -1;
} else if (*cur == decimalMark) {
state = STATE_RHS;
} else if (*cur >= '0' && *cur <= '9') {
Expand Down
6 changes: 3 additions & 3 deletions src/TokenizerDelim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ TokenizerDelim::TokenizerDelim(char delim, char quote,
trimWS_(trimWS),
escapeBackslash_(escapeBackslash),
escapeDouble_(escapeDouble),
moreTokens_(false),
hasEmptyNA_(false)
hasEmptyNA_(false),
moreTokens_(false)
{
for (int i = 0; i < NA_.size(); ++i) {
for (size_t i = 0; i < NA_.size(); ++i) {
if (NA_[i] == "") {
hasEmptyNA_ = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ RObject guess_header_(List sourceSpec, List tokenizerSpec, List locale_) {
if (t.row() > (size_t) 0) // only read one row
break;

if (t.col() >= out.size()) {
if (t.col() >= (size_t) out.size()) {
out.resize(t.col() + 1);
}

Expand Down
6 changes: 3 additions & 3 deletions src/read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ RObject read_tokens(List sourceSpec, List tokenizerSpec, ListOf<List> colSpecs,
}

// Match colNames to with non-skipped collectors
if (p != colNames.size())
if (p != (size_t) colNames.size())
stop("colSpec and colNames must be same size");

CharacterVector outNames(pOut);
Expand All @@ -162,7 +162,7 @@ RObject read_tokens(List sourceSpec, List tokenizerSpec, ListOf<List> colSpecs,
size_t n = (n_max < 0) ? 1000 : n_max;
collectorsResize(collectors, n);

size_t i = -1, j = -1, cells = 0;
int i = -1, j = -1, cells = 0;
for (Token t = tokenizer->nextToken(); t.type() != TOKEN_EOF; t = tokenizer->nextToken()) {
if (progress && (cells++) % 250000 == 0)
progressBar.show(tokenizer->progress());
Expand Down Expand Up @@ -192,7 +192,7 @@ RObject read_tokens(List sourceSpec, List tokenizerSpec, ListOf<List> colSpecs,
progressBar.show(tokenizer->progress());
progressBar.stop();

if (i != n - 1) {
if (i != (int) n - 1) {
collectorsResize(collectors, i + 1);
}

Expand Down

0 comments on commit 0f0d126

Please sign in to comment.