[vlc-commits] libvlc: add missing "_t" in media_discoverer structs/enums

Thomas Guillem git at videolan.org
Wed Jul 20 13:44:29 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 20 13:36:24 2016 +0200| [b0984a632f285643013c709b51a72aa98a3e53c4] | committer: Thomas Guillem

libvlc: add missing "_t" in media_discoverer structs/enums

For the sake of coherence.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b0984a632f285643013c709b51a72aa98a3e53c4
---

 include/vlc/libvlc_media_discoverer.h |   16 ++++++++--------
 lib/media_discoverer.c                |   14 +++++++-------
 test/libvlc/media_discoverer.c        |   10 +++++-----
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/vlc/libvlc_media_discoverer.h b/include/vlc/libvlc_media_discoverer.h
index e18bfbb..05c888f 100644
--- a/include/vlc/libvlc_media_discoverer.h
+++ b/include/vlc/libvlc_media_discoverer.h
@@ -34,7 +34,7 @@ extern "C" {
  * Category of a media discoverer
  * \see libvlc_media_discoverer_list_get()
  */
-typedef enum libvlc_media_discoverer_category {
+typedef enum libvlc_media_discoverer_category_t {
     /** devices, like portable music player */
     libvlc_media_discoverer_devices,
     /** LAN/WAN services, like Upnp, SMB, or SAP */
@@ -43,17 +43,17 @@ typedef enum libvlc_media_discoverer_category {
     libvlc_media_discoverer_podcasts,
     /** Local directories, like Video, Music or Pictures directories */
     libvlc_media_discoverer_localdirs,
-} libvlc_media_discoverer_category;
+} libvlc_media_discoverer_category_t;
 
 /**
  * Media discoverer description
  * \see libvlc_media_discoverer_list_get()
  */
-typedef struct libvlc_media_discoverer_description {
+typedef struct libvlc_media_discoverer_description_t {
     char *psz_name;
     char *psz_longname;
-    libvlc_media_discoverer_category i_cat;
-} libvlc_media_discoverer_description;
+    libvlc_media_discoverer_category_t i_cat;
+} libvlc_media_discoverer_description_t;
 
 /** \defgroup libvlc_media_discoverer LibVLC media discovery
  * \ingroup libvlc
@@ -164,8 +164,8 @@ libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
  */
 LIBVLC_API ssize_t
 libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
-                                  libvlc_media_discoverer_category i_cat,
-                                  libvlc_media_discoverer_description ***ppp_services );
+                                  libvlc_media_discoverer_category_t i_cat,
+                                  libvlc_media_discoverer_description_t ***ppp_services );
 
 /**
  * Release an array of media discoverer services
@@ -178,7 +178,7 @@ libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
  * \param i_count number of elements in the array
  */
 LIBVLC_API void
-libvlc_media_discoverer_list_release( libvlc_media_discoverer_description **pp_services,
+libvlc_media_discoverer_list_release( libvlc_media_discoverer_description_t **pp_services,
                                       size_t i_count );
 
 /**@} */
diff --git a/lib/media_discoverer.c b/lib/media_discoverer.c
index d91937e..5862e2a 100644
--- a/lib/media_discoverer.c
+++ b/lib/media_discoverer.c
@@ -355,7 +355,7 @@ libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis )
 }
 
 void
-libvlc_media_discoverer_list_release( libvlc_media_discoverer_description **pp_services,
+libvlc_media_discoverer_list_release( libvlc_media_discoverer_description_t **pp_services,
                                       size_t i_count )
 {
     if( i_count > 0 )
@@ -372,8 +372,8 @@ libvlc_media_discoverer_list_release( libvlc_media_discoverer_description **pp_s
 
 ssize_t
 libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
-                                  libvlc_media_discoverer_category i_cat,
-                                  libvlc_media_discoverer_description ***ppp_services )
+                                  libvlc_media_discoverer_category_t i_cat,
+                                  libvlc_media_discoverer_description_t ***ppp_services )
 {
     assert( p_inst != NULL && ppp_services != NULL );
 
@@ -420,7 +420,7 @@ libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
             i_nb_services++;
     }
 
-    libvlc_media_discoverer_description **pp_services = NULL, *p_services = NULL;
+    libvlc_media_discoverer_description_t **pp_services = NULL, *p_services = NULL;
     if( i_nb_services > 0 )
     {
         /* Double alloc here, so that the caller iterates through pointers of
@@ -428,9 +428,9 @@ libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
          * without breaking the API. */
 
         pp_services = malloc( i_nb_services
-                              * sizeof(libvlc_media_discoverer_description *) );
+                              * sizeof(libvlc_media_discoverer_description_t *) );
         p_services = malloc( i_nb_services
-                             * sizeof(libvlc_media_discoverer_description) );
+                             * sizeof(libvlc_media_discoverer_description_t) );
         if( pp_services == NULL || p_services == NULL )
         {
             free( pp_services );
@@ -448,7 +448,7 @@ libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
     ppsz_name = ppsz_names;
     p_category = p_categories;
     unsigned int i_service_idx = 0;
-    libvlc_media_discoverer_description *p_service = p_services;
+    libvlc_media_discoverer_description_t *p_service = p_services;
     for( ; *ppsz_name != NULL; ppsz_name++, ppsz_longname++, p_category++ )
     {
         if( pp_services != NULL && *p_category == i_core_cat )
diff --git a/test/libvlc/media_discoverer.c b/test/libvlc/media_discoverer.c
index 2652c94..3ab3d82 100644
--- a/test/libvlc/media_discoverer.c
+++ b/test/libvlc/media_discoverer.c
@@ -114,15 +114,15 @@ main(int i_argc, char *ppsz_argv[])
         return 0;
     }
 
-    for(libvlc_media_discoverer_category i_cat = libvlc_media_discoverer_devices;
+    for(libvlc_media_discoverer_category_t i_cat = libvlc_media_discoverer_devices;
         i_cat <= libvlc_media_discoverer_localdirs; i_cat ++)
     {
         log("== getting list of media_discoverer for %d category ==\n", i_cat);
 
-        libvlc_media_discoverer_description **pp_services;
-        unsigned int i_count =
+        libvlc_media_discoverer_description_t **pp_services;
+        ssize_t i_count =
             libvlc_media_discoverer_list_get(p_vlc, i_cat, &pp_services);
-        if (i_count == 0)
+        if (i_count <= 0)
         {
             log("warn: no discoverers (not critical)\n");
             continue;
@@ -131,7 +131,7 @@ main(int i_argc, char *ppsz_argv[])
 
         for (unsigned int i = 0; i < i_count; ++i)
         {
-            libvlc_media_discoverer_description *p_service = pp_services[i];
+            libvlc_media_discoverer_description_t *p_service = pp_services[i];
 
             assert(i_cat == p_service->i_cat);
             log("= discoverer: name: '%s', longname: '%s' =\n",



More information about the vlc-commits mailing list