vlc | branch: master | Romain Vimont <ro...@videolabs.io> | Mon Jun 11 13:58:52 
2018 +0200| [2d8cd77ba3d3dc3a532eb25460a9cfe124e0e85e] | committer: 
Jean-Baptiste Kempf

Define C++ types in namespaces

In order to respect ODR, in C++ code, declare *_sys_t types in a
separate namespace, either unnamed if it's used only in one translation
unit, or named otherwise.

The GUI modules qt and skins2 are left unchanged for now.

See #17078 and #18033

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 modules/access/dcp/dcp.cpp                       |  4 ++++
 modules/access/decklink.cpp                      |  7 +++++++
 modules/access/dshow/access.h                    |  4 ++++
 modules/access/dshow/crossbar.cpp                |  4 ++++
 modules/access/dshow/dshow.cpp                   | 10 ++++++++++
 modules/access/dshow/filter.cpp                  |  4 ++++
 modules/access/dshow/filter.h                    |  4 ++++
 modules/access/dshow/vlc_dshow.h                 |  4 ++++
 modules/access/live555.cpp                       |  4 ++++
 modules/audio_filter/spatializer/spatializer.cpp |  9 +++++++++
 modules/demux/mkv/Ebml_parser.cpp                |  3 +++
 modules/demux/mkv/Ebml_parser.hpp                |  4 ++++
 modules/demux/mkv/chapter_command.cpp            |  5 ++++-
 modules/demux/mkv/chapter_command.hpp            |  6 +++---
 modules/demux/mkv/chapters.cpp                   |  3 +++
 modules/demux/mkv/chapters.hpp                   |  4 ++++
 modules/demux/mkv/demux.cpp                      |  3 +++
 modules/demux/mkv/demux.hpp                      |  3 +++
 modules/demux/mkv/matroska_segment.cpp           |  4 ++++
 modules/demux/mkv/matroska_segment.hpp           |  3 +++
 modules/demux/mkv/matroska_segment_parse.cpp     |  4 ++++
 modules/demux/mkv/matroska_segment_seeker.cpp    |  3 +++
 modules/demux/mkv/matroska_segment_seeker.hpp    |  4 ++++
 modules/demux/mkv/mkv.cpp                        |  7 +++++++
 modules/demux/mkv/mkv.hpp                        |  3 +++
 modules/demux/mkv/stream_io_callback.cpp         |  3 +++
 modules/demux/mkv/stream_io_callback.hpp         |  4 ++++
 modules/demux/mkv/util.cpp                       |  4 ++++
 modules/demux/mkv/util.hpp                       |  4 ++++
 modules/demux/mkv/virtual_segment.cpp            |  4 ++++
 modules/demux/mkv/virtual_segment.hpp            |  4 ++++
 modules/demux/sid.cpp                            | 15 +++++++++------
 modules/services_discovery/upnp.cpp              |  4 ++++
 modules/stream_out/chromecast/cast.cpp           |  4 ++++
 modules/video_filter/blend.cpp                   |  8 ++++++++
 modules/video_filter/opencv_example.cpp          |  5 +++++
 modules/video_output/decklink.cpp                |  8 ++++++--
 modules/visualization/projectm.cpp               |  3 +++
 modules/visualization/vsxu.cpp                   |  3 +++
 39 files changed, 174 insertions(+), 12 deletions(-)

diff --git a/modules/access/dcp/dcp.cpp b/modules/access/dcp/dcp.cpp
index 66614fab22..075a89f43a 100644
--- a/modules/access/dcp/dcp.cpp
+++ b/modules/access/dcp/dcp.cpp
@@ -84,6 +84,8 @@ vlc_module_begin()
     set_callbacks( Open, Close )
 vlc_module_end()
 
+namespace {
+
 //! Kind of MXF MEDIA TYPE
 typedef enum MxfMedia_t {
     MXF_UNKNOWN = 0,
@@ -215,6 +217,8 @@ class demux_sys_t
     }
 };
 
+} // namespace
+
 /*TODO: basic correlation between SMPTE S428-3/S429-2
  * Real sound is more complex with case of left/right surround, ...
  * and hearing impaired/Narration channels */
diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp
index 48497ef425..a600f20536 100644
--- a/modules/access/decklink.cpp
+++ b/modules/access/decklink.cpp
@@ -129,6 +129,8 @@ static int Control(demux_t *, int, va_list);
 
 class DeckLinkCaptureDelegate;
 
+namespace {
+
 struct demux_sys_t
 {
     IDeckLink *card;
@@ -156,6 +158,8 @@ struct demux_sys_t
     bool tenbits;
 };
 
+} // namespace
+
 static const char *GetFieldDominance(BMDFieldDominance dom, uint32_t *flags)
 {
     switch(dom)
@@ -224,6 +228,7 @@ static es_format_t GetModeSettings(demux_t *demux, 
IDeckLinkDisplayMode *m,
 
     return video_fmt;
 }
+namespace {
 
 class DeckLinkCaptureDelegate : public IDeckLinkInputCallback
 {
@@ -297,6 +302,8 @@ private:
     demux_t *demux_;
 };
 
+} // namespace
+
 HRESULT 
DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame* 
videoFrame, IDeckLinkAudioInputPacket* audioFrame)
 {
     demux_sys_t *sys = static_cast<demux_sys_t *>(demux_->p_sys);
diff --git a/modules/access/dshow/access.h b/modules/access/dshow/access.h
index 6ae768a68f..789e6dd635 100644
--- a/modules/access/dshow/access.h
+++ b/modules/access/dshow/access.h
@@ -35,6 +35,8 @@ using Microsoft::WRL::ComPtr;
 
 typedef struct demux_sys_t demux_sys_t;
 
+namespace dshow {
+
 /****************************************************************************
  * Crossbar stuff
  ****************************************************************************/
@@ -82,3 +84,5 @@ struct access_sys_t
     vlc_tick_t     i_start;
 };
 
+}
+
diff --git a/modules/access/dshow/crossbar.cpp 
b/modules/access/dshow/crossbar.cpp
index 75e93182b3..7e2a55ad19 100644
--- a/modules/access/dshow/crossbar.cpp
+++ b/modules/access/dshow/crossbar.cpp
@@ -39,6 +39,8 @@
 #include "access.h"
 #include "vlc_dshow.h"
 
+namespace dshow {
+
 // Helper function to associate a crossbar pin name with the type.
 static const char * GetPhysicalPinName(long lType)
 {
@@ -287,3 +289,5 @@ HRESULT FindCrossbarRoutes( vlc_object_t *p_this, 
access_sys_t *p_sys,
 
     return result;
 }
+
+} // namespace
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index adbb6bf3a5..13c988666a 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -57,6 +57,8 @@
 #define INSTANCEDATA_OF_PROPERTY_PTR(x) ((PKSPROPERTY((x))) + 1)
 #define INSTANCEDATA_OF_PROPERTY_SIZE(x) (sizeof((x)) - sizeof(KSPROPERTY))
 
+namespace dshow {
+
 /*****************************************************************************
  * Access: local prototypes
  *****************************************************************************/
@@ -215,6 +217,10 @@ static void AccessClose( vlc_object_t * );
 static int  DemuxOpen  ( vlc_object_t * );
 static void DemuxClose ( vlc_object_t * );
 
+} // namespace
+
+using namespace dshow;
+
 vlc_module_begin ()
     set_shortname( N_("DirectShow") )
     set_description( N_("DirectShow input") )
@@ -302,6 +308,8 @@ vlc_module_begin ()
 
 vlc_module_end ()
 
+namespace dshow {
+
 struct ComContext
 {
     ComContext( int mode )
@@ -2389,3 +2397,5 @@ static void ConfigTuner( vlc_object_t *p_this, 
ICaptureGraphBuilder2 *p_graph,
         }
     }
 }
+
+} // namespace
diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp
index d658e6b1ef..fa696fe344 100644
--- a/modules/access/dshow/filter.cpp
+++ b/modules/access/dshow/filter.cpp
@@ -45,6 +45,8 @@
 
 #include <new>
 
