Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Wed, 29 Jul 2015 00:43:32 +0000 (10:43 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 29 Jul 2015 00:49:34 +0000 (10:49 +1000)
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/sound.c
source/blender/makesrna/intern/rna_userdef.c

index f221f588db3c21bf26b510ccda75cf3dc1fa4c21..e68be701b6114528e3b7ee20674f4d638a30b91d 100644 (file)
@@ -51,7 +51,7 @@ typedef struct SoundWaveform {
 void BKE_sound_init_once(void);
 void BKE_sound_exit_once(void);
 
-voidBKE_sound_get_device(void);
+void *BKE_sound_get_device(void);
 
 void BKE_sound_init(struct Main *main);
 
@@ -141,7 +141,7 @@ void *BKE_sound_get_factory(void *sound);
 
 float BKE_sound_get_length(struct bSound *sound);
 
-char** BKE_sound_get_device_names(void);
+char **BKE_sound_get_device_names(void);
 
 bool BKE_sound_is_jack_supported(void);
 
index 5584b087e40d54971c6031701d57a898b3fcee1e..0b89931aa75e49e4a033ee80f926a388d2fabd04 100644 (file)
@@ -68,7 +68,7 @@
 #ifdef WITH_AUDASPACE
 /* evil globals ;-) */
 static int sound_cfra;
-static char** audio_device_names = NULL;
+static char **audio_device_names = NULL;
 #endif
 
 bSound *BKE_sound_new_file(struct Main *bmain, const char *filename)
@@ -131,7 +131,7 @@ void BKE_sound_free(bSound *sound)
 
 #ifdef WITH_AUDASPACE
 
-static const charforce_device = NULL;
+static const char *force_device = NULL;
 
 #ifdef WITH_JACK
 static void sound_sync_callback(void *data, int mode, float time)
@@ -165,9 +165,9 @@ void BKE_sound_init_once(void)
        atexit(BKE_sound_exit_once);
 }
 
-static AUD_Devicesound_device;
+static AUD_Device *sound_device;
 
-voidBKE_sound_get_device(void)
+void *BKE_sound_get_device(void)
 {
        return sound_device;
 }
@@ -176,7 +176,7 @@ void BKE_sound_init(struct Main *bmain)
 {
        AUD_DeviceSpecs specs;
        int device, buffersize;
-       const chardevice_name;
+       const char *device_name;
 
        device = U.audiodevice;
        buffersize = U.mixbufsize;
@@ -184,16 +184,17 @@ void BKE_sound_init(struct Main *bmain)
        specs.format = U.audioformat;
        specs.rate = U.audiorate;
 
-       if (force_device == NULL)
-       {
+       if (force_device == NULL) {
                int i;
-               char** names = BKE_sound_get_device_names();
+               char **names = BKE_sound_get_device_names();
                device_name = names[0];
 
-               // make sure device is within the bounds of the array
-               for(i = 0; names[i]; i++)
-                       if(i == device)
+               /* make sure device is within the bounds of the array */
+               for (i = 0; names[i]; i++) {
+                       if (i == device) {
                                device_name = names[i];
+                       }
+               }
        }
        else
                device_name = force_device;
@@ -238,11 +239,11 @@ void BKE_sound_exit_once(void)
        AUD_exitOnce();
 
 #ifdef WITH_SYSTEM_AUDASPACE
-       if(audio_device_names != NULL)
-       {
+       if (audio_device_names != NULL) {
                int i;
-               for(i = 0; audio_device_names[i]; i++)
+               for (i = 0; audio_device_names[i]; i++) {
                        free(audio_device_names[i]);
+               }
                free(audio_device_names);
                audio_device_names = NULL;
        }
@@ -834,17 +835,16 @@ float BKE_sound_get_length(bSound *sound)
        return info.length;
 }
 
-char** BKE_sound_get_device_names(void)
+char **BKE_sound_get_device_names(void)
 {
-       if(audio_device_names == NULL)
-       {
+       if (audio_device_names == NULL) {
 #ifdef WITH_SYSTEM_AUDASPACE
                audio_device_names = AUD_getDeviceNames();
 #else
-               static const charnames[] = {
+               static const char *names[] = {
                        "Null", "SDL", "OpenAL", "Jack", NULL
                };
-               audio_device_names = (char**)names;
+               audio_device_names = (char **)names;
 #endif
        }
 
index 1392009a30d03ffbf7980e1eeba0de084881fd18..5bf8fe76c91903dc1fa6b5c042fc31afe2121860 100644 (file)
@@ -614,10 +614,9 @@ static EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C), Poi
 #ifdef WITH_SYSTEM_AUDASPACE
        int i;
 
-       char** names = BKE_sound_get_device_names();
+       char **names = BKE_sound_get_device_names();
 
-       for(i = 0; names[i]; i++)
-       {
+       for (i = 0; names[i]; i++) {
                EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]};
                RNA_enum_item_add(&item, &totitem, &new_item);
        }