Skip to content

Commit 82dc037

Browse files
committed
fix: remove casts for -Weverything
1 parent 7ea4454 commit 82dc037

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/_libs/src/parser/tokenizer.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,13 +1890,10 @@ static int copy_string_without_char(char output[PROCESSED_WORD_CAPACITY],
18901890
size_t remaining_bytes_to_read = str_len;
18911891

18921892
while (remaining_bytes_to_read > 0) {
1893-
right = (const char *)memchr(left, char_to_remove, remaining_bytes_to_read);
1893+
right = memchr(left, char_to_remove, remaining_bytes_to_read);
18941894

18951895
// If it doesn't find the char to remove, just copy until EOS.
1896-
// We are also casting directly to size_t because
1897-
// `left` never goes beyond `right` or `end_ptr`.
1898-
size_t chunk_size =
1899-
right ? (size_t)(right - left) : (size_t)(end_ptr - left);
1896+
size_t chunk_size = right ? right - left : end_ptr - left;
19001897

19011898
// check if we have enough space, including the null terminator.
19021899
if (chunk_size + bytes_written >= PROCESSED_WORD_CAPACITY) {

0 commit comments

Comments
 (0)