[vlc-commits] macosx: fixed compilation for llvm-gcc-4.2

Felix Paul Kühne git at videolan.org
Tue Oct 16 16:01:08 CEST 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Oct 16 15:57:06 2012 +0200| [64de31cb586df59bf53f441625cae0a2cf5e94be] | committer: Felix Paul Kühne

macosx: fixed compilation for llvm-gcc-4.2

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

 modules/gui/macosx/StringUtility.m           |    4 ++++
 modules/gui/macosx/VLCVoutWindowController.m |   15 +++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/modules/gui/macosx/StringUtility.m b/modules/gui/macosx/StringUtility.m
index 795da0e..00ae8f2 100644
--- a/modules/gui/macosx/StringUtility.m
+++ b/modules/gui/macosx/StringUtility.m
@@ -280,7 +280,9 @@ unsigned int CocoaKeyToVLC(unichar i_key)
         theString = [theString stringByReplacingOccurrencesOfString:@"Ctrl" withString:@""];
     }
 
+#ifdef __clang__
 #pragma GCC diagnostic ignored "-Wformat"
+#endif
     if ([theString length] > 1) {
         if ([theString rangeOfString:@"Up"].location != NSNotFound)
             return [NSString stringWithFormat:@"%C", NSUpArrowFunctionKey];
@@ -336,7 +338,9 @@ unsigned int CocoaKeyToVLC(unichar i_key)
             return [NSString stringWithFormat:@"%C", NSF1FunctionKey];
         /* note that we don't support esc here, since it is reserved for leaving fullscreen */
     }
+#ifdef __clang__
 #pragma GCC diagnostic warning "-Wformat"
+#endif
 
     return theString;
 }
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index 983970b..30f062b 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -66,10 +66,12 @@
 
 - (void)updateWindowsControlsBarWithSelector:(SEL)aSel
 {
-    [o_vout_dict enumerateKeysAndObjectsUsingBlock:^(id key, VLCVideoWindowCommon *o_window, BOOL *stop) {
-        id o_controlsBar = [o_window controlsBar];
-        if (o_controlsBar)
-            [o_controlsBar performSelector:aSel];
+    [o_vout_dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+        if ([obj respondsToSelector:@selector(controlsBar)]) {
+            id o_controlsBar = [obj controlsBar];
+            if (o_controlsBar)
+                [o_controlsBar performSelector:aSel];
+        }
     }];
 }
 
@@ -86,8 +88,9 @@
 
 - (void)updateWindowsUsingBlock:(void (^)(VLCVideoWindowCommon *o_window))windowUpdater
 {
-    [o_vout_dict enumerateKeysAndObjectsUsingBlock:^(id key, VLCVideoWindowCommon *o_window, BOOL *stop) {
-        windowUpdater(o_window);
+    [o_vout_dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+        if ([obj isKindOfClass: [NSWindow class]])
+            windowUpdater(obj);
     }];
 }
 



More information about the vlc-commits mailing list