diff --git a/include/support.h b/include/support.h index 5127d15d..0fab9b27 100644 --- a/include/support.h +++ b/include/support.h @@ -51,12 +51,12 @@ Bits ConvDecWord(char * word); Bits ConvHexWord(char * word); INLINE char * upcase(char * str) { - for (char* idx = str; *idx ; idx++) *idx = toupper(*idx); + for (char* idx = str; *idx ; idx++) *idx = toupper(*reinterpret_cast(idx)); return str; } INLINE char * lowcase(char * str) { - for(char* idx = str; *idx ; idx++) *idx = tolower(*idx); + for(char* idx = str; *idx ; idx++) *idx = tolower(*reinterpret_cast(idx)); return str; } diff --git a/src/misc/support.cpp b/src/misc/support.cpp index e544d882..993477b7 100644 --- a/src/misc/support.cpp +++ b/src/misc/support.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: support.cpp,v 1.25 2004-08-04 09:12:56 qbix79 Exp $ */ +/* $Id: support.cpp,v 1.26 2004-10-17 14:54:41 qbix79 Exp $ */ #include #include @@ -48,14 +48,14 @@ void strreplace(char * str,char o,char n) { } } char *ltrim(char *str) { - while (*str && (*str==' ' || *str=='\t')) str++; + while (*str && isspace(*reinterpret_cast(str))) str++; return str; } char *rtrim(char *str) { char *p; p = strchr(str, '\0'); - while (--p >= str && isspace(*p)); + while (--p >= str && isspace(*reinterpret_cast(p))); p[1] = '\0'; return str; } @@ -84,7 +84,7 @@ bool ScanCMDBool(char * cmd,char * check) { char * ScanCMDRemain(char * cmd) { char * scan,*found;; if ((scan=found=strchr(cmd,'/'))) { - while (*scan!=' ' && *scan!='\t' && *scan!=0) scan++; + while (*scan && isspace(*reinterpret_cast(scan))!=0) scan++; *scan=0; return found; } else return 0; @@ -104,7 +104,7 @@ char * StripWord(char *&line) { } char * begin=scan; for (;char c=*scan;scan++) { - if (c==' ' || c=='\t') { + if (isspace(*reinterpret_cast(&c))) { *scan++=0; break; } @@ -130,7 +130,7 @@ Bits ConvDecWord(char * word) { Bits ConvHexWord(char * word) { Bitu ret=0; - while (char c=toupper(*word)) { + while (char c=toupper(*reinterpret_cast(word))) { ret*=16; if (c>='0' && c<='9') ret+=c-'0'; else if (c>='A' && c<='F') ret+=10+(c-'A');