[vlc-devel] [PATCH 1/8] renderer: add missing "_t"

Thomas Guillem thomas at gllm.fr
Mon Sep 19 19:09:44 CEST 2016


Bad habit but it's for the sake of coherence.
---
 include/vlc_common.h                  |  4 ++--
 include/vlc_events.h                  |  4 ++--
 include/vlc_renderer_discovery.h      | 39 +++++++++++++++-----------------
 modules/gui/qt/actions_manager.cpp    |  2 +-
 modules/gui/qt/actions_manager.hpp    |  2 +-
 modules/services_discovery/microdns.c | 18 +++++++--------
 src/misc/renderer_discovery.c         | 42 +++++++++++++++++------------------
 7 files changed, 54 insertions(+), 57 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 59988fa..159d4ff 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -208,8 +208,8 @@ typedef struct playlist_item_t playlist_item_t;
 typedef struct services_discovery_t services_discovery_t;
 typedef struct services_discovery_sys_t services_discovery_sys_t;
 typedef struct playlist_add_t playlist_add_t;
-typedef struct vlc_renderer_discovery vlc_renderer_discovery;
-typedef struct vlc_renderer_item vlc_renderer_item;
+typedef struct vlc_renderer_discovery_t vlc_renderer_discovery_t;
+typedef struct vlc_renderer_item_t vlc_renderer_item_t;
 
 /* Modules */
 typedef struct module_t module_t;
diff --git a/include/vlc_events.h b/include/vlc_events.h
index 7191e50..01e11d0 100644
--- a/include/vlc_events.h
+++ b/include/vlc_events.h
@@ -205,11 +205,11 @@ typedef struct vlc_event_t
         /* Renderer discovery events */
         struct vlc_renderer_discovery_item_added
         {
-            vlc_renderer_item * p_new_item;
+            vlc_renderer_item_t * p_new_item;
         } renderer_discovery_item_added;
         struct vlc_renderer_discovery_item_removed
         {
-            vlc_renderer_item * p_item;
+            vlc_renderer_item_t * p_item;
         } renderer_discovery_item_removed;
 
         /* Addons */
