From c5682ac4904e5a98d8121e88c8e48426b422666c Mon Sep 17 00:00:00 2001 From: duerst Date: Wed, 13 Jul 2016 05:15:28 +0000 Subject: * enc/windows_1254.c: Adjust variable/macro names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 +++++- enc/windows_1254.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c61a0699b..e60a717480 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Jul 13 14:15:22 2016 Martin Duerst + + * enc/windows_1254.c: Adjust variable/macro names. + Wed Jul 13 13:19:12 2016 Martin Duerst * enc/iso_8859_9.c, enc/windows_1254.c: Split Windows-1254 from @@ -73,7 +77,7 @@ Sun Jul 10 19:53:41 2016 Martin Duerst Sun Jul 10 19:33:47 2016 Martin Duerst - * test/ruby/enc/test_case_comprehensive.rb: Changed testing logic in to + * test/ruby/enc/test_case_comprehensive.rb: Changed testing logic to catch unintended modifications of characters that do not have a case equivalent in the respective encoding. * enc/iso_8859_1.c, enc/iso_8859_15.c: Fixed unintended modifications of diff --git a/enc/windows_1254.c b/enc/windows_1254.c index d2f5c36ecf..ca9231f0a5 100644 --- a/enc/windows_1254.c +++ b/enc/windows_1254.c @@ -38,11 +38,11 @@ #include "regenc.h" #include "iso_8859.h" -#define ENC_ISO_8859_9_TO_LOWER_CASE(c) EncISO_8859_9_ToLowerCaseTable[c] -#define ENC_IS_ISO_8859_9_CTYPE(code,ctype) \ - ((EncISO_8859_9_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) +#define ENC_CP1254_TO_LOWER_CASE(c) EncCP1254_ToLowerCaseTable[c] +#define ENC_IS_CP1254_CTYPE(code,ctype) \ + ((EncCP1254_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) -static const UChar EncISO_8859_9_ToLowerCaseTable[256] = { +static const UChar EncCP1254_ToLowerCaseTable[256] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', @@ -77,7 +77,7 @@ static const UChar EncISO_8859_9_ToLowerCaseTable[256] = { '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' }; -static const unsigned short EncISO_8859_9_CtypeTable[256] = { +static const unsigned short EncCP1254_CtypeTable[256] = { 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, @@ -126,7 +126,7 @@ mbc_case_fold(OnigCaseFoldType flag, return 2; } - *lower = ENC_ISO_8859_9_TO_LOWER_CASE(*p); + *lower = ENC_CP1254_TO_LOWER_CASE(*p); (*pp)++; return 1; } @@ -144,7 +144,7 @@ is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) } (*pp)++; - v = (EncISO_8859_9_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); + v = (EncCP1254_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); if ((v | BIT_CTYPE_LOWER) != 0) { /* 0xdf etc.. are lower case letter, but can't convert. */ if (*p >= 0xaa && *p <= 0xba) @@ -161,7 +161,7 @@ static int is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED) { if (code < 256) - return ENC_IS_ISO_8859_9_CTYPE(code, ctype); + return ENC_IS_CP1254_CTYPE(code, ctype); else return FALSE; } -- cgit v1.2.3