Reacted on warnings of -Wunused-but-set-variable

This commit is contained in:
Thomas Schmitt 2011-07-04 15:56:26 +02:00
parent 842b62d111
commit 2d568c1dbb
2 changed files with 7 additions and 2 deletions

View File

@ -247,9 +247,8 @@ void iso_msg_debug(int imgid, const char *fmt, ...)
{
char *msg = NULL;
va_list ap;
int ret;
LIBISO_ALLOC_MEM(msg, char, MAX_MSG_LEN);
LIBISO_ALLOC_MEM_VOID(msg, char, MAX_MSG_LEN);
va_start(ap, fmt);
vsnprintf(msg, MAX_MSG_LEN, fmt, ap);
va_end(ap);

View File

@ -547,6 +547,12 @@ void *iso_alloc_mem(size_t size, size_t count, int flag);
ret= ISO_OUT_OF_MEM; goto ex; \
} }
#define LIBISO_ALLOC_MEM_VOID(pt, typ, count) { \
pt= (typ *) iso_alloc_mem(sizeof(typ), (size_t) (count), 0); \
if(pt == NULL) { \
goto ex; \
} }
#define LIBISO_FREE_MEM(pt) { \
if(pt != NULL) \
free((char *) pt); \