mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-09 09:19:09 +02:00
indentation fixes
This commit is contained in:
parent
3ddbb94e37
commit
d7c81f5117
3 changed files with 11 additions and 12 deletions
|
|
@ -91,13 +91,11 @@ void espeakup_sighandler(int sig)
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
pthread_t queue_thread_id;
|
||||
pthread_t queue_thread_id;
|
||||
struct synth_t s = {
|
||||
.voice = "",
|
||||
};
|
||||
|
||||
/* Spawn our queue-processing thread. */
|
||||
|
||||
/* process command line options */
|
||||
process_cli(argc, argv);
|
||||
|
||||
|
|
@ -118,6 +116,7 @@ pthread_t queue_thread_id;
|
|||
}
|
||||
}
|
||||
|
||||
/* Spawn our queue-processing thread. */
|
||||
int err = pthread_create(&queue_thread_id, NULL, &queue_runner, &s);
|
||||
if (err != 0) {
|
||||
return 4;
|
||||
|
|
|
|||
17
queue.c
17
queue.c
|
|
@ -71,7 +71,7 @@ static struct queue_entry_t *queue_remove(void)
|
|||
{
|
||||
struct queue_entry_t *temp = NULL;
|
||||
|
||||
if(last) {
|
||||
if (last) {
|
||||
temp = last;
|
||||
last = temp->next;
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ void queue_clear(void)
|
|||
pthread_mutex_lock(&queue_guard);
|
||||
while (last) {
|
||||
struct queue_entry_t *entry = queue_remove();
|
||||
if(entry)
|
||||
if (entry)
|
||||
free_entry(entry);
|
||||
}
|
||||
pthread_mutex_unlock(&queue_guard);
|
||||
|
|
@ -135,9 +135,9 @@ static void queue_process_entry(struct synth_t *s)
|
|||
espeak_ERROR error;
|
||||
struct queue_entry_t *current = queue_remove();
|
||||
|
||||
pthread_mutex_unlock(&queue_guard); /* So "reader" can go. */
|
||||
pthread_mutex_unlock(&queue_guard); /* So "reader" can go. */
|
||||
|
||||
if(current) {
|
||||
if (current) {
|
||||
switch (current->cmd) {
|
||||
case CMD_SET_FREQUENCY:
|
||||
error = set_frequency(s, current->value, current->adjust);
|
||||
|
|
@ -189,13 +189,14 @@ static void queue_process_entry(struct synth_t *s)
|
|||
* 2. We are processing an entry that has just been removed from the queue.
|
||||
*/
|
||||
|
||||
void *queue_runner(void *arg) {
|
||||
void *queue_runner(void *arg)
|
||||
{
|
||||
struct synth_t *synth = (struct synth_t *) arg;
|
||||
pthread_mutex_lock(&queue_guard);
|
||||
while(1) {
|
||||
pthread_mutex_lock(&queue_guard);
|
||||
while (1) {
|
||||
pthread_cond_wait(&runner_awake, &queue_guard);
|
||||
|
||||
while(last) {
|
||||
while (last) {
|
||||
queue_process_entry(synth);
|
||||
pthread_mutex_lock(&queue_guard);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,4 +178,3 @@ void main_loop(struct synth_t *s)
|
|||
process_buffer(s, buf, length);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue