[Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.100,2.101 unicodectype.c,2.9,2.10

Fredrik Lundh effbot@users.sourceforge.net
Wed, 27 Jun 2001 11:59:45 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv12059/Objects

Modified Files:
	unicodeobject.c unicodectype.c 
Log Message:


use Py_UNICODE_WIDE instead of USE_UCS4_STORAGE and Py_UNICODE_SIZE
tests.


Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.100
retrieving revision 2.101
diff -C2 -r2.100 -r2.101
*** unicodeobject.c	2001/06/27 06:28:56	2.100
--- unicodeobject.c	2001/06/27 18:59:43	2.101
***************
*** 107,111 ****
  PyUnicode_GetMax()
  {
! #ifdef USE_UCS4_STORAGE
  	return 0x10FFFF;
  #else
--- 107,111 ----
  PyUnicode_GetMax()
  {
! #ifdef Py_UNICODE_WIDE
  	return 0x10FFFF;
  #else
***************
*** 792,796 ****
  		goto utf8Error;
  	    }
! #if Py_UNICODE_SIZE == 4
  	    *p++ = (Py_UNICODE)ch;
  #else
--- 792,796 ----
  		goto utf8Error;
  	    }
! #ifdef Py_UNICODE_WIDE
  	    *p++ = (Py_UNICODE)ch;
  #else
***************
*** 1081,1085 ****
  #endif
  	    if (0xDC00 <= ch2 && ch2 <= 0xDFFF) {
! #if Py_UNICODE_SIZE == 2
  		/* This is valid data (a UTF-16 surrogate pair), but
  		   we are not able to store this information since our
--- 1081,1085 ----
  #endif
  	    if (0xDC00 <= ch2 && ch2 <= 0xDFFF) {
! #ifndef Py_UNICODE_WIDE
  		/* This is valid data (a UTF-16 surrogate pair), but
  		   we are not able to store this information since our
***************
*** 1327,1331 ****
              else if (chr <= 0x10ffff) {
                  /* UCS-4 character. Either store directly, or as surrogate pair. */
! #if Py_UNICODE_SIZE == 4
                  *p++ = chr;
  #else
--- 1327,1331 ----
              else if (chr <= 0x10ffff) {
                  /* UCS-4 character. Either store directly, or as surrogate pair. */
! #ifdef Py_UNICODE_WIDE
                  *p++ = chr;
  #else

Index: unicodectype.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodectype.c,v
retrieving revision 2.9
retrieving revision 2.10
diff -C2 -r2.9 -r2.10
*** unicodectype.c	2001/06/27 06:28:56	2.9
--- unicodectype.c	2001/06/27 18:59:43	2.10
***************
*** 69,73 ****
  	ch += ctype->upper;
  
! #ifdef USE_UCS4_STORAGE
      /* The database assumes that the values wrap around at 0x10000. */
      if (ch > 0x10000)
--- 69,73 ----
  	ch += ctype->upper;
  
! #ifdef Py_UNICODE_WIDE
      /* The database assumes that the values wrap around at 0x10000. */
      if (ch > 0x10000)
***************
*** 361,365 ****
  
      ch += ctype->upper;
! #ifdef USE_UCS4_STORAGE
      /* The database assumes that the values wrap around at 0x10000. */
      if (ch > 0x10000)
--- 361,365 ----
  
      ch += ctype->upper;
! #ifdef Py_UNICODE_WIDE
      /* The database assumes that the values wrap around at 0x10000. */
      if (ch > 0x10000)
***************
*** 377,381 ****
  
      ch += ctype->lower;
! #ifdef USE_UCS4_STORAGE
      /* The database assumes that the values wrap around at 0x10000. */
      if (ch > 0x10000)
--- 377,381 ----
  
      ch += ctype->lower;
! #ifdef Py_UNICODE_WIDE
      /* The database assumes that the values wrap around at 0x10000. */
      if (ch > 0x10000)