};
        short freq;
        int time = spk_bleep_time;
+
        freq = vals[val % 12];
        if (val > 11)
                freq *= (1 << (val / 12));
 static void speech_kill(struct vc_data *vc)
 {
        char val = synth->is_alive(synth);
+
        if (val == 0)
                return;
 
 {
        int fg = spk_attr & 0x0f;
        int bg = spk_attr >> 4;
+
        if (fg > 8) {
                synth_printf("%s ", spk_msg_get(MSG_BRIGHT));
                fg -= 8;
 {
        char *cp = spk_characters[ch];
        struct var_t *direct = spk_get_var(DIRECT);
+
        if (direct && direct->u.n.value) {
                if (IS_CHAR(ch, B_CAP)) {
                        spk_pitch_shift++;
 static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)
 {
        u16 ch = ' ';
+
        if (vc && pos) {
                u16 w = scr_readw(pos);
                u16 c = w & 0xff;
 static void say_char(struct vc_data *vc)
 {
        u_short ch;
+
        spk_old_attr = spk_attr;
        ch = get_char(vc, (u_short *) spk_pos, &spk_attr);
        if (spk_attr != spk_old_attr) {
 static void say_phonetic_char(struct vc_data *vc)
 {
        u_short ch;
+
        spk_old_attr = spk_attr;
        ch = get_char(vc, (u_short *) spk_pos, &spk_attr);
        if (isascii(ch) && isalpha(ch)) {
        char ch;
        u_short attr_ch;
        u_char temp;
+
        spk_old_attr = spk_attr;
        ch = (char)get_char(vc, (u_short *) tmp_pos, &temp);
 
 {
        u_long cnt = get_word(vc);
        u_short saved_punc_mask = spk_punc_mask;
+
        if (cnt == 0)
                return;
        spk_punc_mask = PUNC;
        u_char temp;
        char ch;
        u_short edge_said = 0, last_state = 0, state = 0;
+
        spk_parked |= 0x01;
 
        if (spk_x == 0) {
        u_char temp;
        char ch;
        u_short edge_said = 0, last_state = 2, state = 0;
-       spk_parked |= 0x01;
 
+       spk_parked |= 0x01;
        if (spk_x == vc->vc_cols - 1 && spk_y == vc->vc_rows - 1) {
                announce_edge(vc, edge_bottom);
                return;
        char *cp = buf, *str_cap = spk_str_caps_stop;
        char *cp1, *last_cap = spk_str_caps_stop;
        u_char ch;
+
        if (!get_word(vc))
                return;
        while ((ch = (u_char) *cp)) {
        int i = get_line(vc);
        char *cp;
        u_short saved_punc_mask = spk_punc_mask;
+
        if (i == 0) {
                synth_printf("%s\n", spk_msg_get(MSG_BLANK));
                return;
        int i = 0;
        u_char tmp;
        u_short saved_punc_mask = spk_punc_mask;
+
        spk_old_attr = spk_attr;
        spk_attr = get_attributes((u_short *) from);
        while (from < to) {
 {
        u_long start = vc->vc_origin + (spk_y * vc->vc_size_row);
        u_long end = start + (to * 2);
+
        start += from * 2;
        if (say_from_to(vc, start, end, read_punc) <= 0)
                if (cursor_track != read_all_mode)
 static void say_screen_from_to(struct vc_data *vc, u_long from, u_long to)
 {
        u_long start = vc->vc_origin, end;
+
        if (from > 0)
                start += from * vc->vc_size_row;
        if (to > vc->vc_rows)
 static void speakup_win_say(struct vc_data *vc)
 {
        u_long start, end, from, to;
+
        if (win_start < 2) {
                synth_printf("%s\n", spk_msg_get(MSG_NO_WINDOW));
                return;
 {
        int i, len = get_line(vc);
        u_char ch;
+
        spk_parked |= 0x01;
        if (len == 0) {
                synth_printf("%s\n", spk_msg_get(MSG_BLANK));
 {
        int len = get_line(vc);
        u_char ch;
+
        spk_parked |= 0x01;
        if (len == 0) {
                synth_printf("%s\n", spk_msg_get(MSG_BLANK));
 {
        u_char tmp;
        u_short ch = get_char(vc, (u_short *) spk_pos, &tmp);
+
        ch &= 0xff;
        synth_printf(spk_msg_get(MSG_CHAR_INFO), ch, ch);
 }
        static u_char ch = '\0', old_ch = '\0';
        static u_short char_type, last_type;
        int in_count = count;
+
        spk_keydown = 0;
        while (count--) {
                if (cursor_track == read_all_mode) {
 static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag)
 {
        unsigned long flags;
+
        if (synth == NULL || up_flag || spk_killed)
                return;
        spin_lock_irqsave(&speakup_info.spinlock, flags);
 static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag)
 {
        unsigned long flags;
+
        spin_lock_irqsave(&speakup_info.spinlock, flags);
        if (up_flag) {
                spk_lastkey = spk_keydown = 0;
        const u_char *cp = key_info;
        u_char *cp1 = k_buffer;
        u_char ch, version, num_keys;
+
        version = *cp++;
        if (version != KEY_MAP_VER)
                return -1;
 static int edit_bits(struct vc_data *vc, u_char type, u_char ch, u_short key)
 {
        short mask = pb_edit->mask, ch_type = spk_chartab[ch];
+
        if (type != KT_LATIN || (ch_type & B_NUM) || ch < SPACE)
                return -1;
        if (ch == SPACE) {
 static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag)
 {
        unsigned long flags;
+
        spin_lock_irqsave(&speakup_info.spinlock, flags);
        if (cursor_track == read_all_mode) {
                spk_parked &= 0xfe;
 {
        int i;
        int vc_num = vc->vc_num;
+
        for (i = 0; i < 8; i++)
                speakup_console[vc_num]->ht.highsize[i] = 0;
 }
        for (i = 0; i < vc->vc_rows; i++) {
                u16 *end = start + vc->vc_cols * 2;
                u16 *ptr;
+
                for (ptr = start; ptr < end; ptr++) {
                        ch = get_attributes(ptr);
                        bg = (ch & 0x70) >> 4;
 {
        int hc, d;
        int vc_num = vc->vc_num;
+
        if (count_highlight_color(vc) == 1)
                return 0;
        hc = get_highlight_color(vc);
 {
        struct vc_data *vc = vc_cons[cursor_con].d;
        unsigned long flags;
+
        del_timer(&cursor_timer);
        spin_lock_irqsave(&speakup_info.spinlock, flags);
        if (cursor_con != fg_console) {
 static void speakup_bs(struct vc_data *vc)
 {
        unsigned long flags;
+
        if (!speakup_console[vc->vc_num])
                return;
        if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
 static void speakup_con_write(struct vc_data *vc, const char *str, int len)
 {
        unsigned long flags;
+
        if ((vc->vc_num != fg_console) || spk_shut_up || synth == NULL)
                return;
        if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
 static void speakup_con_update(struct vc_data *vc)
 {
        unsigned long flags;
+
        if (speakup_console[vc->vc_num] == NULL || spk_parked)
                return;
        if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
        unsigned long flags;
        int on_off = 2;
        char *label;
+
        if (synth == NULL || up_flag || spk_killed)
                return;
        spin_lock_irqsave(&speakup_info.spinlock, flags);
        char *pn;
        int var_id = (int)value - VAR_START;
        int how = (var_id & 1) ? E_INC : E_DEC;
+
        var_id = var_id / 2 + FIRST_SET_VAR;
        p_header = spk_get_var_header(var_id);
        if (p_header == NULL)
 static void speakup_win_set(struct vc_data *vc)
 {
        char info[40];
+
        if (win_start > 1) {
                synth_printf("%s\n", spk_msg_get(MSG_WINDOW_ALREADY_SET));
                return;
 static void speakup_bits(struct vc_data *vc)
 {
        int val = this_speakup_key - (FIRST_EDIT_BITS - 1);
+
        if (spk_special_handler != NULL || val < 1 || val > 6) {
                synth_printf("%s\n", spk_msg_get(MSG_ERROR));
                return;
        u_char type = KTYP(keysym), value = KVAL(keysym), new_key = 0;
        u_char shift_info, offset;
        int ret = 0;
+
        if (synth == NULL)
                return 0;
 
        case KBD_POST_KEYSYM:{
                        unsigned char type = KTYP(param->value) - 0xf0;
                        unsigned char val = KVAL(param->value);
+
                        switch (type) {
                        case KT_SHIFT:
                                do_handle_shift(vc, val, up);
 {
        struct vt_notifier_param *param = _param;
        struct vc_data *vc = param->vc;
+
        switch (code) {
        case VT_ALLOCATE:
                if (vc->vc_mode == KD_TEXT)