Index: node.c =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/node.c,v retrieving revision 1.1.1.1 diff -b -u -p -r1.1.1.1 node.c --- node.c 28 Jul 2004 13:45:04 -0000 1.1.1.1 +++ node.c 21 Dec 2005 20:42:56 -0000 @@ -145,7 +145,7 @@ format_val(const char *format, int index { char buf[BUFSIZ]; register char *sp = buf; - double val; + long num; char *orig, *trans, save; if (! do_traditional && (s->flags & INTLSTR) != 0) { @@ -160,8 +160,7 @@ format_val(const char *format, int index } /* not an integral value, or out of range */ - if ((val = double_to_int(s->numbr)) != s->numbr - || val < LONG_MIN || val > LONG_MAX) { + if (((AWKNUM)(num = (long)double_to_int(s->numbr))) != s->numbr) { /* * Once upon a time, if GFMT_WORKAROUND wasn't defined, * we just blindly did this: @@ -197,7 +196,6 @@ format_val(const char *format, int index } else { /* integral value */ /* force conversion to long only once */ - register long num = (long) val; if (num < NVAL && num >= 0) { sp = (char *) values[num]; s->stlen = 1; Index: builtin.c =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/builtin.c,v retrieving revision 1.6 diff -b -u -p -r1.6 builtin.c --- builtin.c 14 Nov 2005 15:27:24 -0000 1.6 +++ builtin.c 21 Dec 2005 20:42:57 -0000 @@ -937,16 +937,15 @@ check_pos: goto pr_tail; if (tmpval < 0) { - if (tmpval < INTMAX_MIN) + uval = -tmpval; + if (-(AWKNUM)uval != tmpval) goto out_of_range; sgn = TRUE; - uval = - (uintmax_t) (intmax_t) tmpval; } else { /* Use !, so that NaNs are out of range. */ - if (! (tmpval <= UINTMAX_MAX)) + if ((uval = (uintmax_t) tmpval) != tmpval) goto out_of_range; sgn = FALSE; - uval = (uintmax_t) tmpval; } ii = jj = 0; do {