[vlc-commits] [Git][videolan/vlc][master] 10 commits: rename __LIBVLC__ to LIBVLC_INTERNAL_

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Jan 17 11:06:30 UTC 2023



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
352ad101 by Steve Lhomme at 2023-01-17T10:37:49+00:00
rename __LIBVLC__ to LIBVLC_INTERNAL_

define names starting with 2 underscore are reserved.

https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685

- - - - -
32e310fb by Steve Lhomme at 2023-01-17T10:37:49+00:00
avoid empty function parameters

- - - - -
dc91b163 by Steve Lhomme at 2023-01-17T10:37:49+00:00
vlc_tick: use unsigned for sample frequency

It cannot be negative. The amount of samples and ticks can be negative.

- - - - -
8df09a9e by Steve Lhomme at 2023-01-17T10:37:49+00:00
vlc_picture: add C++ extern "C"

- - - - -
19828b14 by Steve Lhomme at 2023-01-17T10:37:49+00:00
adaptive: remove name of unused variable

- - - - -
449471a7 by Steve Lhomme at 2023-01-17T10:37:49+00:00
cc: use float constants where floats are expected

- - - - -
a9b074ff by Steve Lhomme at 2023-01-17T10:37:49+00:00
udp: don't use empty switch case

- - - - -
95d60de8 by Steve Lhomme at 2023-01-17T10:37:49+00:00
amem: avoid forward declaration of trivial table

- - - - -
dc2fe066 by Steve Lhomme at 2023-01-17T10:37:49+00:00
cea708: explicitly disable untested code

- - - - -
f417fff8 by Steve Lhomme at 2023-01-17T10:37:49+00:00
configure: define WIN32_LEAN_AND_MEAN only for Windows

It is used to avoid a lot of extra definitions and includes when including
windows.h.

- - - - -


23 changed files:

- config.h.meson
- configure.ac
- include/vlc/libvlc.h
- include/vlc_common.h
- include/vlc_media_library.h
- include/vlc_picture.h
- include/vlc_plugin.h
- include/vlc_tick.h
- modules/audio_output/amem.c
- modules/codec/cc.c
- modules/codec/cea708.c
- modules/codec/scte18.c
- modules/codec/stl.c
- modules/codec/substext.h
- modules/codec/ttml/substtml.c
- modules/demux/adaptive/Streams.cpp
- modules/demux/playlist/itml.c
- modules/stream_filter/hds/hds.c
- modules/stream_out/transcode/pcr_sync.c
- src/check_headers
- src/network/http_auth.c
- src/network/udp.c
- src/test/headers.c


Changes:

=====================================
config.h.meson
=====================================
@@ -75,7 +75,7 @@
 #endif /* _WIN32 */
 
 /* Define within the LibVLC source code tree. */
-#define __LIBVLC__
+#define LIBVLC_INTERNAL_
 
 /* Define to the libdir */
 #mesondefine LIBDIR


=====================================
configure.ac
=====================================
@@ -48,8 +48,7 @@ AH_VERBATIM([FORTIFY_SOURCE],
 # define _FORTIFY_SOURCE 2
 #endif])
 AC_DEFINE([_FILE_OFFSET_BITS], 64, [Define to 64 for large files support.])
-AC_DEFINE([__LIBVLC__],, [Define within the LibVLC source code tree.])
-AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
+AC_DEFINE([LIBVLC_INTERNAL_],, [Define within the LibVLC source code tree.])
 
 AC_PROG_CXX
 AC_PROG_CPP
@@ -292,6 +291,7 @@ int foo() { return my_array[0]; }
       AC_MSG_RESULT([yes])
       VLC_ADD_LIBS([libvlccore], [-lsynchronization])
     ])
+    AC_DEFINE([WIN32_LEAN_AND_MEAN],, [Define to limit the scope of <windows.h>.])
     AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
     AC_DEFINE([_ISOC99_SOURCE], [1], [Extensions to ISO C89 from ISO C99.])
     AC_DEFINE([_ISOC11_SOURCE], [1], [Extensions to ISO C99 from ISO C11.])


=====================================
include/vlc/libvlc.h
=====================================
@@ -42,7 +42,7 @@
 # define LIBVLC_API
 #endif
 
