# HG changeset patch # User reimar # Date 1364633582 0 # Node ID efb9481610d2e71d38b885ad87ea9089d41b2e77 # Parent 3be3990375da911d302a1bbf22911dba2ef048cc Avoid declaring loop variables inside the for() This improves compiler compatibility. diff -r 3be3990375da -r efb9481610d2 libao2/ao_coreaudio.c --- a/libao2/ao_coreaudio.c Sat Mar 30 08:42:57 2013 +0000 +++ b/libao2/ao_coreaudio.c Sat Mar 30 08:53:02 2013 +0000 @@ -369,6 +369,7 @@ OSStatus err; UInt32 i_param_size; int num_devices; + int i; AudioDeviceID *devids; char *device_name; @@ -393,7 +394,7 @@ num_devices = i_param_size / sizeof(AudioDeviceID); - for (int i = 0; i < num_devices; ++i) { + for (i = 0; i < num_devices; ++i) { err = GetAudioPropertyString(devids[i], kAudioObjectPropertyName, &device_name); if (err == noErr) { @@ -1247,7 +1248,8 @@ const AudioObjectPropertyAddress inAddresses[], void *inClientData ) { - for (int i=0; i < inNumberAddresses; ++i) + int i; + for (i=0; i < inNumberAddresses; ++i) { if (inAddresses[i].mSelector == kAudioStreamPropertyPhysicalFormat) { ao_msg(MSGT_AO, MSGL_WARN, "got notify kAudioStreamPropertyPhysicalFormat changed.\n"); @@ -1264,7 +1266,8 @@ const AudioObjectPropertyAddress inAddresses[], void *inClientData ) { - for (int i=0; i < inNumberAddresses; ++i) + int i; + for (i=0; i < inNumberAddresses; ++i) { if (inAddresses[i].mSelector == kAudioDevicePropertyDeviceHasChanged) { ao_msg(MSGT_AO, MSGL_WARN, "got notify kAudioDevicePropertyDeviceHasChanged.\n");