From eeb299763f1a1883ca5e33e5bd6788446322607d Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 28 Apr 2003 14:00:12 +0000 Subject: [PATCH] New function tarval_snprintf() used instead of tarval_xprintf [r1089] --- ir/ir/irdump.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 7d4f0c530..e2e4ed9a6 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -136,11 +136,16 @@ static void dump_whole_node(ir_node *n, void* env); static INLINE void dump_node_opcode (ir_node *n) { + char buf[1024]; + int res; + assert(n && n->op); /* Const */ if (n->op->code == iro_Const) { - tarval_xprintf ((printf_func*) fprintf,F,n->attr.con); + res = tarval_snprintf(buf, sizeof(buf), n->attr.con); + assert(res < sizeof(buf) && "buffer to small for tarval_snprintf"); + fprintf(F, buf); /* SymConst */ } else if (n->op->code == iro_SymConst) { @@ -333,6 +338,9 @@ dump_node (ir_node *n, pmap * map) { static void dump_ir_node (ir_node *n) { + char buf[1024]; + int res; + /* dump this node */ fprintf (F, "node: {title: \""); PRINT_NODEID(n); fprintf(F, "\" label: "); @@ -361,9 +369,10 @@ dump_ir_node (ir_node *n) PRINT_DEFAULT_NODE_ATTR; break; case iro_Const: - fprintf (F, "\""); - tarval_xprintf((printf_func*) fprintf,F,n->attr.con); - fprintf (F, "%s\" color: yellow ",id_to_str(get_irn_modeident(n))); + res = tarval_snprintf(buf, sizeof(buf), n->attr.con); + assert(res < sizeof(buf) && "buffer to small for tarval_snprintf"); + + fprintf (F, "\"%s%s\" color: yellow ", buf, id_to_str(get_irn_modeident(n))); PRINT_DEFAULT_NODE_ATTR; break; case iro_Proj: -- 2.20.1