Skip to content

Commit

Permalink
BUG: Replace ssize_t with size_t in tokenize.cpp (numpy#21074)
Browse files Browse the repository at this point in the history
Closes numpy#21073

`ssize_t` is not defined for all platforms in C++ (e.g. windows), so replace it with `size_t` (which is OK here because the difference is always >=1).
  • Loading branch information
BvB93 authored Feb 16, 2022
1 parent b1f12be commit 1168868
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/core/src/multiarray/textreading/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ tokenize(stream *s, tokenizer_state *ts, parser_config *const config)
*/
if (ts->num_fields == 1
|| ts->unquoted_state == TOKENIZE_UNQUOTED_WHITESPACE) {
ssize_t offset_last = ts->fields[ts->num_fields-1].offset;
ssize_t end_last = ts->fields[ts->num_fields].offset;
size_t offset_last = ts->fields[ts->num_fields-1].offset;
size_t end_last = ts->fields[ts->num_fields].offset;
if (!ts->fields->quoted && end_last - offset_last == 1) {
ts->num_fields--;
}
Expand Down

0 comments on commit 1168868

Please sign in to comment.