From patchwork Thu Aug 19 20:27:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Druzhinin X-Patchwork-Id: 120397 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7JKQPuj006102 for ; Thu, 19 Aug 2010 20:27:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338Ab0HSU1a (ORCPT ); Thu, 19 Aug 2010 16:27:30 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:61872 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265Ab0HSU1a (ORCPT ); Thu, 19 Aug 2010 16:27:30 -0400 Received: by ewy23 with SMTP id 23so1640132ewy.19 for ; Thu, 19 Aug 2010 13:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=gFYsC9OK4fzNYj+MHDYLC1eF7Fs7nu9Q9om5N/aVW3E=; b=XCBqFqcgeMuBI+lgr3wAoXUlEkUclgr7ZIVsM7Ll1jyum/m9vOq1JxrilgaiME/1/A C9T8bRpmHELzmWqiQkPZ94QLEh//bcpxOPq9bahr0CwCz7EcmJCN47z0nvIXsmj49agM u9EgWB79F3oE4vpksLPSTa8Z+CjB8d0Z+SCfc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=JEGJdUwUKT2QX9nCMIIYi12uFMM7j2iQRjbX07NmMeHYr3Kqy9M0ps9xOa7RXobHjk xGjg2xdEAsF0tUghpSae8u5NDFSqJawGWPYFUfMxa7EP3e7zdVYJHwga3FUbBmqjrWI2 qZvX1l5GYMo4zoCrzguopQORSAz2Y6zIxBIJM= Received: by 10.213.89.205 with SMTP id f13mr1193353ebm.52.1282249648967; Thu, 19 Aug 2010 13:27:28 -0700 (PDT) Received: from localhost.localdomain ([95.84.52.65]) by mx.google.com with ESMTPS id v8sm3312416eeh.14.2010.08.19.13.27.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 19 Aug 2010 13:27:28 -0700 (PDT) From: Igor Druzhinin To: jlayton@samba.org Cc: linux-cifs@vger.kernel.org, Igor Druzhinin Subject: [PATCH 1/2] cifs: correction of unicode header files Date: Fri, 20 Aug 2010 00:27:12 +0400 Message-Id: <1282249633-27756-1-git-send-email-jaxbrigs@gmail.com> X-Mailer: git-send-email 1.7.2.1 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 19 Aug 2010 20:28:08 +0000 (UTC) diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h index 6506382..7fe6b52 100644 --- a/fs/cifs/cifs_unicode.h +++ b/fs/cifs/cifs_unicode.h @@ -30,6 +30,8 @@ * This is a compressed table of upper and lower case conversion. * */ +#ifndef _CIFS_UNICODE_H +#define _CIFS_UNICODE_H #include #include @@ -67,8 +69,8 @@ extern const struct UniCaseRange CifsUniUpperRange[]; #endif /* UNIUPR_NOUPPER */ #ifndef UNIUPR_NOLOWER -extern signed char UniLowerTable[512]; -extern struct UniCaseRange UniLowerRange[]; +extern signed char CifsUniLowerTable[512]; +extern const struct UniCaseRange CifsUniLowerRange[]; #endif /* UNIUPR_NOLOWER */ #ifdef __KERNEL__ @@ -337,15 +339,15 @@ UniStrupr(register wchar_t *upin) * UniTolower: Convert a unicode character to lower case */ 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 */ - return uc + UniLowerTable[uc]; /* Use base tables */ + return uc + CifsUniLowerTable[uc]; /* Use base tables */ } else { - rp = UniLowerRange; /* Use range tables */ + rp = CifsUniLowerRange; /* Use range tables */ while (rp->start) { if (uc < rp->start) /* Before start of range */ return uc; /* Uppercase = input */ @@ -374,3 +376,5 @@ UniStrlwr(register wchar_t *upin) } #endif + +#endif /* _CIFS_UNICODE_H */ diff --git a/fs/cifs/cifs_uniupr.h b/fs/cifs/cifs_uniupr.h index 18a9d97..0ac7c5a 100644 --- a/fs/cifs/cifs_uniupr.h +++ b/fs/cifs/cifs_uniupr.h @@ -140,7 +140,7 @@ const struct UniCaseRange CifsUniUpperRange[] = { /* * 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, /* 010-01f */ 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] = { /* * Lower Case Range */ -static const struct UniCaseRange CifsUniLowerRange[] = { - 0x0380, 0x03ab, UniCaseRangeL0380, - 0x0400, 0x042f, UniCaseRangeL0400, - 0x0490, 0x04cb, UniCaseRangeL0490, - 0x1e00, 0x1ff7, UniCaseRangeL1e00, - 0xff20, 0xff3a, UniCaseRangeLff20, - 0, 0, 0 +const struct UniCaseRange CifsUniLowerRange[] = { + {0x0380, 0x03ab, UniCaseRangeL0380}, + {0x0400, 0x042f, UniCaseRangeL0400}, + {0x0490, 0x04cb, UniCaseRangeL0490}, + {0x1e00, 0x1ff7, UniCaseRangeL1e00}, + {0xff20, 0xff3a, UniCaseRangeLff20}, + {0} }; #endif