X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Flibcore%2Flc_printf.c;h=458d3dcf7c2369a7a42fbc196fd9fae9cfb50746;hb=2e3f03db78d2a5a8cfc94dd09bdc086034b57bd7;hp=89e512055de368e16c0b0e9f7f019fe042a26a52;hpb=ce692f583b1aa87977d8d9aaffabc8e673cea36a;p=libfirm diff --git a/ir/libcore/lc_printf.c b/ir/libcore/lc_printf.c index 89e512055..458d3dcf7 100644 --- a/ir/libcore/lc_printf.c +++ b/ir/libcore/lc_printf.c @@ -23,6 +23,7 @@ * @author Sebastian Hack * @date 4.12.2005 */ +#include "config.h" #include #include @@ -58,7 +59,7 @@ struct _lc_arg_env_t { /** The default argument environment. */ static lc_arg_env_t *default_env = NULL; -static INLINE lc_arg_env_t *_lc_arg_get_default_env(void) +static inline lc_arg_env_t *_lc_arg_get_default_env(void) { if(!default_env) default_env = lc_arg_add_std(lc_arg_new_env()); @@ -81,8 +82,7 @@ static int lc_arg_cmp(const void *p1, const void *p2, UNUSED(size_t size)) lc_arg_env_t *lc_arg_new_env(void) { - lc_arg_env_t *env = xmalloc(sizeof(*env)); - memset(env, 0, sizeof(*env)); + lc_arg_env_t *env = XMALLOCZ(lc_arg_env_t); env->args = new_set(lc_arg_cmp, 16); return env; } @@ -257,7 +257,7 @@ static int std_emit(lc_appendable_t *app, const lc_arg_occ_t *occ, const lc_arg_ default: { int len = LC_MAX(128, occ->width + 1); - char *buf = xmalloc(len * sizeof(char)); + char *buf = XMALLOCN(char, len); res = dispatch_snprintf(buf, len, fmt, occ->lc_arg_type, val); res = lc_appendable_snadd(app, buf, res); xfree(buf);