|
12 | 12 | #include "ruby.h" |
13 | 13 |
|
14 | 14 | #ifdef RUBY_VM |
15 | | -static VALUE rb_thread_critical; /* dummy */ |
| 15 | +static int rb_thread_critical; /* dummy */ |
16 | 16 | #else |
17 | 17 | /* On Ruby 1.8.x, use rb_thread_critical (defined at rubysig.h) */ |
18 | 18 | #include "rubysig.h" |
@@ -202,8 +202,8 @@ tk_uninstall_cmd(self, cmd_id) |
202 | 202 | VALUE self; |
203 | 203 | VALUE cmd_id; |
204 | 204 | { |
205 | | - int head_len = strlen(cmd_id_head); |
206 | | - int prefix_len = strlen(cmd_id_prefix); |
| 205 | + size_t head_len = strlen(cmd_id_head); |
| 206 | + size_t prefix_len = strlen(cmd_id_prefix); |
207 | 207 |
|
208 | 208 | StringValue(cmd_id); |
209 | 209 | if (strncmp(cmd_id_head, RSTRING_PTR(cmd_id), head_len) != 0) { |
@@ -298,7 +298,8 @@ ary2list(ary, enc_flag, self) |
298 | 298 | VALUE enc_flag; |
299 | 299 | VALUE self; |
300 | 300 | { |
301 | | - int idx, idx2, size, size2, req_chk_flag; |
| 301 | + long idx, idx2, size, size2; |
| 302 | + int req_chk_flag; |
302 | 303 | volatile VALUE val, val2, str_val; |
303 | 304 | volatile VALUE dst; |
304 | 305 | volatile VALUE sys_enc, dst_enc, str_enc; |
@@ -451,7 +452,8 @@ ary2list2(ary, enc_flag, self) |
451 | 452 | VALUE enc_flag; |
452 | 453 | VALUE self; |
453 | 454 | { |
454 | | - int idx, size, req_chk_flag; |
| 455 | + long idx, size; |
| 456 | + int req_chk_flag; |
455 | 457 | volatile VALUE val, str_val; |
456 | 458 | volatile VALUE dst; |
457 | 459 | volatile VALUE sys_enc, dst_enc, str_enc; |
@@ -551,7 +553,7 @@ assoc2kv(assoc, ary, self) |
551 | 553 | VALUE ary; |
552 | 554 | VALUE self; |
553 | 555 | { |
554 | | - int i, j, len; |
| 556 | + long i, j, len; |
555 | 557 | volatile VALUE pair; |
556 | 558 | volatile VALUE val; |
557 | 559 | volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc)); |
@@ -599,7 +601,7 @@ assoc2kv_enc(assoc, ary, self) |
599 | 601 | VALUE ary; |
600 | 602 | VALUE self; |
601 | 603 | { |
602 | | - int i, j, len; |
| 604 | + long i, j, len; |
603 | 605 | volatile VALUE pair; |
604 | 606 | volatile VALUE val; |
605 | 607 | volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc)); |
@@ -1079,7 +1081,7 @@ tkstr_to_str(value) |
1079 | 1081 | VALUE value; |
1080 | 1082 | { |
1081 | 1083 | char * ptr; |
1082 | | - int len; |
| 1084 | + long len; |
1083 | 1085 |
|
1084 | 1086 | ptr = RSTRING_PTR(value); |
1085 | 1087 | len = RSTRING_LEN(value); |
@@ -1134,7 +1136,7 @@ tcl2rb_num_or_nil(self, value) |
1134 | 1136 | #define CBSUBST_TBL_MAX (256) |
1135 | 1137 | struct cbsubst_info { |
1136 | 1138 | int full_subst_length; |
1137 | | - int keylen[CBSUBST_TBL_MAX]; |
| 1139 | + long keylen[CBSUBST_TBL_MAX]; |
1138 | 1140 | char *key[CBSUBST_TBL_MAX]; |
1139 | 1141 | char type[CBSUBST_TBL_MAX]; |
1140 | 1142 | ID ivar[CBSUBST_TBL_MAX]; |
@@ -1300,7 +1302,8 @@ cbsubst_sym_to_subst(self, sym) |
1300 | 1302 | struct cbsubst_info *inf; |
1301 | 1303 | const char *str; |
1302 | 1304 | char *buf, *ptr; |
1303 | | - int idx, len; |
| 1305 | + int idx; |
| 1306 | + long len; |
1304 | 1307 | ID id; |
1305 | 1308 | volatile VALUE ret; |
1306 | 1309 |
|
@@ -1354,7 +1357,8 @@ cbsubst_get_subst_arg(argc, argv, self) |
1354 | 1357 | struct cbsubst_info *inf; |
1355 | 1358 | const char *str; |
1356 | 1359 | char *buf, *ptr; |
1357 | | - int i, idx, len; |
| 1360 | + int i, idx; |
| 1361 | + long len; |
1358 | 1362 | ID id; |
1359 | 1363 | volatile VALUE arg_sym, ret; |
1360 | 1364 |
|
@@ -1422,7 +1426,8 @@ cbsubst_get_subst_key(self, str) |
1422 | 1426 | volatile VALUE list; |
1423 | 1427 | volatile VALUE ret; |
1424 | 1428 | VALUE keyval; |
1425 | | - int i, len, keylen, idx; |
| 1429 | + long i, len, keylen; |
| 1430 | + int idx; |
1426 | 1431 | char *buf, *ptr, *key; |
1427 | 1432 |
|
1428 | 1433 | list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str); |
@@ -1473,7 +1478,8 @@ cbsubst_get_all_subst_keys(self) |
1473 | 1478 | struct cbsubst_info *inf; |
1474 | 1479 | char *buf, *ptr; |
1475 | 1480 | char *keys_buf, *keys_ptr; |
1476 | | - int idx, len; |
| 1481 | + int idx; |
| 1482 | + long len; |
1477 | 1483 | volatile VALUE ret; |
1478 | 1484 |
|
1479 | 1485 | Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO), |
@@ -1525,7 +1531,7 @@ cbsubst_table_setup(argc, argv, self) |
1525 | 1531 | VALUE inf; |
1526 | 1532 | ID id; |
1527 | 1533 | struct cbsubst_info *subst_inf; |
1528 | | - int idx, len; |
| 1534 | + long idx, len; |
1529 | 1535 | unsigned char chr; |
1530 | 1536 |
|
1531 | 1537 | /* accept (key_inf, proc_inf) or (key_inf, longkey_inf, procinf) */ |
@@ -1646,10 +1652,10 @@ cbsubst_scan_args(self, arg_key, val_ary) |
1646 | 1652 | VALUE val_ary; |
1647 | 1653 | { |
1648 | 1654 | struct cbsubst_info *inf; |
1649 | | - int idx; |
| 1655 | + long idx; |
1650 | 1656 | unsigned char *keyptr = (unsigned char*)RSTRING_PTR(arg_key); |
1651 | | - int keylen = RSTRING_LEN(arg_key); |
1652 | | - int vallen = RARRAY_LEN(val_ary); |
| 1657 | + long keylen = RSTRING_LEN(arg_key); |
| 1658 | + long vallen = RARRAY_LEN(val_ary); |
1653 | 1659 | unsigned char type_chr; |
1654 | 1660 | volatile VALUE dst = rb_ary_new2(vallen); |
1655 | 1661 | volatile VALUE proc; |
|
0 commit comments