[前][次][番号順一覧][スレッド一覧]

ruby-changes:21749

From: nobu <ko1@a...>
Date: Sun, 20 Nov 2011 23:02:10 +0900 (JST)
Subject: [ruby-changes:21749] nobu:r33798 (trunk): * ext/tk/tkutil/tkutil.c: fix shorten-64-to-32 warnings.

nobu	2011-11-20 23:02:02 +0900 (Sun, 20 Nov 2011)

  New Revision: 33798

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33798

  Log:
    * ext/tk/tkutil/tkutil.c: fix shorten-64-to-32 warnings.

  Modified files:
    trunk/ext/tk/tkutil/tkutil.c

Index: ext/tk/tkutil/tkutil.c
===================================================================
--- ext/tk/tkutil/tkutil.c	(revision 33797)
+++ ext/tk/tkutil/tkutil.c	(revision 33798)
@@ -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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     VALUE value;
 {
     char * ptr;
-    int len;
+    long len;
 
     ptr = RSTRING_PTR(value);
     len = RSTRING_LEN(value);
@@ -1134,7 +1136,7 @@
 #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 @@
     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 @@
     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 @@
     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 @@
     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 @@
   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 @@
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]