Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: third_party/hunspell/google.patch

Issue 2263263003: hunspell: Changed signed char* to unsigned char* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unformatting Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/hunspell/src/hunspell/csutil.cxx » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/hunspell/google.patch
diff --git a/third_party/hunspell/google.patch b/third_party/hunspell/google.patch
index 0134ce144b949ab92435d602a46353d4ebc90907..47d561dd4c123999fcc745b8bfb6fd290232567f 100644
--- a/third_party/hunspell/google.patch
+++ b/third_party/hunspell/google.patch
@@ -1352,3 +1352,53 @@ diff -u -r1.5 suggestmgr.hxx
int testsug(char** wlst, const char * candidate, int wl, int ns, int cpdsuggest,
int * timer, clock_t * timelimit);
int checkword(const char *, int, int, int *, clock_t *);
+diff --git a/third_party/hunspell/src/hunspell/csutil.cxx b/third_party/hunspell/src/hunspell/csutil.cxx
+index 2be9027..0f2267f 100644
+--- a/third_party/hunspell/src/hunspell/csutil.cxx
++++ b/third_party/hunspell/src/hunspell/csutil.cxx
+@@ -96,10 +96,10 @@ char * u16_u8(char * dest, int size, const w_char * src, int srclen) {
+
+ /* only UTF-16 (BMP) implementation */
+ int u8_u16(w_char * dest, int size, const char * src) {
+- const signed char * u8 = (const signed char *)src;
++ const unsigned char * u8 = (const unsigned char*)src;
+ w_char * u2 = dest;
+ w_char * u2_max = u2 + size;
+-
++
+ while ((u2 < u2_max) && *u8) {
+ switch ((*u8) & 0xf0) {
+ case 0x00:
+@@ -118,7 +118,7 @@ int u8_u16(w_char * dest, int size, const char * src) {
+ case 0x90:
+ case 0xa0:
+ case 0xb0: {
+- HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Unexpected continuation bytes in %ld. character position\n%s\n", static_cast<long>(u8 - (signed char *)src), src);
++ HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Unexpected continuation bytes in %ld. character position\n%s\n", static_cast<long>(u8 - (const unsigned char*)src), src);
+ u2->h = 0xff;
+ u2->l = 0xfd;
+ break;
+@@ -130,7 +130,7 @@ int u8_u16(w_char * dest, int size, const char * src) {
+ u2->l = (*u8 << 6) + (*(u8+1) & 0x3f);
+ u8++;
+ } else {
+- HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast<long>(u8 - (signed char *)src), src);
++ HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast<long>(u8 - (const unsigned char*)src), src);
+ u2->h = 0xff;
+ u2->l = 0xfd;
+ }
+@@ -144,12 +144,12 @@ int u8_u16(w_char * dest, int size, const char * src) {
+ u2->l = (*u8 << 6) + (*(u8+1) & 0x3f);
+ u8++;
+ } else {
+- HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast<long>(u8 - (signed char *)src), src);
++ HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast<long>(u8 - (const unsigned char*)src), src);
+ u2->h = 0xff;
+ u2->l = 0xfd;
+ }
+ } else {
+- HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast<long>(u8 - (signed char *)src), src);
++ HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast<long>(u8 - (const unsigned char*)src), src);
+ u2->h = 0xff;
+ u2->l = 0xfd;
+ }
« no previous file with comments | « no previous file | third_party/hunspell/src/hunspell/csutil.cxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698