blob: eba85a95fcef624517651f573eed94709d6562d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
$NetBSD: patch-src_keyboard_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
- don't mix signed and unsigned char pointers
- silence initialization warning seen with gcc 4.1
--- src/keyboard.c~ 2012-05-10 19:25:36.000000000 +0000
+++ src/keyboard.c
@@ -393,16 +393,19 @@ KEYENT *node;
* fn - Resulting keycode
*/
#if PROTO
-int PASCAL NEAR addkey(unsigned char * seq, int fn)
+int PASCAL NEAR addkey(char * seq, int fn)
#else
int PASCAL NEAR addkey( seq, fn)
-unsigned char * seq;
+char * seq;
int fn;
#endif
{
int first;
KEYENT *cur, *nxtcur;
+ /* required by gcc 4.1 */
+ cur = NULL;
+
/* Skip on null sequences or single character sequences. */
if (seq == NULL || strlen(seq) < 2)
return FALSE;
@@ -419,7 +422,7 @@ int fn;
while (*seq) {
/* Do we match current character */
- if (*seq == cur->ch) {
+ if ((unsigned char)*seq == cur->ch) {
/* Advance to next level */
seq++;
@@ -447,7 +450,7 @@ int fn;
/* If first character in sequence is inserted, add to prefix table */
if (first)
- keyseq[*seq] = 1;
+ keyseq[(unsigned char)*seq] = 1;
/* If characters are left over, insert them into list */
for (first = 1; *seq; first = 0) {
|