+namespace dshow {
+
 DEFINE_GUID(MEDIASUBTYPE_HDYC ,0x43594448 /* CYDH */ , 0x0000, 0x0010, 0x80, 
0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
 DEFINE_GUID(MEDIASUBTYPE_DIVX ,0x58564944 /* XVID */ , 0x0000, 0x0010, 0x80, 
0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
 
@@ -1165,3 +1167,5 @@ STDMETHODIMP CaptureEnumMediaTypes::Clone( 
IEnumMediaTypes **ppEnum )
 
     return NOERROR;
 };
+
+} // namespace
diff --git a/modules/access/dshow/filter.h b/modules/access/dshow/filter.h
index 44c9c42521..597e81f5e9 100644
--- a/modules/access/dshow/filter.h
+++ b/modules/access/dshow/filter.h
@@ -28,6 +28,8 @@
 
 #include <deque>
 
+namespace dshow {
+
 struct VLCMediaSample
 {
     ComPtr<IMediaSample> p_sample;
@@ -226,3 +228,5 @@ public:
 private:
     virtual ~CaptureEnumMediaTypes();
 };
+
+} // namespace
diff --git a/modules/access/dshow/vlc_dshow.h b/modules/access/dshow/vlc_dshow.h
index be98882cc7..57c84ade3b 100644
--- a/modules/access/dshow/vlc_dshow.h
+++ b/modules/access/dshow/vlc_dshow.h
@@ -44,6 +44,8 @@
 
 #include <dshow.h>
 
+namespace dshow {
+
 /*****************************************************************************
  * DirectShow GUIDs.
  *****************************************************************************/
@@ -370,5 +372,7 @@ DECLARE_INTERFACE_(IAMTVAudio, IUnknown)
     STDMETHOD(UnRegisterNotificationCallBack) (THIS_ IAMTunerNotification*);
 };
 
+} // namespace
+
 #endif /* __MINGW64_VERSION_MAJOR */
 #endif /* VLC_DSHOW_H */
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 0197e547cf..c4541c9849 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -145,6 +145,8 @@ vlc_module_end ()
  * Local prototypes
  *****************************************************************************/
 
+namespace {
+
 typedef struct
 {
     demux_t         *p_demux;
@@ -261,6 +263,8 @@ public:
     demux_sys_t *p_sys;
 };
 
+} // namespace
+
 static int Demux  ( demux_t * );
 static int Control( demux_t *, int, va_list );
 
diff --git a/modules/audio_filter/spatializer/spatializer.cpp 
b/modules/audio_filter/spatializer/spatializer.cpp
index ebb43da86f..b3397735e3 100644
--- a/modules/audio_filter/spatializer/spatializer.cpp
+++ b/modules/audio_filter/spatializer/spatializer.cpp
@@ -91,12 +91,17 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
+
+namespace {
+
 struct filter_sys_t
 {
     vlc_mutex_t lock;
     revmodel *p_reverbm;
 };
 
+} // namespace
+
 #define DECLARECB(fn) static int fn (vlc_object_t *,char const *, \
                                      vlc_value_t, vlc_value_t, void *)
 DECLARECB( RoomCallback  );
@@ -107,6 +112,8 @@ DECLARECB( WidthCallback );
 
 #undef  DECLARECB
 
