mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* 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
This commit is contained in:
		
							parent
							
								
									93c1109c19
								
							
						
					
					
						commit
						c5682ac490
					
				
					 2 changed files with 13 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,7 @@
 | 
			
		|||
Wed Jul 13 14:15:22 2016  Martin Duerst  <duerst@it.aoyama.ac.jp>
 | 
			
		||||
 | 
			
		||||
	* enc/windows_1254.c: Adjust variable/macro names.
 | 
			
		||||
 | 
			
		||||
Wed Jul 13 13:19:12 2016  Martin Duerst  <duerst@it.aoyama.ac.jp>
 | 
			
		||||
 | 
			
		||||
	* 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  <duerst@it.aoyama.ac.jp>
 | 
			
		|||
 | 
			
		||||
Sun Jul 10 19:33:47 2016  Martin Duerst  <duerst@it.aoyama.ac.jp>
 | 
			
		||||
 | 
			
		||||
	* 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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue