[PATCH] alsabat: fix one uninitialized warning issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zhang Keqiao <keqiaox.k.zhang@xxxxxxxxxxxxxxx>

Fix a variable uninitialized issue, adding the initialized assignment to fix it.

Signed-off-by: Zhang Keqiao <keqiaox.k.zhang@xxxxxxxxxxxxxxx>
---
 bat/analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bat/analyze.c b/bat/analyze.c
index 2b8ca61..9808b73 100644
--- a/bat/analyze.c
+++ b/bat/analyze.c
@@ -34,7 +34,7 @@ static void check_amplitude(struct bat *bat, float *buf)
 	int i, percent;
 
 	/* calculate average value */
-	for (i = 0, sum = 0.0; i < bat->frames; i++)
+	for (i = 0, sum = 0.0, average = 0.0; i < bat->frames; i++)
 		sum += buf[i];
 	average = sum / bat->frames;
 
-- 
2.9.3

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux