[PATCH 1/1] staging:speakup:place each variable declaration on a single line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Per coding guidelines, each variable declaration or initial assignment is on a separate line in main.c.

Signed-off-by: Brandon McGinty-Carroll <bmmcginty@xxxxxxxxxxxxxxxxxx>
---
 drivers/staging/speakup/main.c |  127 ++++++++++++++++++++++++++++------------
 1 file changed, 89 insertions(+), 38 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 6c7b55c..46e8aa0 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -72,15 +72,23 @@ MODULE_PARM_DESC(quiet, "Do not announce when the synthesizer is found.");
 
 special_func spk_special_handler;
 
-short spk_pitch_shift, synth_flags;
+short spk_pitch_shift;
+short synth_flags;
 static char buf[256];
-int spk_attrib_bleep, spk_bleeps, spk_bleep_time = 10;
-int spk_no_intr, spk_spell_delay;
-int spk_key_echo, spk_say_word_ctl;
-int spk_say_ctrl, spk_bell_pos;
+int spk_attrib_bleep;
+int spk_bleeps;
+int spk_bleep_time = 10;
+int spk_no_intr;
+int spk_spell_delay;
+int spk_key_echo;
+int spk_say_word_ctl;
+int spk_say_ctrl;
+int spk_bell_pos;
 short spk_punc_mask;
