From: handa Date: Mon, 5 Sep 2005 05:00:42 +0000 (+0000) Subject: (MTABLE_MALLOC): Don't use a local variable. X-Git-Tag: REL-1-3-0~190 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e53b74c5a18e0225bdf4254413fb360fb05aad4d;p=m17n%2Fm17n-lib.git (MTABLE_MALLOC): Don't use a local variable. (MTABLE_ALLOCA): Change the name of local variable. --- diff --git a/src/internal.h b/src/internal.h index d32c7de..9a67711 100644 --- a/src/internal.h +++ b/src/internal.h @@ -91,11 +91,10 @@ extern int mdebug_hook (); be one of enum MErrorCode. If the allocation fails, the macro MEMORY_FULL () is called with argument ERR. */ -#define MTABLE_MALLOC(p, size, err) \ - do { \ - int bytes = sizeof (*(p)) * (size); \ - if (! ((p) = (void *) malloc (bytes))) \ - MEMORY_FULL (err); \ +#define MTABLE_MALLOC(p, size, err) \ + do { \ + if (! ((p) = (void *) malloc (sizeof (*(p)) * (size)))) \ + MEMORY_FULL (err); \ } while (0) @@ -131,10 +130,10 @@ extern int mdebug_hook (); #define MTABLE_ALLOCA(p, size, err) \ do { \ - int bytes = sizeof (*(p)) * (size); \ - if (! ((p) = (void *) alloca (bytes))) \ + int allocasize = sizeof (*(p)) * (size); \ + if (! ((p) = (void *) alloca (allocasize))) \ MEMORY_FULL (err); \ - memset ((p), 0, bytes); \ + memset ((p), 0, allocasize); \ } while (0)