Commit 79eb7623 authored by Max Kellermann's avatar Max Kellermann

event_pipe, test: explicitly ignore write() return value

Some compilers are very picky, but we really aren't interested in the return value.
parent b9e64d04
...@@ -159,5 +159,6 @@ void event_pipe_emit_fast(enum pipe_event event) ...@@ -159,5 +159,6 @@ void event_pipe_emit_fast(enum pipe_event event)
assert((unsigned)event < PIPE_EVENT_MAX); assert((unsigned)event < PIPE_EVENT_MAX);
pipe_events[event] = true; pipe_events[event] = true;
(void)write(event_pipe[1], "", 1);
G_GNUC_UNUSED ssize_t nbytes = write(event_pipe[1], "", 1);
} }
...@@ -104,7 +104,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder, ...@@ -104,7 +104,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder,
const void *data, size_t datalen, const void *data, size_t datalen,
G_GNUC_UNUSED uint16_t bit_rate) G_GNUC_UNUSED uint16_t bit_rate)
{ {
write(1, data, datalen); G_GNUC_UNUSED ssize_t nbytes = write(1, data, datalen);
return DECODE_COMMAND_NONE; return DECODE_COMMAND_NONE;
} }
......
...@@ -115,7 +115,7 @@ int main(int argc, char **argv) ...@@ -115,7 +115,7 @@ int main(int argc, char **argv)
return 2; return 2;
} }
write(1, output, length); G_GNUC_UNUSED ssize_t ignored = write(1, output, length);
} }
pcm_convert_deinit(&state); pcm_convert_deinit(&state);
......
...@@ -126,7 +126,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder, ...@@ -126,7 +126,7 @@ decoder_data(G_GNUC_UNUSED struct decoder *decoder,
const void *data, size_t datalen, const void *data, size_t datalen,
G_GNUC_UNUSED uint16_t kbit_rate) G_GNUC_UNUSED uint16_t kbit_rate)
{ {
write(1, data, datalen); G_GNUC_UNUSED ssize_t nbytes = write(1, data, datalen);
return DECODE_COMMAND_NONE; return DECODE_COMMAND_NONE;
} }
......
...@@ -36,8 +36,9 @@ encoder_to_stdout(struct encoder *encoder) ...@@ -36,8 +36,9 @@ encoder_to_stdout(struct encoder *encoder)
size_t length; size_t length;
static char buffer[32768]; static char buffer[32768];
while ((length = encoder_read(encoder, buffer, sizeof(buffer))) > 0) while ((length = encoder_read(encoder, buffer, sizeof(buffer))) > 0) {
write(1, buffer, length); G_GNUC_UNUSED ssize_t ignored = write(1, buffer, length);
}
} }
int main(int argc, char **argv) int main(int argc, char **argv)
......
...@@ -65,7 +65,8 @@ int main(int argc, char **argv) ...@@ -65,7 +65,8 @@ int main(int argc, char **argv)
while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) { while ((nbytes = read(0, buffer, sizeof(buffer))) > 0) {
Compressor_Process_int16(compressor, Compressor_Process_int16(compressor,
(int16_t *)buffer, nbytes / 2); (int16_t *)buffer, nbytes / 2);
write(1, buffer, nbytes);
G_GNUC_UNUSED ssize_t ignored = write(1, buffer, nbytes);
} }
Compressor_delete(compressor); Compressor_delete(compressor);
......
...@@ -65,6 +65,6 @@ int main(int argc, char **argv) ...@@ -65,6 +65,6 @@ int main(int argc, char **argv)
return 2; return 2;
} }
write(1, buffer, nbytes); G_GNUC_UNUSED ssize_t ignored = write(1, buffer, nbytes);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment