Cleanup the warnings.
authorSteven Edwards <winehacker@gmail.com>
Sun, 7 Nov 2004 03:22:50 +0000 (03:22 +0000)
committerSteven Edwards <winehacker@gmail.com>
Sun, 7 Nov 2004 03:22:50 +0000 (03:22 +0000)
Patch by Vandread this closes bug 306.

svn path=/trunk/; revision=11569

rosapps/net/telnet/src/tcharmap.cpp
rosapps/net/telnet/src/tcharmap.h

index 37d9e6b..bafe62e 100644 (file)
@@ -183,14 +183,14 @@ TCharmap::TCharmap() {
        memset(map, 0, sizeof(map));
 
        map[0] = mapB;                          // default map
-       map['B'] = mapB;
-       map['A'] = mapA;
+       map[(unsigned char)'B'] = mapB;
+       map[(unsigned char)'A'] = mapA;
        if(ini.get_fast_write()) {
-               map['0'] = map0_safe;
-               map['2'] = map0_safe;
+               map[(unsigned char)'0'] = map0_safe;
+               map[(unsigned char)'2'] = map0_safe;
        } else {
-               map['0'] = map0;
-               map['2'] = map0;
+               map[(unsigned char)'0'] = map0;
+               map[(unsigned char)'2'] = map0;
        }
        current_map = map[0];
 }
@@ -212,9 +212,9 @@ TCharmap::~TCharmap() {
 }
 
 void TCharmap::modmap(char pos, char mapchar, char c) {
-       if(!map[mapchar]) {
-               map[mapchar] = new char[256];
-               for(int j = 0; j < 256; j++) map[mapchar][pos] = j;
+       if(!map[(unsigned char)mapchar]) {
+               map[(unsigned char)mapchar] = new char[256];
+               for(int j = 0; j < 256; j++) map[(unsigned char)mapchar][(unsigned char)pos] = j;
        }
-       map[mapchar][pos] = c;
+       map[(unsigned char)mapchar][(unsigned char)pos] = c;
 }
index 0ad8b45..cbc97e3 100644 (file)
@@ -15,7 +15,7 @@ public:
        void init() {}
 
        char translate(char c, char mapchar) {
-               if(map[mapchar]) return map[mapchar][(unsigned char)c];
+               if(map[(unsigned char)mapchar]) return map[(unsigned char)mapchar][(unsigned char)c];
                return c;
        }
        char translate(char c) {
@@ -23,7 +23,7 @@ public:
        }
 
        void setmap(char mapchar) {
-               if(map[mapchar]) current_map = map[mapchar];
+               if(map[(unsigned char)mapchar]) current_map = map[(unsigned char)mapchar];
        }
 
        void translate_buffer(char *start, char *end) {