+namespace {
+
 struct callback_s {
   const char *psz_name;
   int (*fp_callback)(vlc_object_t *,const char *,
@@ -114,6 +121,8 @@ struct callback_s {
   void (revmodel::* fp_set)(float);
 };
 
+} // namespace
+
 static const callback_s callbacks[] = {
     { "spatializer-roomsize", RoomCallback,  &revmodel::setroomsize },
     { "spatializer-width",    WidthCallback, &revmodel::setwidth },
diff --git a/modules/demux/mkv/Ebml_parser.cpp 
b/modules/demux/mkv/Ebml_parser.cpp
index eb7315c6ae..1776494fb4 100644
--- a/modules/demux/mkv/Ebml_parser.cpp
+++ b/modules/demux/mkv/Ebml_parser.cpp
@@ -26,6 +26,8 @@
 #include "Ebml_parser.hpp"
 #include "stream_io_callback.hpp"
 
+namespace mkv {
+
 /*****************************************************************************
  * Ebml Stream parser
  *****************************************************************************/
@@ -344,3 +346,4 @@ bool EbmlParser::IsTopPresent( EbmlElement *el ) const
     return false;
 }
 
+} // namespace
diff --git a/modules/demux/mkv/Ebml_parser.hpp 
b/modules/demux/mkv/Ebml_parser.hpp
index 6e427faf18..fea21e5382 100644
--- a/modules/demux/mkv/Ebml_parser.hpp
+++ b/modules/demux/mkv/Ebml_parser.hpp
@@ -27,6 +27,8 @@
 
 #include "mkv.hpp"
 
+namespace mkv {
+
 /*****************************************************************************
  * Ebml Stream parser
  *****************************************************************************/
@@ -66,4 +68,6 @@ class EbmlParser
     bool         mb_dummy;
 };
 
+} // namespace
+
 #endif
diff --git a/modules/demux/mkv/chapter_command.cpp 
b/modules/demux/mkv/chapter_command.cpp
index cff2d56f9c..47479f554e 100644
--- a/modules/demux/mkv/chapter_command.cpp
+++ b/modules/demux/mkv/chapter_command.cpp
@@ -23,8 +23,11 @@
  *****************************************************************************/
 
 #include "chapter_command.hpp"
+#include "demux.hpp"
 #include <algorithm>
 
+namespace mkv {
+
 void chapter_codec_cmds_c::AddCommand( const KaxChapterProcessCommand & 
command )
 {
     uint32 codec_time = uint32(-1);
@@ -766,4 +769,4 @@ bool matroska_script_codec_c::Leave()
     return f_result;
 }
 
-
+} // namespace
diff --git a/modules/demux/mkv/chapter_command.hpp 
b/modules/demux/mkv/chapter_command.hpp
index f206e35b4b..3411824180 100644
--- a/modules/demux/mkv/chapter_command.hpp
+++ b/modules/demux/mkv/chapter_command.hpp
@@ -27,6 +27,8 @@
 
 #include "mkv.hpp"
 
+namespace mkv {
+
 const int MATROSKA_CHAPTER_CODEC_NATIVE  = 0x00;
 const int MATROSKA_CHAPTER_CODEC_DVD     = 0x01;
 
@@ -244,9 +246,6 @@ protected:
     static bool MatchCellNumber   ( const chapter_codec_cmds_c &data, const 
void *p_cookie, size_t i_cookie_size );
 };
 
-
-#include "demux.hpp"
-
 class dvd_chapter_codec_c : public chapter_codec_cmds_c
 {
 public:
@@ -296,5 +295,6 @@ protected:
     matroska_script_interpretor_c interpretor;
 };
 
+} // namespace
 
 #endif
diff --git a/modules/demux/mkv/chapters.cpp b/modules/demux/mkv/chapters.cpp
index 1242908941..7922975b35 100644
--- a/modules/demux/mkv/chapters.cpp
+++ b/modules/demux/mkv/chapters.cpp
@@ -29,6 +29,8 @@
 #include <functional>
 #include <algorithm>
 
+namespace mkv {
+
 chapter_item_c::~chapter_item_c()
 {
     delete p_segment_uid;
@@ -233,3 +235,4 @@ std::string chapter_edition_c::GetMainName() const
     return "";
 }
 
+} // namespace
diff --git a/modules/demux/mkv/chapters.hpp b/modules/demux/mkv/chapters.hpp
index ee4c186912..de87886321 100644
--- a/modules/demux/mkv/chapters.hpp
+++ b/modules/demux/mkv/chapters.hpp
@@ -29,6 +29,8 @@
 
 #include "mkv.hpp"
 
+namespace mkv {
+
 class chapter_translation_c
 {
 public:
@@ -105,4 +107,6 @@ public:
     bool                        b_hidden;
 };
 
+} // namespace
+
 #endif
diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index 2d55eebe56..4e39af0078 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -29,6 +29,8 @@
 
 #include <vlc_actions.h>
 
+namespace mkv {
+
 event_thread_t::event_thread_t(demux_t *p_demux) : p_demux(p_demux)
 {
     vlc_mutex_init( &lock );
@@ -811,3 +813,4 @@ virtual_chapter_c *demux_sys_t::FindChapter( int64_t 
i_find_uid, virtual_segment
     return p_result;
 }
 
+} // namespace
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index 12a6d61e5d..79f15b5f83 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -30,6 +30,8 @@
 #include "chapter_command.hpp"
 #include "virtual_segment.hpp"
 
+namespace mkv {
+
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 #undef ATTRIBUTE_PACKED
 #undef PRAGMA_PACK_BEGIN
@@ -407,5 +409,6 @@ public:
     event_thread_t *p_ev;
 };
 
+} // namespace
 
 #endif
