[Python-checkins] python/dist/src/Modules/cjkcodecs README, 1.2, 1.3 _codecs_hk.c, 1.1, 1.2 _codecs_iso2022.c, 1.2, 1.3 cjkcodecs.h, 1.4, 1.5 multibytecodec.c, 1.2, 1.3

perky at users.sourceforge.net perky at users.sourceforge.net
Thu Aug 19 19:49:59 CEST 2004


Update of /cvsroot/python/python/dist/src/Modules/cjkcodecs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19829

Modified Files:
	README _codecs_hk.c _codecs_iso2022.c cjkcodecs.h 
	multibytecodec.c 
Log Message:
Bug #1005737, #1007249: Fix several build problems and warnings
found on legacy C compilers of HP-UX, IRIX and Tru64.  (Reported
by roadkill, Richard Townsend, Maik Hertha and Minsik Kim)


Index: README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cjkcodecs/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** README	18 Jul 2004 03:06:27 -0000	1.2
--- README	19 Aug 2004 17:49:56 -0000	1.3
***************
*** 3,7 ****
  This directory contains source files for cjkcodecs extension modules.
  They are based on CJKCodecs (http://cjkpython.i18n.org/#CJKCodecs)
! as of Jul 18 2004 currently.
  
  
--- 3,7 ----
  This directory contains source files for cjkcodecs extension modules.
  They are based on CJKCodecs (http://cjkpython.i18n.org/#CJKCodecs)
! as of Aug 20 2004 currently.
  
  

Index: _codecs_hk.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cjkcodecs/_codecs_hk.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** _codecs_hk.c	18 Jul 2004 03:06:27 -0000	1.1
--- _codecs_hk.c	19 Aug 2004 17:49:56 -0000	1.2
***************
*** 3,7 ****
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: _codecs_hk.c,v 1.3 2004/07/07 14:59:26 perky Exp $
   */
  
--- 3,7 ----
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: _codecs_hk.c,v 1.4 2004/07/18 04:44:27 perky Exp $
   */
  

Index: _codecs_iso2022.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cjkcodecs/_codecs_iso2022.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** _codecs_iso2022.c	18 Jul 2004 04:34:33 -0000	1.2
--- _codecs_iso2022.c	19 Aug 2004 17:49:56 -0000	1.3
***************
*** 3,7 ****
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: _codecs_iso2022.c,v 1.18 2004/07/07 18:30:17 perky Exp $
   */
  
--- 3,7 ----
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: _codecs_iso2022.c,v 1.22 2004/08/19 17:08:13 perky Exp $
   */
  
***************
*** 118,122 ****
  struct iso2022_config {
  	int flags;
! 	const struct iso2022_designation designations[]; /* non-ascii desigs */
  };
  
--- 118,122 ----
  struct iso2022_config {
  	int flags;
! 	const struct iso2022_designation *designations; /* non-ascii desigs */
  };
  
***************
*** 198,202 ****
  #if Py_UNICODE_SIZE == 2
  				if (length == 2) {
! 					ucs4_t u4in[2] = {IN1, IN2};
  					encoded = dsg->encoder(u4in, &length);
  				} else
--- 198,204 ----
  #if Py_UNICODE_SIZE == 2
  				if (length == 2) {
! 					ucs4_t u4in[2];
! 					u4in[0] = (ucs4_t)IN1;
! 					u4in[1] = (ucs4_t)IN2;
  					encoded = dsg->encoder(u4in, &length);
  				} else
***************
*** 421,425 ****
  {
  	const struct iso2022_designation *dsgcache = NULL;
! 	
  	while (inleft > 0) {
  		unsigned char c = IN1;
--- 423,427 ----
  {
  	const struct iso2022_designation *dsgcache = NULL;
! 
  	while (inleft > 0) {
  		unsigned char c = IN1;
***************
*** 1048,1095 ****
  				  NULL, dummy_decoder, dummy_encoder }
  #define REGISTRY_SENTINEL	{ 0, }
  
! static const struct iso2022_config iso2022_kr_config = {
! 	0,
! 	{ REGISTRY_KSX1001, REGISTRY_SENTINEL },
  };
  
! static const struct iso2022_config iso2022_jp_config = {
! 	NO_SHIFT | USE_JISX0208_EXT,
! 	{ REGISTRY_JISX0208, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
! 	  REGISTRY_SENTINEL },
  };
  
! static const struct iso2022_config iso2022_jp_1_config = {
! 	NO_SHIFT | USE_JISX0208_EXT,
! 	{ REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_JISX0201_R,
! 	  REGISTRY_JISX0208_O, REGISTRY_SENTINEL },
  };
  
! static const struct iso2022_config iso2022_jp_2_config = {
! 	NO_SHIFT | USE_G2 | USE_JISX0208_EXT,
! 	{ REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_KSX1001,
! 	  REGISTRY_GB2312, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
! 	  REGISTRY_ISO8859_1, REGISTRY_ISO8859_7, REGISTRY_SENTINEL },
  };
  
! static const struct iso2022_config iso2022_jp_2004_config = {
! 	NO_SHIFT | USE_G2 | USE_JISX0208_EXT,
! 	{ REGISTRY_JISX0213_2004_1_PAIRONLY, REGISTRY_JISX0208,
! 	  REGISTRY_JISX0213_2004_1, REGISTRY_JISX0213_2004_2,
! 	  REGISTRY_SENTINEL },
  };
  
! static const struct iso2022_config iso2022_jp_3_config = {
! 	NO_SHIFT | USE_JISX0208_EXT,
! 	{ REGISTRY_JISX0213_2000_1_PAIRONLY, REGISTRY_JISX0208,
! 	  REGISTRY_JISX0213_2000_1, REGISTRY_JISX0213_2000_2,
! 	  REGISTRY_SENTINEL },
  };
  
! static const struct iso2022_config iso2022_jp_ext_config = {
! 	NO_SHIFT | USE_JISX0208_EXT,
! 	{ REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_JISX0201_R,
! 	  REGISTRY_JISX0201_K, REGISTRY_JISX0208_O, REGISTRY_SENTINEL },
  };
  
  
--- 1050,1099 ----
  				  NULL, dummy_decoder, dummy_encoder }
  #define REGISTRY_SENTINEL	{ 0, }
+ #define CONFIGDEF(var, attrs)						\
+ 	static const struct iso2022_config iso2022_##var##_config = {	\
+ 		attrs, iso2022_##var##_designations			\
+ 	};
  
! static const struct iso2022_designation iso2022_kr_designations[] = {
! 	REGISTRY_KSX1001, REGISTRY_SENTINEL
  };
+ CONFIGDEF(kr, 0)
  
! static const struct iso2022_designation iso2022_jp_designations[] = {
! 	REGISTRY_JISX0208, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
! 	REGISTRY_SENTINEL
  };
+ CONFIGDEF(jp, NO_SHIFT | USE_JISX0208_EXT)
  
! static const struct iso2022_designation iso2022_jp_1_designations[] = {
! 	REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_JISX0201_R,
! 	REGISTRY_JISX0208_O, REGISTRY_SENTINEL
  };
+ CONFIGDEF(jp_1, NO_SHIFT | USE_JISX0208_EXT)
  
! static const struct iso2022_designation iso2022_jp_2_designations[] = {
! 	REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_KSX1001,
! 	REGISTRY_GB2312, REGISTRY_JISX0201_R, REGISTRY_JISX0208_O,
! 	REGISTRY_ISO8859_1, REGISTRY_ISO8859_7, REGISTRY_SENTINEL
  };
+ CONFIGDEF(jp_2, NO_SHIFT | USE_G2 | USE_JISX0208_EXT)
  
! static const struct iso2022_designation iso2022_jp_2004_designations[] = {
! 	REGISTRY_JISX0213_2004_1_PAIRONLY, REGISTRY_JISX0208,
! 	REGISTRY_JISX0213_2004_1, REGISTRY_JISX0213_2004_2, REGISTRY_SENTINEL
  };
+ CONFIGDEF(jp_2004, NO_SHIFT | USE_JISX0208_EXT)
  
! static const struct iso2022_designation iso2022_jp_3_designations[] = {
! 	REGISTRY_JISX0213_2000_1_PAIRONLY, REGISTRY_JISX0208,
! 	REGISTRY_JISX0213_2000_1, REGISTRY_JISX0213_2000_2, REGISTRY_SENTINEL
  };
+ CONFIGDEF(jp_3, NO_SHIFT | USE_JISX0208_EXT)
  
! static const struct iso2022_designation iso2022_jp_ext_designations[] = {
! 	REGISTRY_JISX0208, REGISTRY_JISX0212, REGISTRY_JISX0201_R,
! 	REGISTRY_JISX0201_K, REGISTRY_JISX0208_O, REGISTRY_SENTINEL
  };
+ CONFIGDEF(jp_ext, NO_SHIFT | USE_JISX0208_EXT)
  
  

Index: cjkcodecs.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cjkcodecs/cjkcodecs.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** cjkcodecs.h	18 Jul 2004 15:02:45 -0000	1.4
--- cjkcodecs.h	19 Aug 2004 17:49:56 -0000	1.5
***************
*** 3,7 ****
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: cjkcodecs.h,v 1.5 2004/07/06 17:05:24 perky Exp $
   */
  
--- 3,7 ----
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: cjkcodecs.h,v 1.6 2004/07/18 15:22:31 perky Exp $
   */
  
***************
*** 231,235 ****
  #define END_CODECS_LIST					\
  	{"", NULL,} };					\
! 	static const MultibyteCodec *codec_list = 	\
  		(const MultibyteCodec *)_codec_list;
  
--- 231,235 ----
  #define END_CODECS_LIST					\
  	{"", NULL,} };					\
! 	static const MultibyteCodec *codec_list =	\
  		(const MultibyteCodec *)_codec_list;
  

Index: multibytecodec.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cjkcodecs/multibytecodec.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** multibytecodec.c	18 Jul 2004 03:06:29 -0000	1.2
--- multibytecodec.c	19 Aug 2004 17:49:56 -0000	1.3
***************
*** 3,7 ****
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: multibytecodec.c,v 1.12 2004/06/27 19:24:13 perky Exp $
   */
  
--- 3,7 ----
   *
   * Written by Hye-Shik Chang <perky at FreeBSD.org>
!  * $CJKCodecs: multibytecodec.c,v 1.13 2004/08/19 16:57:19 perky Exp $
   */
  
***************
*** 339,343 ****
  	if (buf->excobj == NULL) {
  		buf->excobj = PyUnicodeDecodeError_Create(codec->encoding,
! 				buf->inbuf_top,
  				(int)(buf->inbuf_end - buf->inbuf_top),
  				start, end, reason);
--- 339,343 ----
  	if (buf->excobj == NULL) {
  		buf->excobj = PyUnicodeDecodeError_Create(codec->encoding,
! 				(const char *)buf->inbuf_top,
  				(int)(buf->inbuf_end - buf->inbuf_top),
  				start, end, reason);
***************
*** 966,970 ****
  {
  	PyObject *wr, *ucvt, *r = NULL;
! 	Py_UNICODE *inbuf, *inbuf_end, *data, *inbuf_tmp = NULL;
  	int datalen;
  
--- 966,970 ----
  {
  	PyObject *wr, *ucvt, *r = NULL;
! 	Py_UNICODE *inbuf, *inbuf_end, *inbuf_tmp = NULL;
  	int datalen;
  
***************
*** 983,987 ****
  	}
  
- 	data = PyUnicode_AS_UNICODE(unistr);
  	datalen = PyUnicode_GET_SIZE(unistr);
  	if (datalen == 0) {
--- 983,986 ----



More information about the Python-checkins mailing list