[Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.143,2.144 stringobject.c,2.148,2.149 unicodeobject.c,2.128,2.129

Andrew I MacIntyre aimacintyre@users.sourceforge.net
2002年2月26日 03:36:37 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv27980/dist/src/Objects
Modified Files:
	fileobject.c stringobject.c unicodeobject.c 
Log Message:
OS/2 EMX port changes (Objects part of patch #450267):
 Objects/
 fileobject.c
 stringobject.c
 unicodeobject.c
This commit doesn't include the cleanup patches for stringobject.c and
unicodeobject.c which are shown separately in the patch manager. Those
patches will be regenerated and applied in a subsequent commit, so as
to preserve a fallback position (this commit to those files).
Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.143
retrieving revision 2.144
diff -C2 -d -r2.143 -r2.144
*** fileobject.c	12 Jan 2002 11:05:09 -0000	2.143
--- fileobject.c	26 Feb 2002 11:36:35 -0000	2.144
***************
*** 26,29 ****
--- 26,33 ----
 #endif
 
+ #if defined(PYOS_OS2) && defined(PYCC_GCC)
+ #include <io.h>
+ #endif
+ 
 #define BUF(v) PyString_AS_STRING((PyStringObject *)v)
 
Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.148
retrieving revision 2.149
diff -C2 -d -r2.148 -r2.149
*** stringobject.c	16 Jan 2002 10:53:24 -0000	2.148
--- stringobject.c	26 Feb 2002 11:36:35 -0000	2.149
***************
*** 3101,3104 ****
--- 3101,3113 ----
 		buf[1] = (char)type;
 	}
+ #if defined(PYOS_OS2) && defined(PYCC_GCC)
+ 	/* unfortunately, the EMX C runtime gives us '0x' as the base
+ 	 * marker for %X when we expect/want '0X'
+ 	 */
+ 	else if ((flags & F_ALT) && (type == 'X')) {
+ 		assert(buf[1] == 'x');
+ 		buf[1] = (char)type;
+ 	}
+ #endif
 	return strlen(buf);
 }
Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.128
retrieving revision 2.129
diff -C2 -d -r2.128 -r2.129
*** unicodeobject.c	7 Feb 2002 11:33:49 -0000	2.128
--- unicodeobject.c	26 Feb 2002 11:36:35 -0000	2.129
***************
*** 5163,5166 ****
--- 5163,5175 ----
 * So add it only if the platform doesn't already.
 */
+ #if defined(PYOS_OS2) && defined(PYCC_GCC)
+ if ((flags & F_ALT) && (type == 'x' || type == 'X')) {
+ /* the EMX runtime gives 0x as the base marker when we want 0X
+ * so we cover all bets by supplying our own for both cases.
+ */
+ use_native_c_format = 0;
+ PyOS_snprintf(fmt, sizeof(fmt), "0%c%%.%dl%c", type, prec, type);
+ }
+ #else
 if (x == 0 && (flags & F_ALT) && (type == 'x' || type == 'X')) {
 /* Only way to know what the platform does is to try it. */
***************
*** 5172,5175 ****
--- 5181,5185 ----
 }
 }
+ #endif
 if (use_native_c_format)
 PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%dl%c",

AltStyle によって変換されたページ (->オリジナル) /