Commit bf4f1211 authored by Igor Druzhinin's avatar Igor Druzhinin Committed by Steve French

cifs: correction of unicode header files

This patch corrects a problem of compilation errors at removal of
UNIUPR_NOLOWER definition and adds include guards to cifs_unicode.h.
Signed-off-by: default avatarIgor Druzhinin <jaxbrigs@gmail.com>
Acked-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent fc87a406
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
* This is a compressed table of upper and lower case conversion. * This is a compressed table of upper and lower case conversion.
* *
*/ */
#ifndef _CIFS_UNICODE_H
#define _CIFS_UNICODE_H
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -67,8 +69,8 @@ extern const struct UniCaseRange CifsUniUpperRange[]; ...@@ -67,8 +69,8 @@ extern const struct UniCaseRange CifsUniUpperRange[];
#endif /* UNIUPR_NOUPPER */ #endif /* UNIUPR_NOUPPER */
#ifndef UNIUPR_NOLOWER #ifndef UNIUPR_NOLOWER
extern signed char UniLowerTable[512]; extern signed char CifsUniLowerTable[512];
extern struct UniCaseRange UniLowerRange[]; extern const struct UniCaseRange CifsUniLowerRange[];
#endif /* UNIUPR_NOLOWER */ #endif /* UNIUPR_NOLOWER */
#ifdef __KERNEL__ #ifdef __KERNEL__
...@@ -337,15 +339,15 @@ UniStrupr(register wchar_t *upin) ...@@ -337,15 +339,15 @@ UniStrupr(register wchar_t *upin)
* UniTolower: Convert a unicode character to lower case * UniTolower: Convert a unicode character to lower case
*/ */
static inline wchar_t static inline wchar_t
UniTolower(wchar_t uc) UniTolower(register wchar_t uc)
{ {
register struct UniCaseRange *rp; register const struct UniCaseRange *rp;
if (uc < sizeof(UniLowerTable)) { if (uc < sizeof(CifsUniLowerTable)) {
/* Latin characters */ /* Latin characters */
return uc + UniLowerTable[uc]; /* Use base tables */ return uc + CifsUniLowerTable[uc]; /* Use base tables */
} else { } else {
rp = UniLowerRange; /* Use range tables */ rp = CifsUniLowerRange; /* Use range tables */
while (rp->start) { while (rp->start) {
if (uc < rp->start) /* Before start of range */ if (uc < rp->start) /* Before start of range */
return uc; /* Uppercase = input */ return uc; /* Uppercase = input */
...@@ -374,3 +376,5 @@ UniStrlwr(register wchar_t *upin) ...@@ -374,3 +376,5 @@ UniStrlwr(register wchar_t *upin)
} }
#endif #endif
#endif /* _CIFS_UNICODE_H */
...@@ -140,7 +140,7 @@ const struct UniCaseRange CifsUniUpperRange[] = { ...@@ -140,7 +140,7 @@ const struct UniCaseRange CifsUniUpperRange[] = {
/* /*
* Latin lower case * Latin lower case
*/ */
static signed char CifsUniLowerTable[512] = { signed char CifsUniLowerTable[512] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 000-00f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 000-00f */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 010-01f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 010-01f */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 020-02f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 020-02f */
...@@ -242,12 +242,12 @@ static signed char UniCaseRangeLff20[27] = { ...@@ -242,12 +242,12 @@ static signed char UniCaseRangeLff20[27] = {
/* /*
* Lower Case Range * Lower Case Range
*/ */
static const struct UniCaseRange CifsUniLowerRange[] = { const struct UniCaseRange CifsUniLowerRange[] = {
0x0380, 0x03ab, UniCaseRangeL0380, {0x0380, 0x03ab, UniCaseRangeL0380},
0x0400, 0x042f, UniCaseRangeL0400, {0x0400, 0x042f, UniCaseRangeL0400},
0x0490, 0x04cb, UniCaseRangeL0490, {0x0490, 0x04cb, UniCaseRangeL0490},
0x1e00, 0x1ff7, UniCaseRangeL1e00, {0x1e00, 0x1ff7, UniCaseRangeL1e00},
0xff20, 0xff3a, UniCaseRangeLff20, {0xff20, 0xff3a, UniCaseRangeLff20},
0, 0, 0 {0}
}; };
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment