@@ -88,15 +88,15 @@ gen_values(mrc_codegen_scope *s, mrc_node *tree, int val, int limit)
88
88
if (cursp () >= slimit) slimit = INT16_MAX;
89
89
90
90
if (!val) {
91
- for (int i = 0 ; i < cast->arguments .size ; i++) {
91
+ for (size_t i = 0 ; i < cast->arguments .size ; i++) {
92
92
t = (mrc_node *)cast->arguments .nodes [i];
93
93
codegen (s, t, NOVAL);
94
94
n++;
95
95
}
96
96
return n;
97
97
}
98
98
99
- for (int i = 0 ; i < cast->arguments .size ; i++) {
99
+ for (size_t i = 0 ; i < cast->arguments .size ; i++) {
100
100
t = (mrc_node *)cast->arguments .nodes [i];
101
101
if (nint (t) == PM_KEYWORD_HASH_NODE) break ;
102
102
int is_splat = nint (t) == PM_SPLAT_NODE;
@@ -370,7 +370,7 @@ gen_hash(mrc_codegen_scope *s, mrc_node *tree, int val, int limit)
370
370
mrc_bool first = TRUE ;
371
371
372
372
// while (tree) {
373
- for (int i = 0 ; i < elements.size ; i++) {
373
+ for (size_t i = 0 ; i < elements.size ; i++) {
374
374
if (nint (elements.nodes [i]) == PM_ASSOC_SPLAT_NODE) {
375
375
CAST3 (assoc_splat, elements.nodes [i], assocsplat);
376
376
if (val && first) {
@@ -465,7 +465,7 @@ gen_call(mrc_codegen_scope *s, mrc_node *tree, int val, int safe)
465
465
push ();
466
466
}
467
467
}
468
- for (int i = 0 ; i < arguments->arguments .size ; i++) {
468
+ for (size_t i = 0 ; i < arguments->arguments .size ; i++) {
469
469
mrc_node *t = (mrc_node *)arguments->arguments .nodes [i];
470
470
if (nint (t) == PM_KEYWORD_HASH_NODE) { /* keyword arguments */
471
471
noop = 1 ;
@@ -665,7 +665,7 @@ lambda_body(mrc_codegen_scope *s, mrc_node *tree, mrc_node *body, pm_constant_id
665
665
}
666
666
667
667
668
- int ma, mma, oa, ra, pa, ppa, ka, kd, ba, i, forwarding;
668
+ size_t i, ma, mma, oa, ra, pa, ppa, ka, kd, ba, forwarding; ;
669
669
forwarding = 0 ;
670
670
int block_reg = 0 ;
671
671
pm_constant_id_list_t *lv = (pm_constant_id_list_t *)codegen_palloc (s, sizeof (pm_constant_id_list_t ));
@@ -802,15 +802,15 @@ lambda_body(mrc_codegen_scope *s, mrc_node *tree, mrc_node *body, pm_constant_id
802
802
for (i = 0 ; i < ma; i++) {
803
803
if (nint (parameters->requireds .nodes [i]) == PM_MULTI_TARGET_NODE) {
804
804
CAST3 (multi_target, parameters->requireds .nodes [i], m);
805
- for (int j = 0 ; j < m->lefts .size ; j++) {
805
+ for (size_t j = 0 ; j < m->lefts .size ; j++) {
806
806
mrc_constant_id_list_append (s, lv, ((pm_required_parameter_node_t *)m->lefts .nodes [j])->name );
807
807
}
808
808
}
809
809
}
810
810
for (i = 0 ; i < pa; i++) {
811
811
if (nint (parameters->posts .nodes [i]) == PM_MULTI_TARGET_NODE) {
812
812
CAST3 (multi_target, parameters->posts .nodes [i], m);
813
- for (int j = 0 ; j < m->lefts .size ; j++) {
813
+ for (size_t j = 0 ; j < m->lefts .size ; j++) {
814
814
mrc_constant_id_list_append (s, lv, ((pm_required_parameter_node_t *)m->lefts .nodes [j])->name );
815
815
}
816
816
}
@@ -1062,7 +1062,7 @@ gen_rescue(mrc_codegen_scope *s, mrc_node *tree, uint32_t *pos1, int *exc, uint3
1062
1062
if (nint ((mrc_node *)rescue) != PM_RESCUE_NODE) {
1063
1063
codegen_error (s, " should not happen" );
1064
1064
}
1065
- int i;
1065
+ size_t i;
1066
1066
uint32_t pos2, tmp;
1067
1067
1068
1068
dispatch (s, *pos1);
@@ -1249,19 +1249,19 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1249
1249
case PM_MULTI_WRITE_NODE:
1250
1250
{
1251
1251
CAST (multi_write);
1252
- int len = 0 , n = 0 , post = 0 ;
1252
+ size_t len = 0 , n = 0 , post = 0 ;
1253
1253
CAST3 (array, cast->value , t);
1254
1254
int rhs = cursp ();
1255
1255
1256
1256
if (!val && nint ((mrc_node *)t) == PM_ARRAY_NODE && !(t->base .flags & PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT) ) {
1257
1257
/* fixed rhs */
1258
1258
len = t->elements .size ;
1259
- for (int i = 0 ; i < len; i++) {
1259
+ for (size_t i = 0 ; i < len; i++) {
1260
1260
codegen (s, t->elements .nodes [i], VAL);
1261
1261
}
1262
1262
if (0 < cast->lefts .size ) {
1263
1263
n = 0 ;
1264
- for (int i = 0 ; i < cast->lefts .size ; i++) {
1264
+ for (size_t i = 0 ; i < cast->lefts .size ; i++) {
1265
1265
if (i < len) {
1266
1266
gen_assignment (s, cast->lefts .nodes [i], NULL , rhs+n, NOVAL);
1267
1267
n++;
@@ -1291,7 +1291,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1291
1291
n += rn;
1292
1292
}
1293
1293
if (0 < post) {
1294
- for (int i = 0 ; i < post; i++) {
1294
+ for (size_t i = 0 ; i < post; i++) {
1295
1295
if (n < len) {
1296
1296
gen_assignment (s, cast->rights .nodes [i], NULL , rhs+n, NOVAL);
1297
1297
}
@@ -1447,7 +1447,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1447
1447
push_n (2 ); pop_n (2 ); /* space for receiver, arguments and a block */
1448
1448
genop_3 (s, OP_SEND, cursp (), idx, 0 );
1449
1449
1450
- if (-1 != binary_operator) {
1450
+ if (-1 != ( int32_t ) binary_operator) {
1451
1451
push ();
1452
1452
codegen (s, value, VAL);
1453
1453
push (); pop ();
@@ -1510,7 +1510,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1510
1510
}
1511
1511
int base, nargs = 0 ;
1512
1512
int idx, callargs = -1 , vsp = -1 ;
1513
- uint32_t pos = -1 ;
1513
+ int32_t pos = -1 ;
1514
1514
if (val) {
1515
1515
vsp = cursp ();
1516
1516
push ();
@@ -1534,7 +1534,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1534
1534
}
1535
1535
push_n (nargs + 2 ); pop_n (nargs + 2 ); /* space for receiver, arguments and a block */
1536
1536
genop_3 (s, OP_SEND, cursp (), idx, callargs);
1537
- if (-1 != binary_operator) {
1537
+ if (-1 != ( int32_t ) binary_operator) {
1538
1538
push ();
1539
1539
codegen (s, value, VAL);
1540
1540
push (); pop ();
@@ -1885,7 +1885,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1885
1885
push ();
1886
1886
str_begin = TRUE ;
1887
1887
}
1888
- for (int i = 0 ; i < cast->parts .size ; i++) {
1888
+ for (size_t i = 0 ; i < cast->parts .size ; i++) {
1889
1889
codegen (s, cast->parts .nodes [i], VAL);
1890
1890
pop ();
1891
1891
if (str_begin || 0 < i) {
@@ -1915,7 +1915,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1915
1915
push ();
1916
1916
}
1917
1917
else {
1918
- for (int i = 0 ; i < cast->parts .size ; i++) {
1918
+ for (size_t i = 0 ; i < cast->parts .size ; i++) {
1919
1919
if (nint (cast->parts .nodes [i]) != PM_STRING_NODE) {
1920
1920
codegen (s, cast->parts .nodes [i], NOVAL);
1921
1921
}
@@ -1954,7 +1954,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
1954
1954
case PM_INTERPOLATED_STRING_NODE:
1955
1955
case PM_INTERPOLATED_SYMBOL_NODE:
1956
1956
{
1957
- int i;
1957
+ size_t i;
1958
1958
mrc_node **nodes;
1959
1959
uint32_t size;
1960
1960
if (nt == PM_INTERPOLATED_SYMBOL_NODE) {
@@ -2013,7 +2013,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
2013
2013
}
2014
2014
case PM_INTERPOLATED_X_STRING_NODE:
2015
2015
{
2016
- int i;
2016
+ size_t i;
2017
2017
CAST (interpolated_x_string);
2018
2018
int sym = new_sym (s, MRC_SYM_1 (Kernel));
2019
2019
@@ -2296,10 +2296,10 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
2296
2296
head = cursp ();
2297
2297
codegen (s, (mrc_node *)cast->predicate , VAL);
2298
2298
}
2299
- for (int i = 0 ; i < cast->conditions .size ; i++) {
2299
+ for (size_t i = 0 ; i < cast->conditions .size ; i++) {
2300
2300
pm_when_node_t *when = (pm_when_node_t *)cast->conditions .nodes [i];
2301
2301
pos1 = pos2 = JMPLINK_START;
2302
- for (int j = 0 ; j < when->conditions .size ; j++) {
2302
+ for (size_t j = 0 ; j < when->conditions .size ; j++) {
2303
2303
mrc_node *cond = when->conditions .nodes [j];
2304
2304
mrc_bool splat = FALSE ;
2305
2305
if (nint (cond) == PM_SPLAT_NODE) {
@@ -2508,7 +2508,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
2508
2508
case PM_UNDEF_NODE:
2509
2509
{
2510
2510
CAST (undef);
2511
- for (int i = 0 ; i < cast->names .size ; i++) {
2511
+ for (size_t i = 0 ; i < cast->names .size ; i++) {
2512
2512
CAST3 (symbol, cast->names .nodes [i], name);
2513
2513
int symbol = new_sym (s, nsym (s->c ->p , name->unescaped .source , name->unescaped .length ));
2514
2514
genop_1 (s, OP_UNDEF, symbol);
@@ -2540,7 +2540,7 @@ codegen(mrc_codegen_scope *s, mrc_node *tree, int val)
2540
2540
push ();
2541
2541
}
2542
2542
/* keyword arguments */
2543
- for (int i = 0 ; i < arguments->arguments .size ; i++) {
2543
+ for (size_t i = 0 ; i < arguments->arguments .size ; i++) {
2544
2544
mrc_node *t = (mrc_node *)arguments->arguments .nodes [i];
2545
2545
if (nint (t) == PM_KEYWORD_HASH_NODE) {
2546
2546
nk = gen_hash (s, t, VAL, 14 );
0 commit comments