[vlc-commits] display: remove the unused vararg from the control callback

Steve Lhomme git at videolan.org
Mon Sep 14 13:34:56 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Sep 11 15:06:56 2020 +0200| [91953b8cdbf18e9cc239826c3954205743e594f2] | committer: Steve Lhomme

display: remove the unused vararg from the control callback

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

 include/vlc_vout_display.h              |  2 +-
 modules/hw/mmal/vout.c                  |  3 +--
 modules/hw/vdpau/display.c              |  2 +-
 modules/video_output/android/display.c  | 10 +++++-----
 modules/video_output/caca.c             |  4 +---
 modules/video_output/caopengllayer.m    |  4 ++--
 modules/video_output/decklink.cpp       |  4 ++--
 modules/video_output/fb.c               |  6 +++---
 modules/video_output/flaschen.c         |  6 ++----
 modules/video_output/ios.m              |  4 ++--
 modules/video_output/kms.c              |  4 ++--
 modules/video_output/kva.c              |  5 ++---
 modules/video_output/macosx.m           |  2 +-
 modules/video_output/opengl/display.c   |  4 ++--
 modules/video_output/splitter.c         |  4 ++--
 modules/video_output/vdummy.c           |  6 +++---
 modules/video_output/vmem.c             |  6 +++---
 modules/video_output/vulkan/display.c   |  4 ++--
 modules/video_output/wayland/shm.c      |  2 +-
 modules/video_output/win32/direct3d11.c |  5 ++---
 modules/video_output/win32/direct3d9.c  |  3 +--
 modules/video_output/win32/glwin32.c    |  3 +--
 modules/video_output/win32/wingdi.c     |  3 +--
 modules/video_output/xcb/render.c       |  2 +-
 modules/video_output/xcb/x11.c          |  2 +-
 modules/video_output/yuv.c              |  6 +++---
 src/video_output/display.c              | 10 ++--------
 27 files changed, 50 insertions(+), 66 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 5cd6f86f3a..df9e81eb6d 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -296,7 +296,7 @@ struct vlc_display_operations
      *
      * See \ref vout_display_query for the list of request types.
      */
-    int        (*control)(vout_display_t *, int query, va_list);
+    int        (*control)(vout_display_t *, int query);
 
     /**
      * Reset the picture format handled by the module.
diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
index f65f69f53d..eb622954e0 100644
--- a/modules/hw/mmal/vout.c
+++ b/modules/hw/mmal/vout.c
@@ -703,11 +703,10 @@ static int vd_reset_pictures(vout_display_t *vd, video_format_t *fmt)
     return VLC_SUCCESS;
 }
 
-static int vd_control(vout_display_t *vd, int query, va_list args)
+static int vd_control(vout_display_t *vd, int query)
 {
     vout_display_sys_t * const sys = vd->sys;
     int ret = VLC_EGENERIC;
-    VLC_UNUSED(args);
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 1f32acfccb..70eaa4b8db 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -249,7 +249,7 @@ static int ResetPictures(vout_display_t *vd, video_format_t *fmt)
     return VLC_SUCCESS;
 }
 
-static int Control(vout_display_t *vd, int query, va_list ap)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/android/display.c b/modules/video_output/android/display.c
index 5dfa6d4266..10ac60bb0a 100644
--- a/modules/video_output/android/display.c
+++ b/modules/video_output/android/display.c
@@ -76,7 +76,7 @@ static const vlc_fourcc_t subpicture_chromas[] =
 
 static void             Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void             Display(vout_display_t *, picture_t *);
-static int              Control(vout_display_t *, int, va_list);
+static int              Control(vout_display_t *, int);
 
 typedef struct
 {
@@ -896,7 +896,7 @@ static void CopySourceAspect(video_format_t *p_dest,
     p_dest->i_sar_den = p_src->i_sar_den;
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
@@ -924,11 +924,11 @@ static int Control(vout_display_t *vd, int query, va_list args)
         FixSubtitleFormat(sys);
         return VLC_SUCCESS;
     }
-    default:
-        msg_Warn(vd, "Unknown request in android-display: %d", query);
-        return VLC_EGENERIC;
     case VOUT_DISPLAY_CHANGE_ZOOM:
     case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
         return VLC_SUCCESS;
+    default:
+        msg_Warn(vd, "Unknown request in android-display: %d", query);
+        return VLC_EGENERIC;
     }
 }
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index 060ea9c5c1..d4a66c5e37 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -171,12 +171,10 @@ static void PictureDisplay(vout_display_t *vd, picture_t *picture)
 /**
  * Control for vout display
  */
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
-    (void) args;
-
     switch (query) {
     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
         if (sys->dither)
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index 21b38785d6..587817d153 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -66,7 +66,7 @@ vlc_module_end()
 static void PictureRender   (vout_display_t *vd, picture_t *pic, subpicture_t *subpicture,
                              vlc_tick_t date);
 static void PictureDisplay  (vout_display_t *vd, picture_t *pic);
-static int Control          (vout_display_t *vd, int query, va_list ap);
+static int Control          (vout_display_t *vd, int);
 
 static void *OurGetProcAddress (vlc_gl_t *gl, const char *name);
 static int OpenglLock         (vlc_gl_t *gl);
@@ -310,7 +310,7 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic)
     }
 }
 
