diff options
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/goo/GString.cc')
-rw-r--r-- | Build/source/libs/xpdf/xpdf-src/goo/GString.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/goo/GString.cc b/Build/source/libs/xpdf/xpdf-src/goo/GString.cc index adf7739c9aa..b56ed58ba16 100644 --- a/Build/source/libs/xpdf/xpdf-src/goo/GString.cc +++ b/Build/source/libs/xpdf/xpdf-src/goo/GString.cc @@ -21,6 +21,7 @@ #include <math.h> #include <limits.h> #include "gmem.h" +#include "gmempp.h" #include "GString.h" //------------------------------------------------------------------------ @@ -755,8 +756,9 @@ GString *GString::upperCase() { int i; for (i = 0; i < length; ++i) { - if (islower(s[i])) - s[i] = toupper(s[i]); + if (islower(s[i] & 0xff)) { + s[i] = toupper(s[i] & 0xff); + } } return this; } @@ -765,8 +767,9 @@ GString *GString::lowerCase() { int i; for (i = 0; i < length; ++i) { - if (isupper(s[i])) - s[i] = tolower(s[i]); + if (isupper(s[i] & 0xff)) { + s[i] = tolower(s[i] & 0xff); + } } return this; } @@ -778,7 +781,7 @@ int GString::cmp(GString *str) { n1 = length; n2 = str->length; for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) { - x = *p1 - *p2; + x = (*p1 & 0xff) - (*p2 & 0xff); if (x != 0) { return x; } @@ -795,7 +798,7 @@ int GString::cmpN(GString *str, int n) { for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2 && i < n; ++i, ++p1, ++p2) { - x = *p1 - *p2; + x = (*p1 & 0xff) - (*p2 & 0xff); if (x != 0) { return x; } @@ -812,7 +815,7 @@ int GString::cmp(const char *sA) { n1 = length; for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) { - x = *p1 - *p2; + x = (*p1 & 0xff) - (*p2 & 0xff); if (x != 0) { return x; } @@ -832,7 +835,7 @@ int GString::cmpN(const char *sA, int n) { n1 = length; for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) { - x = *p1 - *p2; + x = (*p1 & 0xff) - (*p2 & 0xff); if (x != 0) { return x; } |