diff Objects/complexobject.c @ 20666:88a242bfb23a legacy-trunk

complex_subtype_from_string(): move the declaration of s_buffer[] out of the if block where it was before. The name is only used inside that if block, but the storage is referenced outside it via the 's' variable. (This patch was part of SF patch #474590 -- RISC OS support.)
author Guido van Rossum <guido@python.org>
date Thu, 25 Oct 2001 18:07:22 +0000
parents 2983b54256c7
children 025ad27d4224
line wrap: on
line diff
--- a/Objects/complexobject.c	Thu Oct 25 15:53:44 2001 +0000
+++ b/Objects/complexobject.c	Thu Oct 25 18:07:22 2001 +0000
@@ -646,6 +646,9 @@
 	int sw_error=0;
 	int sign;
 	char buffer[256]; /* For errors */
+#ifdef Py_USING_UNICODE
+	char s_buffer[256];
+#endif
 	int len;
 
 	if (PyString_Check(v)) {
@@ -654,7 +657,6 @@
 	}
 #ifdef Py_USING_UNICODE
 	else if (PyUnicode_Check(v)) {
-	    	char s_buffer[256];
 		if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) {
 			PyErr_SetString(PyExc_ValueError,
 				 "complex() literal too large to convert");