[vlc-devel] [PATCH 2/2] stream_extractor: rename the public variable to pub

Rémi Denis-Courmont remi at remlab.net
Mon Dec 12 10:25:53 CET 2016


On December 12, 2016 10:12:34 AM GMT+02:00, Steve Lhomme <robux4 at videolabs.io> wrote:
>From: Steve Lhomme <robux4 at gmail.com>
>
>It seems to be a reserved keyword on some compilers.
>---
>src/input/stream_extractor.c | 38
>+++++++++++++++++++-------------------
> 1 file changed, 19 insertions(+), 19 deletions(-)
>
>diff --git a/src/input/stream_extractor.c
>b/src/input/stream_extractor.c
>index 573ba9d..3ea4533 100644
>--- a/src/input/stream_extractor.c
>+++ b/src/input/stream_extractor.c
>@@ -46,7 +46,7 @@
>  **/
> 
> struct stream_extractor_private {
>-    stream_extractor_t public;
>+    stream_extractor_t pub;
>     stream_t* stream;
>     module_t* module;
> 
>@@ -60,15 +60,15 @@ struct stream_extractor_private {
>  */
> static void se_Release( struct stream_extractor_private* priv )
> {
>-    free( priv->public.identifier );
>+    free( priv->pub.identifier );
> 
>     if( priv->module )
>     {
>-        module_unneed( &priv->public, priv->module );
>-        vlc_stream_Delete( priv->public.source );
>+        module_unneed( &priv->pub, priv->module );
>+        vlc_stream_Delete( priv->pub.source );
>     }
> 
>-    vlc_object_release( &priv->public );
>+    vlc_object_release( &priv->pub );
> }
> 
> /**
>@@ -92,7 +92,7 @@ static ssize_t
> se_StreamRead( stream_t* stream, void* buf, size_t len )
> {
>     struct stream_extractor_private* priv = stream->p_sys;
>-    stream_extractor_t* extractor = &priv->public;
>+    stream_extractor_t* extractor = &priv->pub;
>     return extractor->stream.pf_read( extractor, buf, len );
> }
> 
>@@ -100,7 +100,7 @@ static block_t*
> se_StreamBlock( stream_t* stream, bool* eof )
> {
>     struct stream_extractor_private* priv = stream->p_sys;
>-    stream_extractor_t* extractor = &priv->public;
>+    stream_extractor_t* extractor = &priv->pub;
>     return extractor->stream.pf_block( extractor, eof );
> }
> 
>@@ -108,7 +108,7 @@ static int
> se_StreamSeek( stream_t* stream, uint64_t offset )
> {
>     struct stream_extractor_private* priv = stream->p_sys;
>-    stream_extractor_t* extractor = &priv->public;
>+    stream_extractor_t* extractor = &priv->pub;
>     return extractor->stream.pf_seek( extractor, offset );
> }
> 
>@@ -116,7 +116,7 @@ static int
> se_StreamReadDir( stream_t* stream, input_item_node_t* node )
> {
>     struct stream_extractor_private* priv = stream->p_sys;
>-    stream_extractor_t* extractor = &priv->public;
>+    stream_extractor_t* extractor = &priv->pub;
>     return extractor->directory.pf_readdir( extractor, node );
> }
> 
>@@ -124,7 +124,7 @@ static int
> se_StreamControl( stream_t* stream, int req, va_list args )
> {
>     struct stream_extractor_private* priv = stream->p_sys;
>-    stream_extractor_t* extractor = &priv->public;
>+    stream_extractor_t* extractor = &priv->pub;
> 
>     if( extractor->identifier )
>         return extractor->stream.pf_control( extractor, req, args );
>@@ -156,19 +156,19 @@ se_StreamControl( stream_t* stream, int req,
>va_list args )
> static int
>se_InitStream( struct stream_extractor_private* priv, stream_t* source
>)
> {
>-    stream_t* s = vlc_stream_CommonNew( priv->public.obj.parent,
>+    stream_t* s = vlc_stream_CommonNew( priv->pub.obj.parent,
>                                         se_StreamDelete );
>     if( unlikely( !s ) )
>         return VLC_EGENERIC;
> 
>-    if( priv->public.identifier )
>+    if( priv->pub.identifier )
>     {
>-        if( priv->public.stream.pf_read ) s->pf_read = se_StreamRead;
>+        if( priv->pub.stream.pf_read ) s->pf_read = se_StreamRead;
>        else                              s->pf_block = se_StreamBlock;
> 
>         s->pf_seek = se_StreamSeek;
>-        s->psz_url = vlc_stream_extractor_CreateMRL( &priv->public,
>-                                                     
>priv->public.identifier );
>+        s->psz_url = vlc_stream_extractor_CreateMRL( &priv->pub,
>+                                                     
>priv->pub.identifier );
>     }
>     else
>     {
>@@ -201,13 +201,13 @@ vlc_stream_extractor_Attach( stream_t** source,
>char const* identifier,
>     if( unlikely( !priv ) )
>         return VLC_ENOMEM;
> 
>-    priv->public.identifier = identifier ? strdup( identifier ) :
>NULL;
>+    priv->pub.identifier = identifier ? strdup( identifier ) : NULL;
> 
>-    if( unlikely( identifier && !priv->public.identifier ) )
>+    if( unlikely( identifier && !priv->pub.identifier ) )
>         goto error;
> 
>-    priv->public.source = *source;
>-    priv->module = module_need( &priv->public, "stream_extractor",
>+    priv->pub.source = *source;
>+    priv->module = module_need( &priv->pub, "stream_extractor",
>                                 module_name, true );
> 
>     if( !priv->module || se_InitStream( priv, *source ) )
>-- 
>2.10.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

No, public is reserved in C++, not in C. We never supported compiling VLC C modules as C++, only headers.

Your setup might be broken.
-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list