Commit 0d9a1ed4 authored by Felix Paul Kühne's avatar Felix Paul Kühne

fix various compilation warnings

parent f53582de
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
- (void)openMediaFromManagedObject:(NSManagedObject *)file; - (void)openMediaFromManagedObject:(NSManagedObject *)file;
- (void)openMovieFromURL:(NSURL *)url; - (void)openMovieFromURL:(NSURL *)url;
- (void)openMediaList:(VLCMediaList*)list atIndex:(NSUInteger)index; - (void)openMediaList:(VLCMediaList*)list atIndex:(int)index;
@property (nonatomic, readonly) VLCPlaylistViewController *playlistViewController; @property (nonatomic, readonly) VLCPlaylistViewController *playlistViewController;
@property (nonatomic, readonly) VLCDropboxTableViewController *dropboxTableViewController; @property (nonatomic, readonly) VLCDropboxTableViewController *dropboxTableViewController;
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
NSError *theError; NSError *theError;
[[NSFileManager defaultManager] moveItemAtURL:url toURL:destinationURL error:&theError]; [[NSFileManager defaultManager] moveItemAtURL:url toURL:destinationURL error:&theError];
if (theError.code != noErr) if (theError.code != noErr)
APLog(@"saving the file failed (%i): %@", theError.code, theError.localizedDescription); APLog(@"saving the file failed (%li): %@", theError.code, theError.localizedDescription);
[self updateMediaList]; [self updateMediaList];
} else { } else {
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
[self.window.rootViewController presentViewController:navCon animated:YES completion:nil]; [self.window.rootViewController presentViewController:navCon animated:YES completion:nil];
} }
- (void)openMediaList:(VLCMediaList*)list atIndex:(NSUInteger)index - (void)openMediaList:(VLCMediaList*)list atIndex:(int)index
{ {
if (!_movieViewController) if (!_movieViewController)
_movieViewController = [[VLCMovieViewController alloc] initWithNibName:nil bundle:nil]; _movieViewController = [[VLCMovieViewController alloc] initWithNibName:nil bundle:nil];
......
...@@ -135,14 +135,14 @@ ...@@ -135,14 +135,14 @@
_currentFileList = [NSArray arrayWithArray:listOfGoodFilesAndFolders]; _currentFileList = [NSArray arrayWithArray:listOfGoodFilesAndFolders];
APLog(@"found filtered metadata for %i files", _currentFileList.count); APLog(@"found filtered metadata for %lu files", _currentFileList.count);
if ([self.delegate respondsToSelector:@selector(mediaListUpdated)]) if ([self.delegate respondsToSelector:@selector(mediaListUpdated)])
[self.delegate mediaListUpdated]; [self.delegate mediaListUpdated];
} }
- (void)restClient:(DBRestClient *)client loadMetadataFailedWithError:(NSError *)error - (void)restClient:(DBRestClient *)client loadMetadataFailedWithError:(NSError *)error
{ {
APLog(@"DBMetadata download failed with error %i", error.code); APLog(@"DBMetadata download failed with error %li", (long)error.code);
[self _handleError:error]; [self _handleError:error];
} }
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
- (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error - (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error
{ {
APLog(@"DBFile download failed with error %i", error.code); APLog(@"DBFile download failed with error %li", (long)error.code);
[self _handleError:error]; [self _handleError:error];
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)]) if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
[self.delegate operationWithProgressInformationStopped]; [self.delegate operationWithProgressInformationStopped];
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
- (void)restClient:(DBRestClient*)restClient loadStreamableURLFailedWithError:(NSError*)error - (void)restClient:(DBRestClient*)restClient loadStreamableURLFailedWithError:(NSError*)error
{ {
APLog(@"loadStreamableURL failed with error %i", error.code); APLog(@"loadStreamableURL failed with error %li", (long)error.code);
[self _handleError:error]; [self _handleError:error];
} }
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
return; return;
} }
APLog(@"found filtered metadata for %i files", _currentFileList.count); APLog(@"found filtered metadata for %lu files", _currentFileList.count);
if ([self.delegate respondsToSelector:@selector(mediaListUpdated)]) if ([self.delegate respondsToSelector:@selector(mediaListUpdated)])
[self.delegate mediaListUpdated]; [self.delegate mediaListUpdated];
} }
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
- (void)downloadFailedWithError:(NSError*)error - (void)downloadFailedWithError:(NSError*)error
{ {
APLog(@"DriveFile download failed with error %i", error.code); APLog(@"DriveFile download failed with error %li", (long)error.code);
if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)]) if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
[self.delegate operationWithProgressInformationStopped]; [self.delegate operationWithProgressInformationStopped];
_downloadInProgress = NO; _downloadInProgress = NO;
......
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
if (_statusCode == 200) { if (_statusCode == 200) {
_expectedDownloadSize = [response expectedContentLength]; _expectedDownloadSize = [response expectedContentLength];
[self.delegate downloadStarted]; [self.delegate downloadStarted];
APLog(@"expected download size: %i", _expectedDownloadSize); APLog(@"expected download size: %lu", _expectedDownloadSize);
} else { } else {
APLog(@"unhandled status code %i", _statusCode); APLog(@"unhandled status code %lu", (unsigned long)_statusCode);
if ([self.delegate respondsToSelector:@selector(downloadFailedWithErrorDescription:)]) if ([self.delegate respondsToSelector:@selector(downloadFailedWithErrorDescription:)])
[self.delegate downloadFailedWithErrorDescription:[NSString stringWithFormat:NSLocalizedString(@"HTTP_DOWNLOAD_FAILED",nil), _statusCode]]; [self.delegate downloadFailedWithErrorDescription:[NSString stringWithFormat:NSLocalizedString(@"HTTP_DOWNLOAD_FAILED",nil), _statusCode]];
} }
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
} }
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
APLog(@"http file download failed (%i)", error.code); APLog(@"http file download failed (%li)", (long)error.code);
if ([self.delegate respondsToSelector:@selector(downloadFailedWithErrorDescription:)]) if ([self.delegate respondsToSelector:@selector(downloadFailedWithErrorDescription:)])
[self.delegate downloadFailedWithErrorDescription:error.description]; [self.delegate downloadFailedWithErrorDescription:error.description];
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
NSString *fileExtension = [fileName pathExtension]; NSString *fileExtension = [fileName pathExtension];
NSString *rawFileName = [fileName stringByDeletingPathExtension]; NSString *rawFileName = [fileName stringByDeletingPathExtension];
for (NSUInteger x = 1; x < 100; x++) { for (NSUInteger x = 1; x < 100; x++) {
potentialFilename = [NSString stringWithFormat:@"%@ %i.%@", rawFileName, x, fileExtension]; potentialFilename = [NSString stringWithFormat:@"%@ %lu.%@", rawFileName, (unsigned long)x, fileExtension];
if (![[NSFileManager defaultManager] fileExistsAtPath:[libraryPath stringByAppendingPathComponent:potentialFilename]]) if (![[NSFileManager defaultManager] fileExistsAtPath:[libraryPath stringByAppendingPathComponent:potentialFilename]])
break; break;
} }
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
NSError *error; NSError *error;
[fileManager moveItemAtPath:filepath toPath:finalFilePath error:&error]; [fileManager moveItemAtPath:filepath toPath:finalFilePath error:&error];
if (error) { if (error) {
APLog(@"Moving received media %@ to library folder failed (%i), deleting", fileName, error.code); APLog(@"Moving received media %@ to library folder failed (%li), deleting", fileName, (long)error.code);
[fileManager removeItemAtPath:filepath error:nil]; [fileManager removeItemAtPath:filepath error:nil];
} }
......
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
viewController = [[VLCAboutViewController alloc] init]; viewController = [[VLCAboutViewController alloc] init];
} else { } else {
viewController = self.appDelegate.playlistViewController; viewController = self.appDelegate.playlistViewController;
[self.appDelegate.playlistViewController setLibraryMode:itemIndex]; [self.appDelegate.playlistViewController setLibraryMode:(int)itemIndex];
} }
if (!viewController) if (!viewController)
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
@property (nonatomic, strong) MLFile *mediaItem; @property (nonatomic, strong) MLFile *mediaItem;
@property (nonatomic, strong) NSURL *url; @property (nonatomic, strong) NSURL *url;
@property (nonatomic, retain) VLCMediaList *mediaList; @property (nonatomic, retain) VLCMediaList *mediaList;
@property (nonatomic, readwrite) NSUInteger itemInMediaListToBePlayedFirst; @property (nonatomic, readwrite) int itemInMediaListToBePlayedFirst;
- (IBAction)closePlayback:(id)sender; - (IBAction)closePlayback:(id)sender;
......
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
NSData *data = [NSData dataWithContentsOfFile:[directoryPath stringByAppendingPathComponent:@"blob.bin"]]; NSData *data = [NSData dataWithContentsOfFile:[directoryPath stringByAppendingPathComponent:@"blob.bin"]];
uint8_t digest[CC_SHA1_DIGEST_LENGTH]; uint8_t digest[CC_SHA1_DIGEST_LENGTH];
CC_SHA1(data.bytes, data.length, digest); CC_SHA1(data.bytes, (unsigned int)data.length, digest);
NSMutableString *hash = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2]; NSMutableString *hash = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2];
......
...@@ -269,7 +269,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria ...@@ -269,7 +269,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
NSIndexSet *indexSet = [allfiles indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { NSIndexSet *indexSet = [allfiles indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
return ([obj rangeOfString:fileName].location != NSNotFound); return ([obj rangeOfString:fileName].location != NSNotFound);
}]; }];
unsigned int count = indexSet.count; NSUInteger count = indexSet.count;
NSString *additionalFilePath; NSString *additionalFilePath;
NSUInteger currentIndex = [indexSet firstIndex]; NSUInteger currentIndex = [indexSet firstIndex];
for (unsigned int x = 0; x < count; x++) { for (unsigned int x = 0; x < count; x++) {
...@@ -449,7 +449,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria ...@@ -449,7 +449,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
[media parse]; [media parse];
[list addMedia:media]; [list addMedia:media];
} }
[(VLCAppDelegate*)[UIApplication sharedApplication].delegate openMediaList:list atIndex:[tracks indexOfObject:selectedObject]]; [(VLCAppDelegate*)[UIApplication sharedApplication].delegate openMediaList:list atIndex:(int)[tracks indexOfObject:selectedObject]];
} else } else
[self openMediaObject:selectedObject]; [self openMediaObject:selectedObject];
} }
...@@ -562,7 +562,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria ...@@ -562,7 +562,7 @@ static NSString *kDisplayedFirstSteps = @"Did we display the first steps tutoria
file = [(MLAlbumTrack*)tracks[x] files].anyObject; file = [(MLAlbumTrack*)tracks[x] files].anyObject;
[list addMedia:[VLCMedia mediaWithURL: [NSURL URLWithString:file.url]]]; [list addMedia:[VLCMedia mediaWithURL: [NSURL URLWithString:file.url]]];
} }
[(VLCAppDelegate*)[UIApplication sharedApplication].delegate openMediaList:list atIndex:[tracks indexOfObject:selectedObject]]; [(VLCAppDelegate*)[UIApplication sharedApplication].delegate openMediaList:list atIndex:(int)[tracks indexOfObject:selectedObject]];
} else } else
[self openMediaObject:selectedObject]; [self openMediaObject:selectedObject];
} }
......
...@@ -35,7 +35,7 @@ static NSCache *_thumbnailCache; ...@@ -35,7 +35,7 @@ static NSCache *_thumbnailCache;
{ {
const char *ptr = [string UTF8String]; const char *ptr = [string UTF8String];
unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH];
CC_MD5(ptr, strlen(ptr), md5Buffer); CC_MD5(ptr, (unsigned int)strlen(ptr), md5Buffer);
NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
[output appendFormat:@"%02x",md5Buffer[i]]; [output appendFormat:@"%02x",md5Buffer[i]];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment