@@ -795,7 +795,7 @@ static int tokenize_bytes(parser_t *self, size_t line_limit,
795795 break ;
796796 } else if (!isblank (c )) {
797797 self -> state = START_FIELD ;
798- // fall through to subsequent state
798+ PD_FALLTHROUGH ; // fall through to subsequent state
799799 } else {
800800 // if whitespace char, keep slurping
801801 break ;
@@ -849,12 +849,12 @@ static int tokenize_bytes(parser_t *self, size_t line_limit,
849849 self -> state = WHITESPACE_LINE ;
850850 break ;
851851 }
852- // fall through
853852 }
854853
855854 // normal character - fall through
856855 // to handle as START_FIELD
857856 self -> state = START_FIELD ;
857+ PD_FALLTHROUGH ;
858858 }
859859 case START_FIELD :
860860 // expecting field
@@ -1130,10 +1130,10 @@ int parser_consume_rows(parser_t *self, size_t nrows) {
11301130
11311131 /* if word_deletions == 0 (i.e. this case) then char_count must
11321132 * 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 ;
11371137
11381138 TRACE (("parser_consume_rows: Deleting %d words, %d chars\n" , word_deletions ,
11391139 char_count ));
@@ -1415,9 +1415,11 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
14151415 int negative = 0 ;
14161416 switch (* p ) {
14171417 case '-' :
1418- negative = 1 ; // Fall through to increment position.
1418+ negative = 1 ;
1419+ PD_FALLTHROUGH ; // Fall through to increment position.
14191420 case '+' :
14201421 p ++ ;
1422+ break ;
14211423 }
14221424
14231425 int exponent = 0 ;
@@ -1485,9 +1487,11 @@ double xstrtod(const char *str, char **endptr, char decimal, char sci,
14851487 negative = 0 ;
14861488 switch (* ++ p ) {
14871489 case '-' :
1488- negative = 1 ; // Fall through to increment pos.
1490+ negative = 1 ;
1491+ PD_FALLTHROUGH ; // Fall through to increment position.
14891492 case '+' :
14901493 p ++ ;
1494+ break ;
14911495 }
14921496
14931497 // Process string of digits.
@@ -1595,9 +1599,11 @@ double precise_xstrtod(const char *str, char **endptr, char decimal, char sci,
15951599 int negative = 0 ;
15961600 switch (* p ) {
15971601 case '-' :
1598- negative = 1 ; // Fall through to increment position.
1602+ negative = 1 ;
1603+ PD_FALLTHROUGH ; // Fall through to increment position.
15991604 case '+' :
16001605 p ++ ;
1606+ break ;
16011607 }
16021608
16031609 double number = 0. ;
@@ -1656,9 +1662,11 @@ double precise_xstrtod(const char *str, char **endptr, char decimal, char sci,
16561662 negative = 0 ;
16571663 switch (* ++ p ) {
16581664 case '-' :
1659- negative = 1 ; // Fall through to increment pos.
1665+ negative = 1 ;
1666+ PD_FALLTHROUGH ; // Fall through to increment position.
16601667 case '+' :
16611668 p ++ ;
1669+ break ;
16621670 }
16631671
16641672 // Process string of digits.
@@ -1762,8 +1770,8 @@ static char *_str_copy_decimal_str_c(const char *s, char **endpos, char decimal,
17621770 return s_copy ;
17631771}
17641772
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 ) {
17671775 // 'normalize' representation to C-locale; replace decimal with '.' and
17681776 // remove thousands separator.
17691777 char * endptr ;
@@ -1975,7 +1983,7 @@ uint64_t str_to_uint64(uint_state *state, const char *p_item, int64_t int_max,
19751983 break ;
19761984 }
19771985 if ((number < pre_max ) ||
1978- ((number == pre_max ) && (d - '0' <= dig_pre_max ))) {
1986+ ((number == pre_max ) && (( uint64_t )( d - '0' ) <= dig_pre_max ))) {
19791987 number = number * 10 + (d - '0' );
19801988 d = * ++ p ;
19811989
@@ -1987,7 +1995,7 @@ uint64_t str_to_uint64(uint_state *state, const char *p_item, int64_t int_max,
19871995 } else {
19881996 while (isdigit_ascii (d )) {
19891997 if ((number < pre_max ) ||
1990- ((number == pre_max ) && (d - '0' <= dig_pre_max ))) {
1998+ ((number == pre_max ) && (( uint64_t )( d - '0' ) <= dig_pre_max ))) {
19911999 number = number * 10 + (d - '0' );
19922000 d = * ++ p ;
19932001
0 commit comments