[vlc-commits] config: remove useless parameter from string list callback

Rémi Denis-Courmont git at videolan.org
Wed Feb 28 20:02:42 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 28 20:20:54 2018 +0200| [aa4c56236225b3ae70666c6b508ba43763655418] | committer: Rémi Denis-Courmont

config: remove useless parameter from string list callback

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

 include/vlc_configuration.h             |  3 +--
 modules/access/dshow/dshow.cpp          | 13 ++++++-------
 modules/audio_output/alsa.c             | 11 ++++++-----
 modules/audio_output/directsound.c      |  9 ++++-----
 modules/audio_output/mmdevice.c         |  5 ++---
 modules/audio_output/waveout.c          |  9 ++++-----
 modules/video_output/win32/direct3d9.c  |  7 ++-----
 modules/video_output/win32/directdraw.c |  8 +++-----
 src/config/core.c                       |  2 +-
 src/libvlc.h                            |  2 +-
 src/win32/thread.c                      |  5 ++---
 11 files changed, 32 insertions(+), 42 deletions(-)

diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index 4651da526e..26de9a8aca 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -64,8 +64,7 @@ typedef union
     float       f;
 } module_value_t;
 
-typedef int (*vlc_string_list_cb)(vlc_object_t *, const char *,
-                                  char ***, char ***);
+typedef int (*vlc_string_list_cb)(const char *, char ***, char ***);
 typedef int (*vlc_integer_list_cb)(const char *, int64_t **, char ***);
 
 /**
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index 59ee553d70..efe87b7593 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -74,7 +74,7 @@ static size_t EnumDeviceCaps( vlc_object_t *, IBaseFilter *,
                               AM_MEDIA_TYPE *mt, size_t, bool );
 static bool ConnectFilters( vlc_object_t *, access_sys_t *,
                             IBaseFilter *, CaptureFilter * );
-static int FindDevices( vlc_object_t *, const char *, char ***, char *** );
+static int FindDevices( const char *, char ***, char *** );
 
 static void ShowPropertyPage( IUnknown * );
 static void ShowDeviceProperties( vlc_object_t *, ICaptureGraphBuilder2 *,
@@ -2043,8 +2043,7 @@ static int AppendAudioEnabledVDevs( vlc_object_t *p_this, std::list<std::string>
 /*****************************************************************************
  * config variable callback
  *****************************************************************************/
