Don't declare the variable l if FIONREAD is not defined.
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 20 Nov 2009 20:24:46 +0000 (21:24 +0100)
committerDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 20 Nov 2009 20:24:46 +0000 (21:24 +0100)
This avoids two warnings due to FIONREAD not being defined.

src/modules/module-pipe-sink.c
src/modules/module-pipe-source.c

index 10cc341..f06d1ee 100644 (file)
@@ -101,9 +101,10 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
 
         case PA_SINK_MESSAGE_GET_LATENCY: {
             size_t n = 0;
-            int l;
 
 #ifdef FIONREAD
+            int l;
+
             if (ioctl(u->fd, FIONREAD, &l) >= 0 && l > 0)
                 n = (size_t) l;
 #endif
index de68093..c5eba43 100644 (file)
@@ -105,9 +105,10 @@ static int source_process_msg(
 
         case PA_SOURCE_MESSAGE_GET_LATENCY: {
             size_t n = 0;
-            int l;
 
 #ifdef FIONREAD
+            int l;
+
             if (ioctl(u->fd, FIONREAD, &l) >= 0 && l > 0)
                 n = (size_t) l;
 #endif