From 7f3e510992a58ac8f8813c43996b88d68b0d2cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 2 Mar 2011 09:18:51 +0000 Subject: [PATCH] get rid of aliasing warnings. --- packages/PLStream/pl-fmt.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/PLStream/pl-fmt.c b/packages/PLStream/pl-fmt.c index 7b7077249..45d376ba0 100644 --- a/packages/PLStream/pl-fmt.c +++ b/packages/PLStream/pl-fmt.c @@ -201,7 +201,7 @@ static int emit_rubber(format_state *state); word pl_format_predicate(term_t chr, term_t descr) { int c; - predicate_t proc; + predicate_t proc = NULL; Symbol s; int arity; @@ -507,7 +507,10 @@ do_format(IOSTREAM *fd, PL_chars_t *fmt, int argc, term_t argv) case 'g': /* shortest of 'f' and 'e' */ case 'G': /* shortest of 'f' and 'E' */ { number n; - tmp_buffer b; + union { + tmp_buffer b; + buffer b1; + } u; NEED_ARG; if ( !valueExpression(argv, &n PASS_LD) ) @@ -519,11 +522,11 @@ do_format(IOSTREAM *fd, PL_chars_t *fmt, int argc, term_t argv) } SHIFT; - initBuffer(&b); - formatFloat(c, arg, &n, (Buffer)&b); + initBuffer(&u.b); + formatFloat(c, arg, &n, &u.b1); clearNumber(&n); - outstring0(&state, baseBuffer(&b, char)); - discardBuffer(&b); + outstring0(&state, baseBuffer(&u.b, char)); + discardBuffer(&u.b); here++; break; }