summaryrefslogtreecommitdiff
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
commit13556ea5ee72c4d0fd94693ebf58d3bcde8d59f7 (patch)
treeb8fe5723cc3fa40e3c0390d3aef8f4b2396c67b4 /pack.c
parent0227035dd379c4345084fe3fccb1925147549a9e (diff)
* 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
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 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<sizeof(xtype); i++) { \
t[sizeof(xtype)-i-1] = s[i]; \
} \