[vlc-commits] [Git][videolan/vlc][master] 8 commits: bonjour: cast to long before converting a NSInteger to a string

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Oct 22 19:59:05 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
b9cf5973 by Steve Lhomme at 2025-10-22T19:25:37+00:00
bonjour: cast to long before converting a NSInteger to a string

As advised in the Apple documentation [^1].

[^1]: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265

- - - - -
6b22e6e6 by Steve Lhomme at 2025-10-22T19:25:37+00:00
ci_filters: add missing field initializers

Spotted when using -Werror=missing-field-initializers.
Maybe they are not filled with 0 by default as in C.

- - - - -
5b6daff7 by Steve Lhomme at 2025-10-22T19:25:37+00:00
macosx: use named initializers for vlc_display_operations

- - - - -
ab160829 by Steve Lhomme at 2025-10-22T19:25:37+00:00
VLCInputItem: use named initializers for input_item_parser_cbs_t

- - - - -
b808437b by Steve Lhomme at 2025-10-22T19:25:37+00:00
macosx: use named initializers for vlc_window_operations

- - - - -
7859aef7 by Steve Lhomme at 2025-10-22T19:25:37+00:00
configure: add extra compilation checks for Objective C

- - - - -
a0f9a441 by Steve Lhomme at 2025-10-22T19:25:37+00:00
makefile: fix folder to generate before building Metal shaders

- - - - -
ef1d401d by Steve Lhomme at 2025-10-22T19:25:37+00:00
configure: add regular compilation warnings for Objective C

- - - - -


8 changed files:

- configure.ac
- modules/gui/macosx/Makefile.am
- modules/gui/macosx/library/VLCInputItem.m
- modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
- modules/gui/minimal_macosx/intf.m
- modules/services_discovery/bonjour.m
- modules/video_filter/ci_filters.m
- modules/video_output/macosx.m


Changes:

=====================================
configure.ac
=====================================
@@ -1199,6 +1199,9 @@ AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -W
 AC_LANG_PUSH(C++)
 AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security -Wduplicated-branches -Wduplicated-cond], [CXXFLAGS])
 AC_LANG_POP(C++)
+AC_LANG_PUSH([Objective C])
+AX_APPEND_COMPILE_FLAGS([-Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wvolatile-register-var -Wformat -Wformat-security], [OBJCFLAGS])
+AC_LANG_POP([Objective C])
 
 dnl -Werror-implicit-function-declaration is used for the if_nametoindex detection with winstore
 AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wshadow=local -Wmultistatement-macros], [CFLAGS])
@@ -1213,6 +1216,9 @@ AS_IF([test "${enable_extra_checks}" = "yes"], [
     AC_LANG_PUSH(C++)
     AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=excess-initializers], [CXXFLAGS])
     AC_LANG_POP(C++)
+    AC_LANG_PUSH([Objective C])
+    AX_APPEND_COMPILE_FLAGS([-Werror=missing-field-initializers -Werror=format -Werror=excess-initializers -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=implicit-int -Wextra], [OBJCFLAGS])
+    AC_LANG_POP([Objective C])
 ])
 
 # Casting incompatible functions is notoriously bug prone with emscripten:


