@@ -795,7 +795,7 @@ static int tokenize_bytes(parser_t *self, size_t line_limit,
795
795
break ;
796
796
} else if (!isblank (c )) {
797
797
self -> state = START_FIELD ;
798
- // fall through to subsequent state
798
+ PD_FALLTHROUGH ; // fall through to subsequent state
799
799
} else {
800
800
// if whitespace char, keep slurping
801
801
break ;
@@ -849,12 +849,12 @@ static int tokenize_bytes(parser_t *self, size_t line_limit,
849
849
self -> state = WHITESPACE_LINE ;
850
850
break ;
851
851
}
852
- // fall through
853
852
}
854
853
855
854
// normal character - fall through
856
855
// to handle as START_FIELD
857
856
self -> state = START_FIELD ;
857
+ PD_FALLTHROUGH ;
858
858
}
859
859
case START_FIELD :
860
860
// expecting field
@@ -1130,10 +1130,10 @@ int parser_consume_rows(parser_t *self, size_t nrows) {
1130
1130
1131
1131
/* if word_deletions == 0 (i.e. this case) then char_count must
1132
1132
* be 0 too, as no data needs to be skipped */
1133
- const int64_t char_count = word_deletions >= 1
1134
- ? (self -> word_starts [word_deletions - 1 ] +
1135
- strlen (self -> words [word_deletions - 1 ]) + 1 )
1136
- : 0 ;
1133
+ const uint64_t char_count =
1134
+ word_deletions >= 1 ? (self -> word_starts [word_deletions - 1 ] +
1135
+ strlen (self -> words [word_deletions - 1 ]) + 1 )
1136
+ : 0 ;
1137
1137
1138
1138
TRACE (("parser_consume_rows: Deleting %d words, %d chars\n" , word_deletions ,
1139
1139
char_count ));
@@ -1415,9 +1415,11 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
1415
1415
int negative = 0 ;
1416
1416
switch (* p ) {
1417
1417
case '-' :
1418
- negative = 1 ; // Fall through to increment position.
1418
+ negative = 1 ;
1419
+ PD_FALLTHROUGH ; // Fall through to increment position.
1419
1420
case '+' :
1420
1421
p ++ ;
1422
+ break ;
1421
1423
}
1422
1424
1423
1425
int exponent = 0 ;
@@ -1485,9 +1487,11 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
1485
1487
negative = 0 ;
1486
1488
switch (* ++ p ) {
1487
1489
case '-' :
1488
- negative = 1 ; // Fall through to increment pos.
1490
+ negative = 1 ;
1491
+ PD_FALLTHROUGH ; // Fall through to increment position.
1489
1492
case '+' :
1490
1493
p ++ ;
1494
+ break ;
1491
1495
}
1492
1496
1493
1497
// Process string of digits.
@@ -1595,9 +1599,11 @@ double precise_xstrtod(const char *str, char **endptr, char decimal, char sci,
1595
1599
int negative = 0 ;
1596
1600
switch (* p ) {
1597
1601
case '-' :
1598
- negative = 1 ; // Fall through to increment position.
1602
+ negative = 1 ;
1603
+ PD_FALLTHROUGH ; // Fall through to increment position.
1599
1604
case '+' :
1600
1605
p ++ ;
1606
+ break ;
1601
1607
}
1602
1608
1603
1609
double number = 0. ;
@@ -1656,9 +1662,11 @@ double precise_xstrtod(const char *str, char **endptr, char decimal, char sci,
1656
1662
negative = 0 ;
1657
1663
switch (* ++ p ) {
1658
1664
case '-' :
1659
- negative = 1 ; // Fall through to increment pos.
1665
+ negative = 1 ;
1666
+ PD_FALLTHROUGH ; // Fall through to increment position.
1660
1667
case '+' :
1661
1668
p ++ ;
1669
+ break ;
1662
1670
}
1663
1671
1664
1672
// Process string of digits.
@@ -1762,8 +1770,8 @@ static char *_str_copy_decimal_str_c(const char *s, char **endpos, char decimal,
1762
1770
return s_copy ;
1763
1771
}
1764
1772
1765
- double round_trip (const char * p , char * * q , char decimal , char sci , char tsep ,
1766
- int skip_trailing , int * error , int * maybe_int ) {
1773
+ double round_trip (const char * p , char * * q , char decimal , char Py_UNUSED ( sci ) ,
1774
+ char tsep , int skip_trailing , int * error , int * maybe_int ) {
1767
1775
// 'normalize' representation to C-locale; replace decimal with '.' and
1768
1776
// remove thousands separator.
1769
1777
char * endptr ;
@@ -1975,7 +1983,7 @@ uint64_t str_to_uint64(uint_state *state, const char *p_item, int64_t int_max,
1975
1983
break ;
1976
1984
}
1977
1985
if ((number < pre_max ) ||
1978
- ((number == pre_max ) && (d - '0' <= dig_pre_max ))) {
1986
+ ((number == pre_max ) && (( uint64_t )( d - '0' ) <= dig_pre_max ))) {
1979
1987
number = number * 10 + (d - '0' );
1980
1988
d = * ++ p ;
1981
1989
@@ -1987,7 +1995,7 @@ uint64_t str_to_uint64(uint_state *state, const char *p_item, int64_t int_max,
1987
1995
} else {
1988
1996
while (isdigit_ascii (d )) {
1989
1997
if ((number < pre_max ) ||
1990
- ((number == pre_max ) && (d - '0' <= dig_pre_max ))) {
1998
+ ((number == pre_max ) && (( uint64_t )( d - '0' ) <= dig_pre_max ))) {
1991
1999
number = number * 10 + (d - '0' );
1992
2000
d = * ++ p ;
1993
2001
0 commit comments