X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftv%2Ftv.c;h=36487127c25ae2adf56806deea25ba7875e790f1;hb=6571b31236f780199ba476adc33ee23518200497;hp=819a72b1463c35ac56a5e1df142aa2a29bc096ff;hpb=3fb8e424c9b3bc2e66c1c0378635c4dfe20ef845;p=libfirm diff --git a/ir/tv/tv.c b/ir/tv/tv.c index 819a72b14..36487127c 100644 --- a/ir/tv/tv.c +++ b/ir/tv/tv.c @@ -24,7 +24,7 @@ * @date 2003 * @author Mathias Heil * @version $Id$ - * @summary + * @brief * * Values are stored in a format depending upon chosen arithmetic * module. Default uses strcalc and fltcalc. @@ -33,19 +33,19 @@ */ #include "config.h" -#include /* assertions */ -#include /* atoi() */ +#include +#include #include #ifdef HAVE_STRINGS_H -#include /* strings.h also includes bsd only function strcasecmp */ +#include #endif #include #include "tv_t.h" -#include "set.h" /* to store tarvals in */ -#include "entity_t.h" /* needed to store pointers to entities */ +#include "set.h" +#include "entity_t.h" #include "irmode_t.h" -#include "irnode.h" /* defines boolean return values (pnc_number)*/ +#include "irnode.h" #include "strcalc.h" #include "fltcalc.h" #include "irtools.h" @@ -351,7 +351,7 @@ tarval *new_tarval_from_str(const char *str, size_t len, ir_mode *mode) case irms_reference: if (!strcasecmp(str, "null")) return get_tarval_null(mode); - /* fall through */ + /* FALLTHROUGH */ case irms_int_number: sc_val_from_str(str, len, NULL, mode); return get_tarval(sc_get_buffer(), sc_get_buffer_length(), mode); @@ -1439,7 +1439,7 @@ int tarval_snprintf(char *buf, size_t len, tarval *tv) { switch (get_mode_sort(tv->mode)) { case irms_reference: if (tv == tv->mode->null) return snprintf(buf, len, "NULL"); - /* fall through */ + /* FALLTHROUGH */ case irms_int_number: switch (mode_info->mode_output) { @@ -1451,8 +1451,9 @@ int tarval_snprintf(char *buf, size_t len, tarval *tv) { str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_OCT, 0); break; - case TVO_HEX: case TVO_NATIVE: + prefix = "0x"; + case TVO_HEX: default: str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX, 0); break;