[Python-checkins] r45545 - python/trunk/Modules/datetimemodule.c

skip.montanaro python-checkins at python.org
Tue Apr 18 21:35:05 CEST 2006


Author: skip.montanaro
Date: Tue Apr 18 21:35:04 2006
New Revision: 45545

Modified:
   python/trunk/Modules/datetimemodule.c
Log:
C++ compiler cleanup: "typename" is a C++ keyword

Modified: python/trunk/Modules/datetimemodule.c
==============================================================================
--- python/trunk/Modules/datetimemodule.c	(original)
+++ python/trunk/Modules/datetimemodule.c	Tue Apr 18 21:35:04 2006
@@ -2411,11 +2411,11 @@
 date_repr(PyDateTime_Date *self)
 {
 	char buffer[1028];
-	const char *typename;
+	const char *type_name;
 
-	typename = self->ob_type->tp_name;
+	type_name = self->ob_type->tp_name;
 	PyOS_snprintf(buffer, sizeof(buffer), "%s(%d, %d, %d)",
-		      typename,
+		      type_name,
 		      GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
 
 	return PyString_FromString(buffer);
@@ -3138,7 +3138,7 @@
 time_repr(PyDateTime_Time *self)
 {
 	char buffer[100];
-	const char *typename = self->ob_type->tp_name;
+	const char *type_name = self->ob_type->tp_name;
 	int h = TIME_GET_HOUR(self);
 	int m = TIME_GET_MINUTE(self);
 	int s = TIME_GET_SECOND(self);
@@ -3147,13 +3147,13 @@
 
 	if (us)
 		PyOS_snprintf(buffer, sizeof(buffer),
-			      "%s(%d, %d, %d, %d)", typename, h, m, s, us);
+			      "%s(%d, %d, %d, %d)", type_name, h, m, s, us);
 	else if (s)
 		PyOS_snprintf(buffer, sizeof(buffer),
-			      "%s(%d, %d, %d)", typename, h, m, s);
+			      "%s(%d, %d, %d)", type_name, h, m, s);
 	else
 		PyOS_snprintf(buffer, sizeof(buffer),
-			      "%s(%d, %d)", typename, h, m);
+			      "%s(%d, %d)", type_name, h, m);
 	result = PyString_FromString(buffer);
 	if (result != NULL && HASTZINFO(self))
 		result = append_keyword_tzinfo(result, self->tzinfo);
@@ -4036,13 +4036,13 @@
 datetime_repr(PyDateTime_DateTime *self)
 {
 	char buffer[1000];
-	const char *typename = self->ob_type->tp_name;
+	const char *type_name = self->ob_type->tp_name;
 	PyObject *baserepr;
 
 	if (DATE_GET_MICROSECOND(self)) {
 		PyOS_snprintf(buffer, sizeof(buffer),
 			      "%s(%d, %d, %d, %d, %d, %d, %d)",
-			      typename,
+			      type_name,
 			      GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
 			      DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
 			      DATE_GET_SECOND(self),
@@ -4051,7 +4051,7 @@
 	else if (DATE_GET_SECOND(self)) {
 		PyOS_snprintf(buffer, sizeof(buffer),
 			      "%s(%d, %d, %d, %d, %d, %d)",
-			      typename,
+			      type_name,
 			      GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
 			      DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
 			      DATE_GET_SECOND(self));
@@ -4059,7 +4059,7 @@
 	else {
 		PyOS_snprintf(buffer, sizeof(buffer),
 			      "%s(%d, %d, %d, %d, %d)",
-			      typename,
+			      type_name,
 			      GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
 			      DATE_GET_HOUR(self), DATE_GET_MINUTE(self));
 	}


More information about the Python-checkins mailing list