[Python-checkins] python/dist/src/Python compile.c,2.258,2.259

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 15 Aug 2002 18:57:34 -0700


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

Modified Files:
	compile.c 
Log Message:
Minor cleanup of parsename() and parsestr(): the 'struct compiling *'
argument should be called 'c', like everywhere else.  Renamed a
complex variable 'c' to 'z' and moved it inside the only scope where
it's used.


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.258
retrieving revision 2.259
diff -C2 -d -r2.258 -r2.259
*** compile.c	15 Aug 2002 14:59:02 -0000	2.258
--- compile.c	16 Aug 2002 01:57:32 -0000	2.259
***************
*** 1134,1138 ****
  
  static PyObject *
! parsenumber(struct compiling *co, char *s)
  {
  	char *end;
--- 1134,1138 ----
  
  static PyObject *
! parsenumber(struct compiling *c, char *s)
  {
  	char *end;
***************
*** 1140,1144 ****
  	double dx;
  #ifndef WITHOUT_COMPLEX
- 	Py_complex c;
  	int imflag;
  #endif
--- 1140,1143 ----
***************
*** 1159,1164 ****
  				    "will return positive values "
  				    "in Python 2.4 and up",
! 				    co->c_filename,
! 				    co->c_lineno,
  				    NULL,
  				    NULL) < 0)
--- 1158,1163 ----
  				    "will return positive values "
  				    "in Python 2.4 and up",
! 				    c->c_filename,
! 				    c->c_lineno,
  				    NULL,
  				    NULL) < 0)
***************
*** 1177,1185 ****
  #ifndef WITHOUT_COMPLEX
  	if (imflag) {
! 		c.real = 0.;
  		PyFPE_START_PROTECT("atof", return 0)
! 		c.imag = atof(s);
! 		PyFPE_END_PROTECT(c)
! 		return PyComplex_FromCComplex(c);
  	}
  	else
--- 1176,1185 ----
  #ifndef WITHOUT_COMPLEX
  	if (imflag) {
! 		Py_complex z;
! 		z.real = 0.;
  		PyFPE_START_PROTECT("atof", return 0)
! 		z.imag = atof(s);
! 		PyFPE_END_PROTECT(z)
! 		return PyComplex_FromCComplex(z);
  	}
  	else
***************
*** 1216,1220 ****
  
  static PyObject *
! parsestr(struct compiling *com, char *s)
  {
  	PyObject *v;
--- 1216,1220 ----
  
  static PyObject *
! parsestr(struct compiling *c, char *s)
  {
  	PyObject *v;
***************
*** 1225,1229 ****
  	int quote = *s;
  	int rawmode = 0;
! 	char* encoding = ((com == NULL) ? NULL : com->c_encoding);
  	int need_encoding;
  	int unicode = 0;
--- 1225,1229 ----
  	int quote = *s;
  	int rawmode = 0;
! 	char* encoding = ((c == NULL) ? NULL : c->c_encoding);
  	int need_encoding;
  	int unicode = 0;
***************
*** 1246,1250 ****
  	len = strlen(s);
  	if (len > INT_MAX) {
! 		com_error(com, PyExc_OverflowError, 
  			  "string to parse is too long");
  		return NULL;
--- 1246,1250 ----
  	len = strlen(s);
  	if (len > INT_MAX) {
! 		com_error(c, PyExc_OverflowError, 
  			  "string to parse is too long");
  		return NULL;
***************
*** 1316,1320 ****
  		Py_XDECREF(u);
  		if (v == NULL)
! 			PyErr_SyntaxLocation(com->c_filename, com->c_lineno);
  		return v;
  			
--- 1316,1320 ----
  		Py_XDECREF(u);
  		if (v == NULL)
! 			PyErr_SyntaxLocation(c->c_filename, c->c_lineno);
  		return v;
  			
***************
*** 1346,1350 ****
  				  need_encoding ? encoding : NULL);
  	if (v == NULL)
! 		PyErr_SyntaxLocation(com->c_filename, com->c_lineno);
  	return v;
  }
--- 1346,1350 ----
  				  need_encoding ? encoding : NULL);
  	if (v == NULL)
! 		PyErr_SyntaxLocation(c->c_filename, c->c_lineno);
  	return v;
  }