projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9d1fda9
)
Fixed output of mode_P constants
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 8 Jun 2006 16:03:19 +0000
(16:03 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Thu, 8 Jun 2006 16:03:19 +0000
(16:03 +0000)
[r7897]
ir/tv/tv.c
patch
|
blob
|
history
diff --git
a/ir/tv/tv.c
b/ir/tv/tv.c
index
6c50d1d
..
0e6a172
100644
(file)
--- a/
ir/tv/tv.c
+++ b/
ir/tv/tv.c
@@
-1474,23
+1474,26
@@
int tarval_snprintf(char *buf, size_t len, tarval *tv)
switch (get_mode_sort(tv->mode))
{
switch (get_mode_sort(tv->mode))
{
+ case irms_reference:
+ if (tv == tv->mode->null) return snprintf(buf, len, "NULL");
+ /* fall through */
case irms_int_number:
case irms_character:
switch (mode_info->mode_output) {
case TVO_DECIMAL:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_DEC);
case irms_int_number:
case irms_character:
switch (mode_info->mode_output) {
case TVO_DECIMAL:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_DEC);
- break;
+
break;
case TVO_OCTAL:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_OCT);
case TVO_OCTAL:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_OCT);
- break;
+
break;
case TVO_HEX:
case TVO_NATIVE:
default:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX);
case TVO_HEX:
case TVO_NATIVE:
default:
str = sc_print(tv->value, get_mode_size_bits(tv->mode), SC_HEX);
- break;
+
break;
}
return snprintf(buf, len, "%s%s%s", prefix, str, suffix);
}
return snprintf(buf, len, "%s%s%s", prefix, str, suffix);
@@
-1509,23
+1512,6
@@
int tarval_snprintf(char *buf, size_t len, tarval *tv)
}
break;
}
break;
- case irms_reference:
- if (tv == tv->mode->null) return snprintf(buf, len, "NULL");
- if (tv->value != NULL) {
- if (len > tv->length) {
- memcpy(buf, tv->value, tv->length);
- buf[tv->length] = '\0';
- }
- else {
- /* truncated */
- memcpy(buf, tv->value, len-1);
- buf[len-1] = '\0';
- }
- return tv->length;
- }
- else
- return snprintf(buf, len, "void");
-
case irms_internal_boolean:
switch (mode_info->mode_output) {
case irms_internal_boolean:
switch (mode_info->mode_output) {
@@
-1703,15
+1689,6
@@
static const tarval_mode_info hex_output = {
NULL,
};
NULL,
};
-/**
- * default mode_info for output as reference
- */
-static const tarval_mode_info reference_output = {
- TVO_NATIVE,
- "&(",
- ")",
-};
-
/*
* Initialization of the tarval module: called before init_mode()
*/
/*
* Initialization of the tarval module: called before init_mode()
*/
@@
-1767,7
+1744,7
@@
void init_tarval_2(void)
set_tarval_mode_output_option(mode_Iu, &hex_output);
set_tarval_mode_output_option(mode_Ls, &hex_output);
set_tarval_mode_output_option(mode_Lu, &hex_output);
set_tarval_mode_output_option(mode_Iu, &hex_output);
set_tarval_mode_output_option(mode_Ls, &hex_output);
set_tarval_mode_output_option(mode_Lu, &hex_output);
- set_tarval_mode_output_option(mode_P, &
reference
_output);
+ set_tarval_mode_output_option(mode_P, &
hex
_output);
}
/* free all memory occupied by tarval. */
}
/* free all memory occupied by tarval. */