diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-04-15 08:07:11 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-04-15 08:07:11 +0000 |
commit | b8c51212db9104873fc5eceb853ae0a630299059 (patch) | |
tree | f1135b4ebf2b3c006615ca43101b621a40273909 /source3/lib | |
parent | 88460f2f6932241b103110075ddc52109159b59f (diff) | |
download | samba-b8c51212db9104873fc5eceb853ae0a630299059.tar.gz samba-b8c51212db9104873fc5eceb853ae0a630299059.tar.bz2 samba-b8c51212db9104873fc5eceb853ae0a630299059.zip |
use macros for table boundaries
(This used to be commit a82a5acff2ad2120f5480f0cb08550e95d80c59e)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_unistr.c | 15 |
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; } |