-#ifdef __LIBVLC__
+#ifdef LIBVLC_INTERNAL_
 /* Avoid unhelpful warnings from libvlc with our deprecated APIs */
 #   define LIBVLC_DEPRECATED
 #elif defined(__GNUC__) && \


=====================================
include/vlc_common.h
=====================================
@@ -298,7 +298,7 @@
  *
  * This macro performs a run-time assertion if C assertions are enabled
  * and the following preprocessor symbol is defined:
- * @verbatim __LIBVLC__ @endverbatim
+ * @verbatim LIBVLC_INTERNAL_ @endverbatim
  * That restriction ensures that assertions in public header files are not
  * unwittingly <i>leaked</i> to externally-compiled plug-ins
  * including those header files.
@@ -306,7 +306,7 @@
  * Within the LibVLC code base, this is exactly the same as assert(), which can
  * and probably should be used directly instead.
  */
-#ifdef __LIBVLC__
+#ifdef LIBVLC_INTERNAL_
 # define vlc_assert(pred) assert(pred)
 #else
 # define vlc_assert(pred) ((void)0)


=====================================
include/vlc_media_library.h
=====================================
@@ -945,7 +945,7 @@ VLC_API void vlc_ml_playback_states_all_release( vlc_ml_playback_states_all* pre
 VLC_API void vlc_ml_bookmark_release( vlc_ml_bookmark_t* p_bookmark );
 VLC_API void vlc_ml_bookmark_list_release( vlc_ml_bookmark_list_t* p_list );
 
-static inline vlc_ml_query_params_t vlc_ml_query_params_create()
+static inline vlc_ml_query_params_t vlc_ml_query_params_create(void)
 {
     return (vlc_ml_query_params_t) {
         .psz_pattern = NULL,


=====================================
include/vlc_picture.h
=====================================
@@ -28,6 +28,10 @@
 #include <assert.h>
 #include <vlc_atomic.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct vlc_ancillary;
 typedef uint32_t vlc_ancillary_id;
 
@@ -528,4 +532,8 @@ static inline void picture_SwapUV(picture_t *picture)
 
 /** @} */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* VLC_PICTURE_H */


=====================================
include/vlc_plugin.h
=====================================
@@ -577,7 +577,7 @@ int CDECL_SYMBOL VLC_SYMBOL(vlc_entry_cfg_str_enum)(const char *name, \
     "\x47\x4e\x55\x20\x47\x65\x6e\x65\x72\x61\x6c\x20\x50\x75\x62\x6c" \
     "\x69\x63\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x76\x65\x72\x73" \
     "\x69\x6f\x6e\x20\x32\x20\x6f\x72\x20\x6c\x61\x74\x65\x72\x2e"
-#if defined (__LIBVLC__)
+#if defined (LIBVLC_INTERNAL_)
 # define VLC_MODULE_COPYRIGHT VLC_COPYRIGHT_VIDEOLAN
 # ifndef VLC_MODULE_LICENSE
 #  define VLC_MODULE_LICENSE VLC_LICENSE_LGPL_2_1_PLUS


=====================================
include/vlc_tick.h
=====================================
@@ -98,11 +98,11 @@ static inline vlc_tick_t vlc_tick_rate_duration(float frame_rate)
 /*
  * samples<>vlc_tick_t
  */
-static inline vlc_tick_t vlc_tick_from_samples(int64_t samples, int samp_rate)
+static inline vlc_tick_t vlc_tick_from_samples(int64_t samples, unsigned samp_rate)
 {
     return CLOCK_FREQ * samples / samp_rate;
 }
-static inline int64_t samples_from_vlc_tick(vlc_tick_t t, int samp_rate)
+static inline int64_t samples_from_vlc_tick(vlc_tick_t t, unsigned samp_rate)
 {
     return t * samp_rate / CLOCK_FREQ;
 }


=====================================
modules/audio_output/amem.c
=====================================
@@ -35,7 +35,17 @@ static void Close (vlc_object_t *);
 #define AMEM_NB_FORMATS 3
 
 /* Forward declaration */
-static const char *const format_list[AMEM_NB_FORMATS];
+static const char* const format_list[AMEM_NB_FORMATS] = {
+    "S16N",
+    "S32N",
+    "FL32",
+};
+
+static const vlc_fourcc_t format_list_fourcc[AMEM_NB_FORMATS] = {
+    VLC_CODEC_S16N,
+    VLC_CODEC_S32N,
+    VLC_CODEC_FL32,
+};
 
 vlc_module_begin ()
     set_shortname (N_("Audio memory"))
@@ -59,18 +69,6 @@ vlc_module_begin ()
 
 vlc_module_end ()
 
-static const char *const format_list[AMEM_NB_FORMATS] = {
-    "S16N",
-    "S32N",
-    "FL32",
-};
-
-static const vlc_fourcc_t format_list_fourcc[AMEM_NB_FORMATS] = {
-    VLC_CODEC_S16N,
-    VLC_CODEC_S32N,
-    VLC_CODEC_FL32,
-};
-
 typedef struct
 {
     void *opaque;


=====================================
modules/codec/cc.c
=====================================
@@ -105,8 +105,8 @@ typedef enum
 #define EIA608_SCREEN_ROWS 15
 #define EIA608_SCREEN_COLUMNS 32
 
-#define EIA608_MARGIN  0.10
-#define EIA608_VISIBLE (1.0 - EIA608_MARGIN * 2)
+#define EIA608_MARGIN  0.10f
+#define EIA608_VISIBLE (1.0f - EIA608_MARGIN * 2)
 #define FONT_TO_LINE_HEIGHT_RATIO 1.06
 
 struct eia608_screen // A CC buffer


=====================================
modules/codec/cea708.c
=====================================
@@ -539,7 +539,11 @@ static void CEA708_Window_Reset( cea708_window_t *p_w )
 
 static bool CEA708_Window_BreaksSpace( const cea708_window_t *p_w )
 {
+#if 1
+    // FIXME: missing test case
+    (void)p_w;
     return true;
+#else
     if( p_w->style.print_direction == CEA708_WA_DIRECTION_LTR &&
         p_w->style.justify == CEA708_WA_JUSTIFY_LEFT )
         return true;
@@ -549,6 +553,7 @@ static bool CEA708_Window_BreaksSpace( const cea708_window_t *p_w )
         return true;
 
     return false;
+#endif
 }
 
 static uint8_t CEA708_Window_MinCol( const cea708_window_t *p_w )


=====================================
modules/codec/scte18.c
=====================================
@@ -73,7 +73,7 @@ typedef struct scte18_cea_t
  ****************************************************************************/
 #define BUF_ADVANCE(n) p_buffer += n; i_buffer -= n;
 
-static inline scte18_cea_t * scte18_cea_New()
+static inline scte18_cea_t * scte18_cea_New(void)
 {
     return calloc( 1, sizeof(scte18_cea_t) );
 }


=====================================
modules/codec/stl.c
=====================================
@@ -110,7 +110,7 @@ static cct_number_t cct_nums[] = { {CCT_ISO_6937_2, "ISO_6937-2"},
                                    {CCT_ISO_8859_7, "ISO_8859-7"},
                                    {CCT_ISO_8859_8, "ISO_8859-8"} };
 
-static text_style_t * CreateGroupStyle()
+static text_style_t * CreateGroupStyle(void)
 {
     text_style_t *p_style = text_style_Create(STYLE_NO_DEFAULTS);
     if(p_style)


=====================================
modules/codec/substext.h
=====================================
@@ -79,7 +79,7 @@ static inline void SubpictureUpdaterSysRegionInit(substext_updater_region_t *p_u
     p_updtregion->inner_align = 0;
 }
 
-static inline substext_updater_region_t *SubpictureUpdaterSysRegionNew( )
+static inline substext_updater_region_t *SubpictureUpdaterSysRegionNew( void )
 {
     substext_updater_region_t *p_region = malloc(sizeof(*p_region));
     if(p_region)
@@ -299,7 +299,7 @@ static inline subpicture_t *decoder_NewSubpictureText(decoder_t *decoder)
         .p_sys       = sys,
     };
     SubpictureUpdaterSysRegionInit( &sys->region );
-    sys->margin_ratio = 0.04;
+    sys->margin_ratio = 0.04f;
     sys->p_default_style = text_style_Create( STYLE_NO_DEFAULTS );
     if(unlikely(!sys->p_default_style))
     {


=====================================
modules/codec/ttml/substtml.c
=====================================
@@ -131,7 +131,7 @@ static void ttml_style_Delete( ttml_style_t* p_ttml_style )
     free( p_ttml_style );
 }
 
-static ttml_style_t * ttml_style_New( )
+static ttml_style_t * ttml_style_New( void )
 {
     ttml_style_t *p_ttml_style = calloc( 1, sizeof( ttml_style_t ) );
     if( unlikely( !p_ttml_style ) )


=====================================
modules/demux/adaptive/Streams.cpp
=====================================
@@ -724,7 +724,7 @@ bool AbstractStream::getMediaAdvanceAmount(vlc_tick_t *duration) const
     return true;
 }
 
-bool AbstractStream::runUpdates(bool b_preparsing)
+bool AbstractStream::runUpdates(bool)
 {
     if(!valid)
         return false;


=====================================
modules/demux/playlist/itml.c
=====================================
@@ -338,7 +338,7 @@ static bool parse_track_dict( stream_t *p_demux, input_item_node_t *p_input_node
     return i_ret;
 }
 
-static track_elem_t *new_track()
+static track_elem_t *new_track(void)
 {
     track_elem_t *p_track = malloc( sizeof *p_track );
     if( likely( p_track ) )


=====================================
modules/stream_filter/hds/hds.c
=====================================
@@ -491,7 +491,7 @@ static uint8_t* parse_afrt( vlc_object_t* p_this,
     return data_p;
 }
 
-static inline chunk_t* chunk_new()
+static inline chunk_t* chunk_new(void)
 {
     chunk_t* chunk = calloc(1, sizeof(chunk_t));
     return chunk;


=====================================
modules/stream_out/transcode/pcr_sync.c
=====================================
@@ -66,7 +66,7 @@ struct es_data
     pcr_event_t *last_pcr_event;
 };
 
-static inline struct es_data es_data_Init()
+static inline struct es_data es_data_Init(void)
 {
     return (struct es_data){.is_deleted = false,
                             .last_input_dts = VLC_TICK_INVALID,


=====================================
src/check_headers
=====================================
@@ -12,7 +12,7 @@ while read l; do
 	test -z "$d" && continue
 	test "$d" = "WORDS_BIGENDIAN" && continue
 	test "$d" = "UNICODE" && continue
-	test "$d" = "__LIBVLC__" && continue
+	test "$d" = "LIBVLC_INTERNAL_" && continue
 
 	if test -z "$regexp"; then
 		regexp="[^A-Za-z0-9_]\("


=====================================
src/network/http_auth.c
=====================================
@@ -82,7 +82,7 @@ static char *AuthGetParamNoQuotesConcat( const char *psz_header, const char *psz
     }
 }
 
-static char *GenerateCnonce()
+static char *GenerateCnonce(void)
 {
     char ps_random[32];
     char *md5_hex;


=====================================
src/network/udp.c
=====================================
@@ -725,6 +725,7 @@ int net_SetCSCov (int fd, int sendcov, int recvcov)
                     &type, &(socklen_t){ sizeof (type) }))
         return VLC_EGENERIC;
 
+#if defined( UDPLITE_RECV_CSCOV ) || defined( DCCP_SOCKOPT_SEND_CSCOV )
     switch (type)
     {
 #ifdef UDPLITE_RECV_CSCOV
@@ -768,7 +769,7 @@ int net_SetCSCov (int fd, int sendcov, int recvcov)
             return VLC_SUCCESS;
 #endif
     }
-#if !defined( UDPLITE_RECV_CSCOV ) && !defined( DCCP_SOCKOPT_SEND_CSCOV )
+#else
     VLC_UNUSED(sendcov);
     VLC_UNUSED(recvcov);
 #endif


=====================================
src/test/headers.c
=====================================
@@ -25,10 +25,10 @@
 
 #define PACKAGE "vlc"
 
-/* Because we are from src/ __LIBVLC__ is defined, but we don't want that,
+/* Because we are from src/ LIBVLC_INTERNAL_ is defined, but we don't want that,
  * as we act here as a third-party program just linking to libvlc */
-#ifdef __LIBVLC__
-# undef __LIBVLC__
+#ifdef LIBVLC_INTERNAL_
+# undef LIBVLC_INTERNAL_
 #endif
 
 #include <vlc/vlc.h>



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/39e7bc0f52c6ac8516aa523bdb829cc7f390fd51...f417fff8c2ca0f55b95277c52130b4036b408206

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/39e7bc0f52c6ac8516aa523bdb829cc7f390fd51...f417fff8c2ca0f55b95277c52130b4036b408206
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list