summaryrefslogtreecommitdiff
path: root/devel/tvision/files/patch-uchar
blob: 64cbc8a26e7f851143e51e1a305a6555f6473a80 (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Avoid possible problems with signed/unsigned char comparisons. And
functions like toupper must be called with an unsigned char.


diff -ur tvision-0.8-orig/lib/TButton.cc lib/TButton.cc
--- tvision-0.8-orig/lib/TButton.cc	Thu Jul 26 09:59:19 2001
+++ lib/TButton.cc	Wed Jul 28 20:44:03 2004
@@ -202,7 +202,7 @@
             if( event.keyDown.keyCode == getAltCode(c) ||
                 ( owner->phase == phPostProcess &&
                   c != 0 &&
-                  toupper(event.keyDown.charScan.charCode) == c
+                  toupper(event.keyDown.charScan.charCode) == (uchar)c
                 ) ||
                 ( (state & sfFocused) != 0 &&
                   event.keyDown.charScan.charCode == ' '
diff -ur tvision-0.8-orig/lib/TCluster.cc lib/TCluster.cc
--- tvision-0.8-orig/lib/TCluster.cc	Thu Jul 26 09:59:19 2001
+++ lib/TCluster.cc	Wed Jul 28 20:44:16 2004
@@ -271,7 +271,7 @@
                             (state & sfFocused) != 0
                           ) &&
                           c != 0 &&
-                          toupper(event.keyDown.charScan.charCode) == c
+                          toupper(event.keyDown.charScan.charCode) == (uchar)c
                         )
                       )
                         {
diff -ur tvision-0.8-orig/lib/TFileList.cc lib/TFileList.cc
--- tvision-0.8-orig/lib/TFileList.cc	Wed Jul 28 18:52:17 2004
+++ lib/TFileList.cc	Wed Jul 28 20:45:21 2004
@@ -80,7 +80,7 @@
 
     /* SS: changed */
 
-    for (char *p = sR.name; *p != '\0'; p++) *p = toupper(*p);
+    for (unsigned char *p = (unsigned char *)sR.name; *p != '\0'; p++) *p = toupper(*p);
     return &sR;
 }
 
diff -ur tvision-0.8-orig/lib/TInputLine.cc lib/TInputLine.cc
--- tvision-0.8-orig/lib/TInputLine.cc	Thu Jul 26 09:59:20 2001
+++ lib/TInputLine.cc	Wed Jul 28 20:45:56 2004
@@ -29,7 +29,7 @@
     char *p;
 
     if( (p = strchr( (char *) s, '~' )) != 0 )
-        return toupper(p[1]);
+        return toupper((uchar)(p[1]));
     else
         return 0;
 }
diff -ur tvision-0.8-orig/lib/TLabel.cc lib/TLabel.cc
--- tvision-0.8-orig/lib/TLabel.cc	Thu Jul 26 09:59:20 2001
+++ lib/TLabel.cc	Wed Jul 28 20:46:18 2004
@@ -86,7 +86,7 @@
         char c = hotKey( text );
         if( getAltCode(c) == event.keyDown.keyCode ||
                 ( c != 0 && owner->phase == TGroup::phPostProcess &&
-                toupper(event.keyDown.charScan.charCode) ==  c )
+                toupper(event.keyDown.charScan.charCode) ==  (uchar)c )
           )
 	    focusLink(event);
         }
diff -ur tvision-0.8-orig/lib/TMenuView.cc lib/TMenuView.cc
--- tvision-0.8-orig/lib/TMenuView.cc	Wed Jul 28 18:52:17 2004
+++ lib/TMenuView.cc	Wed Jul 28 20:47:15 2004
@@ -339,14 +339,14 @@
 
 TMenuItem *TMenuView::findItem( char ch )
 {
-    ch = toupper(ch);
+    ch = toupper((uchar)ch);
     TMenuItem *p = menu->items;
     while( p != 0 )
         {
         if( p->name != 0 && !p->disabled )
             {
             char *loc = strchr( (char *) p->name, '~' );
-            if( loc != 0 && (uchar)ch == toupper( loc[1] ) )
+            if( loc != 0 && (uchar)ch == toupper( (uchar)(loc[1]) ) )
                 return p;
             }
         p =  p->next;
diff -ur tvision-0.8-orig/lib/TValidator.cc lib/TValidator.cc
--- tvision-0.8-orig/lib/TValidator.cc	Thu Jul 26 09:59:22 2001
+++ lib/TValidator.cc	Wed Jul 28 20:49:31 2004
@@ -388,10 +388,10 @@
         if (! isLetter(ch))
             return prError;
                 else 
-            consume(toupper(ch), input);
+            consume(toupper((uchar)ch), input);
         break;
         case  '!': 
-        consume(toupper(ch), input);
+        consume(toupper((uchar)ch), input);
         break;
         case  '@':
         consume(ch, input);
@@ -427,7 +427,7 @@
 
           if (pic[index] == ';')
           index++;
-          if (toupper(pic[index]) != toupper(ch))
+          if (toupper((uchar)(pic[index])) != toupper((uchar)ch))
 #ifndef __UNPATCHED
 	if (ch != ' ')
 	    return rScan;
diff -ur tvision-0.8-orig/lib/asm.cc lib/asm.cc
--- tvision-0.8-orig/lib/asm.cc	Wed Jul 28 18:52:18 2004
+++ lib/asm.cc	Wed Jul 28 20:51:59 2004
@@ -137,8 +137,8 @@
   long	patternHash	= 0;
   long	testHash	= 0;
 
-  register const char*  testP= (const char*)block;
-  register const char*  patP = str;
+  register const unsigned char*  testP= (const unsigned char*)block;
+  register const unsigned char*  patP = (const unsigned char*)str;
   register long   x = 1;
   int             i = patternLength-1;
   while(i--) x =  (x<<5)%q;
@@ -148,13 +148,13 @@
     testHash    = ( (testHash   <<5) + toupper(*testP++) ) % q;
   }
 
-  testP = (const char*)block;
-  const char* end = testP + testLength - patternLength;
+  testP = (const unsigned char*)block;
+  const unsigned char* end = testP + testLength - patternLength;
 
   while (1) {
 
      if(testHash == patternHash)
-	 return testP-(const char*)block;
+	 return testP-(const unsigned char*)block;
 
      if (testP >= end) break;
 
diff -ur tvision-0.8-orig/lib/tvtext.cc lib/tvtext.cc
--- tvision-0.8-orig/lib/tvtext.cc	Thu Jul 26 09:59:22 2001
+++ lib/tvtext.cc	Wed Jul 28 20:40:13 2004
@@ -64,7 +64,7 @@
             return '\xF0';      // special case to handle alt-Space
 
         else if( tmp >= 0x10 && tmp <= 0x32 )
-            return altCodes1[tmp-0x10];     // alt-letter
+            return altCodes1[tmp - 0x10];     // alt-letter
 
         else if( tmp >= 0x78 && tmp <= 0x83 )
             return altCodes2[tmp - 0x78];   // alt-number
@@ -78,7 +78,7 @@
     if( c == 0 )
         return 0;
 
-    c = toupper(c);
+    c = toupper((unsigned char) c);
 
     /* SS: this makes g++ happy */