summaryrefslogtreecommitdiff
path: root/source3/lib/util_unistr.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util_unistr.c')
-rw-r--r--source3/lib/util_unistr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 3144e58b2a..0c88a0c7c7 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -1043,6 +1043,9 @@ typedef struct {
unsigned char flags;
} smb_unicode_table_t;
+#define TABLE1_BOUNDARY 9450
+#define TABLE2_BOUNDARY 64256
+
static smb_unicode_table_t map_table1[] = {
#include "unicode_map_table1.h"
};
@@ -1053,22 +1056,22 @@ static smb_unicode_table_t map_table2[] = {
static unsigned char map_table_flags(smb_ucs2_t v)
{
- if (v < 9450) return map_table1[v].flags;
- if (v >= 64256) return map_table2[v - 64256].flags;
+ if (v < TABLE1_BOUNDARY) return map_table1[v].flags;
+ if (v >= TABLE2_BOUNDARY) return map_table2[v - TABLE2_BOUNDARY].flags;
return 0;
}
static smb_ucs2_t map_table_lower(smb_ucs2_t v)
{
- if (v < 9450) return map_table1[v].lower;
- if (v >= 64256) return map_table2[v - 64256].lower;
+ if (v < TABLE1_BOUNDARY) return map_table1[v].lower;
+ if (v >= TABLE2_BOUNDARY) return map_table2[v - TABLE2_BOUNDARY].lower;
return v;
}
static smb_ucs2_t map_table_upper(smb_ucs2_t v)
{
- if (v < 9450) return map_table1[v].upper;
- if (v >= 64256) return map_table2[v - 64256].upper;
+ if (v < TABLE1_BOUNDARY) return map_table1[v].upper;
+ if (v >= TABLE2_BOUNDARY) return map_table2[v - TABLE2_BOUNDARY].upper;
return v;
}