replaced all printf with NSLog

This commit is contained in:
Diego Waxemberg
2015-01-09 16:56:17 -05:00
parent 600560d9e3
commit b7ccf57a2d
3 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -86,7 +86,7 @@ static NSData* p12 = nil;
BIO_free(bio); BIO_free(bio);
if (!x509) { if (!x509) {
fprintf(stderr, "unable to parse certificate in memory\n"); NSLog(@"ERROR: unable to parse certificate in memory");
return NULL; return NULL;
} }
@@ -115,7 +115,7 @@ static NSData* p12 = nil;
BIO_free(bio); BIO_free(bio);
if (!pkey) { if (!pkey) {
fprintf(stderr, "unable to parse private key in memory\n"); NSLog(@"ERROR: unable to parse private key in memory!");
return NULL; return NULL;
} }
@@ -195,7 +195,7 @@ static NSData* p12 = nil;
x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL); x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
if (!x509) { if (!x509) {
fprintf(stderr, "unable to parse certificate in memory\n"); NSLog(@"ERROR: unable to parse certificate in memory!");
return NULL; return NULL;
} }
return [NSData dataWithBytes:x509->signature->data length:x509->signature->length]; return [NSData dataWithBytes:x509->signature->data length:x509->signature->length];
+8 -8
View File
@@ -108,7 +108,7 @@ void ArInit(void)
status = AudioComponentInstanceNew(AudioComponentFindNext(NULL, &audioDesc), &audioUnit); status = AudioComponentInstanceNew(AudioComponentFindNext(NULL, &audioDesc), &audioUnit);
if (status) { if (status) {
printf("Unable to instantiate new AudioComponent: %d\n", (int32_t)status); NSLog(@"Unable to instantiate new AudioComponent: %d", (int32_t)status);
} }
AudioStreamBasicDescription audioFormat = {0}; AudioStreamBasicDescription audioFormat = {0};
@@ -129,7 +129,7 @@ void ArInit(void)
&audioFormat, &audioFormat,
sizeof(audioFormat)); sizeof(audioFormat));
if (status) { if (status) {
printf("Unable to set audio unit to input: %d\n", (int32_t)status); NSLog(@"Unable to set audio unit to input: %d", (int32_t)status);
} }
AURenderCallbackStruct callbackStruct = {0}; AURenderCallbackStruct callbackStruct = {0};
@@ -143,12 +143,12 @@ void ArInit(void)
&callbackStruct, &callbackStruct,
sizeof(callbackStruct)); sizeof(callbackStruct));
if (status) { if (status) {
printf("Unable to set audio unit callback: %d\n", (int32_t)status); NSLog(@"Unable to set audio unit callback: %d", (int32_t)status);
} }
status = AudioUnitInitialize(audioUnit); status = AudioUnitInitialize(audioUnit);
if (status) { if (status) {
printf("Unable to initialize audioUnit: %d\n", (int32_t)status); NSLog(@"Unable to initialize audioUnit: %d", (int32_t)status);
} }
} }
@@ -161,7 +161,7 @@ void ArRelease(void)
OSStatus status = AudioUnitUninitialize(audioUnit); OSStatus status = AudioUnitUninitialize(audioUnit);
if (status) { if (status) {
printf("Unable to uninitialize audioUnit: %d\n", (int32_t)status); NSLog(@"Unable to uninitialize audioUnit: %d", (int32_t)status);
} }
// Audio session is now inactive // Audio session is now inactive
@@ -183,7 +183,7 @@ void ArStart(void)
{ {
OSStatus status = AudioOutputUnitStart(audioUnit); OSStatus status = AudioOutputUnitStart(audioUnit);
if (status) { if (status) {
printf("Unable to start audioUnit: %d\n", (int32_t)status); NSLog(@"Unable to start audioUnit: %d", (int32_t)status);
} }
} }
@@ -191,7 +191,7 @@ void ArStop(void)
{ {
OSStatus status = AudioOutputUnitStop(audioUnit); OSStatus status = AudioOutputUnitStop(audioUnit);
if (status) { if (status) {
printf("Unable to stop audioUnit: %d\n", (int32_t)status); NSLog(@"Unable to stop audioUnit: %d", (int32_t)status);
} }
} }
@@ -211,7 +211,7 @@ void ArDecodeAndPlaySample(char* sampleData, int sampleLength)
[audioLock lock]; [audioLock lock];
if (audioBufferQueueLength > MAX_QUEUE_ENTRIES) { if (audioBufferQueueLength > MAX_QUEUE_ENTRIES) {
printf("Audio player too slow. Dropping all decoded samples!\n"); NSLog(@"Audio player too slow. Dropping all decoded samples!");
// Clear all values from the buffer queue // Clear all values from the buffer queue
struct AUDIO_BUFFER_QUEUE_ENTRY *entry; struct AUDIO_BUFFER_QUEUE_ENTRY *entry;
@@ -80,7 +80,7 @@
} }
- (void)connectionTerminated:(long)errorCode { - (void)connectionTerminated:(long)errorCode {
printf("Connection terminated: %ld\n", errorCode); NSLog(@"Connection terminated: %ld", errorCode);
UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:@"Connection Terminated" message:@"The connection was terminated" preferredStyle:UIAlertControllerStyleAlert]; UIAlertController* conTermAlert = [UIAlertController alertControllerWithTitle:@"Connection Terminated" message:@"The connection was terminated" preferredStyle:UIAlertControllerStyleAlert];
[conTermAlert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action){ [conTermAlert addAction:[UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action){
@@ -92,7 +92,7 @@
} }
- (void) stageStarting:(char*)stageName { - (void) stageStarting:(char*)stageName {
printf("Starting %s\n", stageName); NSLog(@"Starting %s", stageName);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
NSString* lowerCase = [NSString stringWithFormat:@"%s in progress...", stageName]; NSString* lowerCase = [NSString stringWithFormat:@"%s in progress...", stageName];
NSString* titleCase = [[[lowerCase substringToIndex:1] uppercaseString] stringByAppendingString:[lowerCase substringFromIndex:1]]; NSString* titleCase = [[[lowerCase substringToIndex:1] uppercaseString] stringByAppendingString:[lowerCase substringFromIndex:1]];
@@ -127,11 +127,11 @@
} }
- (void) displayMessage:(char*)message { - (void) displayMessage:(char*)message {
printf("Display message: %s\n", message); NSLog(@"Display message: %s", message);
} }
- (void) displayTransientMessage:(char*)message { - (void) displayTransientMessage:(char*)message {
printf("Display transient message: %s\n", message); NSLog(@"Display transient message: %s", message);
} }
- (void)didReceiveMemoryWarning - (void)didReceiveMemoryWarning