diff --git a/include/vlc_renderer_discovery.h b/include/vlc_renderer_discovery.h
index 504bea0..d7060f5 100644
--- a/include/vlc_renderer_discovery.h
+++ b/include/vlc_renderer_discovery.h
@@ -37,8 +37,6 @@
  * @{
  */
 
-typedef struct vlc_renderer_item vlc_renderer_item;
-
 #define VLC_RENDERER_CAN_AUDIO 0x0001
 #define VLC_RENDERER_CAN_VIDEO 0x0002
 
@@ -53,7 +51,7 @@ typedef struct vlc_renderer_item vlc_renderer_item;
  * @param i_flags flags for the item
  * @return a renderer item or NULL in case of error
  */
-VLC_API vlc_renderer_item *
+VLC_API vlc_renderer_item_t *
 vlc_renderer_item_new(const char *psz_name, const char *psz_uri,
                       const char *psz_extra_sout, const char *psz_icon_uri,
                       int i_flags) VLC_USED;
@@ -61,50 +59,50 @@ vlc_renderer_item_new(const char *psz_name, const char *psz_uri,
 /**
  * Hold a renderer item, i.e. creates a new reference
  */
-VLC_API vlc_renderer_item *
-vlc_renderer_item_hold(vlc_renderer_item *p_item);
+VLC_API vlc_renderer_item_t *
+vlc_renderer_item_hold(vlc_renderer_item_t *p_item);
 
 /**
  * Releases a renderer item, i.e. decrements its reference counter
  */
 VLC_API void
-vlc_renderer_item_release(vlc_renderer_item *p_item);
+vlc_renderer_item_release(vlc_renderer_item_t *p_item);
 
 /**
  * Get the human readable name of a renderer item
  */
 VLC_API const char *
-vlc_renderer_item_name(const vlc_renderer_item *p_item);
+vlc_renderer_item_name(const vlc_renderer_item_t *p_item);
 
 /**
  * Get the sout command of a renderer item
  */
 VLC_API const char *
-vlc_renderer_item_sout(const vlc_renderer_item *p_item);
+vlc_renderer_item_sout(const vlc_renderer_item_t *p_item);
 
 /**
  * Get the icon uri of a renderer item
  */
 VLC_API const char *
-vlc_renderer_item_icon_uri(const vlc_renderer_item *p_item);
+vlc_renderer_item_icon_uri(const vlc_renderer_item_t *p_item);
 
 /**
  * Get the flags of a renderer item
  */
 VLC_API int
-vlc_renderer_item_flags(const vlc_renderer_item *p_item);
+vlc_renderer_item_flags(const vlc_renderer_item_t *p_item);
 
 /**
  * Set an opaque context
  */
 VLC_API void
-vlc_renderer_item_set_ctx(vlc_renderer_item *p_item, void *p_ctx);
+vlc_renderer_item_set_ctx(vlc_renderer_item_t *p_item, void *p_ctx);
 
 /**
  * Get the opaque context previously set
  */
 VLC_API void*
-vlc_renderer_item_ctx(const vlc_renderer_item *p_item);
+vlc_renderer_item_ctx(const vlc_renderer_item_t *p_item);
 
 /**
  * @}
@@ -112,7 +110,6 @@ vlc_renderer_item_ctx(const vlc_renderer_item *p_item);
  * @{
  */
 
-typedef struct vlc_renderer_discovery vlc_renderer_discovery;
 typedef struct vlc_renderer_discovery_sys vlc_renderer_discovery_sys;
 
 /**
@@ -139,7 +136,7 @@ vlc_rd_get_names(vlc_object_t *p_obj, char ***pppsz_names,
  * @return a valid vlc_renderer_discovery, need to be released with
  * vlc_rd_release()
  */
-VLC_API vlc_renderer_discovery *
+VLC_API vlc_renderer_discovery_t *
 vlc_rd_new(vlc_object_t *p_obj, const char *psz_name) VLC_USED;
 
 #define vlc_rd_release(p_rd) vlc_object_release(p_rd)
@@ -151,22 +148,22 @@ vlc_rd_new(vlc_object_t *p_obj, const char *psz_name) VLC_USED;
  * @see vlc_RendererDiscoveryItemRemoved
  */
 VLC_API vlc_event_manager_t *
-vlc_rd_event_manager(vlc_renderer_discovery *p_rd);
+vlc_rd_event_manager(vlc_renderer_discovery_t *p_rd);
 
 /**
  * Start the renderer discovery module
  *
- * Once started, the module can send new vlc_renderer_item via the
+ * Once started, the module can send new vlc_renderer_item_t via the
  * vlc_RendererDiscoveryItemAdded event.
  */
 VLC_API int
-vlc_rd_start(vlc_renderer_discovery *p_rd);
+vlc_rd_start(vlc_renderer_discovery_t *p_rd);
 
 /**
  * Stop the renderer discovery module
  */
 VLC_API void
-vlc_rd_stop(vlc_renderer_discovery *p_rd);
+vlc_rd_stop(vlc_renderer_discovery_t *p_rd);
 
 /**
  * @}
@@ -174,7 +171,7 @@ vlc_rd_stop(vlc_renderer_discovery *p_rd);
  * @{
  */
 
-struct vlc_renderer_discovery
+struct vlc_renderer_discovery_t
 {
     VLC_COMMON_MEMBERS
     module_t *          p_module;
@@ -193,7 +190,7 @@ struct vlc_renderer_discovery
  * This will send the vlc_RendererDiscoveryItemAdded event
  */
 VLC_API void
-vlc_rd_add_item(vlc_renderer_discovery * p_rd, vlc_renderer_item * p_item);
+vlc_rd_add_item(vlc_renderer_discovery_t * p_rd, vlc_renderer_item_t * p_item);
 
 /**
  * Add a new renderer item
@@ -201,7 +198,7 @@ vlc_rd_add_item(vlc_renderer_discovery * p_rd, vlc_renderer_item * p_item);
  * This will send the vlc_RendererDiscoveryItemRemoved event
  */
 VLC_API void
-vlc_rd_remove_item(vlc_renderer_discovery * p_rd, vlc_renderer_item * p_item);
+vlc_rd_remove_item(vlc_renderer_discovery_t * p_rd, vlc_renderer_item_t * p_item);
 
 /**
  * Renderer Discovery proble helpers
diff --git a/modules/gui/qt/actions_manager.cpp b/modules/gui/qt/actions_manager.cpp
index 05e1de8..a185cbf 100644
--- a/modules/gui/qt/actions_manager.cpp
+++ b/modules/gui/qt/actions_manager.cpp
@@ -250,7 +250,7 @@ void ActionsManager::renderer_event_received( const vlc_event_t * p_event, void
 
     if ( p_event->type == vlc_RendererDiscoveryItemAdded )
     {
-        vlc_renderer_item *p_item =  p_event->u.renderer_discovery_item_added.p_new_item;
+        vlc_renderer_item_t *p_item =  p_event->u.renderer_discovery_item_added.p_new_item;
 
         QAction *firstSeparator = NULL;
         foreach (QAction* action, VLCMenuBar::rendererMenu->actions())
diff --git a/modules/gui/qt/actions_manager.hpp b/modules/gui/qt/actions_manager.hpp
index b11c076..b545f49 100644
--- a/modules/gui/qt/actions_manager.hpp
+++ b/modules/gui/qt/actions_manager.hpp
@@ -74,7 +74,7 @@ private:
     virtual ~ActionsManager();
 
     intf_thread_t       *p_intf;
-    vlc_renderer_discovery *p_rd;
+    vlc_renderer_discovery_t *p_rd;
 
     bool  b_rd_started;
     static void renderer_event_received( const vlc_event_t * p_event, void * user_data );
diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c
index f7e5fe8..641e306 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -111,7 +111,7 @@ struct item
 {
     char *              psz_uri;
     input_item_t *      p_input_item;
-    vlc_renderer_item * p_renderer_item;
+    vlc_renderer_item_t*p_renderer_item;
     mtime_t             i_last_seen;
 };
 
@@ -181,7 +181,7 @@ items_add_input( struct discovery_sys *p_sys, services_discovery_t *p_sd,
 }
 
 static int
-items_add_renderer( struct discovery_sys *p_sys, vlc_renderer_discovery *p_rd,
+items_add_renderer( struct discovery_sys *p_sys, vlc_renderer_discovery_t *p_rd,
                     const char *psz_name, char *psz_uri,
                     const char *psz_icon_uri, int i_flags )
 {
@@ -191,7 +191,7 @@ items_add_renderer( struct discovery_sys *p_sys, vlc_renderer_discovery *p_rd,
 
     const char *psz_extra_uri = i_flags & VLC_RENDERER_CAN_VIDEO ? NULL : "video=0";
 
-    vlc_renderer_item *p_renderer_item =
+    vlc_renderer_item_t *p_renderer_item =
         vlc_renderer_item_new( psz_name, psz_uri, psz_extra_uri, psz_icon_uri, i_flags );
     if( p_renderer_item == NULL )
     {
@@ -245,7 +245,7 @@ items_exists( struct discovery_sys *p_sys, const char *psz_uri )
 
 static void
 items_timeout( struct discovery_sys *p_sys, services_discovery_t *p_sd,
-               vlc_renderer_discovery *p_rd )
+               vlc_renderer_discovery_t *p_rd )
 {
     mtime_t i_now = mdate();
 
@@ -437,7 +437,7 @@ RunSD( void *p_this )
 static void
 new_entries_rd_cb( void *p_this, int i_status, const struct rr_entry *p_entries )
 {
-    vlc_renderer_discovery *p_rd = (vlc_renderer_discovery *)p_this;
+    vlc_renderer_discovery_t *p_rd = (vlc_renderer_discovery_t *)p_this;
     struct discovery_sys *p_sys = &p_rd->p_sys->s;
     if( i_status < 0 )
     {
@@ -519,7 +519,7 @@ new_entries_rd_cb( void *p_this, int i_status, const struct rr_entry *p_entries
 static bool
 stop_rd_cb( void *p_this )
 {
-    vlc_renderer_discovery *p_rd = ( vlc_renderer_discovery* )p_this;
+    vlc_renderer_discovery_t *p_rd = p_this;
     struct discovery_sys *p_sys = &p_rd->p_sys->s;
 
     if( atomic_load( &p_sys->stop ) )
@@ -534,7 +534,7 @@ stop_rd_cb( void *p_this )
 static void *
 RunRD( void *p_this )
 {
-    vlc_renderer_discovery *p_rd = ( vlc_renderer_discovery* )p_this;
+    vlc_renderer_discovery_t *p_rd = p_this;
     struct discovery_sys *p_sys = &p_rd->p_sys->s;
 
     int i_status = mdns_listen( p_sys->p_microdns,
@@ -632,7 +632,7 @@ CloseSD( vlc_object_t *p_this )
 static int
 OpenRD( vlc_object_t *p_obj )
 {
-    vlc_renderer_discovery *p_rd = (vlc_renderer_discovery *)p_obj;
+    vlc_renderer_discovery_t *p_rd = (vlc_renderer_discovery_t *)p_obj;
 
     p_rd->p_sys = calloc( 1, sizeof(vlc_renderer_discovery_sys) );
     if( !p_rd->p_sys )
@@ -646,7 +646,7 @@ OpenRD( vlc_object_t *p_obj )
 static void
 CloseRD( vlc_object_t *p_this )
 {
-    vlc_renderer_discovery *p_rd = (vlc_renderer_discovery *) p_this;
+    vlc_renderer_discovery_t *p_rd = (vlc_renderer_discovery_t *) p_this;
 
     CleanCommon( &p_rd->p_sys->s );
     free( p_rd->p_sys );
diff --git a/src/misc/renderer_discovery.c b/src/misc/renderer_discovery.c
index 96010d2..ae28f5e 100644
--- a/src/misc/renderer_discovery.c
+++ b/src/misc/renderer_discovery.c
@@ -32,7 +32,7 @@
 #include <vlc_modules.h>
 #include <libvlc.h>
 
-struct vlc_renderer_item
+struct vlc_renderer_item_t
 {
     char *psz_name;
     char *psz_sout;
@@ -42,20 +42,20 @@ struct vlc_renderer_item
     atomic_uint refs;
 };
 
-vlc_renderer_item *
+vlc_renderer_item_t *
 vlc_renderer_item_new(const char *psz_name, const char *psz_uri,
                       const char *psz_extra_sout, const char *psz_icon_uri,
                       int i_flags)
 {
     assert(psz_uri != NULL);
-    vlc_renderer_item *p_item = NULL;
+    vlc_renderer_item_t *p_item = NULL;
     vlc_url_t url;
     vlc_UrlParse(&url, psz_uri);
 
     if (url.psz_protocol == NULL || url.psz_host == NULL)
         goto error;
 
-    p_item = calloc(1, sizeof(vlc_renderer_item));
+    p_item = calloc(1, sizeof(vlc_renderer_item_t));
     if (unlikely(p_item == NULL))
         goto error;
 
@@ -94,7 +94,7 @@ error:
 }
 
 const char *
-vlc_renderer_item_name(const vlc_renderer_item *p_item)
+vlc_renderer_item_name(const vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
@@ -102,7 +102,7 @@ vlc_renderer_item_name(const vlc_renderer_item *p_item)
 }
 
 const char *
-vlc_renderer_item_sout(const vlc_renderer_item *p_item)
+vlc_renderer_item_sout(const vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
@@ -110,7 +110,7 @@ vlc_renderer_item_sout(const vlc_renderer_item *p_item)
 }
 
 const char *
-vlc_renderer_item_icon_uri(const vlc_renderer_item *p_item)
+vlc_renderer_item_icon_uri(const vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
@@ -118,7 +118,7 @@ vlc_renderer_item_icon_uri(const vlc_renderer_item *p_item)
 }
 
 int
-vlc_renderer_item_flags(const vlc_renderer_item *p_item)
+vlc_renderer_item_flags(const vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
@@ -126,7 +126,7 @@ vlc_renderer_item_flags(const vlc_renderer_item *p_item)
 }
 
 void
-vlc_renderer_item_set_ctx(vlc_renderer_item *p_item, void *p_ctx)
+vlc_renderer_item_set_ctx(vlc_renderer_item_t *p_item, void *p_ctx)
 {
     assert(p_item != NULL);
 
@@ -134,15 +134,15 @@ vlc_renderer_item_set_ctx(vlc_renderer_item *p_item, void *p_ctx)
 }
 
 void*
-vlc_renderer_item_ctx(const vlc_renderer_item *p_item)
+vlc_renderer_item_ctx(const vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
     return p_item->p_ctx;
 }
 
-vlc_renderer_item *
-vlc_renderer_item_hold(vlc_renderer_item *p_item)
+vlc_renderer_item_t *
+vlc_renderer_item_hold(vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
@@ -151,7 +151,7 @@ vlc_renderer_item_hold(vlc_renderer_item *p_item)
 }
 
 void
-vlc_renderer_item_release(vlc_renderer_item *p_item)
+vlc_renderer_item_release(vlc_renderer_item_t *p_item)
 {
     assert(p_item != NULL);
 
@@ -225,7 +225,7 @@ vlc_rd_get_names(vlc_object_t *p_obj, char ***pppsz_names,
 static void
 rd_destructor(vlc_object_t *p_obj)
 {
-    vlc_renderer_discovery * p_rd =(vlc_renderer_discovery *)p_obj;
+    vlc_renderer_discovery_t * p_rd =(vlc_renderer_discovery_t *)p_obj;
     assert(!p_rd->p_module); /* Forgot to call Stop */
 
     config_ChainDestroy(p_rd->p_cfg);
@@ -233,10 +233,10 @@ rd_destructor(vlc_object_t *p_obj)
     vlc_event_manager_fini(&p_rd->event_manager);
 }
 
-vlc_renderer_discovery *
+vlc_renderer_discovery_t *
 vlc_rd_new(vlc_object_t *p_obj, const char *psz_name)
 {
-    vlc_renderer_discovery *p_rd;
+    vlc_renderer_discovery_t *p_rd;
 
     p_rd = vlc_custom_create(p_obj, sizeof(*p_rd), "renderer discovery");
     if(!p_rd)
@@ -253,13 +253,13 @@ vlc_rd_new(vlc_object_t *p_obj, const char *psz_name)
 }
 
 VLC_API vlc_event_manager_t *
-vlc_rd_event_manager(vlc_renderer_discovery *p_rd)
+vlc_rd_event_manager(vlc_renderer_discovery_t *p_rd)
 {
     return &p_rd->event_manager;
 }
 
 int
-vlc_rd_start(vlc_renderer_discovery *p_rd)
+vlc_rd_start(vlc_renderer_discovery_t *p_rd)
 {
     assert(!p_rd->p_module);
 
@@ -275,14 +275,14 @@ vlc_rd_start(vlc_renderer_discovery *p_rd)
 }
 
 void
-vlc_rd_stop(vlc_renderer_discovery * p_rd)
+vlc_rd_stop(vlc_renderer_discovery_t * p_rd)
 {
     module_unneed(p_rd, p_rd->p_module);
     p_rd->p_module = NULL;
 }
 
 void
-vlc_rd_add_item(vlc_renderer_discovery * p_rd, vlc_renderer_item * p_item)
+vlc_rd_add_item(vlc_renderer_discovery_t * p_rd, vlc_renderer_item_t * p_item)
 {
     vlc_event_t event;
     event.type = vlc_RendererDiscoveryItemAdded;
@@ -292,7 +292,7 @@ vlc_rd_add_item(vlc_renderer_discovery * p_rd, vlc_renderer_item * p_item)
 }
 
 void
-vlc_rd_remove_item(vlc_renderer_discovery * p_rd, vlc_renderer_item * p_item)
+vlc_rd_remove_item(vlc_renderer_discovery_t * p_rd, vlc_renderer_item_t * p_item)
 {
     vlc_event_t event;
     event.type = vlc_RendererDiscoveryItemRemoved;
-- 
2.9.3



More information about the vlc-devel mailing list