1 --- src/hunspell/hashmgr.cxx
2 +++ src/hunspell/hashmgr.cxx
5 int HashMgr::hash(const char * word) const
8 + unsigned long hv = 0;
9 for (int i=0; i < 4 && *word != 0; i++)
10 hv = (hv << 8) | (*word++);
12 --- src/hunspell/csutil.cxx
13 +++ src/hunspell/csutil.cxx
15 case 0xd0: { // 2-byte UTF-8 codes
16 if ((*(u8+1) & 0xc0) == 0x80) {
17 u2->h = (*u8 & 0x1f) >> 2;
18 - u2->l = (*u8 << 6) + (*(u8+1) & 0x3f);
19 + u2->l = (*reinterpret_cast<unsigned char const *>(u8) << 6) + (*(u8+1) & 0x3f);
22 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);
25 case 0xe0: { // 3-byte UTF-8 codes
26 if ((*(u8+1) & 0xc0) == 0x80) {
27 - u2->h = ((*u8 & 0x0f) << 4) + ((*(u8+1) & 0x3f) >> 2);
28 + u2->h = ((*reinterpret_cast<unsigned char const *>(u8) & 0x0f) << 4) + ((*(u8+1) & 0x3f) >> 2);
30 if ((*(u8+1) & 0xc0) == 0x80) {
31 - u2->l = (*u8 << 6) + (*(u8+1) & 0x3f);
32 + u2->l = (*reinterpret_cast<unsigned char const *>(u8) << 6) + (*(u8+1) & 0x3f);
35 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);