-int spk_punc_level, spk_reading_punc;
-char spk_str_caps_start[MAXVARLEN + 1] = "\0", spk_str_caps_stop[MAXVARLEN + 1] = "\0";
+int spk_punc_level;
+int spk_reading_punc;
+char spk_str_caps_start[MAXVARLEN + 1] = "\0";
+char spk_str_caps_stop[MAXVARLEN + 1] = "\0";
 const struct st_bits_data spk_punc_info[] = {
 	{"none", "", 0},
 	{"some", "/$%&@", SOME},
@@ -95,14 +103,16 @@ const struct st_bits_data spk_punc_info[] = {
 
 static char mark_cut_flag;
 #define MAX_KEY 160
-u_char *spk_our_keys[MAX_KEY], *spk_shift_table;
+u_char *spk_our_keys[MAX_KEY];
+u_char *spk_shift_table;
 u_char spk_key_buf[600];
 const u_char spk_key_defaults[] = {
 #include "speakupmap.h"
 };
 
 /* Speakup Cursor Track Variables */
-static int cursor_track = 1, prev_cursor_track = 1;
+static int cursor_track = 1;
+static int prev_cursor_track = 1;
 
 /* cursor track modes, must be ordered same as cursor_msgs */
 enum {
@@ -240,8 +250,11 @@ static u_short default_chartab[256] = {
 struct task_struct *speakup_task;
 struct bleep spk_unprocessed_sound;
 static int spk_keydown;
-static u_char spk_lastkey, spk_close_press, keymap_flags;
-static u_char last_keycode, this_speakup_key;
+static u_char spk_lastkey;
+static u_char spk_close_press;
+static u_char keymap_flags;
+static u_char last_keycode;
+static u_char this_speakup_key;
 static u_long last_spk_jiffy;
 
 struct st_spk_t *speakup_console[MAX_NR_CONSOLES];
@@ -536,7 +549,9 @@ static void say_next_char(struct vc_data *vc)
 
 static u_long get_word(struct vc_data *vc)
 {
-	u_long cnt = 0, tmpx = spk_x, tmp_pos = spk_pos;
+	u_long cnt = 0;
+	u_long tmpx = spk_x;
+	u_long tmp_pos = spk_pos;
 	char ch;
 	u_short attr_ch;
 	u_char temp;
@@ -595,7 +610,9 @@ static void say_prev_word(struct vc_data *vc)
 {
 	u_char temp;
 	char ch;
-	u_short edge_said = 0, last_state = 0, state = 0;
+	u_short edge_said = 0;
+	u_short last_state = 0;
+	u_short state = 0;
 	spk_parked |= 0x01;
 
 	if (spk_x == 0) {
@@ -647,7 +664,9 @@ static void say_next_word(struct vc_data *vc)
 {
 	u_char temp;
 	char ch;
-	u_short edge_said = 0, last_state = 2, state = 0;
+	u_short edge_said = 0;
+	u_short last_state = 2;
+	u_short state = 0;
 	spk_parked |= 0x01;
 
 	if (spk_x == vc->vc_cols - 1 && spk_y == vc->vc_rows - 1) {
@@ -686,8 +705,10 @@ static void say_next_word(struct vc_data *vc)
 static void spell_word(struct vc_data *vc)
 {
 	static char *delay_str[] = { "", ",", ".", ". .", ". . ." };
-	char *cp = buf, *str_cap = spk_str_caps_stop;
-	char *cp1, *last_cap = spk_str_caps_stop;
+	char *cp = buf;
+	char *str_cap = spk_str_caps_stop;
+	char *cp1;
+	char *last_cap = spk_str_caps_stop;
 	u_char ch;
 	if (!get_word(vc))
 		return;
@@ -853,8 +874,10 @@ static int say_sentence_num(int num, int prev)
 
 static int get_sentence_buf(struct vc_data *vc, int read_punc)
 {
-	u_long start, end;
-	int i, bn;
+	u_long start;
+	u_long end;
+	int i;
+	int bn;
 	u_char tmp;
 
 	currbuf++;
@@ -903,7 +926,8 @@ static int get_sentence_buf(struct vc_data *vc, int read_punc)
 
 static void say_screen_from_to(struct vc_data *vc, u_long from, u_long to)
 {
-	u_long start = vc->vc_origin, end;
+	u_long start = vc->vc_origin;
+	u_long end;
 	if (from > 0)
 		start += from * vc->vc_size_row;
 	if (to > vc->vc_rows)
@@ -922,7 +946,10 @@ static void say_screen(struct vc_data *vc)
 
 static void speakup_win_say(struct vc_data *vc)
 {
-	u_long start, end, from, to;
+	u_long start;
+	u_long end;
+	u_long from;
+	u_long to;
 	if (win_start < 2) {
 		synth_printf("%s\n", spk_msg_get(MSG_NO_WINDOW));
 		return;
@@ -971,7 +998,8 @@ static void right_edge(struct vc_data *vc)
 
 static void say_first_char(struct vc_data *vc)
 {
-	int i, len = get_line(vc);
+	int i;
+	int len = get_line(vc);
 	u_char ch;
 	spk_parked |= 0x01;
 	if (len == 0) {
@@ -1047,10 +1075,12 @@ static void say_to_right(struct vc_data *vc)
 static void spkup_write(const char *in_buf, int count)
 {
 	static int rep_count;
-	static u_char ch = '\0', old_ch = '\0';
-	static u_short char_type, last_type;
+	static u_char ch = '\0';
+	static u_char old_ch = '\0';
+	static u_short char_type;
+	static u_short last_type;
 	int in_count = count;
-	spk_keydown = 0;
+	int spk_keydown = 0;
 	while (count--) {
 		if (cursor_track == read_all_mode) {
 			/* Insert Sentence Index */
@@ -1178,10 +1208,14 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag)
 
 int spk_set_key_info(const u_char *key_info, u_char *k_buffer)
 {
-	int i = 0, states, key_data_len;
+	int i = 0;
+	int states;
+	int key_data_len;
 	const u_char *cp = key_info;
 	u_char *cp1 = k_buffer;
-	u_char ch, version, num_keys;
+	u_char ch;
+	u_char version;
+	u_char num_keys;
 	version = *cp++;
 	if (version != KEY_MAP_VER)
 		return -1;
@@ -1263,7 +1297,8 @@ static const struct st_bits_data *pb_edit;
 
 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];
+	short mask = pb_edit->mask;
+	short ch_type = spk_chartab[ch];
 	if (type != KT_LATIN || (ch_type & B_NUM) || ch < SPACE)
 		return -1;
 	if (ch == SPACE) {
@@ -1309,7 +1344,9 @@ void speakup_deallocate(struct vc_data *vc)
 }
 
 static u_char is_cursor;
-static u_long old_cursor_pos, old_cursor_x, old_cursor_y;
+static u_long old_cursor_pos;
+	static u_long old_cursor_x;
+	static u_long old_cursor_y;
 static int cursor_con;
 
 static void reset_highlight_buffers(struct vc_data *);
@@ -1377,7 +1414,10 @@ static void start_read_all_timer(struct vc_data *vc, int command)
 
 static void handle_cursor_read_all(struct vc_data *vc, int command)
 {
-	int indcount, sentcount, rv, sn;
+	int indcount;
+	int sentcount;
+	int rv;
+	int sn;
 
 	switch (command) {
 	case RA_NEXT_SENT:
@@ -1499,7 +1539,9 @@ static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag)
 
 static void update_color_buffer(struct vc_data *vc, const char *ic, int len)
 {
-	int i, bi, hi;
+	int i;
+	int bi;
+	int hi;
 	int vc_num = vc->vc_num;
 
 	bi = ((vc->vc_attr & 0x70) >> 4);
@@ -1538,7 +1580,8 @@ static void reset_highlight_buffers(struct vc_data *vc)
 
 static int count_highlight_color(struct vc_data *vc)
 {
-	int i, bg;
+	int i;
+	int bg;
 	int cc;
 	int vc_num = vc->vc_num;
 	u16 ch;
@@ -1567,8 +1610,10 @@ static int count_highlight_color(struct vc_data *vc)
 
 static int get_highlight_color(struct vc_data *vc)
 {
-	int i, j;
-	unsigned int cptr[8], tmp;
+	int i;
+	int j;
+	unsigned int cptr[8];
+	unsigned int tmp;
 	int vc_num = vc->vc_num;
 
 	for (i = 0; i < 8; i++)
@@ -1592,7 +1637,8 @@ static int get_highlight_color(struct vc_data *vc)
 
 static int speak_highlight(struct vc_data *vc)
 {
-	int hc, d;
+	int hc;
+	int d;
 	int vc_num = vc->vc_num;
 	if (count_highlight_color(vc) == 1)
 		return 0;
@@ -1856,7 +1902,8 @@ static int handle_goto(struct vc_data *vc, u_char type, u_char ch, u_short key)
 {
 	static u_char goto_buf[8];
 	static int num;
-	int maxlen, go_pos;
+	int maxlen;
+	int go_pos;
 	char *cp;
 	if (type == KT_SPKUP && ch == SPEAKUP_GOTO)
 		goto do_goto;
@@ -1953,7 +2000,8 @@ static void do_nothing(struct vc_data *vc)
 	return;			/* flush done in do_spkup */
 }
 
-static u_char key_speakup, spk_key_locked;
+static u_char key_speakup;
+	static u_char spk_key_locked;
 
 static void speakup_lock(struct vc_data *vc)
 {
@@ -2009,8 +2057,11 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
 	unsigned long flags;
 	int kh;
 	u_char *key_info;
-	u_char type = KTYP(keysym), value = KVAL(keysym), new_key = 0;
-	u_char shift_info, offset;
+	u_char type = KTYP(keysym);
+	u_char value = KVAL(keysym);
+	u_char new_key = 0;
+	u_char shift_info;
+	u_char offset;
 	int ret = 0;
 	if (synth == NULL)
 		return 0;
-- 
1.7.10.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux