[vlc-devel] [PATCH 08/33] chromecast: processMessage() doesn't need to return a value

Steve Lhomme robux4 at videolabs.io
Wed Dec 23 12:58:27 CET 2015


---
 modules/stream_out/chromecast/chromecast.h        |  2 +-
 modules/stream_out/chromecast/chromecast_ctrl.cpp | 12 +-----------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/modules/stream_out/chromecast/chromecast.h b/modules/stream_out/chromecast/chromecast.h
index 9cdd1bb..239321a 100644
--- a/modules/stream_out/chromecast/chromecast.h
+++ b/modules/stream_out/chromecast/chromecast.h
@@ -85,7 +85,7 @@ struct intf_sys_t
     std::queue<castchannel::CastMessage> messagesToSend;
     unsigned i_requestId;
 
-    int processMessage(const castchannel::CastMessage &msg);
+    void processMessage(const castchannel::CastMessage &msg);
 };
 
 #endif /* VLC_CHROMECAST_H */
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index e0da352..64ea330 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -91,9 +91,8 @@ intf_sys_t::~intf_sys_t()
  * @param msg the CastMessage to process
  * @return 0 if the message has been successfuly processed else -1
  */
-int intf_sys_t::processMessage(const castchannel::CastMessage &msg)
+void intf_sys_t::processMessage(const castchannel::CastMessage &msg)
 {
-    int i_ret = 0;
     std::string namespace_ = msg.namespace_();
 
     if (namespace_ == NAMESPACE_DEVICEAUTH)
@@ -104,12 +103,10 @@ int intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         if (authMessage.has_error())
         {
             msg_Err(p_stream, "Authentification error: %d", authMessage.error().error_type());
-            i_ret = -1;
         }
         else if (!authMessage.has_response())
         {
             msg_Err(p_stream, "Authentification message has no response field");
-            i_ret = -1;
         }
         else
         {
@@ -136,7 +133,6 @@ int intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         else
         {
             msg_Err(p_stream, "Heartbeat command not supported: %s", type.c_str());
-            i_ret = -1;
         }
 
         json_value_free(p_data);
@@ -199,7 +195,6 @@ int intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         {
             msg_Err(p_stream, "Receiver command not supported: %s",
                     msg.payload_utf8().c_str());
-            i_ret = -1;
         }
 
         json_value_free(p_data);
@@ -227,7 +222,6 @@ int intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         {
             msg_Err(p_stream, "Media command not supported: %s",
                     msg.payload_utf8().c_str());
-            i_ret = -1;
         }
 
         json_value_free(p_data);
@@ -249,16 +243,12 @@ int intf_sys_t::processMessage(const castchannel::CastMessage &msg)
         {
             msg_Err(p_stream, "Connection command not supported: %s",
                     type.c_str());
-            i_ret = -1;
         }
     }
     else
     {
         msg_Err(p_stream, "Unknown namespace: %s", msg.namespace_().c_str());
-        i_ret = -1;
     }
-
-    return i_ret;
 }
 
 /*****************************************************************************
-- 
2.6.3



More information about the vlc-devel mailing list