mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Enable and fix -Wunused-but-set-variable warnings.
This commit is contained in:
+4
-3
@@ -275,9 +275,10 @@ dnl
|
||||
dnl Reference: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
dnl ================================================================
|
||||
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-function], [CFLAGS="-Wunused-function $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="-Wunused-parameter $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-variable], [CFLAGS="-Wunused-variable $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-function], [CFLAGS="-Wunused-function $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [CFLAGS="-Wunused-parameter $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-variable], [CFLAGS="-Wunused-variable $CFLAGS"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wunused-but-set-variable], [CFLAGS="-Wunused-but-set-variable $CFLAGS"])
|
||||
|
||||
dnl ================================================================
|
||||
dnl Generate output.
|
||||
|
||||
@@ -257,7 +257,7 @@ static void *polling_thread(void *p)
|
||||
while (1) {
|
||||
int a_stop_is_required = 0;
|
||||
|
||||
int a_status = pthread_mutex_lock(&my_mutex);
|
||||
(void)pthread_mutex_lock(&my_mutex);
|
||||
my_event_is_running = 0;
|
||||
|
||||
while (my_start_is_required == 0) {
|
||||
@@ -284,16 +284,16 @@ static void *polling_thread(void *p)
|
||||
event->user_data = NULL;
|
||||
}
|
||||
|
||||
a_status = pthread_mutex_lock(&my_mutex);
|
||||
(void)pthread_mutex_lock(&my_mutex);
|
||||
event_delete((espeak_EVENT *)pop());
|
||||
a_stop_is_required = my_stop_is_required;
|
||||
if (a_stop_is_required > 0)
|
||||
my_stop_is_required = 0;
|
||||
|
||||
a_status = pthread_mutex_unlock(&my_mutex);
|
||||
(void)pthread_mutex_unlock(&my_mutex);
|
||||
}
|
||||
|
||||
a_status = pthread_mutex_lock(&my_mutex);
|
||||
(void)pthread_mutex_lock(&my_mutex);
|
||||
|
||||
my_event_is_running = 0;
|
||||
|
||||
@@ -303,7 +303,7 @@ static void *polling_thread(void *p)
|
||||
my_stop_is_required = 0;
|
||||
}
|
||||
|
||||
a_status = pthread_mutex_unlock(&my_mutex);
|
||||
(void)pthread_mutex_unlock(&my_mutex);
|
||||
|
||||
if (a_stop_is_required > 0) {
|
||||
// no mutex required since the stop command is synchronous
|
||||
@@ -311,10 +311,10 @@ static void *polling_thread(void *p)
|
||||
init();
|
||||
|
||||
// acknowledge the stop request
|
||||
espeak_ng_STATUS a_status = pthread_mutex_lock(&my_mutex);
|
||||
(void)pthread_mutex_lock(&my_mutex);
|
||||
my_stop_is_acknowledged = 1;
|
||||
a_status = pthread_cond_signal(&my_cond_stop_is_acknowledged);
|
||||
a_status = pthread_mutex_unlock(&my_mutex);
|
||||
(void)pthread_cond_signal(&my_cond_stop_is_acknowledged);
|
||||
(void)pthread_mutex_unlock(&my_mutex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user