audio-parser, output_thread: work around -Wmaybe-uninitialized

False positives in gcc 4.7.
This commit is contained in:
Max Kellermann
2012-06-12 19:21:53 +02:00
parent 50cfb997cc
commit 055257a210
2 changed files with 16 additions and 0 deletions

View File

@@ -26,6 +26,7 @@
#include "audio_parser.h"
#include "audio_format.h"
#include "audio_check.h"
#include "gcc.h"
#include <assert.h>
#include <string.h>
@@ -160,6 +161,11 @@ audio_format_parse(struct audio_format *dest, const char *src,
/* parse sample rate */
#if GCC_CHECK_VERSION(4,7)
/* workaround -Wmaybe-uninitialized false positive */
rate = 0;
#endif
if (!parse_sample_rate(src, mask, &rate, &src, error_r))
return false;
@@ -171,6 +177,11 @@ audio_format_parse(struct audio_format *dest, const char *src,
/* parse sample format */
#if GCC_CHECK_VERSION(4,7)
/* workaround -Wmaybe-uninitialized false positive */
sample_format = SAMPLE_FORMAT_UNDEFINED;
#endif
if (!parse_sample_format(src, mask, &sample_format, &src, error_r))
return false;