summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2013-04-07 05:53:42 +0000
committerkientzle <kientzle@FreeBSD.org>2013-04-07 05:53:42 +0000
commita04522357c5561bcc85d1f6c366e413807aa4d77 (patch)
treeadddd0627e58c74a326f280b3cd990a84b7d46f1 /sys/boot
parent1fd889a6f3998cbaf12fdf4c18fdc323faa8c406 (diff)
downloadFreeBSD-src-a04522357c5561bcc85d1f6c366e413807aa4d77.zip
FreeBSD-src-a04522357c5561bcc85d1f6c366e413807aa4d77.tar.gz
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.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/ficl/tools.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/boot/ficl/tools.c b/sys/boot/ficl/tools.c
index 02f9acf..7201663 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:
OpenPOWER on IntegriCloud