X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flibcore%2Flc_opts_enum.c;h=c286f97c813e91a3d8df744be95b38ac7c60a769;hb=89be0b49f0d8da284c9cbbbf048c7fba0574769d;hp=ebcb034b38a33ee47a2088818e674bfabd891001;hpb=b2bc749a070c19f486cde1f847ad4c4e08194a00;p=libfirm diff --git a/ir/libcore/lc_opts_enum.c b/ir/libcore/lc_opts_enum.c index ebcb034b3..c286f97c8 100644 --- a/ir/libcore/lc_opts_enum.c +++ b/ir/libcore/lc_opts_enum.c @@ -15,17 +15,14 @@ #include #include -#ifdef _WIN32 -#include -#endif - #include "lc_opts_t.h" #include "lc_opts_enum.h" +#include "xmalloc.h" static const char *delim = " \t|,"; #define DECL_CB(N, op) \ -int lc_opt_enum_ ## N ## _cb(LC_UNUSED(const char *name), LC_UNUSED(lc_opt_type_t type), void *data, size_t len, ...) \ +int lc_opt_enum_ ## N ## _cb(const char *name, lc_opt_type_t type, void *data, size_t len, ...) \ { \ lc_opt_enum_ ## N ## _var_t *var = (lc_opt_enum_ ## N ## _var_t*)data; \ const lc_opt_enum_ ## N ## _items_t *items = var->items; \ @@ -36,6 +33,8 @@ int lc_opt_enum_ ## N ## _cb(LC_UNUSED(const char *name), LC_UNUSED(lc_opt_type_ const char *arg; \ int res = 0; \ \ + (void) name; \ + (void) type; \ va_start(args, len); \ arg = va_arg(args, const char *); \ va_end(args); \ @@ -72,7 +71,7 @@ DECL_CB(const_ptr, =) DECL_CB(func_ptr, =) #define DECL_DUMP(T, N, cond) \ -int lc_opt_enum_ ## N ## _dump(char *buf, size_t n, LC_UNUSED(const char *name), LC_UNUSED(lc_opt_type_t type), void *data, LC_UNUSED(size_t len)) \ +int lc_opt_enum_ ## N ## _dump(char *buf, size_t n, const char *name, lc_opt_type_t type, void *data, size_t len) \ { \ lc_opt_enum_ ## N ## _var_t *var = (lc_opt_enum_ ## N ## _var_t*)data; \ const lc_opt_enum_ ## N ## _items_t *items = var->items; \ @@ -80,6 +79,9 @@ int lc_opt_enum_ ## N ## _dump(char *buf, size_t n, LC_UNUSED(const char *name), TYPE(value) = *var->value; \ int i; \ size_t l = strlen(buf); \ + (void) name; \ + (void) type; \ + (void) len; \ \ if (l >= n) \ return (int)l; \ @@ -104,13 +106,16 @@ int lc_opt_enum_ ## N ## _dump(char *buf, size_t n, LC_UNUSED(const char *name), #define DECL_DUMP_VALS(T, N) \ -int lc_opt_enum_ ## N ## _dump_vals(char *buf, size_t n, LC_UNUSED(const char *name), LC_UNUSED(lc_opt_type_t type), void *data, LC_UNUSED(size_t len)) \ +int lc_opt_enum_ ## N ## _dump_vals(char *buf, size_t n, const char *name, lc_opt_type_t type, void *data, size_t len) \ { \ lc_opt_enum_ ## N ## _var_t *var = (lc_opt_enum_ ## N ## _var_t*) data; \ const lc_opt_enum_ ## N ## _items_t *items = var->items; \ const char *prefix = ""; \ int i; \ size_t l = strlen(buf); \ + (void) name; \ + (void) type; \ + (void) len; \ \ if (l >= n) \ return (int)l; \