From 89fc2ae80bb1eeca1d967723c1918c0b156508a0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 4 Mar 2017 15:01:55 +0100 Subject: speakup: extend synth buffer to 16bit unicode characters This extends the synth buffer slots to 16bit, so as to hold 16bit unicode characters. synth_buffer_getc and synth_buffer_peek now return 16bit characters. Speech synthesizers which do not support characters beyond latin1 can use the synth_buffer_skip_nonlatin1() helper to skip the non-latin1 characters before getting or peeking. All synthesizers are made to use it for now. This makes synth_buffer_add take a 16bit character. For simplicity for now, synth_printf is left to using latin1 formats and strings. synth_putwc, synth_putwc_s, synth_putws and synth_putws_s helpers are however added to put 16bit characters and strings. Signed-off-by: Samuel Thibault Reviewed-by: Chris Brannon Signed-off-by: Greg Kroah-Hartman --- drivers/staging/speakup/speakup_acntpc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/staging/speakup/speakup_acntpc.c') diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index cf6fcd63498d..56ece087ff88 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -196,6 +196,7 @@ static void do_catch_up(struct spk_synth *synth) synth->flush(synth); continue; } + synth_buffer_skip_nonlatin1(); if (synth_buffer_empty()) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); break; -- cgit v1.2.3-59-g8ed1b