[vlc-commits] macosx: fix various compilation warnings with regard to integer sizes

Felix Paul Kühne git at videolan.org
Sat Jun 9 17:44:16 CEST 2018


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sat Jun  9 17:43:29 2018 +0200| [67587d2c17861f4fdb27ba283b4ccdd912696113] | committer: Felix Paul Kühne

macosx: fix various compilation warnings with regard to integer sizes

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

 modules/gui/macosx/NSSound+VLCAdditions.m          |  4 ++--
 modules/gui/macosx/VLCAddonsWindowController.m     |  2 +-
 .../gui/macosx/VLCAudioEffectsWindowController.m   |  2 +-
 modules/gui/macosx/VLCBookmarksWindowController.m  |  8 +++----
 modules/gui/macosx/VLCCoreInteraction.h            |  2 +-
 modules/gui/macosx/VLCCoreInteraction.m            |  8 +++----
 modules/gui/macosx/VLCExtensionsManager.m          |  2 +-
 modules/gui/macosx/VLCFSPanelController.m          |  8 +++----
 modules/gui/macosx/VLCInputManager.m               |  8 +++----
 modules/gui/macosx/VLCMainMenu.m                   | 10 ++++-----
 modules/gui/macosx/VLCOpenWindowController.m       | 25 +++++++++++-----------
 modules/gui/macosx/VLCPLModel.m                    | 14 ++++++------
 modules/gui/macosx/VLCPlaylist.m                   |  8 +++----
 modules/gui/macosx/VLCPlaylistInfo.m               | 12 +++++------
 modules/gui/macosx/VLCSimplePrefsController.m      | 11 +++++-----
 modules/gui/macosx/VLCStringUtility.m              |  7 +++---
 .../VLCTrackSynchronizationWindowController.m      |  2 +-
 modules/gui/macosx/VLCUIWidgets.m                  | 16 ++++++++------
 .../gui/macosx/VLCVideoEffectsWindowController.m   |  8 +++----
 modules/gui/macosx/applescript.h                   |  2 +-
 modules/gui/macosx/applescript.m                   |  8 +++----
 modules/gui/macosx/prefs.m                         | 10 ++++-----
 modules/gui/macosx/prefs_widgets.m                 | 24 ++++++++++-----------
 23 files changed, 103 insertions(+), 98 deletions(-)

diff --git a/modules/gui/macosx/NSSound+VLCAdditions.m b/modules/gui/macosx/NSSound+VLCAdditions.m
index c3343c9c37..74f98f2a91 100644
--- a/modules/gui/macosx/NSSound+VLCAdditions.m
+++ b/modules/gui/macosx/NSSound+VLCAdditions.m
@@ -95,7 +95,7 @@
     bool b_returned = YES;
 
     /* since core audio doesn't provide a reasonable way to see how many channels we got, let's see how long we can do this */
-    for (NSUInteger x = 1; b_returned ; x++)
+    for (int x = 1; b_returned ; x++)
         b_returned = [NSSound setSystemVolume: f_volume forChannel:x];
 }
 
@@ -106,7 +106,7 @@
     bool b_returned = YES;
 
     /* since core audio doesn't provide a reasonable way to see how many channels we got, let's see how long we can do this */
-    for (NSUInteger x = 1; b_returned ; x++)
+    for (int x = 1; b_returned ; x++)
         b_returned = [NSSound setSystemVolume: f_volume forChannel:x];
 }
 
