From b78514101907978f7776df1b5d95dac8a7798129 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 7 Aug 2020 18:10:20 +0800 Subject: [PATCH] printf: The argument p shall be a pointer to void. (#93) --- run.c | 4 ++-- tran.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/run.c b/run.c index ae17756..01b4597 100644 --- a/run.c +++ b/run.c @@ -119,7 +119,7 @@ int adjbuf(char **pbuf, int *psiz, int minlen, int quantum, char **pbptr, if (rminlen) minlen += quantum - rminlen; tbuf = realloc(*pbuf, minlen); - DPRINTF("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, *pbuf, tbuf); + DPRINTF("adjbuf %s: %d %d (pbuf=%p, tbuf=%p)\n", whatrtn, *psiz, minlen, (void*)*pbuf, (void*)tbuf); if (tbuf == NULL) { if (whatrtn) FATAL("out of memory in %s", whatrtn); @@ -1843,7 +1843,7 @@ const char *filename(FILE *fp) Cell *x; size_t i; bool stat; - + x = execute(a[0]); getsval(x); stat = true; diff --git a/tran.c b/tran.c index 2617b85..ee5facb 100644 --- a/tran.c +++ b/tran.c @@ -361,7 +361,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ fldno = atoi(vp->nval); if (fldno > *NF) newfld(fldno); - DPRINTF("setting field %d to %s (%p)\n", fldno, s, s); + DPRINTF("setting field %d to %s (%p)\n", fldno, s, (const void*)s); } else if (isrec(vp)) { donefld = false; /* mark $1... invalid */ donerec = true; @@ -378,7 +378,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ vp->fmt = NULL; setfree(vp); DPRINTF("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n", - (void*)vp, NN(vp->nval), t, t, vp->tval, donerec, donefld); + (void*)vp, NN(vp->nval), t, (void*)t, vp->tval, donerec, donefld); vp->sval = t; if (&vp->fval == NF) { donerec = false; /* mark $0 invalid */ @@ -492,7 +492,7 @@ static char *get_str_val(Cell *vp, char **fmt) /* get string val of a Cel } done: DPRINTF("getsval %p: %s = \"%s (%p)\", t=%o\n", - (void*)vp, NN(vp->nval), vp->sval, vp->sval, vp->tval); + (void*)vp, NN(vp->nval), vp->sval, (void*)vp->sval, vp->tval); return(vp->sval); }