diff --git a/modules/demux/mkv/matroska_segment.cpp 
b/modules/demux/mkv/matroska_segment.cpp
index 6ab71ab343..057d992d23 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -32,6 +32,8 @@
 #include <new>
 #include <iterator>
 
+namespace mkv {
+
 matroska_segment_c::matroska_segment_c( demux_sys_t & demuxer, EbmlStream & 
estream, KaxSegment *p_seg )
     :segment(p_seg)
     ,es(estream)
@@ -1436,3 +1438,5 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, 
KaxSimpleBlock * & pp_s
         }
     }
 }
+
+} // namespace
diff --git a/modules/demux/mkv/matroska_segment.hpp 
b/modules/demux/mkv/matroska_segment.hpp
index 397466f4be..fa8fcb8f4b 100644
--- a/modules/demux/mkv/matroska_segment.hpp
+++ b/modules/demux/mkv/matroska_segment.hpp
@@ -37,6 +37,8 @@
 
 #include "Ebml_parser.hpp"
 
+namespace mkv {
+
 class EbmlParser;
 
 class chapter_edition_c;
@@ -177,5 +179,6 @@ private:
     friend SegmentSeeker;
 };
 
+} // namespace
 
 #endif
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp 
b/modules/demux/mkv/matroska_segment_parse.cpp
index c8d9065faa..e263f8dfb2 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -41,6 +41,8 @@ extern "C" {
 #include <stdexcept>
 #include <limits>
 
+namespace mkv {
+
 /* GetFourCC helper */
 #define GetFOURCC( p )  __GetFOURCC( (uint8_t*)p )
 static vlc_fourcc_t __GetFOURCC( uint8_t *p )
@@ -2090,3 +2092,5 @@ bool matroska_segment_c::TrackInit( mkv_track_t * p_tk )
 
     return true;
 }
+
+} // namespace
diff --git a/modules/demux/mkv/matroska_segment_seeker.cpp 
b/modules/demux/mkv/matroska_segment_seeker.cpp
index 1d1b18a88f..a4c5daec29 100644
--- a/modules/demux/mkv/matroska_segment_seeker.cpp
+++ b/modules/demux/mkv/matroska_segment_seeker.cpp
@@ -49,6 +49,8 @@ namespace {
     template<class It> It next_( It it ) { return ++it; }
 }
 
+namespace mkv {
+
 SegmentSeeker::cluster_positions_t::iterator
 SegmentSeeker::add_cluster_position( fptr_t fpos )
 {
@@ -521,3 +523,4 @@ SegmentSeeker::mkv_jump_to( matroska_segment_c& ms, fptr_t 
fpos )
         ms.es.I_O().setFilePointer( fpos );
 }
 
+} // namespace
diff --git a/modules/demux/mkv/matroska_segment_seeker.hpp 
b/modules/demux/mkv/matroska_segment_seeker.hpp
index ada76dca0d..bfc2f4e608 100644
--- a/modules/demux/mkv/matroska_segment_seeker.hpp
+++ b/modules/demux/mkv/matroska_segment_seeker.hpp
@@ -31,6 +31,8 @@
 #include <map>
 #include <limits>
 
+namespace mkv {
+
 class matroska_segment_c;
 
 class SegmentSeeker
@@ -125,4 +127,6 @@ class SegmentSeeker
         cluster_map_t       _clusters;
 };
 
+} // namespace
+
 #endif /* include-guard */
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 8b7dd1d561..af6554dcb2 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -39,9 +39,12 @@
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
+namespace mkv {
 static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
+} // namespace
 
+using namespace mkv;
 vlc_module_begin ()
     set_shortname( "Matroska" )
     set_description( N_("Matroska stream demuxer" ) )
@@ -77,6 +80,8 @@ vlc_module_begin ()
     add_shortcut( "mka", "mkv" )
 vlc_module_end ()
 
+namespace mkv {
+
 struct demux_sys_t;
 
 static int  Demux  ( demux_t * );
@@ -898,3 +903,5 @@ bool matroska_stream_c::isUsed() const
     }
     return false;
 }