diff --git a/modules/gui/macosx/VLCAddonsWindowController.m b/modules/gui/macosx/VLCAddonsWindowController.m
index 692faa9ccc..0820702c2c 100644
--- a/modules/gui/macosx/VLCAddonsWindowController.m
+++ b/modules/gui/macosx/VLCAddonsWindowController.m
@@ -273,7 +273,7 @@ static void addonChangedCallback( addons_manager_t *manager,
 - (void)_refactorDataModel
 {
     BOOL installedOnly = _localAddonsOnlyCheckbox.state == NSOnState;
-    int type = [[_typeSwitcher selectedItem] tag];
+    int type = (int)[[_typeSwitcher selectedItem] tag];
 
     NSUInteger count = _addons.count;
     NSMutableArray *filteredItems = [[NSMutableArray alloc] initWithCapacity:count];
diff --git a/modules/gui/macosx/VLCAudioEffectsWindowController.m b/modules/gui/macosx/VLCAudioEffectsWindowController.m
index bee6bf0087..be46755158 100644
--- a/modules/gui/macosx/VLCAudioEffectsWindowController.m
+++ b/modules/gui/macosx/VLCAudioEffectsWindowController.m
@@ -721,7 +721,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
     NSString *preset = [[[NSUserDefaults standardUserDefaults] objectForKey:@"EQValues"] objectAtIndex:presetID];
     NSArray *values = [preset componentsSeparatedByString:@" "];
     NSUInteger count = [values count];
-    for (NSUInteger x = 0; x < count; x++)
+    for (int x = 0; x < count; x++)
         [self setValue:[[values objectAtIndex:x] floatValue] forSlider:x];
 }
 
diff --git a/modules/gui/macosx/VLCBookmarksWindowController.m b/modules/gui/macosx/VLCBookmarksWindowController.m
index 55c9cb34aa..8035cbbe4f 100644
--- a/modules/gui/macosx/VLCBookmarksWindowController.m
+++ b/modules/gui/macosx/VLCBookmarksWindowController.m
@@ -160,8 +160,7 @@
     input_thread_t * p_input = pl_CurrentInput(getIntf());
     seekpoint_t **pp_bookmarks;
     int i_bookmarks;
-    int row;
-    row = [_dataTable selectedRow];
+    int row = (int)[_dataTable selectedRow];
 
     if (!p_input)
         return;
@@ -204,7 +203,8 @@
 {
     /* save field contents and close sheet */
      seekpoint_t **pp_bookmarks;
-    int i_bookmarks, i;
+    int i_bookmarks;
+    NSInteger i;
     input_thread_t * p_input = pl_CurrentInput(getIntf());
 
     if (!p_input) {
@@ -279,7 +279,7 @@ clear:
     if (!p_input)
         return;
 
-    int i_focused = [_dataTable selectedRow];
+    int i_focused = (int)[_dataTable selectedRow];
 
     if (i_focused >= 0)
         input_Control(p_input, INPUT_DEL_BOOKMARK, i_focused);
diff --git a/modules/gui/macosx/VLCCoreInteraction.h b/modules/gui/macosx/VLCCoreInteraction.h
index 3616c181c5..58cdbf16de 100644
--- a/modules/gui/macosx/VLCCoreInteraction.h
+++ b/modules/gui/macosx/VLCCoreInteraction.h
@@ -31,7 +31,7 @@
 @property (readonly, nonatomic) float maxVolume;
 @property (readwrite) int playbackRate;
 @property (nonatomic, readwrite) BOOL aspectRatioIsLocked;
- at property (readonly) int durationOfCurrentPlaylistItem;
+ at property (readonly) NSInteger durationOfCurrentPlaylistItem;
 @property (readonly) NSURL * URLOfCurrentPlaylistItem;
 @property (readonly) NSString * nameOfCurrentPlaylistItem;
 @property (nonatomic, readwrite) BOOL mute;
diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index cdd229a182..28484dcd9f 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -248,7 +248,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     playlist_Next(pl_Get(getIntf()));
 }
 
-- (int)durationOfCurrentPlaylistItem
+- (NSInteger)durationOfCurrentPlaylistItem
 {
     intf_thread_t *p_intf = getIntf();
     if (!p_intf)
@@ -262,7 +262,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     input_Control(p_input, INPUT_GET_LENGTH, &i_duration);
     vlc_object_release(p_input);
 
-    return (int)(i_duration / 1000000);
+    return (i_duration / 1000000);
 }
 
 - (NSURL*)URLOfCurrentPlaylistItem
@@ -357,7 +357,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
     if (!p_input)
         return;
 
-    int i_interval = var_InheritInteger( p_input, p_value );
+    int64_t i_interval = var_InheritInteger( p_input, p_value );
     if (i_interval > 0) {
         mtime_t val = CLOCK_FREQ * i_interval;
         if (!b_value)
@@ -595,7 +595,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 
     float volume = playlist_VolumeGet(pl_Get(p_intf));
 
-    return lroundf(volume * AOUT_VOLUME_DEFAULT);
+    return (int)lroundf(volume * AOUT_VOLUME_DEFAULT);
 }
 
 - (void)setVolume: (int)i_value
diff --git a/modules/gui/macosx/VLCExtensionsManager.m b/modules/gui/macosx/VLCExtensionsManager.m
index 30564517b9..3f1d64147e 100644
--- a/modules/gui/macosx/VLCExtensionsManager.m
+++ b/modules/gui/macosx/VLCExtensionsManager.m
@@ -200,7 +200,7 @@
 - (void)triggerMenu:(id)sender
 {
     intf_thread_t *p_intf = getIntf();
-    uint32_t identifier = [(NSMenuItem *)sender tag];
+    uint32_t identifier = (unsigned int)[(NSMenuItem *)sender tag];
 
     uint16_t i_ext = MENU_GET_EXTENSION(identifier);
     uint16_t i_action = MENU_GET_ACTION(identifier);
diff --git a/modules/gui/macosx/VLCFSPanelController.m b/modules/gui/macosx/VLCFSPanelController.m
index 6e90980ba6..58c37daf70 100644
--- a/modules/gui/macosx/VLCFSPanelController.m
+++ b/modules/gui/macosx/VLCFSPanelController.m
@@ -270,15 +270,15 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
             mtime_t remaining = 0;
             if (dur > t)
                 remaining = dur - t;
-            totalTime = [NSString stringWithFormat:@"-%s", secstotimestr(psz_time, (remaining / CLOCK_FREQ))];
+            totalTime = [NSString stringWithFormat:@"-%s", secstotimestr(psz_time, (int)(remaining / CLOCK_FREQ))];
         } else {
-            totalTime = toNSStr(secstotimestr(psz_time, (dur / 1000000)));
+            totalTime = toNSStr(secstotimestr(psz_time, (int)(dur / 1000000)));
         }
         [_remainingOrTotalTime setStringValue:totalTime];
     }
 
     /* Update current position (left field) */
-    NSString *playbackPosition = toNSStr(secstotimestr(psz_time, t / CLOCK_FREQ));
+    NSString *playbackPosition = toNSStr(secstotimestr(psz_time, (int)(t / CLOCK_FREQ)));
 
     [_elapsedTime setStringValue:playbackPosition];
     vlc_object_release(p_input);
@@ -401,7 +401,7 @@ static NSString *kAssociatedFullscreenRect = @"VLCFullscreenAssociatedWindowRect
         return;
 
     /* Get timeout and make sure it is not lower than 1 second */
-    int _timeToKeepVisibleInSec = MAX(var_CreateGetInteger(getIntf(), "mouse-hide-timeout") / 1000, 1);
+    long long _timeToKeepVisibleInSec = MAX(var_CreateGetInteger(getIntf(), "mouse-hide-timeout") / 1000, 1);
 
     _hideTimer = [NSTimer scheduledTimerWithTimeInterval:_timeToKeepVisibleInSec
                                                   target:self
diff --git a/modules/gui/macosx/VLCInputManager.m b/modules/gui/macosx/VLCInputManager.m
index 9f60b767fb..5de9ee6523 100644
--- a/modules/gui/macosx/VLCInputManager.m
+++ b/modules/gui/macosx/VLCInputManager.m
@@ -302,7 +302,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
         return;
     }
 
-    int state = -1;
+    int64_t state = -1;
     if (p_current_input) {
         state = var_GetInteger(p_current_input, "state");
     }
@@ -385,7 +385,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
 - (void)stopItunesPlayback
 {
     intf_thread_t *p_intf = getIntf();
-    int controlItunes = var_InheritInteger(p_intf, "macosx-control-itunes");
+    int64_t controlItunes = var_InheritInteger(p_intf, "macosx-control-itunes");
     if (controlItunes <= 0)
         return;
 
@@ -663,7 +663,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
     if (!lastPosition || lastPosition.intValue <= 0)
         return;
 
-    int settingValue = config_GetInt("macosx-continue-playback");
+    int settingValue = (int)config_GetInt("macosx-continue-playback");
     if (settingValue == 2) // never resume
         return;
 
@@ -717,7 +717,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
 
     if (relativePos > .05 && relativePos < .95 && dur > 180) {
         msg_Dbg(getIntf(), "Store current playback position of %f", relativePos);
-        [mutDict setObject:[NSNumber numberWithInt:pos] forKey:url];
+        [mutDict setObject:[NSNumber numberWithInteger:pos] forKey:url];
 
         [mediaList removeObject:url];
         [mediaList addObject:url];
diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m
index 3337c7569f..481d2bc390 100644
--- a/modules/gui/macosx/VLCMainMenu.m
+++ b/modules/gui/macosx/VLCMainMenu.m
@@ -275,7 +275,7 @@
     var_Create(p_playlist, "freetype-outline-thickness", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
 
     [self setupMenu: _subtitle_textcolorMenu withIntList:"freetype-color" andSelector:@selector(switchSubtitleOption:)];
-    [_subtitle_bgopacity_sld setIntValue: config_GetInt("freetype-background-opacity")];
+    [_subtitle_bgopacity_sld setIntegerValue: config_GetInt("freetype-background-opacity")];
     [self setupMenu: _subtitle_bgcolorMenu withIntList:"freetype-background-color" andSelector:@selector(switchSubtitleOption:)];
     [self setupMenu: _subtitle_outlinethicknessMenu withIntList:"freetype-outline-thickness" andSelector:@selector(switchSubtitleOption:)];
 
@@ -836,9 +836,9 @@
     if (p_input) {
         /* we can obviously only do that if an input is available */
         int64_t length = var_GetInteger(p_input, "length");
-        [_timeSelectionPanel setMaxValue:(length / CLOCK_FREQ)];
+        [_timeSelectionPanel setMaxValue:(int)(length / CLOCK_FREQ)];
         int64_t pos = var_GetInteger(p_input, "time");
-        [_timeSelectionPanel setJumpTimeValue: (pos / CLOCK_FREQ)];
+        [_timeSelectionPanel setJumpTimeValue: (int)(pos / CLOCK_FREQ)];
         [_timeSelectionPanel runModalForWindow:[NSApp mainWindow]
                              completionHandler:^(NSInteger returnCode, int64_t returnTime) {
 
@@ -1056,14 +1056,14 @@
 
 - (void)switchSubtitleSize:(id)sender
 {
-    int intValue = [sender tag];
+    NSInteger intValue = [sender tag];
     var_SetInteger(pl_Get(getIntf()), "sub-text-scale", intValue);
 }
 
 
 - (void)switchSubtitleOption:(id)sender
 {
-    int intValue = [sender tag];
+    NSInteger intValue = [sender tag];
     NSString *representedObject = [sender representedObject];
 
     var_SetInteger(pl_Get(getIntf()), [representedObject UTF8String], intValue);
diff --git a/modules/gui/macosx/VLCOpenWindowController.m b/modules/gui/macosx/VLCOpenWindowController.m
index 47323d53f3..570fce8212 100644
--- a/modules/gui/macosx/VLCOpenWindowController.m
+++ b/modules/gui/macosx/VLCOpenWindowController.m
@@ -418,7 +418,7 @@ static NSString *kCaptureTabViewId  = @"capture";
     [_tabView selectTabViewItemWithIdentifier:identifier];
     [_fileSubCheckbox setState: NSOffState];
 
-    int i_result = [NSApp runModalForWindow: self.window];
+    NSModalResponse i_result = [NSApp runModalForWindow: self.window];
     [self.window close];
 
     // Check if dialog was canceled or stopped (NSModalResponseStop)
@@ -484,7 +484,7 @@ static NSString *kCaptureTabViewId  = @"capture";
         [options addObject: [NSString stringWithFormat: @"input-slave=%@", _fileSlavePath]];
     if ([[[_tabView selectedTabViewItem] identifier] isEqualToString: kCaptureTabViewId]) {
         if ([[[_captureModePopup selectedItem] title] isEqualToString: _NS("Screen")]) {
-            int selected_index = [_screenPopup indexOfSelectedItem];
+            NSInteger selected_index = [_screenPopup indexOfSelectedItem];
             NSValue *v = [_displayInfos objectAtIndex:selected_index];
             struct display_info_t *item = (struct display_info_t *)[v pointerValue];
 
@@ -985,7 +985,7 @@ static NSString *kCaptureTabViewId  = @"capture";
 
 - (IBAction)openNetStepperChanged:(id)sender
 {
-    int i_tag = [sender tag];
+    NSInteger i_tag = [sender tag];
 
     if (i_tag == 0) {
         [_netUDPPortTextField setIntValue: [_netUDPPortStepper intValue]];
@@ -1103,15 +1103,15 @@ static NSString *kCaptureTabViewId  = @"capture";
         [_captureTabView selectTabViewItemAtIndex:1];
 
         [self setMRL: @"screen://"];
-        [_screenHeightTextField setIntValue: config_GetInt("screen-height")];
-        [_screenWidthTextField setIntValue: config_GetInt("screen-width")];
+        [_screenHeightTextField setIntegerValue: config_GetInt("screen-height")];
+        [_screenWidthTextField setIntegerValue: config_GetInt("screen-width")];
         [_screenFPSTextField setFloatValue: config_GetFloat("screen-fps")];
-        [_screenLeftTextField setIntValue: config_GetInt("screen-left")];
-        [_screenTopTextField setIntValue: config_GetInt("screen-top")];
-        [_screenFollowMouseCheckbox setIntValue: config_GetInt("screen-follow-mouse")];
+        [_screenLeftTextField setIntegerValue: config_GetInt("screen-left")];
+        [_screenTopTextField setIntegerValue: config_GetInt("screen-top")];
+        [_screenFollowMouseCheckbox setIntegerValue: config_GetInt("screen-follow-mouse")];
 
-        int screenIindex = config_GetInt("screen-index");
-        int displayID = config_GetInt("screen-display-id");
+        NSInteger screenIindex = config_GetInt("screen-index");
+        NSInteger displayID = config_GetInt("screen-display-id");
         unsigned int displayCount = 0;
         CGError returnedError;
         struct display_info_t *item;
@@ -1175,8 +1175,9 @@ static NSString *kCaptureTabViewId  = @"capture";
 
 - (IBAction)screenChanged:(id)sender
 {
-    int selected_index = [_screenPopup indexOfSelectedItem];
-    if (selected_index >= [_displayInfos count]) return;
+    NSInteger selected_index = [_screenPopup indexOfSelectedItem];
+    if (selected_index >= [_displayInfos count])
+        return;
 
     NSValue *v = [_displayInfos objectAtIndex:selected_index];
     struct display_info_t *item = (struct display_info_t *)[v pointerValue];
diff --git a/modules/gui/macosx/VLCPLModel.m b/modules/gui/macosx/VLCPLModel.m
index 89bf55e008..07f8a59e50 100644
--- a/modules/gui/macosx/VLCPLModel.m
+++ b/modules/gui/macosx/VLCPLModel.m
@@ -520,7 +520,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
         char psz_duration[MSTRTIME_MAX_SIZE];
         mtime_t dur = input_item_GetDuration(p_input);
         if (dur != -1) {
-            secstotimestr(psz_duration, dur/1000000);
+            secstotimestr(psz_duration, (int)(dur/1000000));
             o_value = toNSStr(psz_duration);
         }
         else
@@ -688,8 +688,8 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
             return NO;
         }
 
-        NSUInteger j = 0;
-        for (NSUInteger i = 0; i < count; i++) {
+        int j = 0;
+        for (int i = 0; i < count; i++) {
             playlist_item_t *p_item = playlist_ItemGetById(p_playlist, [[o_filteredItems objectAtIndex:i] plItemId]);
             if (p_item)
                 pp_items[j++] = p_item;
@@ -699,7 +699,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
         if (index == NSOutlineViewDropOnItemIndex)
             index = p_new_parent->i_children;
 
-        if (playlist_TreeMoveMany(p_playlist, j, pp_items, p_new_parent, index) != VLC_SUCCESS) {
+        if (playlist_TreeMoveMany(p_playlist, j, pp_items, p_new_parent, (int)index) != VLC_SUCCESS) {
             PL_UNLOCK;
             free(pp_items);
             return NO;
@@ -710,11 +710,11 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
 
         // rebuild our model
         NSUInteger filteredItemsCount = [o_filteredItems count];
-        for(NSUInteger i = 0; i < filteredItemsCount; ++i) {
+        for(int i = 0; i < filteredItemsCount; ++i) {
             VLCPLItem *o_item = [o_filteredItems objectAtIndex:i];
             NSLog(@"delete child from parent %p", [o_item parent]);
             [[o_item parent] deleteChild:o_item];
-            [targetItem addChild:o_item atPos:index + i];
+            [targetItem addChild:o_item atPos:(int)index + i];
         }
 
         [_outlineView reloadData];
@@ -747,7 +747,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
 
     [[[VLCMain sharedInstance] playlist] addPlaylistItems:items
                                          withParentItemId:[targetItem plItemId]
-                                                    atPos:index
+                                                    atPos:(int)index
                                             startPlayback:NO];
     return YES;
 }
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 895faf8599..c066fdf4e4 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -268,7 +268,7 @@
             tmpItem = [tmpItem parent];
         }
 
-        for(int i = itemsToExpand.count - 1; i >= 0; i--) {
+        for(int i = (int)itemsToExpand.count - 1; i >= 0; i--) {
             VLCPLItem *currentItem = [itemsToExpand objectAtIndex:i];
             [_outlineView expandItem: currentItem];
         }
@@ -347,11 +347,11 @@
 {
     NSIndexSet *selectedRows = [_outlineView selectedRowIndexes];
 
-    NSInteger position = -1;
+    int position = -1;
     VLCPLItem *parentItem = [[self model] rootItem];
 
     if (selectedRows.count >= 1) {
-        position = selectedRows.firstIndex + 1;
+        position = (int)selectedRows.firstIndex + 1;
         parentItem = [_outlineView itemAtRow:selectedRows.firstIndex];
         if ([parentItem parent] != nil)
             parentItem = [parentItem parent];
@@ -689,7 +689,7 @@
         b_playlistmenu_nib_loaded = [NSBundle loadNibNamed:@"PlaylistMenu" owner:self];
 
     NSPoint pt = [_outlineView convertPoint: [o_event locationInWindow] fromView: nil];
-    int row = [_outlineView rowAtPoint:pt];
+    NSInteger row = [_outlineView rowAtPoint:pt];
     if (row != -1 && ![[_outlineView selectedRowIndexes] containsIndex: row])
         [_outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
 
diff --git a/modules/gui/macosx/VLCPlaylistInfo.m b/modules/gui/macosx/VLCPlaylistInfo.m
index c05cb1ee45..646790746b 100644
--- a/modules/gui/macosx/VLCPlaylistInfo.m
+++ b/modules/gui/macosx/VLCPlaylistInfo.m
@@ -276,14 +276,14 @@ FREENULL( psz_##foo );
                                              @"%6.0f kb/s", (float)(p_item->p_stats->f_demux_bitrate)*8000]];
 
     /* Video */
-    [_videoDecodedTextField setIntValue: p_item->p_stats->i_decoded_video];
-    [_displayedTextField setIntValue: p_item->p_stats->i_displayed_pictures];
-    [_lostFramesTextField setIntValue: p_item->p_stats->i_lost_pictures];
+    [_videoDecodedTextField setIntegerValue: p_item->p_stats->i_decoded_video];
+    [_displayedTextField setIntegerValue: p_item->p_stats->i_displayed_pictures];
+    [_lostFramesTextField setIntegerValue: p_item->p_stats->i_lost_pictures];
 
     /* Audio */
-    [_audioDecodedTextField setIntValue: p_item->p_stats->i_decoded_audio];
-    [_playedAudioBuffersTextField setIntValue: p_item->p_stats->i_played_abuffers];
-    [_lostAudioBuffersTextField setIntValue: p_item->p_stats->i_lost_abuffers];
+    [_audioDecodedTextField setIntegerValue: p_item->p_stats->i_decoded_audio];
+    [_playedAudioBuffersTextField setIntegerValue: p_item->p_stats->i_played_abuffers];
+    [_lostAudioBuffersTextField setIntegerValue: p_item->p_stats->i_lost_abuffers];
 }
 
 - (void)updateStreamsList
diff --git a/modules/gui/macosx/VLCSimplePrefsController.m b/modules/gui/macosx/VLCSimplePrefsController.m
index 9bf68d0361..a69a26fce9 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/VLCSimplePrefsController.m
@@ -465,7 +465,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
     ssize_t count = config_GetIntChoices(name, &values, &texts);
     for (ssize_t i = 0; i < count; i++) {
         NSMenuItem *mi = [[NSMenuItem alloc] initWithTitle: toNSStr(texts[i]) action: NULL keyEquivalent: @""];
-        [mi setRepresentedObject:[NSNumber numberWithInt:values[i]]];
+        [mi setRepresentedObject:[NSNumber numberWithInteger:values[i]]];
         [[object menu] addItem:mi];
 
         if (p_item->value.i == values[i])
@@ -525,7 +525,8 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
 
 - (void)resetControls
 {
-    int i, y = 0;
+    int i = 0;
+    NSInteger y = 0;
 
     /**********************
      * interface settings *
@@ -598,7 +599,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
         [_audio_volTextField setEnabled: YES];
         [_audio_volSlider setEnabled: YES];
 
-        i = var_InheritInteger(p_intf, "auhal-volume");
+        i = (int)var_InheritInteger(p_intf, "auhal-volume");
         i = i * 200. / AOUT_VOLUME_MAX;
         [_audio_volSlider setIntValue: i];
         [_audio_volTextField setIntValue: i];
@@ -693,7 +694,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
 
     /* Select the accurate value of the PopupButton */
     bool cache_equal = true;
-    int i_cache = config_GetInt("file-caching");
+    int i_cache = (int)config_GetInt("file-caching");
 
     TestCaC("network-caching", 10/3);
     TestCaC("disc-caching", 1);
@@ -1407,7 +1408,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
     [self showSettingsForCategory:_hotkeysView];
 }
 
-- (int)numberOfRowsInTableView:(NSTableView *)aTableView
+- (NSUInteger)numberOfRowsInTableView:(NSTableView *)aTableView
 {
     return [_hotkeySettings count];
 }
diff --git a/modules/gui/macosx/VLCStringUtility.m b/modules/gui/macosx/VLCStringUtility.m
index 7c3a383bf4..103fd8a48a 100644
--- a/modules/gui/macosx/VLCStringUtility.m
+++ b/modules/gui/macosx/VLCStringUtility.m
@@ -73,7 +73,8 @@ NSString *const kVLCMediaUnknown = @"Unknown";
     NSMutableString *o_wrapped;
     NSString *o_out_string;
     NSRange glyphRange, effectiveRange, charRange;
-    unsigned glyphIndex, breaksInserted = 0;
+    NSUInteger glyphIndex;
+    unsigned breaksInserted = 0;
 
     NSTextStorage *o_storage = [[NSTextStorage alloc] initWithString: o_in_string
                                                           attributes: [NSDictionary dictionaryWithObjectsAndKeys:
@@ -117,9 +118,9 @@ NSString *const kVLCMediaUnknown = @"Unknown";
         mtime_t remaining = 0;
         if (dur > t)
             remaining = dur - t;
-        return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
+        return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (int)(remaining / 1000000))];
     } else
-        return toNSStr(secstotimestr(psz_time, t / CLOCK_FREQ ));
+        return toNSStr(secstotimestr(psz_time, (int)(t / CLOCK_FREQ )));
 }
 
 - (NSString *)stringForTime:(long long int)time
diff --git a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
index 85d6d7f33d..8c2ceaa79d 100644
--- a/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
+++ b/modules/gui/macosx/VLCTrackSynchronizationWindowController.m
@@ -59,7 +59,7 @@
     [[_sv_speedTextField formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("fps")]];
     [_sv_durLabel setStringValue: _NS("Subtitle duration factor:")];
 
-    int i_mode = var_InheritInteger(getIntf(), SUBSDELAY_CFG_MODE);
+    int i_mode = (int)var_InheritInteger(getIntf(), SUBSDELAY_CFG_MODE);
     NSString * o_toolTip, * o_suffix;
 
     switch (i_mode) {
diff --git a/modules/gui/macosx/VLCUIWidgets.m b/modules/gui/macosx/VLCUIWidgets.m
index 49818af70c..b621e35d92 100644
--- a/modules/gui/macosx/VLCUIWidgets.m
+++ b/modules/gui/macosx/VLCUIWidgets.m
@@ -306,9 +306,11 @@
     return nil;
 }
 
-- (void)addSubview:(NSView *)view atRow:(NSUInteger)row column:(NSUInteger)column
-                                                       rowSpan:(NSUInteger)rowSpan
-                                                       colSpan:(NSUInteger)colSpan
+- (void)addSubview:(NSView *)view
+             atRow:(NSUInteger)row
+            column:(NSUInteger)column
+           rowSpan:(NSUInteger)rowSpan
+           colSpan:(NSUInteger)colSpan
 {
     if (row + 1 > _rowCount)
         _rowCount = row + 1;
@@ -321,10 +323,10 @@
         [dict setObject:view forKey:@"view"];
         [_griddedViews addObject:dict];
     }
-    [dict setObject:[NSNumber numberWithInt:rowSpan] forKey:@"rowSpan"];
-    [dict setObject:[NSNumber numberWithInt:colSpan] forKey:@"colSpan"];
-    [dict setObject:[NSNumber numberWithInt:row] forKey:@"row"];
-    [dict setObject:[NSNumber numberWithInt:column] forKey:@"col"];
+    [dict setObject:[NSNumber numberWithUnsignedInteger:rowSpan] forKey:@"rowSpan"];
+    [dict setObject:[NSNumber numberWithUnsignedInteger:colSpan] forKey:@"colSpan"];
+    [dict setObject:[NSNumber numberWithUnsignedInteger:row] forKey:@"row"];
+    [dict setObject:[NSNumber numberWithUnsignedInteger:column] forKey:@"col"];
 
     [self addSubview:view];
     [self relayout];
diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index 00a6202531..886302afd7 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -433,17 +433,17 @@
     {
         if ([widget isKindOfClass: [NSSlider class]])
         {
-            [widget setIntValue: val.i_int];
+            [widget setIntValue: (int)val.i_int];
             [widget setToolTip: [NSString stringWithFormat:@"%lli", val.i_int]];
         }
         else if ([widget isKindOfClass: [NSButton class]])
             [widget setState: val.i_int ? NSOnState : NSOffState];
         else if ([widget isKindOfClass: [NSTextField class]])
-            [widget setIntValue: val.i_int];
+            [widget setIntValue: (int)val.i_int];
         else if ([widget isKindOfClass: [NSStepper class]])
-            [widget setIntValue: val.i_int];
+            [widget setIntValue: (int)val.i_int];
         else if ([widget isKindOfClass: [NSPopUpButton class]])
-            [widget selectItemWithTag: val.i_int];
+            [widget selectItemWithTag: (int)val.i_int];
     }
     else if (i_type == VLC_VAR_FLOAT)
     {
diff --git a/modules/gui/macosx/applescript.h b/modules/gui/macosx/applescript.h
index aee356bfae..6d22fc30a3 100644
--- a/modules/gui/macosx/applescript.h
+++ b/modules/gui/macosx/applescript.h
@@ -44,7 +44,7 @@
 @property (readwrite) int audioVolume;
 @property (readwrite) int audioDesync;
 @property (readwrite) int currentTime;
- at property (readonly) int durationOfCurrentItem;
+ at property (readonly) NSInteger durationOfCurrentItem;
 @property (readonly) NSString *pathOfCurrentItem;
 @property (readonly) NSString *nameOfCurrentItem;
 @property (readonly) BOOL playbackShowsMenu;
diff --git a/modules/gui/macosx/applescript.m b/modules/gui/macosx/applescript.m
index 9f6893b1ad..7fe7a536cf 100644
--- a/modules/gui/macosx/applescript.m
+++ b/modules/gui/macosx/applescript.m
@@ -207,7 +207,7 @@
     if(!p_input)
         return i_delay;
 
-    i_delay = var_GetInteger(p_input, "audio-delay");
+    i_delay = (int)var_GetInteger(p_input, "audio-delay");
     vlc_object_release(p_input);
 
     return (i_delay / 1000);
@@ -224,7 +224,7 @@
 
 - (int) currentTime {
     input_thread_t * p_input = pl_CurrentInput(getIntf());
-    int64_t i_currentTime = -1;
+    int i_currentTime = -1;
 
     if (!p_input)
         return i_currentTime;
@@ -248,7 +248,7 @@
     }
 }
 
-- (int) durationOfCurrentItem {
+- (NSInteger) durationOfCurrentItem {
     return [[VLCCoreInteraction sharedInstance] durationOfCurrentPlaylistItem];
 }
 
@@ -266,7 +266,7 @@
     if (!p_input_thread)
         return NO;
 
-    int i_current_title = var_GetInteger(p_input_thread, "title");
+    int i_current_title = (int)var_GetInteger(p_input_thread, "title");
 
     input_title_t **p_input_title;
     int count;
diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m
index 1560fc46d9..340afe9c9b 100644
--- a/modules/gui/macosx/prefs.m
+++ b/modules/gui/macosx/prefs.m
@@ -91,7 +91,7 @@
 
 - (id)initWithName:(NSString*)name;
 
-- (int)numberOfChildren;
+- (NSInteger)numberOfChildren;
 - (VLCTreeItem *)childAtIndex:(NSInteger)i_index;
 
 - (NSString *)name;
@@ -320,7 +320,7 @@
     return [[self children] objectAtIndex:i_index];
 }
 
-- (int)numberOfChildren
+- (NSInteger)numberOfChildren
 {
     return [[self children] count];
 }
@@ -505,15 +505,15 @@
         for (j = 0; j < confsize; j++) {
             int configType = p_configs[j].i_type;
             if (configType == CONFIG_CATEGORY) {
-                categoryItem = [self itemRepresentingCategory:p_configs[j].value.i];
+                categoryItem = [self itemRepresentingCategory:(int)p_configs[j].value.i];
                 if (!categoryItem) {
-                    categoryItem = [VLCTreeCategoryItem categoryTreeItemWithCategory:p_configs[j].value.i];
+                    categoryItem = [VLCTreeCategoryItem categoryTreeItemWithCategory:(int)p_configs[j].value.i];
                     if (categoryItem)
                         [[self children] addObject:categoryItem];
                 }
             }
             else if (configType == CONFIG_SUBCATEGORY) {
-                lastsubcat = p_configs[j].value.i;
+                lastsubcat = (int)p_configs[j].value.i;
                 if (categoryItem && ![self isSubCategoryGeneral:lastsubcat]) {
                     subCategoryItem = [categoryItem itemRepresentingSubCategory:lastsubcat];
                     if (!subCategoryItem) {
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index 308e56cf93..31969efbcd 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -1394,7 +1394,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 
 -(void)resetValues
 {
-    [o_textfield setIntValue: config_GetInt(self.p_item->psz_name)];
+    [o_textfield setIntegerValue: config_GetInt(self.p_item->psz_name)];
     [super resetValues];
 }
 
@@ -1470,13 +1470,13 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 {
     [o_popup removeAllItems];
 
-    int i_current_selection = config_GetInt(self.p_item->psz_name);
+    NSInteger i_current_selection = config_GetInt(self.p_item->psz_name);
     int64_t *values;
     char **texts;
     ssize_t count = config_GetIntChoices(self.p_item->psz_name, &values, &texts);
     for (ssize_t i = 0; i < count; i++) {
         NSMenuItem *mi = [[NSMenuItem alloc] initWithTitle: toNSStr(texts[i]) action: NULL keyEquivalent: @""];
-        [mi setRepresentedObject:[NSNumber numberWithInt:values[i]]];
+        [mi setRepresentedObject:[NSNumber numberWithInteger:values[i]]];
         [[o_popup menu] addItem:mi];
 
         if (i_current_selection == values[i])
@@ -1522,7 +1522,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
         /* build the textfield */
         ADD_TEXTFIELD(o_textfield, mainFrame, [self.label frame].size.width + 2,
                       28, 70, toolTip, @"")
-        [o_textfield setIntValue: p_item->value.i];
+        [o_textfield setIntegerValue: p_item->value.i];
         [o_textfield setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield setDelegate: self];
         [[NSNotificationCenter defaultCenter] addObserver: self
@@ -1533,7 +1533,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 
         /* build the mintextfield */
         ADD_LABEL(o_textfield_min, mainFrame, 12, -30, @"-88888", @"")
-        [o_textfield_min setIntValue: p_item->min.i];
+        [o_textfield_min setIntegerValue: p_item->min.i];
         [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield_min setAlignment:NSRightTextAlignment];
         [self addSubview: o_textfield_min];
@@ -1541,7 +1541,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
         /* build the maxtextfield */
         ADD_LABEL(o_textfield_max, mainFrame,
                   mainFrame.size.width - 50, -30, @"88888", @"")
-        [o_textfield_max setIntValue: p_item->max.i];
+        [o_textfield_max setIntegerValue: p_item->max.i];
         [o_textfield_max setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_textfield_max];
 
@@ -1554,7 +1554,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
                    [o_textfield_max frame].origin.x -
                    ([o_textfield_min frame].origin.x + [o_textfield_min frame].size.width) - 14, toolTip,
                    p_item->min.i, p_item->max.i)
-        [o_slider setIntValue: p_item->value.i];
+        [o_slider setIntegerValue: p_item->value.i];
         [o_slider setAutoresizingMask:NSViewWidthSizable ];
         [o_slider setTarget: self];
         [o_slider setAction: @selector(sliderChanged:)];
@@ -1595,9 +1595,9 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 
 - (void)resetValues
 {
-    int value = config_GetInt(self.p_item->psz_name);
-    [o_textfield setIntValue:value];
-    [o_slider setIntValue:value];
+    NSInteger value = config_GetInt(self.p_item->psz_name);
+    [o_textfield setIntegerValue:value];
+    [o_slider setIntegerValue:value];
     [super resetValues];
 }
 @end
@@ -1831,7 +1831,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 
         /* add the checkbox */
         ADD_CHECKBOX(o_checkbox, mainFrame, 0,
-                     0, labelString, toolTip, p_item->value.i, NSImageLeft)
+                     0, labelString, toolTip, (int)p_item->value.i, NSImageLeft)
         [o_checkbox setAutoresizingMask:NSViewNotSizable];
         [self addSubview: o_checkbox];
     }
@@ -1918,7 +1918,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
 
 - (int)intValue
 {
-    return [o_popup selectedTag];
+    return (int)[o_popup selectedTag];
 }
 
 - (void)resetValues



More information about the vlc-commits mailing list