Correct printf with 64bit pointer
authorGodzil <godzil@godzil.net>
Thu, 14 Mar 2013 20:41:37 +0000 (21:41 +0100)
committerManoël Trapier <godzil@MacBook-Pro.home>
Wed, 24 Jun 2015 22:41:45 +0000 (23:41 +0100)
util/amisc/ashow.c
util/topgen/pattern.c

index eff632c..e8ec12a 100644 (file)
@@ -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);
        }
 }
index d7e82e9..e009da5 100644 (file)
@@ -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);