+
+} // namespace
diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
index 7841873215..3e0ae211b9 100644
--- a/modules/demux/mkv/mkv.hpp
+++ b/modules/demux/mkv/mkv.hpp
@@ -96,6 +96,8 @@
 //# define MKV_DEBUG 0
 #endif
 
+namespace mkv {
+
 #define MATROSKA_COMPRESSION_NONE  -1
 #define MATROSKA_COMPRESSION_ZLIB   0
 #define MATROSKA_COMPRESSION_BLIB   1
@@ -231,5 +233,6 @@ class mkv_track_t
         vlc_tick_t i_codec_delay;
 };
 
+} // namespace
 
 #endif /* _MKV_HPP_ */
diff --git a/modules/demux/mkv/stream_io_callback.cpp 
b/modules/demux/mkv/stream_io_callback.cpp
index 32e5692afb..dfa52c2efe 100644
--- a/modules/demux/mkv/stream_io_callback.cpp
+++ b/modules/demux/mkv/stream_io_callback.cpp
@@ -24,6 +24,8 @@
 
 #include "stream_io_callback.hpp"
 
+namespace mkv {
+
 /*****************************************************************************
  * Stream managment
  *****************************************************************************/
@@ -113,3 +115,4 @@ uint64 vlc_stream_io_callback::toRead( void )
     return static_cast<uint64>( i_size - vlc_stream_Tell( s ) );
 }
 
+} // namespace
diff --git a/modules/demux/mkv/stream_io_callback.hpp 
b/modules/demux/mkv/stream_io_callback.hpp
index d0621c5cf3..bbea5d6f07 100644
--- a/modules/demux/mkv/stream_io_callback.hpp
+++ b/modules/demux/mkv/stream_io_callback.hpp
@@ -35,6 +35,8 @@
 
 using namespace LIBEBML_NAMESPACE;
 
+namespace mkv {
+
 /*****************************************************************************
  * Stream managment
  *****************************************************************************/
@@ -64,4 +66,6 @@ class vlc_stream_io_callback: public IOCallback
     uint64           toRead          ( void );
 };
 
+} // namespace
+
 #endif
diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index 737240d2e8..64f6323eaa 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -25,6 +25,8 @@
 #include "util.hpp"
 #include "demux.hpp"
 
+namespace mkv {
+
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -425,3 +427,5 @@ void MkvTree( demux_t & demuxer, int i_level, const char 
*psz_format, ... )
     MkvTree_va( demuxer, i_level, psz_format, args );
     va_end( args );
 }
+
+} // namespace
diff --git a/modules/demux/mkv/util.hpp b/modules/demux/mkv/util.hpp
index 6e5e74f8f4..dd6728d37f 100644
--- a/modules/demux/mkv/util.hpp
+++ b/modules/demux/mkv/util.hpp
@@ -25,6 +25,8 @@
 
 #include "mkv.hpp"
 
+namespace mkv {
+
 #ifdef HAVE_ZLIB_H
 int32_t zlib_decompress_extra( demux_t * p_demux, mkv_track_t & tk );
 block_t *block_zlib_decompress( vlc_object_t *p_this, block_t *p_in_block );
@@ -94,3 +96,5 @@ block_t * packetize_wavpack( const mkv_track_t &, uint8_t *, 
size_t);
 /* helper functions to print the mkv parse tree */
 void MkvTree_va( demux_t& demuxer, int i_level, const char* fmt, va_list args);
 void MkvTree( demux_t & demuxer, int i_level, const char *psz_format, ... );
+
+} // namespace
diff --git a/modules/demux/mkv/virtual_segment.cpp 
b/modules/demux/mkv/virtual_segment.cpp
index 86e58c767b..cde60b580e 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -27,6 +27,8 @@
 
 #include "demux.hpp"
 
+namespace mkv {
+
 /* FIXME move this, it's demux_sys_t::FindSegment */
 matroska_segment_c * getSegmentbyUID( KaxSegmentUID * p_uid, 
std::vector<matroska_segment_c*> & segments )
 {
@@ -754,3 +756,5 @@ void virtual_segment_c::KeepTrackSelection( 
matroska_segment_c & old, matroska_s
         }
     }
 }
+
+} // namespace
diff --git a/modules/demux/mkv/virtual_segment.hpp 
b/modules/demux/mkv/virtual_segment.hpp
index c9a37cbf87..d09913b689 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -31,6 +31,8 @@
 #include "matroska_segment.hpp"
 #include "chapters.hpp"
 
