From: Christoph Mallon Date: Wed, 21 Nov 2007 16:11:15 +0000 (+0000) Subject: Use new_tarval_from_double() to create floating point constants. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=21708118f00510d7b1aa28e16012b26944dca640;p=cparser Use new_tarval_from_double() to create floating point constants. [r18504] --- diff --git a/ast2firm.c b/ast2firm.c index c7764f4..6caa8a7 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -559,15 +559,15 @@ static ir_node *const_to_firm(const const_t *cnst) tarval *tv; size_t len; if(mode_is_float(mode)) { - len = snprintf(buf, sizeof(buf), "%LF", cnst->v.float_value); + tv = new_tarval_from_double(cnst->v.float_value, mode); } else { if(mode_is_signed(mode)) { len = snprintf(buf, sizeof(buf), "%lld", cnst->v.int_value); } else { len = snprintf(buf, sizeof(buf), "%llu", cnst->v.int_value); } + tv = new_tarval_from_str(buf, len, mode); } - tv = new_tarval_from_str(buf, len, mode); return new_d_Const(dbgi, mode, tv); }