Skip to content

Commit

Permalink
Fix a bunch of warnings
Browse files Browse the repository at this point in the history
- I left alone all the warnings from libav stuff like
  deprecated functions. I'll fix those shortly.
  • Loading branch information
samiamwork committed Dec 18, 2011
1 parent 97df8ba commit 40edba2
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 22 deletions.
4 changes: 2 additions & 2 deletions AppController_Open.m
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ - (BOOL)openSubtitles:(NSArray*)subtitleURLs encoding:(CFStringEncoding)encoding
}

[_subtitles release];
_subtitles = [subtitles retain];
_subtitles = [subtitles mutableCopy];
[[_playlist currentItem] setSubtitleURLs:subtitleURLs];
[self autoenableSubtitles];
[self updateExternalSubtitleTrackNames];
Expand Down Expand Up @@ -908,7 +908,7 @@ - (id)tableView:(NSTableView*)tableView
return codecName([[[_movie audioTracks] objectAtIndex:aIndex] codecId]);
}
else {
return [[_subtitles objectAtIndex:sIndex] type];
return [(MSubtitle*)[_subtitles objectAtIndex:sIndex] type];
}
}
else if ([identifier isEqualToString:@"format"]) {
Expand Down
7 changes: 7 additions & 0 deletions AppController_Remote.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#import "UserDefaults.h"
#import "FullScreener.h"
#import "MainWindow.h"
#import "MMovie.h"
#import "MMovieView.h"

#import "AppleRemote/MultiClickRemoteBehavior.h"
Expand Down Expand Up @@ -120,6 +121,8 @@ - (void)remoteControlRepeat:(NSTimer*)timer
case kRemoteButtonMinus : [self remoteControlMinusAction:self]; break;
case kRemoteButtonLeft_Hold : [self remoteControlLeftAction:self]; break;
case kRemoteButtonRight_Hold: [self remoteControlRightAction:self]; break;
default:
break;
}
}