+namespace mkv {
+
 /* virtual classes don't own anything but virtual elements so they shouldn't 
have to delete anything */
 
 class virtual_chapter_c
@@ -165,4 +167,6 @@ private:
     void KeepTrackSelection( matroska_segment_c & old, matroska_segment_c & 
next );
 };
 
+} // namespace
+
 #endif
diff --git a/modules/demux/sid.cpp b/modules/demux/sid.cpp
index 61e11f965c..26df2de12c 100644
--- a/modules/demux/sid.cpp
+++ b/modules/demux/sid.cpp
@@ -57,7 +57,9 @@ vlc_module_begin ()
     set_callbacks (Open, Close)
 vlc_module_end ()
 
-struct demux_sid
+namespace {
+
+struct demux_sys_t
 {
     sidplay2 *player;
     sid2_config_t config;
@@ -74,6 +76,7 @@ struct demux_sid
     bool title_changed;
 };
 
+} // namespace
 
 static int Demux (demux_t *);
 static int Control (demux_t *, int, va_list);
@@ -81,7 +84,7 @@ static int Control (demux_t *, int, va_list);
 static int Open (vlc_object_t *obj)
 {
     demux_t *demux = (demux_t *)obj;
-    demux_sid *sys = NULL;
+    demux_sys_t *sys = NULL;
     es_format_t fmt;
     bool result = false;
     SidTune *tune = NULL;
@@ -124,7 +127,7 @@ static int Open (vlc_object_t *obj)
     if (unlikely(player==NULL))
         goto error;
 
-    sys = reinterpret_cast<demux_sid*>(calloc (1, sizeof(demux_sid)));
+    sys = reinterpret_cast<demux_sys_t *>(calloc(1, sizeof(demux_sys_t)));
     if (unlikely(sys==NULL))
         goto error;
 
@@ -194,7 +197,7 @@ error:
 static void Close (vlc_object_t *obj)
 {
     demux_t *demux = (demux_t *)obj;
-    demux_sid *sys = reinterpret_cast<demux_sid*>(demux->p_sys);
+    demux_sys_t *sys = reinterpret_cast<demux_sys_t *>(demux->p_sys);
 
     delete sys->player;
     delete sys->config.sidEmulation;
@@ -204,7 +207,7 @@ static void Close (vlc_object_t *obj)
 
 static int Demux (demux_t *demux)
 {
-    demux_sid *sys = reinterpret_cast<demux_sid*>(demux->p_sys);
+    demux_sys_t *sys = reinterpret_cast<demux_sys_t *>(demux->p_sys);
 
     block_t *block = block_Alloc( sys->block_size);
     if (unlikely(block==NULL))
@@ -235,7 +238,7 @@ static int Demux (demux_t *demux)
 
 static int Control (demux_t *demux, int query, va_list args)
 {
-    demux_sid *sys = reinterpret_cast<demux_sid*>(demux->p_sys);
+    demux_sys_t *sys = reinterpret_cast<demux_sys_t *>(demux->p_sys);
 
     switch (query)
     {
diff --git a/modules/services_discovery/upnp.cpp 
b/modules/services_discovery/upnp.cpp
index 703eeeb378..e4183a1486 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -59,6 +59,8 @@ static const char *const ppsz_readible_satip_channel_lists[] 
= {
     "Astra 19.2°E", "Astra 28.2°E", "Astra 23.5°E", N_("Master List"), 
N_("Server List"), N_("Custom List")
 };
 
+namespace {
+
 /*
  * VLC handle
  */
@@ -74,6 +76,8 @@ struct access_sys_t
     UpnpInstanceWrapper* p_upnp;
 };
 
+} // namespace
+
 /*
  * VLC callback prototypes
  */
diff --git a/modules/stream_out/chromecast/cast.cpp 
b/modules/stream_out/chromecast/cast.cpp
index 855cf79b1f..407d1e2e23 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -49,6 +49,8 @@
 #define CC_ENABLE_SPU
 #endif
 
+namespace {
+
 struct sout_access_out_sys_t
 {
     sout_access_out_sys_t(httpd_host_t *httpd_host, intf_sys_t * const intf,
@@ -170,6 +172,8 @@ struct sout_stream_id_sys_t
     bool                  flushed;
 };
 
+} // namespace
+
 #define SOUT_CFG_PREFIX "sout-chromecast-"
 
 static const char DEFAULT_MUXER[] = "avformat{mux=matroska,options={live=1}}";
diff --git a/modules/video_filter/blend.cpp b/modules/video_filter/blend.cpp
index 12f4115c27..3339abe528 100644
--- a/modules/video_filter/blend.cpp
+++ b/modules/video_filter/blend.cpp
@@ -60,6 +60,8 @@ void merge(T *dst, unsigned src, unsigned f)
     *dst = div255((255 - f) * (*dst) + src * f);
 }
 
+namespace {
+
 struct CPixel {
     unsigned i, j, k;
     unsigned a;
@@ -519,6 +521,8 @@ private:
     G g;
 };
 
+} // namespace
+
 template <class TDst, class TSrc, class TConvert>
 void Blend(const CPicture &dst_data, const CPicture &src_data,
            unsigned width, unsigned height, int alpha)
@@ -551,6 +555,8 @@ void Blend(const CPicture &dst_data, const CPicture 
&src_data,
 typedef void (*blend_function_t)(const CPicture &dst_data, const CPicture 
&src_data,
                                  unsigned width, unsigned height, int alpha);
 
+namespace {
+
 static const struct {
     vlc_fourcc_t     dst;
     vlc_fourcc_t     src;
@@ -632,6 +638,8 @@ struct filter_sys_t {
     blend_function_t blend;
 };
 
+} // namespace
+
 /**
  * It blends 2 picture together.
  */
diff --git a/modules/video_filter/opencv_example.cpp 
b/modules/video_filter/opencv_example.cpp
index c3a5fe98a6..1d787858cc 100644
--- a/modules/video_filter/opencv_example.cpp
+++ b/modules/video_filter/opencv_example.cpp
@@ -49,6 +49,9 @@
 /*****************************************************************************
  * filter_sys_t : filter descriptor
  *****************************************************************************/
+
+namespace {
+
 struct filter_sys_t
 {
     CvMemStorage* p_storage;
@@ -57,6 +60,8 @@ struct filter_sys_t
     int i_id;
 };
 
+} // namespace
+
 /****************************************************************************
  * Local prototypes
  ****************************************************************************/
diff --git a/modules/video_output/decklink.cpp 
b/modules/video_output/decklink.cpp
index d0ddf916a4..2e06c54617 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -177,10 +177,12 @@ static const char * const rgsz_ar_text[] = {
 };
 static_assert(ARRAY_SIZE(rgi_ar_values) == ARRAY_SIZE(rgsz_ar_text), "afd 
arrays messed up");
 
+namespace {
+
 /* Only one audio output module and one video output module
  * can be used per process.
  * We use a static mutex in audio/video submodules entry points.  */
-typedef struct decklink_sys_t
+struct decklink_sys_t
 {
     /* With LOCK */
     IDeckLinkOutput *p_output;
@@ -217,7 +219,9 @@ typedef struct decklink_sys_t
         int nosignal_delay;
         picture_t *pic_nosignal;
     } video;
-} decklink_sys_t;
+};
+
+} // namespace
 
 /*****************************************************************************
  * Local prototypes.
diff --git a/modules/visualization/projectm.cpp 
b/modules/visualization/projectm.cpp
index 443ada348e..04f6a3f8db 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -132,6 +132,8 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
+namespace {
+
 struct filter_sys_t
 {
     /* */
@@ -151,6 +153,7 @@ struct filter_sys_t
     unsigned i_nb_samples;
 };
 
+} // namespace
 
 static block_t *DoWork( filter_t *, block_t * );
 static void *Thread( void * );
diff --git a/modules/visualization/vsxu.cpp b/modules/visualization/vsxu.cpp
index 8be523e6fa..faa8815102 100644
--- a/modules/visualization/vsxu.cpp
+++ b/modules/visualization/vsxu.cpp
@@ -73,6 +73,7 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
+namespace {
 
 struct filter_sys_t
 {
@@ -92,6 +93,8 @@ struct filter_sys_t
     bool b_quit;
 };
 
+} // namespace
+
 static block_t *DoWork( filter_t *, block_t * );
 static void *Thread( void * );
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to