Fixed some problems reported by the CLANG static analyzer.
5 // Created by Jens Alfke on 6/17/08.
6 // Copyright 2008 Jens Alfke. All rights reserved.
12 NSString* MYCAErrorString( OSStatus coreAudioError )
14 if( coreAudioError >= 0x20202020 )
15 return NSFileTypeForHFSTypeCode(coreAudioError);
17 return [NSString stringWithFormat: @"%i",coreAudioError];
20 NSError* MYCAError( OSStatus coreAudioError, NSString *message )
22 NSString *errStr = $sprintf(@"CoreAudio error %@", MYCAErrorString(coreAudioError));
24 message = [message stringByAppendingFormat: @" [%@]", errStr];
27 NSString *domain = (coreAudioError >= 0x20202020) ?MYCoreAudioErrorDomain :NSOSStatusErrorDomain;
28 return [NSError errorWithDomain: domain code: coreAudioError
29 userInfo: $dict({NSLocalizedDescriptionKey, message})];
33 void _MYThrowCAError( OSStatus err, NSString *operation ) throw(NSError*)
35 NSError *error = MYCAError(err, $sprintf(@"Error in %@", operation));
36 Warn(@"EXCEPTION: %@",error.localizedDescription);
40 void _MYWarnCAError( OSStatus err, NSString *operation )
42 NSError *error = MYCAError(err, $sprintf(@"Error in %@", operation));
43 Warn(@"%@",error.localizedDescription);