Skip to content

Commit

Permalink
[GH #828] Fix print_n/i and say_n/i void return warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Dec 13, 2012
1 parent 3421639 commit 11d0b5d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
32 changes: 16 additions & 16 deletions src/ops/core_ops.c
Expand Up @@ -16910,7 +16910,7 @@ Parrot_print_i(opcode_t *cur_opcode, PARROT_INTERP) {

#endif
;
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
return cur_opcode + 2;
}

Expand All @@ -16926,7 +16926,7 @@ Parrot_print_ic(opcode_t *cur_opcode, PARROT_INTERP) {

#endif
;
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
return cur_opcode + 2;
}

Expand All @@ -16943,14 +16943,14 @@ Parrot_print_n(opcode_t *cur_opcode, PARROT_INTERP) {
#endif
;
#if defined(PARROT_HAS_NEGATIVE_ZERO)
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));

#else
if ((!Parrot_is_nzero(NREG(1)))) {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
}
else {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0", 2);
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0", 2);
}

#endif
Expand All @@ -16971,14 +16971,14 @@ Parrot_print_nc(opcode_t *cur_opcode, PARROT_INTERP) {
#endif
;
#if defined(PARROT_HAS_NEGATIVE_ZERO)
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));

#else
if ((!Parrot_is_nzero(NREG(1)))) {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
}
else {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0", 2);
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0", 2);
}

#endif
Expand Down Expand Up @@ -17032,7 +17032,7 @@ Parrot_say_i(opcode_t *cur_opcode, PARROT_INTERP) {

#endif
;
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
return cur_opcode + 2;
}

Expand All @@ -17048,7 +17048,7 @@ Parrot_say_ic(opcode_t *cur_opcode, PARROT_INTERP) {

#endif
;
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
return cur_opcode + 2;
}

Expand All @@ -17066,14 +17066,14 @@ Parrot_say_n(opcode_t *cur_opcode, PARROT_INTERP) {
#endif
;
#if defined(PARROT_HAS_NEGATIVE_ZERO)
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));

#else
if ((!Parrot_is_nzero(NREG(1)))) {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
}
else {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0\n", 2);
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0\n", 2);
}

#endif
Expand All @@ -17095,14 +17095,14 @@ Parrot_say_nc(opcode_t *cur_opcode, PARROT_INTERP) {
#endif
;
#if defined(PARROT_HAS_NEGATIVE_ZERO)
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));

#else
if ((!Parrot_is_nzero(NREG(1)))) {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
}
else {
Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0\n", 2);
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0\n", 2);
}

#endif
Expand Down
16 changes: 8 additions & 8 deletions src/ops/io.ops
Expand Up @@ -52,7 +52,7 @@ inline op print(in INT) :base_io {
#else
sprintf(buf, INTVAL_FMT, (INTVAL)$1);
#endif
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
}

inline op print(in NUM) :base_io {
Expand All @@ -63,13 +63,13 @@ inline op print(in NUM) :base_io {
sprintf(buf, FLOATVAL_FMT, $1);
#endif
#ifdef PARROT_HAS_NEGATIVE_ZERO
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
#else
if (!Parrot_is_nzero(NREG(1)))
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
else
/* Workaround for older msvcrt and openbsd. GH #366 */
Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0", 2);
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0", 2);
#endif
}

Expand Down Expand Up @@ -105,7 +105,7 @@ inline op say(in INT) :base_io {
#else
sprintf(buf, INTVAL_FMT "\n", (INTVAL)$1);
#endif
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
}

inline op say(in NUM) :base_io {
Expand All @@ -117,13 +117,13 @@ inline op say(in NUM) :base_io {
sprintf(buf, 128, FLOATVAL_FMT, $1);
#endif
#ifdef PARROT_HAS_NEGATIVE_ZERO
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
#else
if (!Parrot_is_nzero(NREG(1)))
Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), buf, strlen(buf));
else
/* Workaround for older msvcrt and openbsd. GH #366 */
Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0\n", 2);
(void)Parrot_io_write_b(interp, _PIO_STDOUT(interp), "-0\n", 2);
#endif
}

Expand Down

0 comments on commit 11d0b5d

Please sign in to comment.