diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-05-07 21:59:26 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-05-07 21:59:26 +0300 |
commit | f8ca822a7e81bd80afa7181ec5c0f0b4a50a4945 (patch) | |
tree | c1f332cdba2d0aed44e9f14cb3fc0b04028dd334 | |
parent | 15070b3cd065d20f04985568edf18723ee7d761e (diff) | |
download | egawk-f8ca822a7e81bd80afa7181ec5c0f0b4a50a4945.tar.gz egawk-f8ca822a7e81bd80afa7181ec5c0f0b4a50a4945.tar.bz2 egawk-f8ca822a7e81bd80afa7181ec5c0f0b4a50a4945.zip |
Fix minor printf format warnings.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | array.c | 4 | ||||
-rw-r--r-- | builtin.c | 28 | ||||
-rw-r--r-- | debug.c | 3 |
4 files changed, 24 insertions, 17 deletions
@@ -1,3 +1,9 @@ +2012-05-07 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (prnode): Add casts to void* for %p format. + * debug.c (print_instruction): Ditto. + * builtin.c: Fix %lf format to be %f everywhere. + 2012-05-04 Arnold D. Robbins <arnold@skeeve.com> * getopt.c [DJGPP]: Change to __DJGPP__. @@ -882,10 +882,10 @@ static void pr_node(NODE *n) { if ((n->flags & NUMBER) != 0) - printf("%s %g p: %p", flags2str(n->flags), n->numbr, n); + printf("%s %g p: %p", flags2str(n->flags), n->numbr, (void *) n); else printf("%s %.*s p: %p", flags2str(n->flags), - (int) n->stlen, n->stptr, n); + (int) n->stlen, n->stptr, (void *) n); } @@ -2781,11 +2781,11 @@ do_lshift(int nargs) shift = force_number(s2); if (do_lint) { if (val < 0 || shift < 0) - lintwarn(_("lshift(%lf, %lf): negative values will give strange results"), val, shift); + lintwarn(_("lshift(%f, %f): negative values will give strange results"), val, shift); if (double_to_int(val) != val || double_to_int(shift) != shift) - lintwarn(_("lshift(%lf, %lf): fractional values will be truncated"), val, shift); + lintwarn(_("lshift(%f, %f): fractional values will be truncated"), val, shift); if (shift >= sizeof(uintmax_t) * CHAR_BIT) - lintwarn(_("lshift(%lf, %lf): too large shift value will give strange results"), val, shift); + lintwarn(_("lshift(%f, %f): too large shift value will give strange results"), val, shift); } DEREF(s1); @@ -2818,11 +2818,11 @@ do_rshift(int nargs) shift = force_number(s2); if (do_lint) { if (val < 0 || shift < 0) - lintwarn(_("rshift(%lf, %lf): negative values will give strange results"), val, shift); + lintwarn(_("rshift(%f, %f): negative values will give strange results"), val, shift); if (double_to_int(val) != val || double_to_int(shift) != shift) - lintwarn(_("rshift(%lf, %lf): fractional values will be truncated"), val, shift); + lintwarn(_("rshift(%f, %f): fractional values will be truncated"), val, shift); if (shift >= sizeof(uintmax_t) * CHAR_BIT) - lintwarn(_("rshift(%lf, %lf): too large shift value will give strange results"), val, shift); + lintwarn(_("rshift(%f, %f): too large shift value will give strange results"), val, shift); } DEREF(s1); @@ -2855,9 +2855,9 @@ do_and(int nargs) right = force_number(s2); if (do_lint) { if (left < 0 || right < 0) - lintwarn(_("and(%lf, %lf): negative values will give strange results"), left, right); + lintwarn(_("and(%f, %f): negative values will give strange results"), left, right); if (double_to_int(left) != left || double_to_int(right) != right) - lintwarn(_("and(%lf, %lf): fractional values will be truncated"), left, right); + lintwarn(_("and(%f, %f): fractional values will be truncated"), left, right); } DEREF(s1); @@ -2890,9 +2890,9 @@ do_or(int nargs) right = force_number(s2); if (do_lint) { if (left < 0 || right < 0) - lintwarn(_("or(%lf, %lf): negative values will give strange results"), left, right); + lintwarn(_("or(%f, %f): negative values will give strange results"), left, right); if (double_to_int(left) != left || double_to_int(right) != right) - lintwarn(_("or(%lf, %lf): fractional values will be truncated"), left, right); + lintwarn(_("or(%f, %f): fractional values will be truncated"), left, right); } DEREF(s1); @@ -2928,9 +2928,9 @@ do_xor(int nargs) right = force_number(s2); if (do_lint) { if (left < 0 || right < 0) - lintwarn(_("xor(%lf, %lf): negative values will give strange results"), left, right); + lintwarn(_("xor(%f, %f): negative values will give strange results"), left, right); if (double_to_int(left) != left || double_to_int(right) != right) - lintwarn(_("xor(%lf, %lf): fractional values will be truncated"), left, right); + lintwarn(_("xor(%f, %f): fractional values will be truncated"), left, right); } DEREF(s1); @@ -2962,9 +2962,9 @@ do_compl(int nargs) if ((tmp->flags & (NUMCUR|NUMBER)) == 0) lintwarn(_("compl: received non-numeric argument")); if (d < 0) - lintwarn(_("compl(%lf): negative value will give strange results"), d); + lintwarn(_("compl(%f): negative value will give strange results"), d); if (double_to_int(d) != d) - lintwarn(_("compl(%lf): fractional value will be truncated"), d); + lintwarn(_("compl(%f): fractional value will be truncated"), d); } uval = (uintmax_t) d; @@ -3704,7 +3704,8 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump) if (noffset == 0) { static char buf[50]; /* offset for 2nd to last lines in a multi-line output */ - noffset = sprintf(buf, "[ :%p] %-20.20s: ", pc, opcode2str(pc->opcode)); + noffset = sprintf(buf, "[ :%p] %-20.20s: ", (void *) pc, + opcode2str(pc->opcode)); } if (pc->opcode == Op_func) { |