-static int FindDevices( vlc_object_t *p_this, const char *psz_name,
-                            char ***vp, char ***tp )
+static int FindDevices( const char *psz_name, char ***vp, char ***tp )
 {
     /* Find list of devices */
     std::list<std::string> list_devices;
@@ -2056,19 +2055,19 @@ static int FindDevices( vlc_object_t *p_this, const char *psz_name,
         // initialized as STA.
         ComContext ctx( COINIT_APARTMENTTHREADED );
 
-        FindCaptureDevice( p_this, NULL, &list_devices, b_audio );
+        FindCaptureDevice( NULL, NULL, &list_devices, b_audio );
 
         if( b_audio )
         {
             std::list<std::string> list_vdevs;
-            FindCaptureDevice( p_this, NULL, &list_vdevs, false );
+            FindCaptureDevice( NULL, NULL, &list_vdevs, false );
             if( !list_vdevs.empty() )
-                AppendAudioEnabledVDevs( p_this, list_devices, list_vdevs );
+                AppendAudioEnabledVDevs( NULL, list_devices, list_vdevs );
         }
     }
     catch (const std::runtime_error& ex)
     {
-        msg_Err( p_this, "Failed fetch devices: %s", ex.what() );
+        msg_Err( (vlc_object_t *)NULL, "Failed fetch devices: %s", ex.what() );
     }
 
     unsigned count = 2 + list_devices.size(), i = 2;
diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index e54b55db5d..3ae26a560f 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -59,7 +59,7 @@ struct aout_sys_t
 
 static int Open (vlc_object_t *);
 static void Close (vlc_object_t *);
-static int EnumDevices (vlc_object_t *, char const *, char ***, char ***);
+static int EnumDevices(char const *, char ***, char ***);
 
 #define AUDIO_DEV_TEXT N_("Audio output device")
 #define AUDIO_DEV_LONGTEXT N_("Audio output device (using ALSA syntax).")
@@ -719,12 +719,11 @@ static void Stop (audio_output_t *aout)
 /**
  * Enumerates ALSA output devices.
  */
-static int EnumDevices(vlc_object_t *obj, char const *varname,
+static int EnumDevices(char const *varname,
                        char ***restrict idp, char ***restrict namep)
 {
     void **hints;
 
-    msg_Dbg (obj, "Available ALSA PCM devices:");
     if (snd_device_name_hint(-1, "pcm", &hints) < 0)
         return -1;
 
@@ -745,7 +744,6 @@ static int EnumDevices(vlc_object_t *obj, char const *varname,
             desc = xstrdup (name);
         for (char *lf = strchr(desc, '\n'); lf; lf = strchr(lf, '\n'))
             *lf = ' ';
-        msg_Dbg (obj, "%s (%s)", (desc != NULL) ? desc : name, name);
 
         ids = xrealloc (ids, (n + 1) * sizeof (*ids));
         names = xrealloc (names, (n + 1) * sizeof (*names));
@@ -809,11 +807,14 @@ static int Open(vlc_object_t *obj)
 
     /* ALSA does not support hot-plug events so list devices at startup */
     char **ids, **names;
-    int count = EnumDevices (VLC_OBJECT(aout), NULL, &ids, &names);
+    int count = EnumDevices(NULL, &ids, &names);
     if (count >= 0)
     {
+        msg_Dbg (obj, "Available ALSA PCM devices:");
+
         for (int i = 0; i < count; i++)
         {
+            msg_Dbg(obj, "%s: %s", ids[i], names[i]);
             aout_HotplugReport (aout, ids[i], names[i]);
             free (names[i]);
             free (ids[i]);
diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index 4f1c2040d5..6503ce91da 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -48,8 +48,7 @@ static void Close( vlc_object_t * );
 static HRESULT StreamStart( aout_stream_t *, audio_sample_format_t *,
                             const GUID * );
 static HRESULT StreamStop( aout_stream_t * );
-static int ReloadDirectXDevices( vlc_object_t *, const char *,
-                                 char ***, char *** );
+static int ReloadDirectXDevices( const char *, char ***, char *** );
 static void * PlayedDataEraser( void * );
 /* Speaker setup override options list */
 static const char *const speaker_list[] = { "Windows default", "Mono", "Stereo",
@@ -1018,7 +1017,7 @@ static int CALLBACK DeviceEnumCallback( LPGUID guid, LPCWSTR desc,
 /**
  * Stores the list of devices in preferences
  */
-static int ReloadDirectXDevices( vlc_object_t *p_this, char const *psz_name,
+static int ReloadDirectXDevices( char const *psz_name,
                                  char ***values, char ***descs )
 {
     ds_list_t list = {
@@ -1032,7 +1031,6 @@ static int ReloadDirectXDevices( vlc_object_t *p_this, char const *psz_name,
     (void) psz_name;
 
     DirectSoundEnumerate( DeviceEnumCallback, &list );
-    msg_Dbg( p_this, "found %u devices", list.count );
 
     *values = list.ids;
     *descs = list.names;
@@ -1068,7 +1066,8 @@ static int Open(vlc_object_t *obj)
 
     /* DirectSound does not support hot-plug events (unless with WASAPI) */
     char **ids, **names;
-    int count = ReloadDirectXDevices(obj, NULL, &ids, &names);
+    int count = ReloadDirectXDevices(NULL, &ids, &names);
+    msg_Dbg(obj, "found %d devices", count);
     if (count >= 0)
     {
         for (int i = 0; i < count; i++)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index fb53afbc24..fd4fb4ba22 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -1393,8 +1393,7 @@ static void Reload_DevicesEnum_Added(void *data, LPCWSTR wid, IMMDevice *dev)
     list->count = new_count;
 }
 
-static int ReloadAudioDevices(vlc_object_t *this, char const *name,
-                              char ***values, char ***descs)
+static int ReloadAudioDevices(char const *name, char ***values, char ***descs)
 {
     (void) name;
 
@@ -1426,7 +1425,7 @@ static int ReloadAudioDevices(vlc_object_t *this, char const *name,
     }
     list.count++;
 
-    DevicesEnum(this, it, Reload_DevicesEnum_Added, &list);
+    DevicesEnum(NULL, it, Reload_DevicesEnum_Added, &list);
 
 error:
     IMMDeviceEnumerator_Release((IMMDeviceEnumerator *)it);
diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index 0eb844bcd4..d1ed683042 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -74,8 +74,7 @@ static void WaveOutClean( aout_sys_t * p_sys );
 
 static void WaveOutClearBuffer( HWAVEOUT, WAVEHDR *);
 
-static int ReloadWaveoutDevices( vlc_object_t *, const char *,
-                                 char ***, char *** );
+static int ReloadWaveoutDevices( const char *, char ***, char *** );
 static uint32_t findDeviceID(char *);
 static int WaveOutTimeGet(audio_output_t * , mtime_t *);
 static void WaveOutFlush( audio_output_t *, bool);
@@ -696,12 +695,12 @@ static void WaveOutClearBuffer( HWAVEOUT h_waveout, WAVEHDR *p_waveheader )
 /*
   reload the configuration drop down list, of the Audio Devices
 */
-static int ReloadWaveoutDevices( vlc_object_t *p_this, char const *psz_name,
+static int ReloadWaveoutDevices( char const *psz_name,
                                  char ***values, char ***descs )
 {
     int n = 0, nb_devices = waveOutGetNumDevs();
 
-    VLC_UNUSED( p_this); VLC_UNUSED( psz_name );
+    VLC_UNUSED( psz_name );
 
     *values = xmalloc( (nb_devices + 1) * sizeof(char *) );
     *descs = xmalloc( (nb_devices + 1) * sizeof(char *) );
@@ -806,7 +805,7 @@ static int Open(vlc_object_t *obj)
 
     /* WaveOut does not support hot-plug events so list devices at startup */
     char **ids, **names;
-    int count = ReloadWaveoutDevices(VLC_OBJECT(aout), NULL, &ids, &names);
+    int count = ReloadWaveoutDevices(NULL, &ids, &names);
     if (count >= 0)
     {
         for (int i = 0; i < count; i++)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 3ed8fb8942..9a89f4f55f 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -83,8 +83,7 @@ static void GLConvClose(vlc_object_t *);
 
 #define D3D9_HELP N_("Recommended video output for Windows Vista and later versions")
 
-static int FindShadersCallback(vlc_object_t *, const char *,
-                               char ***, char ***);
+static int FindShadersCallback(const char *, char ***, char ***);
 
 vlc_module_begin ()
     set_shortname("Direct3D9")
@@ -1781,10 +1780,8 @@ static void ListShaders(enum_context_t *ctx)
 }
 
 /* Populate the list of available shader techniques in the options */
-static int FindShadersCallback(vlc_object_t *object, const char *name,
-                               char ***values, char ***descs)
+static int FindShadersCallback(const char *name, char ***values, char ***descs)
 {
-    VLC_UNUSED(object);
     VLC_UNUSED(name);
 
     enum_context_t ctx = { NULL, NULL, 0 };
diff --git a/modules/video_output/win32/directdraw.c b/modules/video_output/win32/directdraw.c
index 13995577da..689a9cebcc 100644
--- a/modules/video_output/win32/directdraw.c
+++ b/modules/video_output/win32/directdraw.c
@@ -96,8 +96,8 @@
 static int  Open (vlc_object_t *);
 static void Close(vlc_object_t *);
 
-static int FindDevicesCallback(vlc_object_t *, const char *,
-                               char ***, char ***);
+static int FindDevicesCallback(const char *, char ***, char ***);
+
 vlc_module_begin()
     set_shortname("DirectDraw")
     set_description(N_("DirectX (DirectDraw) video output"))
@@ -1484,8 +1484,7 @@ static BOOL WINAPI DirectXEnumCallback2(GUID *guid, LPSTR desc,
     return TRUE; /* Keep enumerating */
 }
 
-static int FindDevicesCallback(vlc_object_t *object, const char *name,
-                               char ***values, char ***descs)
+static int FindDevicesCallback(const char *name, char ***values, char ***descs)
 {
     enum_context_t ctx;
 
@@ -1509,7 +1508,6 @@ static int FindDevicesCallback(vlc_object_t *object, const char *name,
         FreeLibrary(hddraw_dll);
     }
 
-    VLC_UNUSED(object);
     VLC_UNUSED(name);
 
     *values = ctx.values;
diff --git a/src/config/core.c b/src/config/core.c
index bec7e0e9aa..5d994b3a38 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -320,7 +320,7 @@ ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name,
 
         if (cfg->list.psz_cb == NULL)
             return 0;
-        return cfg->list.psz_cb(obj, name, values, texts);
+        return cfg->list.psz_cb(name, values, texts);
     }
 
     char **vals = xmalloc (sizeof (*vals) * count);
diff --git a/src/libvlc.h b/src/libvlc.h
index 7a5a6f155b..a8f50404b2 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -37,7 +37,7 @@ void system_Configure ( libvlc_int_t *, int, const char *const [] );
 #if defined(_WIN32) || defined(__OS2__)
 void system_End(void);
 #ifndef __OS2__
-size_t EnumClockSource( vlc_object_t *, const char *, char ***, char *** );
+size_t EnumClockSource( const char *, char ***, char *** );
 #endif
 #endif
 void vlc_CPU_dump(vlc_object_t *);
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 0a6c48dd9f..514146ae7d 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -877,8 +877,7 @@ static BOOL SelectClockSource(void *data)
     return TRUE;
 }
 
-size_t EnumClockSource (vlc_object_t *obj, const char *var,
-                        char ***vp, char ***np)
+size_t EnumClockSource(const char *var, char ***vp, char ***np)
 {
     const size_t max = 6;
     char **values = xmalloc (sizeof (*values) * max);
@@ -908,7 +907,7 @@ size_t EnumClockSource (vlc_object_t *obj, const char *var,
 
     *vp = values;
     *np = names;
-    (void) obj; (void) var;
+    (void) var;
     return n;
 }
 



More information about the vlc-commits mailing list