@@ -216,12 +216,12 @@ STATIC mp_parse_node_t fold_constants(compiler_t *comp, mp_parse_node_t pn, mp_m
216216 mp_int_t arg1 = MP_PARSE_NODE_LEAF_SMALL_INT (pns -> nodes [2 ]);
217217 if (MP_PARSE_NODE_IS_TOKEN_KIND (pns -> nodes [1 ], MP_TOKEN_OP_DBL_LESS )) {
218218 // int << int
219- if (!(arg1 >= BITS_PER_WORD || arg0 > (MP_SMALL_INT_MAX >> arg1 ) || arg0 < (MP_SMALL_INT_MIN >> arg1 ))) {
219+ if (!(arg1 >= ( mp_int_t ) BITS_PER_WORD || arg0 > (MP_SMALL_INT_MAX >> arg1 ) || arg0 < (MP_SMALL_INT_MIN >> arg1 ))) {
220220 pn = mp_parse_node_new_leaf (MP_PARSE_NODE_SMALL_INT , arg0 << arg1 );
221221 }
222222 } else if (MP_PARSE_NODE_IS_TOKEN_KIND (pns -> nodes [1 ], MP_TOKEN_OP_DBL_MORE )) {
223223 // int >> int
224- if (arg1 >= BITS_PER_WORD ) {
224+ if (arg1 >= ( mp_int_t ) BITS_PER_WORD ) {
225225 // Shifting to big amounts is underfined behavior
226226 // in C and is CPU-dependent; propagate sign bit.
227227 arg1 = BITS_PER_WORD - 1 ;
@@ -386,8 +386,8 @@ STATIC scope_t *scope_new_and_link(compiler_t *comp, scope_kind_t kind, mp_parse
386386 return scope ;
387387}
388388
389- STATIC void apply_to_single_or_list (compiler_t * comp , mp_parse_node_t pn , int pn_list_kind , void (* f )(compiler_t * , mp_parse_node_t )) {
390- if (MP_PARSE_NODE_IS_STRUCT (pn ) && MP_PARSE_NODE_STRUCT_KIND (( mp_parse_node_struct_t * ) pn ) == pn_list_kind ) {
389+ STATIC void apply_to_single_or_list (compiler_t * comp , mp_parse_node_t pn , pn_kind_t pn_list_kind , void (* f )(compiler_t * , mp_parse_node_t )) {
390+ if (MP_PARSE_NODE_IS_STRUCT_KIND (pn , pn_list_kind ) ) {
391391 mp_parse_node_struct_t * pns = (mp_parse_node_struct_t * )pn ;
392392 int num_nodes = MP_PARSE_NODE_STRUCT_NUM_NODES (pns );
393393 for (int i = 0 ; i < num_nodes ; i ++ ) {
@@ -398,7 +398,7 @@ STATIC void apply_to_single_or_list(compiler_t *comp, mp_parse_node_t pn, int pn
398398 }
399399}
400400
401- STATIC int list_get (mp_parse_node_t * pn , int pn_kind , mp_parse_node_t * * nodes ) {
401+ STATIC int list_get (mp_parse_node_t * pn , pn_kind_t pn_kind , mp_parse_node_t * * nodes ) {
402402 if (MP_PARSE_NODE_IS_NULL (* pn )) {
403403 * nodes = NULL ;
404404 return 0 ;
@@ -811,14 +811,14 @@ STATIC void c_assign_tuple(compiler_t *comp, mp_parse_node_t node_head, uint num
811811 uint num_head = (node_head == MP_PARSE_NODE_NULL ) ? 0 : 1 ;
812812
813813 // look for star expression
814- int have_star_index = -1 ;
814+ uint have_star_index = -1 ;
815815 if (num_head != 0 && MP_PARSE_NODE_IS_STRUCT_KIND (node_head , PN_star_expr )) {
816816 EMIT_ARG (unpack_ex , 0 , num_tail );
817817 have_star_index = 0 ;
818818 }
819- for (int i = 0 ; i < num_tail ; i ++ ) {
819+ for (uint i = 0 ; i < num_tail ; i ++ ) {
820820 if (MP_PARSE_NODE_IS_STRUCT_KIND (nodes_tail [i ], PN_star_expr )) {
821- if (have_star_index < 0 ) {
821+ if (have_star_index == ( uint ) - 1 ) {
822822 EMIT_ARG (unpack_ex , num_head + i , num_tail - i - 1 );
823823 have_star_index = num_head + i ;
824824 } else {
@@ -827,7 +827,7 @@ STATIC void c_assign_tuple(compiler_t *comp, mp_parse_node_t node_head, uint num
827827 }
828828 }
829829 }
830- if (have_star_index < 0 ) {
830+ if (have_star_index == ( uint ) - 1 ) {
831831 EMIT_ARG (unpack_sequence , num_head + num_tail );
832832 }
833833 if (num_head != 0 ) {
@@ -837,7 +837,7 @@ STATIC void c_assign_tuple(compiler_t *comp, mp_parse_node_t node_head, uint num
837837 c_assign (comp , node_head , ASSIGN_STORE );
838838 }
839839 }
840- for (int i = 0 ; i < num_tail ; i ++ ) {
840+ for (uint i = 0 ; i < num_tail ; i ++ ) {
841841 if (num_head + i == have_star_index ) {
842842 c_assign (comp , ((mp_parse_node_struct_t * )nodes_tail [i ])-> nodes [0 ], ASSIGN_STORE );
843843 } else {
0 commit comments