summaryrefslogtreecommitdiff
path: root/include/private/apr_encode_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/private/apr_encode_private.h')
-rw-r--r--include/private/apr_encode_private.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/include/private/apr_encode_private.h b/include/private/apr_encode_private.h
index 8db2e0166..93ce0a02d 100644
--- a/include/private/apr_encode_private.h
+++ b/include/private/apr_encode_private.h
@@ -34,7 +34,8 @@ extern "C" {
*/
#if APR_CHARSET_EBCDIC
- static int convert_a2e[256] = {
+
+static unsigned char convert_a2e[256] = {
0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x3C, 0x3D, 0x32, 0x26, 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,
0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D, 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
@@ -52,7 +53,7 @@ extern "C" {
0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9C, 0x48, 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57,
0x8C, 0x49, 0xCD, 0xCE, 0xCB, 0xCF, 0xCC, 0xE1, 0x70, 0xDD, 0xDE, 0xDB, 0xDC, 0x8D, 0x8E, 0xDF};
- static int convert_e2a[256] = {
+static unsigned char convert_e2a[256] = {
0x00, 0x01, 0x02, 0x03, 0x9C, 0x09, 0x86, 0x7F, 0x97, 0x8D, 0x8E, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x9D, 0x0A, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8F, 0x1C, 0x1D, 0x1E, 0x1F,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x17, 0x1B, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x05, 0x06, 0x07,
@@ -69,12 +70,16 @@ extern "C" {
0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0xB9, 0xFB, 0xFC, 0xF9, 0xFA, 0xFF,
0x5C, 0xF7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0xB2, 0xD4, 0xD6, 0xD2, 0xD3, 0xD5,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xB3, 0xDB, 0xDC, 0xD9, 0xDA, 0x9F};
-#define decode ENCODE_TO_ASCII(ch) convert_e2a[(unsigned char)ch]
-#define decode ENCODE_TO_NATIVE(ch) convert_a2e[(unsigned char)ch]
-#else /* APR_CHARSET_EBCDIC */
-#define ENCODE_TO_ASCII(ch) (ch)
-#define ENCODE_TO_NATIVE(ch) (ch)
-#endif /* !APR_CHARSET_EBCDIC */
+
+#define TO_ASCII(ch) (convert_e2a[(unsigned char)(ch)])
+#define TO_NATIVE(ch) (convert_a2e[(unsigned char)(ch)])
+
+#else /* APR_CHARSET_EBCDIC */
+
+#define TO_ASCII(ch) ((unsigned char)(ch))
+#define TO_NATIVE(ch) ((unsigned char)(ch))
+
+#endif /* !APR_CHARSET_EBCDIC */
/** @} */
#ifdef __cplusplus