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

ruby-changes:14829

From: nobu <ko1@a...>
Date: Wed, 17 Feb 2010 14:26:51 +0900 (JST)
Subject: [ruby-changes:14829] Ruby:r26693 (trunk): * ext/dl/cfunc.c (rb_dlcfunc_inspect): get rid of overflow.

nobu	2010-02-17 14:26:33 +0900 (Wed, 17 Feb 2010)

  New Revision: 26693

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

  Log:
    * ext/dl/cfunc.c (rb_dlcfunc_inspect): get rid of overflow.
    
    * ext/dl/closure.c (dlc_callback, rb_dlclosure_init): ditto.
    
    * ext/dl/cptr.c (rb_dlptr_s_malloc): ditto.
    
    * ext/dl/method.c (rb_dlfunction_initialize): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/ext/dl/cfunc.c
    trunk/ext/dl/closure.c
    trunk/ext/dl/cptr.c
    trunk/ext/dl/method.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26692)
+++ ChangeLog	(revision 26693)
@@ -1,3 +1,13 @@
+Wed Feb 17 14:26:30 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/dl/cfunc.c (rb_dlcfunc_inspect): get rid of overflow.
+
+	* ext/dl/closure.c (dlc_callback, rb_dlclosure_init): ditto.
+
+	* ext/dl/cptr.c (rb_dlptr_s_malloc): ditto.
+
+	* ext/dl/method.c (rb_dlfunction_initialize): ditto.
+
 Wed Feb 17 01:16:12 2010  Yusuke Endoh  <mame@t...>
 
 	* hash.c (hash_update): always raise an exception when adding a new
Index: ext/dl/cfunc.c
===================================================================
--- ext/dl/cfunc.c	(revision 26692)
+++ ext/dl/cfunc.c	(revision 26693)
@@ -284,7 +284,7 @@
 {
     VALUE val;
     char  *str;
-    int str_size;
+    size_t str_size;
     struct cfunc_data *cfunc;
 
     TypedData_Get_Struct(self, struct cfunc_data, &dlcfunc_data_type, cfunc);
Index: ext/dl/method.c
===================================================================
--- ext/dl/method.c	(revision 26692)
+++ ext/dl/method.c	(revision 26693)
@@ -91,7 +91,7 @@
     result = ffi_prep_cif (
 	    cif,
 	    NUM2INT(abi),
-	    RARRAY_LEN(args),
+	    RARRAY_LENINT(args),
 	    DL2FFI_TYPE(NUM2INT(ret_type)),
 	    arg_types);
 
Index: ext/dl/cptr.c
===================================================================
--- ext/dl/cptr.c	(revision 26692)
+++ ext/dl/cptr.c	(revision 26693)
@@ -186,7 +186,7 @@
 rb_dlptr_s_malloc(int argc, VALUE argv[], VALUE klass)
 {
     VALUE size, sym, obj;
-    int   s;
+    long s;
     freefunc_t f;
 
     switch (rb_scan_args(argc, argv, "11", &size, &sym)) {
Index: ext/dl/closure.c
===================================================================
--- ext/dl/closure.c	(revision 26692)
+++ ext/dl/closure.c	(revision 26693)
@@ -57,7 +57,7 @@
     VALUE self      = (VALUE)ctx;
     VALUE rbargs    = rb_iv_get(self, "@args");
     VALUE ctype     = rb_iv_get(self, "@ctype");
-    int argc        = RARRAY_LEN(rbargs);
+    int argc        = RARRAY_LENINT(rbargs);
     VALUE *params   = xcalloc(argc, sizeof(VALUE *));
     VALUE ret;
     int i, dl_type;
@@ -165,7 +165,7 @@
     if (2 == rb_scan_args(rbargc, argv, "21", &ret, &args, &abi))
 	abi = INT2NUM(FFI_DEFAULT_ABI);
 
-    argc = RARRAY_LEN(args);
+    argc = RARRAY_LENINT(args);
 
     TypedData_Get_Struct(self, dl_closure, &dlclosure_data_type, cl);
 

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

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