[Bf-blender-cvs] [cff71fe] master: Cleanup: style

Campbell Barton noreply at git.blender.org
Wed Jul 29 02:54:27 CEST 2015


Commit: cff71fee2118333eae49d0ad7766802d2bcb491e
Author: Campbell Barton
Date:   Wed Jul 29 10:43:32 2015 +1000
Branches: master
https://developer.blender.org/rBcff71fee2118333eae49d0ad7766802d2bcb491e

Cleanup: style

===================================================================

M	source/blender/blenkernel/BKE_sound.h
M	source/blender/blenkernel/intern/sound.c
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index f221f58..e68be70 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -51,7 +51,7 @@ typedef struct SoundWaveform {
 void BKE_sound_init_once(void);
 void BKE_sound_exit_once(void);
 
-void* BKE_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);
 
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 5584b08..0b89931 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -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 char* force_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_Device* sound_device;
+static AUD_Device *sound_device;
 
-void* BKE_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 char* device_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 char* names[] = {
+		static const char *names[] = {
 			"Null", "SDL", "OpenAL", "Jack", NULL
 		};
-		audio_device_names = (char**)names;
+		audio_device_names = (char **)names;
 #endif
 	}
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1392009..5bf8fe7 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -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);
 	}




More information about the Bf-blender-cvs mailing list