aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--array.c4
-rw-r--r--builtin.c28
-rw-r--r--debug.c3
4 files changed, 24 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ce24b51..cf55c5fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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__.
diff --git a/array.c b/array.c
index e814e976..f28a32de 100644
--- a/array.c
+++ b/array.c
@@ -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);
}
diff --git a/builtin.c b/builtin.c
index 44e0b85c..c4082126 100644
--- a/builtin.c
+++ b/builtin.c
@@ -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;
diff --git a/debug.c b/debug.c
index 4306392f..d8f5d5ee 100644
--- a/debug.c
+++ b/debug.c
@@ -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) {