From 350e569c2cc0438dceff97fdd0b7ef4f9c029ac8 Mon Sep 17 00:00:00 2001 From: Godzil Date: Thu, 14 Mar 2013 21:41:37 +0100 Subject: [PATCH] Correct printf with 64bit pointer --- util/amisc/ashow.c | 2 +- util/topgen/pattern.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/amisc/ashow.c b/util/amisc/ashow.c index eff632cb7..e8ec12a9e 100644 --- a/util/amisc/ashow.c +++ b/util/amisc/ashow.c @@ -98,7 +98,7 @@ void show(struct outhead *headp) * Now we can show all names. */ for (np = &name[0]; np < &name[headp->oh_nname]; np++) { - printf("Name %d:\n", np - name); + printf("Name %ld:\n",(long)(np - name)); showname(np); } } diff --git a/util/topgen/pattern.c b/util/topgen/pattern.c index d7e82e9a7..e009da548 100644 --- a/util/topgen/pattern.c +++ b/util/topgen/pattern.c @@ -129,7 +129,7 @@ void printpatterns() while (p < current) { if (p->p_constraint) { /* The pattern has a constraint */ - fprintf(genc,"\tcase %d :\n",p - pattable); + fprintf(genc,"\tcase %ld :\n",(long)(p - pattable)); fprintf(genc,linedir,p->p_lineno,inpfile); /* linedirective */ fputs("\tr = (",genc); prconstraint(p->p_constraint);