=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -59,7 +59,7 @@ libmacosx_plugin_la_METAL_AIR_FILES = $(libmacosx_plugin_la_METAL_srcs:.metal=.a
 libmacosx_plugin_la_METAL_LIBRARY = gui/macosx/Resources/Shaders.metallib
 
 $(libmacosx_plugin_la_METAL_LIBRARY): $(libmacosx_plugin_la_METAL_AIR_FILES)
-	$(AM_V_at)$(MKDIR_P) "gui/macosx/shaders"
+	$(AM_V_at)$(MKDIR_P) "gui/macosx/Resources"
 	$(metallib_verbose)$(METALLIB) $(libmacosx_plugin_la_METAL_AIR_FILES) -o $@
 
 EXTRA_DIST += $(libmacosx_plugin_la_METAL_srcs)


=====================================
modules/gui/macosx/library/VLCInputItem.m
=====================================
@@ -68,8 +68,8 @@ static void cb_subtree_added(input_item_t *p_item, input_item_node_t *p_node, vo
 
 static const struct input_item_parser_cbs_t parserCallbacks =
 {
-    cb_parsing_ended,
-    cb_subtree_added,
+    .on_ended = cb_parsing_ended,
+    .on_subtree_added = cb_subtree_added,
 };
 
 @implementation VLCInputItem


=====================================
modules/gui/macosx/windows/video/VLCVideoOutputProvider.m
=====================================
@@ -159,13 +159,12 @@ static void WindowUnsetFullscreen(vlc_window_t *wnd)
 static atomic_bool b_intf_starting = false;
 
 static const struct vlc_window_operations ops = {
-    WindowEnable,
-    WindowDisable,
-    WindowResize,
-    NULL,
-    WindowSetState,
-    WindowUnsetFullscreen,
-    WindowSetFullscreen,
+    .enable = WindowEnable,
+    .disable = WindowDisable,
+    .resize = WindowResize,
+    .set_state = WindowSetState,
+    .unset_fullscreen = WindowUnsetFullscreen,
+    .set_fullscreen = WindowSetFullscreen,
 };
 
 int WindowOpen(vlc_window_t *p_wnd)


=====================================
modules/gui/minimal_macosx/intf.m
=====================================
@@ -180,14 +180,12 @@ static void WindowSetFullscreen(vlc_window_t *p_wnd, const char *psz_id)
 }
 
 static const struct vlc_window_operations ops = {
-    WindowEnable,
-    WindowDisable,
-    WindowResize,
-    NULL,
-    WindowSetState,
-    WindowUnsetFullscreen,
-    WindowSetFullscreen,
-    NULL,
+    .enable = WindowEnable,
+    .disable = WindowDisable,
+    .resize = WindowResize,
+    .set_state = WindowSetState,
+    .unset_fullscreen = WindowUnsetFullscreen,
+    .set_fullscreen = WindowSetFullscreen,
 };
 
 int WindowOpen(vlc_window_t *p_wnd)


=====================================
modules/services_discovery/bonjour.m
=====================================
@@ -351,7 +351,7 @@ static NSString * ipAddressAsStringForData(NSData * data)
 {
     vlc_renderer_discovery_t *p_rd = (vlc_renderer_discovery_t *)_p_this;
 
-    NSString *uri = [NSString stringWithFormat:@"%@://%@:%ld", protocol, netService.hostName, netService.port];
+    NSString *uri = [NSString stringWithFormat:@"%@://%@:%ld", protocol, netService.hostName, (long)netService.port];
     NSDictionary *txtDict = [NSNetService dictionaryFromTXTRecordData:[netService TXTRecordData]];
     NSString *displayName = netService.name;
     int rendererFlags = 0;
@@ -414,7 +414,7 @@ static NSString * ipAddressAsStringForData(NSData * data)
     if ([protocol isEqualToString:@"smb"]) {
         host = ipAddressAsStringForData(netService.addresses.firstObject);
     }
-    NSString *uri = [NSString stringWithFormat:@"%@://%@:%ld", protocol, host, netService.port];
+    NSString *uri = [NSString stringWithFormat:@"%@://%@:%ld", protocol, host, (long)netService.port];
 
     input_item_t *p_input_item = input_item_NewDirectory([uri UTF8String], [netService.name UTF8String], ITEM_NET );
     if (p_input_item != NULL) {


=====================================
modules/video_filter/ci_filters.m
=====================================
@@ -139,7 +139,8 @@ static struct filter_desc       filter_desc_table[] =
         { "adjust", @"CIHueAdjust" },
         {
             { "hue", @"inputAngle", {{{-180.f, +180.f}, {+3.f, -3.f}}}, VLC_VAR_FLOAT }
-        }
+        },
+        NULL, NULL
     },
     [FILTER_ADJUST_COLOR_CONTROLS] =
     {
@@ -148,39 +149,45 @@ static struct filter_desc       filter_desc_table[] =
             { "contrast",   @"inputContrast",   {{{.0f, 2.f}, {.0f, 2.f}}},   VLC_VAR_FLOAT },
             { "brightness", @"inputBrightness", {{{.0f, 2.f}, {-1.f, +1.f}}}, VLC_VAR_FLOAT },
             { "saturation", @"inputSaturation", {{{.0f, 3.f}, {.0f, 2.7f}}},  VLC_VAR_FLOAT }
-        }
+        },
+        NULL, NULL
     },
     [FILTER_ADJUST_GAMMA] =
     {
         { "adjust", @"CIGammaAdjust" },
         {
             { "gamma", @"inputPower", {{{.01f, 1.f}, {10.f, 1.f}}, {{1.f, 10.f}, {1.f, .01f}}}, VLC_VAR_FLOAT }
-        }
+        },
+        NULL, NULL
     },
     [FILTER_INVERT] =
     {
-        { "invert", @"CIColorInvert" }
+        { "invert", @"CIColorInvert" }, { { } },
+        NULL, NULL
     },
     [FILTER_POSTERIZE] =
     {
         { "posterize", @"CIColorPosterize" },
         {
             { "posterize-level", @"inputLevels", {{{2.f, 256.f}, {2.f, 256.f}}}, VLC_VAR_INTEGER }
-        }
+        },
+        NULL, NULL
     },
     [FILTER_SEPIA] =
     {
         { "sepia", @"CISepiaTone" },
         {
             { "sepia-intensity", @"inputIntensity", {{{.0f, 255.f}, {.0f, 1.f}}}, VLC_VAR_INTEGER }
-        }
+        },
+        NULL, NULL
     },
     [FILTER_SHARPEN] =
     {
         { "sharpen", @"CISharpenLuminance" },
         {
             { "sharpen-sigma", @"inputSharpness", {{{.0f, 2.f}, {.0f, 5.f}}}, VLC_VAR_FLOAT }
-        }
+        },
+        NULL, NULL
     },
     [FILTER_PSYCHEDELIC] =
     {
@@ -190,7 +197,7 @@ static struct filter_desc       filter_desc_table[] =
     },
     [FILTER_CUSTOM] =
     {
-        { "custom" }, { { } },
+        { "custom", NULL }, { { } },
         filter_PsychedelicInit,
         filter_PsychedelicControl
     },


=====================================
modules/video_output/macosx.m
=====================================
@@ -135,7 +135,11 @@ static int SetViewpoint(vout_display_t *vd, const vlc_viewpoint_t *vp)
 }
 
 static const struct vlc_display_operations ops = {
-    Close, PictureRender, PictureDisplay, NULL, Control, NULL, SetViewpoint, NULL,
+    .close = Close,
+    .prepare = PictureRender,
+    .display = PictureDisplay,
+    .control = Control,
+    .set_viewpoint = SetViewpoint,
 };
 
 static int Open (vout_display_t *vd,



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1deac746dcac43f53f52bbefe0b689ad89599291...ef1d401dd84c70da1bea3edf7e9da571bc7f8586

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1deac746dcac43f53f52bbefe0b689ad89599291...ef1d401dd84c70da1bea3edf7e9da571bc7f8586
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