[pulseaudio-discuss] [PATCH v2 17/19] core: Remove dead code in pa_mainloop_run()

Peter Meerwald pmeerw at pmeerw.net
Thu Dec 19 03:11:46 PST 2013


From: Peter Meerwald <p.meerwald at bct-electronic.com>

    while ((r = pa_mainloop_iterate(m, 1, retval)) >= 0)
        ;

     if (r == -2)
         return 1;
     else if (r < 0)
        return -1;
     else
        return 0;

the last else is never reached, discovered by coverity

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/pulse/mainloop.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index 0e1fba0..66a1475 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -953,10 +953,8 @@ int pa_mainloop_run(pa_mainloop *m, int *retval) {
 
     if (r == -2)
         return 1;
-    else if (r < 0)
-        return -1;
     else
-        return 0;
+        return -1;
 }
 
 void pa_mainloop_quit(pa_mainloop *m, int retval) {
-- 
1.7.9.5



More information about the pulseaudio-discuss mailing list