From a04522357c5561bcc85d1f6c366e413807aa4d77 Mon Sep 17 00:00:00 2001 From: kientzle Date: Sun, 7 Apr 2013 05:53:42 +0000 Subject: [PATCH] The CELL fields can be various integer types depending on the platform (ARM uses 'int' and 'unsigned'; i386 uses 'long' and 'unsigned long'), so we need explicit casts to long and unsigned long here to ensure that the result matches the printf %ld and %lx specifiers. --- sys/boot/ficl/tools.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/boot/ficl/tools.c b/sys/boot/ficl/tools.c index 02f9acf3c66b..720166319564 100644 --- a/sys/boot/ficl/tools.c +++ b/sys/boot/ficl/tools.c @@ -216,10 +216,11 @@ static void seeColon(FICL_VM *pVM, CELL *pc) { FICL_WORD *pLit = (FICL_WORD *)c.p; sprintf(cp, "%.*s ( %#lx literal )", - pLit->nName, pLit->name, c.u); + pLit->nName, pLit->name, (unsigned long)c.u); } else - sprintf(cp, "literal %ld (%#lx)", c.i, c.u); + sprintf(cp, "literal %ld (%#lx)", + (long)c.i, (unsigned long)c.u); break; case STRINGLIT: { @@ -281,7 +282,7 @@ static void seeColon(FICL_VM *pVM, CELL *pc) } else /* probably not a word - punt and print value */ { - sprintf(cp, "%ld ( %#lx )", pc->i, pc->u); + sprintf(cp, "%ld ( %#lx )", (long)pc->i, (unsigned long)pc->u); } vmTextOut(pVM, pVM->pad, 1); @@ -324,19 +325,22 @@ static void seeXT(FICL_VM *pVM) break; case VARIABLE: - sprintf(pVM->pad, "variable = %ld (%#lx)", pFW->param->i, pFW->param->u); + sprintf(pVM->pad, "variable = %ld (%#lx)", + (long)pFW->param->i, (unsigned long)pFW->param->u); vmTextOut(pVM, pVM->pad, 1); break; #if FICL_WANT_USER case USER: - sprintf(pVM->pad, "user variable %ld (%#lx)", pFW->param->i, pFW->param->u); + sprintf(pVM->pad, "user variable %ld (%#lx)", + (long)pFW->param->i, (unsigned long)pFW->param->u); vmTextOut(pVM, pVM->pad, 1); break; #endif case CONSTANT: - sprintf(pVM->pad, "constant = %ld (%#lx)", pFW->param->i, pFW->param->u); + sprintf(pVM->pad, "constant = %ld (%#lx)", + (long)pFW->param->i, (unsigned long)pFW->param->u); vmTextOut(pVM, pVM->pad, 1); default: