summaryrefslogtreecommitdiffstats
path: root/src/tests/parec-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/parec-simple.c')
-rw-r--r--src/tests/parec-simple.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tests/parec-simple.c b/src/tests/parec-simple.c
index 6c0d529b..c9d3bef5 100644
--- a/src/tests/parec-simple.c
+++ b/src/tests/parec-simple.c
@@ -47,13 +47,13 @@ static ssize_t loop_write(int fd, const void*data, size_t size) {
ret += r;
data = (const uint8_t*) data + r;
- size -= r;
+ size -= (size_t) r;
}
return ret;
}
-int main(PA_GCC_UNUSED int argc, char*argv[]) {
+int main(int argc, char*argv[]) {
/* The sample type to use */
static const pa_sample_spec ss = {
.format = PA_SAMPLE_S16LE,
@@ -72,7 +72,6 @@ int main(PA_GCC_UNUSED int argc, char*argv[]) {
for (;;) {
uint8_t buf[BUFSIZE];
- ssize_t r;
/* Record some data ... */
if (pa_simple_read(s, buf, sizeof(buf), &error) < 0) {
@@ -81,7 +80,7 @@ int main(PA_GCC_UNUSED int argc, char*argv[]) {
}
/* And write it to STDOUT */
- if ((r = loop_write(STDOUT_FILENO, buf, sizeof(buf))) <= 0) {
+ if (loop_write(STDOUT_FILENO, buf, sizeof(buf)) != sizeof(buf)) {
fprintf(stderr, __FILE__": write() failed: %s\n", strerror(errno));
goto finish;
}