summaryrefslogtreecommitdiffstats
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-17 13:59:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-17 13:59:09 +0000
commita8799c688968fd059cb49b06eb62b6ccea8396ee (patch)
treeb8fe5723cc3fa40e3c0390d3aef8f4b2396c67b4 /pack.c
parent4e541c3ef91f7c115cdd4694e76b556e2b3db93c (diff)
downloadruby-a8799c688968fd059cb49b06eb62b6ccea8396ee.tar.gz
ruby-a8799c688968fd059cb49b06eb62b6ccea8396ee.tar.xz
ruby-a8799c688968fd059cb49b06eb62b6ccea8396ee.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@10546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/pack.c b/pack.c
index 8ff90369f..ea81868ae 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<sizeof(xtype); i++) { \
t[sizeof(xtype)-i-1] = s[i]; \
} \