Differences From Artifact [40bc42d9ab]:
- File src/encodings/common.h — part of check-in [6bf2b02dc4] at 2017-02-12 20:05:03 on branch trunk — More efficient UTF-8 -> ISO-8859-15 conversion (user: js, size: 1663) [annotate] [blame] [check-ins using]
To Artifact [8b3b315d4d]:
- File
src/encodings/common.h
— part of check-in
[405d11522e]
at
2017-02-12 23:56:13
on branch trunk
— encodings: Make the page tables unsigned char[]
This also removes page.*Size, as the macros can just use sizeof() on the
arrays. (user: js, size: 1686) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 | if OF_UNLIKELY ((c & 0xFF) < page##nr##Start) { \ output[i] = (unsigned char)c; \ continue; \ } \ \ index = (c & 0xFF) - page##nr##Start; \ \ | | | | | | | | | | | | | | | | | | | | | | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | if OF_UNLIKELY ((c & 0xFF) < page##nr##Start) { \ output[i] = (unsigned char)c; \ continue; \ } \ \ index = (c & 0xFF) - page##nr##Start; \ \ if (index >= sizeof(page##nr)) { \ output[i] = (unsigned char)c; \ continue; \ } \ \ if (page##nr[index] == 0x00) { \ if (lossy) { \ output[i] = '?'; \ continue; \ } else \ return false; \ } \ \ output[i] = page##nr[index]; \ break; #define CASE_MISSING_IS_ERROR(nr) \ case 0x##nr: \ if OF_UNLIKELY ((c & 0xFF) < page##nr##Start) { \ if (lossy) { \ output[i] = '?'; \ continue; \ } else \ return false; \ } \ \ index = (c & 0xFF) - page##nr##Start; \ \ if (index >= sizeof(page##nr) || page##nr[index] == 0) { \ if (lossy) { \ output[i] = '?'; \ continue; \ } else \ return false; \ } \ \ output[i] = page##nr[index]; \ break; |