summaryrefslogtreecommitdiff
path: root/ext/tk/tkutil/tkutil.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-20 14:02:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-20 14:02:02 +0000
commit22dcc88584072526fc09bc4a68b51deb1e24d67b (patch)
treeec3f5b63917ec62189012de92e8c41f26b12c3ab /ext/tk/tkutil/tkutil.c
parentbe276c140d26d7205e5f36922d08b0b9ebd24ccc (diff)
* ext/tk/tkutil/tkutil.c: fix shorten-64-to-32 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tkutil/tkutil.c')
-rw-r--r--ext/tk/tkutil/tkutil.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index 2f92b334bb..833057d292 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -12,7 +12,7 @@
#include "ruby.h"
#ifdef RUBY_VM
-static VALUE rb_thread_critical; /* dummy */
+static int rb_thread_critical; /* dummy */
#else
/* On Ruby 1.8.x, use rb_thread_critical (defined at rubysig.h) */
#include "rubysig.h"
@@ -202,8 +202,8 @@ tk_uninstall_cmd(self, cmd_id)
VALUE self;
VALUE cmd_id;
{
- int head_len = strlen(cmd_id_head);
- int prefix_len = strlen(cmd_id_prefix);
+ size_t head_len = strlen(cmd_id_head);
+ size_t prefix_len = strlen(cmd_id_prefix);
StringValue(cmd_id);
if (strncmp(cmd_id_head, RSTRING_PTR(cmd_id), head_len) != 0) {
@@ -298,7 +298,8 @@ ary2list(ary, enc_flag, self)
VALUE enc_flag;
VALUE self;
{
- int idx, idx2, size, size2, req_chk_flag;
+ long idx, idx2, size, size2;
+ int req_chk_flag;
volatile VALUE val, val2, str_val;
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
@@ -451,7 +452,8 @@ ary2list2(ary, enc_flag, self)
VALUE enc_flag;
VALUE self;
{
- int idx, size, req_chk_flag;
+ long idx, size;
+ int req_chk_flag;
volatile VALUE val, str_val;
volatile VALUE dst;
volatile VALUE sys_enc, dst_enc, str_enc;
@@ -551,7 +553,7 @@ assoc2kv(assoc, ary, self)
VALUE ary;
VALUE self;
{
- int i, j, len;
+ long i, j, len;
volatile VALUE pair;
volatile VALUE val;
volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
@@ -599,7 +601,7 @@ assoc2kv_enc(assoc, ary, self)
VALUE ary;
VALUE self;
{
- int i, j, len;
+ long i, j, len;
volatile VALUE pair;
volatile VALUE val;
volatile VALUE dst = rb_ary_new2(2 * RARRAY_LEN(assoc));
@@ -1079,7 +1081,7 @@ tkstr_to_str(value)
VALUE value;
{
char * ptr;
- int len;
+ long len;
ptr = RSTRING_PTR(value);
len = RSTRING_LEN(value);
@@ -1134,7 +1136,7 @@ tcl2rb_num_or_nil(self, value)
#define CBSUBST_TBL_MAX (256)
struct cbsubst_info {
int full_subst_length;
- int keylen[CBSUBST_TBL_MAX];
+ long keylen[CBSUBST_TBL_MAX];
char *key[CBSUBST_TBL_MAX];
char type[CBSUBST_TBL_MAX];
ID ivar[CBSUBST_TBL_MAX];
@@ -1300,7 +1302,8 @@ cbsubst_sym_to_subst(self, sym)
struct cbsubst_info *inf;
const char *str;
char *buf, *ptr;
- int idx, len;
+ int idx;
+ long len;
ID id;
volatile VALUE ret;
@@ -1354,7 +1357,8 @@ cbsubst_get_subst_arg(argc, argv, self)
struct cbsubst_info *inf;
const char *str;
char *buf, *ptr;
- int i, idx, len;
+ int i, idx;
+ long len;
ID id;
volatile VALUE arg_sym, ret;
@@ -1422,7 +1426,8 @@ cbsubst_get_subst_key(self, str)
volatile VALUE list;
volatile VALUE ret;
VALUE keyval;
- int i, len, keylen, idx;
+ long i, len, keylen;
+ int idx;
char *buf, *ptr, *key;
list = rb_funcall(cTclTkLib, ID_split_tklist, 1, str);
@@ -1473,7 +1478,8 @@ cbsubst_get_all_subst_keys(self)
struct cbsubst_info *inf;
char *buf, *ptr;
char *keys_buf, *keys_ptr;
- int idx, len;
+ int idx;
+ long len;
volatile VALUE ret;
Data_Get_Struct(rb_const_get(self, ID_SUBST_INFO),
@@ -1525,7 +1531,7 @@ cbsubst_table_setup(argc, argv, self)
VALUE inf;
ID id;
struct cbsubst_info *subst_inf;
- int idx, len;
+ long idx, len;
unsigned char chr;
/* accept (key_inf, proc_inf) or (key_inf, longkey_inf, procinf) */
@@ -1646,10 +1652,10 @@ cbsubst_scan_args(self, arg_key, val_ary)
VALUE val_ary;
{
struct cbsubst_info *inf;
- int idx;
+ long idx;
unsigned char *keyptr = (unsigned char*)RSTRING_PTR(arg_key);
- int keylen = RSTRING_LEN(arg_key);
- int vallen = RARRAY_LEN(val_ary);
+ long keylen = RSTRING_LEN(arg_key);
+ long vallen = RARRAY_LEN(val_ary);
unsigned char type_chr;
volatile VALUE dst = rb_ary_new2(vallen);
volatile VALUE proc;