-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some implicit narrowing conversions
- Loading branch information
Showing
5 changed files
with
37 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* Copyright (C) 2005 - 2007 Stephen F. Booth <[email protected]> | ||
* Copyright (C) 2005 - 2020 Stephen F. Booth <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -138,13 +136,13 @@ - (NSString *) discID | |
|
||
// zero is lead out | ||
int offsets[100]; | ||
offsets[0] = [self leadOut] + 150; | ||
offsets[0] = (int)[self leadOut] + 150; | ||
|
||
NSUInteger i; | ||
for(i = 0; i < [self countOfTracks]; ++i) | ||
offsets[1 + i] = [self firstSectorForTrack:i] + 150; | ||
offsets[1 + i] = (int)[self firstSectorForTrack:i] + 150; | ||
|
||
int result = discid_put(discID, 1, [self countOfTracks], offsets); | ||
int result = discid_put(discID, 1, (int)[self countOfTracks], offsets); | ||
if(result) | ||
musicBrainzDiscID = [NSString stringWithCString:discid_get_id(discID) encoding:NSASCIIStringEncoding]; | ||
|
||
|
@@ -163,13 +161,13 @@ - (NSURL *) discIDSubmissionUrl | |
|
||
// zero is lead out | ||
int offsets[100]; | ||
offsets[0] = [self leadOut] + 150; | ||
offsets[0] = (int)[self leadOut] + 150; | ||
|
||
NSUInteger i; | ||
for(i = 0; i < [self countOfTracks]; ++i) | ||
offsets[1 + i] = [self firstSectorForTrack:i] + 150; | ||
offsets[1 + i] = (int)[self firstSectorForTrack:i] + 150; | ||
|
||
int result = discid_put(discID, 1, [self countOfTracks], offsets); | ||
int result = discid_put(discID, 1, (int)[self countOfTracks], offsets); | ||
if(result) | ||
submissionUrl = [NSURL URLWithString:[NSString stringWithCString:discid_get_submission_url(discID) encoding:NSASCIIStringEncoding]]; | ||
|
||
|
@@ -188,13 +186,13 @@ - (NSString *) freeDBDiscID | |
|
||
// zero is lead out | ||
int offsets[100]; | ||
offsets[0] = [self leadOut] + 150; | ||
offsets[0] = (int)[self leadOut] + 150; | ||
|
||
NSUInteger i; | ||
for(i = 0; i < [self countOfTracks]; ++i) | ||
offsets[1 + i] = [self firstSectorForTrack:i] + 150; | ||
offsets[1 + i] = (int)[self firstSectorForTrack:i] + 150; | ||
|
||
int result = discid_put(discID, 1, [self countOfTracks], offsets); | ||
int result = discid_put(discID, 1, (int)[self countOfTracks], offsets); | ||
if(result) | ||
freeDBDiscID = [NSString stringWithCString:discid_get_freedb_id(discID) encoding:NSASCIIStringEncoding]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* Copyright (C) 2005 - 2007 Stephen F. Booth <[email protected]> | ||
* Copyright (C) 2005 - 2020 Stephen F. Booth <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -142,7 +140,7 @@ - (IBAction) save:(id)sender | |
// Apply style | ||
[logMessage addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Helvetica" size:11.0] range:NSMakeRange(0, [logMessage length])]; | ||
|
||
NSData *rtf = [logMessage RTFFromRange:NSMakeRange(0, [logMessage length]) documentAttributes:nil]; | ||
NSData *rtf = [logMessage RTFFromRange:NSMakeRange(0, [logMessage length]) documentAttributes:@{ NSDocumentTypeDocumentAttribute: NSRTFTextDocumentType } ]; | ||
|
||
BOOL fileCreated = [[NSFileManager defaultManager] createFileAtPath:filename contents:rtf attributes:nil]; | ||
NSAssert(YES == fileCreated, NSLocalizedStringFromTable(@"Unable to create the output file.", @"Exceptions", @"")); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* Copyright (C) 2005 - 2007 Stephen F. Booth <[email protected]> | ||
* Copyright (C) 2005 - 2020 Stephen F. Booth <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -67,35 +65,35 @@ - (void) writeTags | |
// Album title | ||
album = [metadata albumTitle]; | ||
if(nil != album) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"ALBUM"] cStringUsingEncoding:NSASCIIStringEncoding], [album UTF8String], strlen([album UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"ALBUM"] cStringUsingEncoding:NSASCIIStringEncoding], [album UTF8String], (int)strlen([album UTF8String])); | ||
|
||
// Artist | ||
artist = [metadata trackArtist]; | ||
if(nil == artist) | ||
artist = [metadata albumArtist]; | ||
if(nil != artist) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"ARTIST"] cStringUsingEncoding:NSASCIIStringEncoding], [artist UTF8String], strlen([artist UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"ARTIST"] cStringUsingEncoding:NSASCIIStringEncoding], [artist UTF8String], (int)strlen([artist UTF8String])); | ||
|
||
// Composer | ||
composer = [metadata trackComposer]; | ||
if(nil == composer) | ||
composer = [metadata albumComposer]; | ||
if(nil != composer) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"COMPOSER"] cStringUsingEncoding:NSASCIIStringEncoding], [composer UTF8String], strlen([composer UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"COMPOSER"] cStringUsingEncoding:NSASCIIStringEncoding], [composer UTF8String], (int)strlen([composer UTF8String])); | ||
|
||
// Genre | ||
genre = [metadata trackGenre]; | ||
if(nil == genre) | ||
genre = [metadata albumGenre]; | ||
if(nil != genre) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"GENRE"] cStringUsingEncoding:NSASCIIStringEncoding], [genre UTF8String], strlen([genre UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"GENRE"] cStringUsingEncoding:NSASCIIStringEncoding], [genre UTF8String], (int)strlen([genre UTF8String])); | ||
|
||
// Year | ||
year = [metadata trackDate]; | ||
if(nil == year) | ||
year = [metadata albumDate]; | ||
if(nil != year) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"YEAR"] cStringUsingEncoding:NSASCIIStringEncoding], [year UTF8String], strlen([year UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"YEAR"] cStringUsingEncoding:NSASCIIStringEncoding], [year UTF8String], (int)strlen([year UTF8String])); | ||
|
||
// Comment | ||
comment = [metadata albumComment]; | ||
|
@@ -105,55 +103,55 @@ - (void) writeTags | |
if([[[[self taskInfo] settings] objectForKey:@"saveSettingsInComment"] boolValue]) | ||
comment = (nil == comment ? [self encoderSettingsString] : [NSString stringWithFormat:@"%@\n%@", comment, [self encoderSettingsString]]); | ||
if(nil != comment) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"COMMENT"] cStringUsingEncoding:NSASCIIStringEncoding], [comment UTF8String], strlen([comment UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"COMMENT"] cStringUsingEncoding:NSASCIIStringEncoding], [comment UTF8String], (int)strlen([comment UTF8String])); | ||
|
||
// Track title | ||
title = [metadata trackTitle]; | ||
if(nil != title) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"TITLE"] cStringUsingEncoding:NSASCIIStringEncoding], [title UTF8String], strlen([title UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"TITLE"] cStringUsingEncoding:NSASCIIStringEncoding], [title UTF8String], (int)strlen([title UTF8String])); | ||
|
||
// Track number | ||
trackNumber = [metadata trackNumber]; | ||
if(nil != trackNumber) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"TRACK"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [trackNumber intValue]] UTF8String], strlen([[NSString stringWithFormat:@"%u", [trackNumber intValue]] UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"TRACK"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [trackNumber intValue]] UTF8String], (int)strlen([[NSString stringWithFormat:@"%u", [trackNumber intValue]] UTF8String])); | ||
|
||
// Track total | ||
trackTotal = [metadata trackTotal]; | ||
if(nil != trackTotal) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"TRACKTOTAL"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [trackTotal intValue]] UTF8String], strlen([[NSString stringWithFormat:@"%u", [trackTotal intValue]] UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"TRACKTOTAL"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [trackTotal intValue]] UTF8String], (int)strlen([[NSString stringWithFormat:@"%u", [trackTotal intValue]] UTF8String])); | ||
|
||
// Disc number | ||
discNumber = [metadata discNumber]; | ||
if(nil != discNumber) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"DISCNUMBER"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [discNumber intValue]] UTF8String], strlen([[NSString stringWithFormat:@"%u", [discNumber intValue]] UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"DISCNUMBER"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [discNumber intValue]] UTF8String], (int)strlen([[NSString stringWithFormat:@"%u", [discNumber intValue]] UTF8String])); | ||
|
||
// Discs in set | ||
discTotal = [metadata discTotal]; | ||
if(nil != discTotal) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"DISCTOTAL"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [discTotal intValue]] UTF8String], strlen([[NSString stringWithFormat:@"%u", [discTotal intValue]] UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"DISCTOTAL"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [discTotal intValue]] UTF8String], (int)strlen([[NSString stringWithFormat:@"%u", [discTotal intValue]] UTF8String])); | ||
|
||
// Compilation | ||
compilation = [metadata compilation]; | ||
if(nil != compilation) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"COMPILATION"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [compilation intValue]] UTF8String], strlen([[NSString stringWithFormat:@"%u", [compilation intValue]] UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"COMPILATION"] cStringUsingEncoding:NSASCIIStringEncoding], [[NSString stringWithFormat:@"%u", [compilation intValue]] UTF8String], (int)strlen([[NSString stringWithFormat:@"%u", [compilation intValue]] UTF8String])); | ||
|
||
// ISRC | ||
isrc = [metadata ISRC]; | ||
if(nil != isrc) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"ISRC"] cStringUsingEncoding:NSASCIIStringEncoding], [isrc UTF8String], strlen([isrc UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"ISRC"] cStringUsingEncoding:NSASCIIStringEncoding], [isrc UTF8String], (int)strlen([isrc UTF8String])); | ||
|
||
// MCN | ||
mcn = [metadata MCN]; | ||
if(nil != mcn) | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"MCN"] cStringUsingEncoding:NSASCIIStringEncoding], [mcn UTF8String], strlen([mcn UTF8String])); | ||
WavpackAppendTagItem(wpc, [[AudioMetadata customizeWavPackTag:@"MCN"] cStringUsingEncoding:NSASCIIStringEncoding], [mcn UTF8String], (int)strlen([mcn UTF8String])); | ||
|
||
// Encoded by | ||
bundleVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; | ||
WavpackAppendTagItem(wpc, "TOOL NAME", "Max", strlen("Max")); | ||
WavpackAppendTagItem(wpc, "TOOL VERSION", [bundleVersion UTF8String], strlen([bundleVersion UTF8String])); | ||
WavpackAppendTagItem(wpc, "TOOL NAME", "Max", (int)strlen("Max")); | ||
WavpackAppendTagItem(wpc, "TOOL VERSION", [bundleVersion UTF8String], (int)strlen([bundleVersion UTF8String])); | ||
|
||
// Encoder settings | ||
WavpackAppendTagItem(wpc, "ENCODING", [[self encoderSettingsString] UTF8String], strlen([[self encoderSettingsString] UTF8String])); | ||
WavpackAppendTagItem(wpc, "ENCODING", [[self encoderSettingsString] UTF8String], (int)strlen([[self encoderSettingsString] UTF8String])); | ||
|
||
result = WavpackWriteTag(wpc); | ||
NSAssert(0 != result, NSLocalizedStringFromTable(@"Unable to write to the output file.", @"Exceptions", @"")); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* | ||
* $Id$ | ||
* | ||
* Copyright (C) 2005 - 2007 Stephen F. Booth <[email protected]> | ||
* Copyright (C) 2005 - 2020 Stephen F. Booth <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -293,11 +291,11 @@ | |
if(kOggStreamTypeUnknown == streamType) { | ||
oggpack_buffer opb; | ||
char buffer[6]; | ||
int packtype; | ||
long packtype; | ||
unsigned i; | ||
|
||
memset(buffer, 0, 6); | ||
oggpack_readinit(&opb, op.packet, op.bytes); | ||
oggpack_readinit(&opb, op.packet, (int)op.bytes); | ||
|
||
packtype = oggpack_read(&opb, 8); | ||
for(i = 0; i < 6; ++i) { | ||
|
@@ -378,7 +376,7 @@ | |
[image unlockFocus]; | ||
} | ||
|
||
return [bitmapRep representationUsingType:type properties:nil]; | ||
return [bitmapRep representationUsingType:type properties:@{}]; | ||
} | ||
|
||
NSImage * | ||
|
@@ -511,7 +509,7 @@ | |
pathString = [NSString stringWithFormat:@"%@/%@-%.8x-XXXXXXXX.%@", directory, @"Max", sessionID, extension]; | ||
strlcpy(path, [pathString fileSystemRepresentation], MAXPATHLEN); | ||
|
||
fd = mkstemps(path, 1 + [extension length]); | ||
fd = mkstemps(path, 1 + (int)[extension length]); | ||
NSCAssert1(-1 != fd, @"Unable to create a temporary file: %s", strerror(errno)); | ||
|
||
intResult = close(fd); | ||
|