From 13556ea5ee72c4d0fd94693ebf58d3bcde8d59f7 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 17 Jul 2006 13:59:09 +0000 Subject: [PATCH] * ext/io/wait/wait.c (io_ready_p): protoize. * pack.c (define_swapx): should not use plain malloc. * ext/curses/curses.c (curses_getmouse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ ext/curses/curses.c | 2 +- ext/io/wait/wait.c | 3 +-- pack.c | 7 +++---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0188fb67b0..f16192ac90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Mon Jul 17 22:55:31 2006 Yukihiro Matsumoto + + * ext/io/wait/wait.c (io_ready_p): protoize. + +Mon Jul 17 13:43:05 2006 Yukihiro Matsumoto + + * pack.c (define_swapx): should not use plain malloc. + + * ext/curses/curses.c (curses_getmouse): ditto. + Mon Jul 17 12:58:41 2006 WATANABE Hirofumi * configure.in: should use ac_cv_lib_dl_dlopen=no on MinGW. diff --git a/ext/curses/curses.c b/ext/curses/curses.c index f1d037b19d..5d5fdb567f 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -646,7 +646,7 @@ curses_getmouse(VALUE obj) val = Data_Make_Struct(cMouseEvent,struct mousedata, 0,curses_mousedata_free,mdata); - mdata->mevent = (MEVENT*)malloc(sizeof(MEVENT)); + mdata->mevent = (MEVENT*)xmalloc(sizeof(MEVENT)); return (getmouse(mdata->mevent) == OK) ? val : Qnil; } diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c index 13daaf6b53..4b95698ce7 100644 --- a/ext/io/wait/wait.c +++ b/ext/io/wait/wait.c @@ -53,8 +53,7 @@ EXTERN struct timeval rb_time_interval _((VALUE time)); =end */ static VALUE -io_ready_p(io) - VALUE io; +io_ready_p(VALUE io) { OpenFile *fptr; ioctl_arg n; diff --git a/pack.c b/pack.c index 8ff90369fc..ea81868ae5 100644 --- a/pack.c +++ b/pack.c @@ -52,18 +52,17 @@ #define define_swapx(x, xtype) \ static xtype \ -TOKEN_PASTE(swap,x)(z) \ - xtype z; \ +TOKEN_PASTE(swap,x)(xtype z) \ { \ xtype r; \ xtype *zp; \ unsigned char *s, *t; \ int i; \ \ - zp = malloc(sizeof(xtype)); \ + zp = xmalloc(sizeof(xtype)); \ *zp = z; \ s = (unsigned char*)zp; \ - t = malloc(sizeof(xtype)); \ + t = xmalloc(sizeof(xtype)); \ for (i=0; i