Use G_GINT64_MODIFIER for qofmath test.

Fixes the problem Andreas noticed on amd64.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15304 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2007-01-03 00:12:19 +00:00
parent d122eddbb6
commit 7a763898d3

View File

@ -330,21 +330,12 @@ add128 (qofint128 a, qofint128 b)
#ifdef TEST_128_BIT_MULT
#ifdef HAVE_SCANF_LLD
#define LLX "%llx"
#elif HAVE_SCANF_QD
#define LLX "%qx"
#elif HAVE_SCANF_I64D
#define LLX "%I64x"
#else
#error "Unknown 64-bit Hex code"
#endif
static void pr (gint64 a, gint64 b)
{
qofint128 prod = mult128 (a,b);
printf ("%" G_GINT64_FORMAT " * %" G_GINT64_FORMAT " = %"
G_GUINT64_FORMAT " %" G_GUINT64_FORMAT " (0x" LLX " " LLX ") %hd\n",
G_GUINT64_FORMAT " %" G_GUINT64_FORMAT " (0x%"
G_GINT64_MODIFIER "x %" G_GINT64_MODIFIER "x) %hd\n",
a, b, prod.hi, prod.lo, prod.hi, prod.lo, prod.isbig);
}
@ -355,7 +346,8 @@ static void prd (gint64 a, gint64 b, gint64 c)
gint64 rem = rem128 (prod, c);
printf ("%" G_GINT64_FORMAT " * %" G_GINT64_FORMAT " / %" G_GINT64_FORMAT
" = %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT " + %"
G_GINT64_FORMAT " (0x" LLX " " LLX ") %hd\n",
G_GINT64_FORMAT " (0x%" G_GINT64_MODIFIER "x %"
G_GINT64_MODIFIER "x) %hd\n",
a, b, c, quot.hi, quot.lo, rem, quot.hi, quot.lo, quot.isbig);
}
@ -412,7 +404,8 @@ int main ()
for (i=0; i<20; i++) {
quot = div128 (n, d);
printf ("%d result = " LLX " " LLX "\n", i, quot.hi, quot.lo);
printf ("%d result = %" G_GINT64_MODIFIER "x %" G_GINT64_MODIFIER "x\n",
i, quot.hi, quot.lo);
d >>=1;
n = shift128 (n);
}