]> code.delx.au - pulseaudio/blobdiff - src/utils/paplay.c
add a few more gcc warning flags and fix quite a few problems found by doing so
[pulseaudio] / src / utils / paplay.c
index 9264a9405f39d6d86106d854f791536c69c3a360..df2edf6227f1724f76560c9849229fc9aceee20a 100644 (file)
@@ -107,14 +107,14 @@ static void stream_write_callback(pa_stream *s, size_t length, void *userdata) {
     if (readf_function) {
         size_t k = pa_frame_size(&sample_spec);
 
-        if ((bytes = readf_function(sndfile, data, length/k)) > 0)
-            bytes *= k;
+        if ((bytes = readf_function(sndfile, data, (sf_count_t) (length/k))) > 0)
+            bytes *= (sf_count_t) k;
 
     } else
-        bytes = sf_read_raw(sndfile, data, length);
+        bytes = sf_read_raw(sndfile, data, (sf_count_t) length);
 
     if (bytes > 0)
-        pa_stream_write(s, data, bytes, pa_xfree, 0, PA_SEEK_RELATIVE);
+        pa_stream_write(s, data, (size_t) bytes, pa_xfree, 0, PA_SEEK_RELATIVE);
     else
         pa_xfree(data);
 
@@ -283,7 +283,7 @@ int main(int argc, char *argv[]) {
 
             case ARG_VOLUME: {
                 int v = atoi(optarg);
-                volume = v < 0 ? 0 : v;
+                volume = v < 0 ? 0U : (pa_volume_t) v;
                 break;
             }
 
@@ -315,8 +315,8 @@ int main(int argc, char *argv[]) {
         goto quit;
     }
 
-    sample_spec.rate = sfinfo.samplerate;
-    sample_spec.channels = sfinfo.channels;
+    sample_spec.rate = (uint32_t) sfinfo.samplerate;
+    sample_spec.channels = (uint8_t) sfinfo.channels;
 
     readf_function = NULL;