[vlc-devel] [PATCH 00/13] Convert p_sys to void*

Romain Vimont rom1v at videolabs.io
Tue Apr 24 17:40:38 CEST 2018


On Tue, Apr 24, 2018 at 06:12:34PM +0300, RĂ©mi Denis-Courmont wrote:
> LGTM. But where the private data is only used in an assertion, you should cast rather than use an intermediate variable. Otherwise, this will trigger warnings.

Thank you for your review (this patchset is not very review-friendly).

I updated my commits to cast instead of using a variable when it is only
used in asserts (there are only 2 cases). I will wait a bit before
reposting the whole patchset. Meanwhile, here is the full diff:

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index d49dc2bea9..e8feec3095 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -175,8 +175,7 @@ static void stream_start_now(pa_stream *s, audio_output_t *aout)
 {
     pa_operation *op;

-    aout_sys_t *p_sys = aout->sys;
-    assert (p_sys->trigger == NULL);
+    assert ( ((aout_sys_t *)aout->sys)->trigger == NULL );

     op = pa_stream_cork(s, 0, NULL, NULL);
     if (op != NULL)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index ddccaf64b6..f0701d67fe 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -1265,8 +1265,7 @@ static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
 static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                  block_t *p_buffer )
 {
-    sout_stream_sys_t *p_sys = p_stream->p_sys;
-    assert( p_sys->p_mux == NULL );
+    assert( ((sout_stream_sys_t *)p_stream->p_sys)->p_mux == NULL );

     while( p_buffer != NULL )
     {


More information about the vlc-devel mailing list