-static int Control (vout_display_t *vd, int query, va_list ap)
+static int Control (vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index 6aef604490..4f25dc6d01 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -753,9 +753,9 @@ end:
         pDLVideoFrame->Release();
 }
 
-static int ControlVideo(vout_display_t *vd, int query, va_list args)
+static int ControlVideo(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
index 55e9523c81..4ea44c154c 100644
--- a/modules/video_output/fb.c
+++ b/modules/video_output/fb.c
@@ -94,7 +94,7 @@ vlc_module_end ()
  * Local prototypes
  *****************************************************************************/
 static void           Display(vout_display_t *, picture_t *);
-static int            Control(vout_display_t *, int, va_list);
+static int            Control(vout_display_t *, int);
 
 /* */
 static int  OpenDisplay  (vout_display_t *, bool force_resolution);
@@ -345,9 +345,9 @@ static void Display(vout_display_t *vd, picture_t *picture)
     picture_Copy(sys->picture, picture);
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/video_output/flaschen.c b/modules/video_output/flaschen.c
index b2e38ff838..ec515c9b8b 100644
--- a/modules/video_output/flaschen.c
+++ b/modules/video_output/flaschen.c
@@ -79,7 +79,7 @@ struct vout_display_sys_t {
     int             fd;
 };
 static void            Display(vout_display_t *, picture_t *);
-static int             Control(vout_display_t *, int, va_list);
+static int             Control(vout_display_t *, int);
 
 static const struct vlc_display_operations ops = {
     Close, NULL, Display, Control, NULL, NULL,
@@ -210,10 +210,8 @@ static void Display(vout_display_t *vd, picture_t *picture)
 /**
  * Control for vout display
  */
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    VLC_UNUSED(args);
-
     switch (query) {
     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
     case VOUT_DISPLAY_CHANGE_ZOOM:
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index a7de419cc1..07c8355d45 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -58,7 +58,7 @@ static void Close(vout_display_t *vd);
 
 static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void PictureDisplay(vout_display_t *, picture_t *);
-static int Control(vout_display_t*, int, va_list);
+static int Control(vout_display_t*, int);
 
 static void *OurGetProcAddress(vlc_gl_t *, const char *);
 
@@ -262,7 +262,7 @@ static void Close(vout_display_t *vd)
  * vout display callbacks
  *****************************************************************************/
 
-static int Control(vout_display_t *vd, int query, va_list ap)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
     struct gl_sys *glsys = sys->gl->sys;
diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index 78b026b97c..9965f3a8ef 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -598,9 +598,9 @@ err_out:
 }
 
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 43d37a93e6..badef7a452 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -110,7 +110,7 @@ struct vout_display_sys_t
  * Local prototypes
  *****************************************************************************/
 static void            Display(vout_display_t *, picture_t *);
-static int             Control(vout_display_t *, int, va_list);
+static int             Control(vout_display_t *, int);
 
 static int  OpenDisplay ( vout_display_t *, video_format_t * );
 static void CloseDisplay( vout_display_t * );
@@ -392,9 +392,8 @@ static void Display( vout_display_t *vd, picture_t *picture )
 /*****************************************************************************
  * Control: control facility for the vout
  *****************************************************************************/
-static int Control( vout_display_t *vd, int query, va_list args )
+static int Control( vout_display_t *vd, int query )
 {
-    VLC_UNUSED(args);
     vout_display_sys_t *sys = vd->sys;
 
     switch (query)
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 24fb26250d..22d4eb18c9 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -346,7 +346,7 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic)
     sys->has_first_frame = true;
 }
 
-static int Control (vout_display_t *vd, int query, va_list ap)
+static int Control (vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
index a9891cc658..151e98aff2 100644
--- a/modules/video_output/opengl/display.c
+++ b/modules/video_output/opengl/display.c
@@ -85,7 +85,7 @@ struct vout_display_sys_t
 /* Display callbacks */
 static void PictureRender (vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void PictureDisplay (vout_display_t *, picture_t *);
-static int Control (vout_display_t *, int, va_list);
+static int Control (vout_display_t *, int);
 
 static int SetViewpoint(vout_display_t *vd, const vlc_viewpoint_t *vp)
 {
@@ -229,7 +229,7 @@ FlipVerticalAlign(vout_display_cfg_t *cfg)
         cfg->align.vertical = VLC_VIDEO_ALIGN_TOP;
 }
 
-static int Control (vout_display_t *vd, int query, va_list ap)
+static int Control (vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/splitter.c b/modules/video_output/splitter.c
index 57f63ad7d3..6ca82e34c1 100644
--- a/modules/video_output/splitter.c
+++ b/modules/video_output/splitter.c
@@ -93,9 +93,9 @@ static void vlc_vidsplit_Display(vout_display_t *vd, picture_t *picture)
     (void) picture;
 }
 
-static int vlc_vidsplit_Control(vout_display_t *vd, int query, va_list args)
+static int vlc_vidsplit_Control(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/video_output/vdummy.c b/modules/video_output/vdummy.c
index 182636dfdb..91309cca24 100644
--- a/modules/video_output/vdummy.c
+++ b/modules/video_output/vdummy.c
@@ -64,7 +64,7 @@ vlc_module_end ()
  * Local prototypes
  *****************************************************************************/
 static void            DisplayStat(vout_display_t *, picture_t *);
-static int             Control(vout_display_t *, int, va_list);
+static int             Control(vout_display_t *, int);
 
 /*****************************************************************************
  * OpenVideo: activates dummy vout display method
@@ -125,9 +125,9 @@ static void DisplayStat(vout_display_t *vd, picture_t *picture)
     }
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 125ba80237..ce077db7a3 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -103,7 +103,7 @@ typedef unsigned (*vlc_format_cb)(void **, char *, unsigned *, unsigned *,
 
 static void           Prepare(vout_display_t *, picture_t *, subpicture_t *, vlc_tick_t);
 static void           Display(vout_display_t *, picture_t *);
-static int            Control(vout_display_t *, int, va_list);
+static int            Control(vout_display_t *, int);
 
 static const struct vlc_display_operations ops = {
     Close, Prepare, Display, Control, NULL, NULL,
@@ -272,9 +272,9 @@ static void Display(vout_display_t *vd, picture_t *pic)
         sys->display(sys->opaque, sys->pic_opaque);
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/modules/video_output/vulkan/display.c b/modules/video_output/vulkan/display.c
index de9155c283..cba7ca8903 100644
--- a/modules/video_output/vulkan/display.c
+++ b/modules/video_output/vulkan/display.c
@@ -73,7 +73,7 @@ struct vout_display_sys_t
 // Display callbacks
 static void PictureRender(vout_display_t *, picture_t *, subpicture_t *, mtime_t);
 static void PictureDisplay(vout_display_t *, picture_t *);
-static int Control(vout_display_t *, int, va_list);
+static int Control(vout_display_t *, int);
 static void Close(vout_display_t *);
 static void UpdateParams(vout_display_t *);
 
@@ -334,7 +334,7 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic)
     pl_swapchain_swap_buffers(sys->vk->swapchain);
 }
 
-static int Control(vout_display_t *vd, int query, va_list ap)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 75bd2cf9c8..a336658d8d 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -175,7 +175,7 @@ static int ResetPictures(vout_display_t *vd, video_format_t *fmt)
     return VLC_SUCCESS;
 }
 
-static int Control(vout_display_t *vd, int query, va_list ap)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d127f669e7..c4a020fb06 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -141,7 +141,7 @@ static void Direct3D11DestroyResources(vout_display_t *);
 static void Direct3D11DeleteRegions(int, picture_t **);
 static int Direct3D11MapSubpicture(vout_display_t *, int *, picture_t ***, subpicture_t *);
 
-static int Control(vout_display_t *, int, va_list);
+static int Control(vout_display_t *, int);
 
 
 static int UpdateDisplayFormat(vout_display_t *vd, const video_format_t *fmt)
@@ -414,9 +414,8 @@ static void Close(vout_display_t *vd)
     CommonWindowClean(&vd->sys->sys);
 #endif
 }
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    VLC_UNUSED(args);
     vout_display_sys_t *sys = vd->sys;
     int res = CommonControl( vd, &sys->area, &sys->sys, query );
 
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index b38cf3c105..55235f63d6 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1689,9 +1689,8 @@ static void Direct3D9Close(vout_display_t *vd)
     Direct3D9DestroyResources(vd);
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    VLC_UNUSED(args);
     vout_display_sys_t *sys = vd->sys;
     return CommonControl(vd, &sys->area, &sys->sys, query);
 }
diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 3606023b01..627a33ccc4 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -84,9 +84,8 @@ static int SetViewpoint(vout_display_t *vd, const vlc_viewpoint_t *vp)
     return vout_display_opengl_SetViewpoint(sys->vgl, vp);
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    VLC_UNUSED(args);
     vout_display_sys_t *sys = vd->sys;
     return CommonControl(vd, &sys->area, &sys->sys, query);
 }
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index f65cdae122..e25eed09e3 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -97,9 +97,8 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
     picture_CopyPixels(&fake_pic, picture);
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    VLC_UNUSED(args);
     vout_display_sys_t *sys = vd->sys;
     return CommonControl(vd, &sys->area, &sys->sys, query);
 }
diff --git a/modules/video_output/xcb/render.c b/modules/video_output/xcb/render.c
index efc1906ca6..1cf833f2c6 100644
--- a/modules/video_output/xcb/render.c
+++ b/modules/video_output/xcb/render.c
@@ -350,7 +350,7 @@ static void DeleteBuffers(vout_display_t *vd)
     xcb_free_pixmap(conn, sys->drawable.crop);
 }
 
-static int Control(vout_display_t *vd, int query, va_list ap)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index aaa56d8768..f48471f0c5 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -141,7 +141,7 @@ static int ResetPictures(vout_display_t *vd, video_format_t *fmt)
     return VLC_SUCCESS;
 }
 
-static int Control(vout_display_t *vd, int query, va_list ap)
+static int Control(vout_display_t *vd, int query)
 {
     vout_display_sys_t *sys = vd->sys;
 
diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c
index 1f7036f3c3..e7460a1d2f 100644
--- a/modules/video_output/yuv.c
+++ b/modules/video_output/yuv.c
@@ -75,7 +75,7 @@ vlc_module_end()
 
 /* */
 static void           Display(vout_display_t *, picture_t *);
-static int            Control(vout_display_t *, int, va_list);
+static int            Control(vout_display_t *, int);
 
 /*****************************************************************************
  * vout_display_sys_t: video output descriptor
@@ -248,9 +248,9 @@ static void Display(vout_display_t *vd, picture_t *picture)
     fflush(sys->f);
 }
 
-static int Control(vout_display_t *vd, int query, va_list args)
+static int Control(vout_display_t *vd, int query)
 {
-    (void) vd; (void) args;
+    (void) vd;
 
     switch (query) {
         case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 59814163a8..5e895fd5b1 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -61,15 +61,9 @@ static picture_t *VideoBufferNew(filter_t *filter)
     return picture_pool_Get(pool);
 }
 
-static int vout_display_Control(vout_display_t *vd, int query, ...)
+static int vout_display_Control(vout_display_t *vd, int query)
 {
-    va_list ap;
-    int ret;
-
-    va_start(ap, query);
-    ret = vd->ops->control(vd, query, ap);
-    va_end(ap);
-    return ret;
+    return vd->ops->control(vd, query);
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list