Expand Down Expand Up @@ -165,6 +168,8 @@ - (void)remoteButton:(RemoteControlEventIdentifier)buttonIdentifier
case kRemoteButtonPlay_Hold : [self remoteControlPlayHoldAction:self]; break;
case kRemoteButtonMenu : [self remoteControlMenuAction:self]; break;
case kRemoteButtonMenu_Hold : [self remoteControlMenuHoldAction:self]; break;
default:
break;
}
}
// repeat-needed buttons
Expand All @@ -182,6 +187,8 @@ - (void)remoteButton:(RemoteControlEventIdentifier)buttonIdentifier
[self stopRemoteControlRepeatTimer];
}
break;
default:
break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions AppleRemote/HIDRemoteControlDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ - (void) handleEventWithCookieString: (NSString*) cookieString sumOfValues: (SIn
// happen when the main thread is too busy to handle all incoming events in time.
NSString* subCookieString;
NSString* lastSubCookieString=nil;
while(subCookieString = [self validCookieSubstring: cookieString]) {
while((subCookieString = [self validCookieSubstring: cookieString])) {
cookieString = [cookieString substringFromIndex: [subCookieString length]];
lastSubCookieString = subCookieString;
if (processesBacklog) [self handleEventWithCookieString: subCookieString sumOfValues:sumOfValues];
Expand Down Expand Up @@ -461,7 +461,7 @@ - (BOOL) openDevice {
IOHIDElementCookie cookie;
NSEnumerator *allCookiesEnumerator = [allCookies objectEnumerator];

while (cookie = (IOHIDElementCookie)[[allCookiesEnumerator nextObject] intValue]) {
while ((cookie = (IOHIDElementCookie)[[allCookiesEnumerator nextObject] intValue])) {
(*queue)->addElement(queue, cookie, 0);
}

Expand Down
4 changes: 2 additions & 2 deletions FFAudioTrack_Digital.m
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@ - (void)enqueueDtsData:(AVPacket*)packet
buffer[7] = (packetSize>> 5) & 0xFF;

UInt8 p0 = packetPtr[0];
if ((p0 == 0xFF || p0 == 0xFE) && _bigEndian ||
(p0 == 0x1F || p0 == 0x7F) && !_bigEndian) {
if (((p0 == 0xFF || p0 == 0xFE) && _bigEndian) ||
((p0 == 0x1F || p0 == 0x7F) && !_bigEndian)) {
swab(packetPtr, buffer + 8, packetSize);
}
else {
Expand Down
4 changes: 2 additions & 2 deletions FFVideoTrack.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ @interface PacketQueue : NSObject
unsigned int _capacity;
unsigned int _front;
unsigned int _rear;
NSLock* _mutex;
NSRecursiveLock* _mutex;
}

- (id)initWithCapacity:(unsigned int)capacity;
Expand Down Expand Up @@ -129,7 +129,7 @@ @interface ImageQueue : NSObject
unsigned int _front;
unsigned int _rear;
BOOL _full;
NSLock* _mutex;
NSRecursiveLock* _mutex;
}
@end

Expand Down
1 change: 1 addition & 0 deletions FullScreener_Transition.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#import "FullScreener.h"

#import "MMovie.h"
#import "MMovieView.h"
#import "MainWindow.h"
#import "FullWindow.h"
Expand Down
4 changes: 2 additions & 2 deletions MMovie.m
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ - (id)initWithURL:(NSURL*)url movieInfo:(MMovieInfo*)movieInfo
}
if ((self = [super init])) {
_url = [url retain];
_videoTracks = [movieInfo->videoTracks retain];
_audioTracks = [movieInfo->audioTracks retain];
_videoTracks = [movieInfo->videoTracks mutableCopy];
_audioTracks = [movieInfo->audioTracks mutableCopy];
_hasAC3Codec = movieInfo->hasAC3Codec;
_hasDTSCodec = movieInfo->hasDTSCodec;
_startTime = movieInfo->startTime;
Expand Down
6 changes: 3 additions & 3 deletions MMovie_FFMPEG_Playback.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ - (BOOL)readFrame
{
FFVideoTrack* vTrack;
NSEnumerator* enumerator = [_videoTracks objectEnumerator];
while (vTrack = (FFVideoTrack*)[[enumerator nextObject] impl]) {
while ((vTrack = (FFVideoTrack*)[[enumerator nextObject] impl])) {
if ([vTrack isQueueFull]) {
return TRUE;
}
Expand All @@ -150,7 +150,7 @@ - (BOOL)readFrame
_needKeyFrame = FALSE;

enumerator = [_videoTracks objectEnumerator];
while (vTrack = (FFVideoTrack*)[[enumerator nextObject] impl]) {
while ((vTrack = (FFVideoTrack*)[[enumerator nextObject] impl])) {
if ([vTrack isEnabled] && [vTrack streamIndex] == packet.stream_index) {
[vTrack putPacket:&packet];
//TRACE(@"[%s] frame id %d flag %d pts %lld dts %lld pos %lld", __PRETTY_FUNCTION__,
Expand All @@ -164,7 +164,7 @@ - (BOOL)readFrame

FFAudioTrack* aTrack;
enumerator = [_audioTracks objectEnumerator];
while (aTrack = (FFAudioTrack*)[[enumerator nextObject] impl]) {
while ((aTrack = (FFAudioTrack*)[[enumerator nextObject] impl])) {
if ([aTrack isEnabled] &&
[aTrack streamIndex] == packet.stream_index) {
[aTrack putPacket:&packet];
Expand Down
4 changes: 2 additions & 2 deletions MSubtitle.m
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ - (void)addString:(NSMutableAttributedString*)string
else if (endTime < [item endTime]) {
[item setBeginTime:endTime];

NSMutableString* s = [[item string] copy];
NSAttributedString* s = [[item string] copy];
item = [MSubtitleItem itemWithString:[s autorelease]
beginTime:beginTime endTime:endTime];
[item appendString:NEW_LINE];
Expand All @@ -210,7 +210,7 @@ - (void)addString:(NSMutableAttributedString*)string
else if ([item beginTime] < beginTime) {
float bt = [item beginTime];
[item setBeginTime:beginTime];
NSMutableString* s = [[item string] copy];
NSAttributedString* s = [[item string] copy];
item = [MSubtitleItem itemWithString:[s autorelease]
beginTime:bt endTime:beginTime];
[_items insertObject:item atIndex:index];
Expand Down
2 changes: 1 addition & 1 deletion MainWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ - (void)orderFrontRegardless
}
}

- (void)setLevel:(int)newLevel
- (void)setLevel:(NSInteger)newLevel
{
//TRACE(@"%s %d", __PRETTY_FUNCTION__, newLevel);
if ([[NSApp delegate] isDesktopBackground]) {
Expand Down
1 change: 1 addition & 0 deletions PlayPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#import "PlayPanel.h"
#import "SeekSlider.h"
#import "AppController.h" // NSApp's delegate
#import "MMovieView.h"

#import <Carbon/Carbon.h> // for kHIWindowVisibleInAllSpaces

Expand Down
19 changes: 13 additions & 6 deletions Playlist.m
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,14 @@ - (void)removeItemAtIndex:(unsigned int)index
return;
}

// If we're removing the current item, change it to the previous item
if (_currentItem == [_array objectAtIndex:index]) {
if (index == [_array count] - 1) {
index = [_array count] - 2;
}
_currentItem = (0 <= index) ? [_array objectAtIndex:index] : nil;
if (index == 0 && [_array count] == 0) {
_currentItem = nil;
}
else {
_currentItem = [_array objectAtIndex:index];
}
}
[_array removeObjectAtIndex:index];

Expand Down Expand Up @@ -431,8 +434,12 @@ - (int)indexOfItem:(PlaylistItem*)item { return [_array indexOfObject:item]; }
- (void)setCurrentItemAtIndex:(unsigned int)index
{
//TRACE(@"%s %d", __PRETTY_FUNCTION__, index);
_currentItem = (0 <= index && index < [_array count]) ?
[_array objectAtIndex:index] : nil;
if (index >= [_array count]) {
_currentItem = nil;
}
else {
_currentItem = [_array objectAtIndex:index];
}
}

- (void)setNextItem_RepeatOff:(BOOL)forward
Expand Down
1 change: 1 addition & 0 deletions PreferenceController_Advanced_File.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#import "UserDefaults.h"

#import "MMovie.h"
extern void _LSCopyAllApplicationURLs(NSArray**);

@implementation PreferenceController (Advanced_FileBinding)

Expand Down

0 comments on commit 40edba2

Please sign in to comment.