C++ compiler cleanup: "typename" is a C++ keyword

This commit is contained in:
Skip Montanaro 2006-04-18 19:35:04 +00:00
parent 1b04664eab
commit 14f8899dc2
1 changed files with 11 additions and 11 deletions

View File

@ -2411,11 +2411,11 @@ static PyObject *
date_repr(PyDateTime_Date *self) date_repr(PyDateTime_Date *self)
{ {
char buffer[1028]; 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)", PyOS_snprintf(buffer, sizeof(buffer), "%s(%d, %d, %d)",
typename, type_name,
GET_YEAR(self), GET_MONTH(self), GET_DAY(self)); GET_YEAR(self), GET_MONTH(self), GET_DAY(self));
return PyString_FromString(buffer); return PyString_FromString(buffer);
@ -3138,7 +3138,7 @@ static PyObject *
time_repr(PyDateTime_Time *self) time_repr(PyDateTime_Time *self)
{ {
char buffer[100]; 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 h = TIME_GET_HOUR(self);
int m = TIME_GET_MINUTE(self); int m = TIME_GET_MINUTE(self);
int s = TIME_GET_SECOND(self); int s = TIME_GET_SECOND(self);
@ -3147,13 +3147,13 @@ time_repr(PyDateTime_Time *self)
if (us) if (us)
PyOS_snprintf(buffer, sizeof(buffer), 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) else if (s)
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
"%s(%d, %d, %d)", typename, h, m, s); "%s(%d, %d, %d)", type_name, h, m, s);
else else
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
"%s(%d, %d)", typename, h, m); "%s(%d, %d)", type_name, h, m);
result = PyString_FromString(buffer); result = PyString_FromString(buffer);
if (result != NULL && HASTZINFO(self)) if (result != NULL && HASTZINFO(self))
result = append_keyword_tzinfo(result, self->tzinfo); result = append_keyword_tzinfo(result, self->tzinfo);
@ -4036,13 +4036,13 @@ static PyObject *
datetime_repr(PyDateTime_DateTime *self) datetime_repr(PyDateTime_DateTime *self)
{ {
char buffer[1000]; char buffer[1000];
const char *typename = self->ob_type->tp_name; const char *type_name = self->ob_type->tp_name;
PyObject *baserepr; PyObject *baserepr;
if (DATE_GET_MICROSECOND(self)) { if (DATE_GET_MICROSECOND(self)) {
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
"%s(%d, %d, %d, %d, %d, %d, %d)", "%s(%d, %d, %d, %d, %d, %d, %d)",
typename, type_name,
GET_YEAR(self), GET_MONTH(self), GET_DAY(self), GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
DATE_GET_HOUR(self), DATE_GET_MINUTE(self), DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
DATE_GET_SECOND(self), DATE_GET_SECOND(self),
@ -4051,7 +4051,7 @@ datetime_repr(PyDateTime_DateTime *self)
else if (DATE_GET_SECOND(self)) { else if (DATE_GET_SECOND(self)) {
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
"%s(%d, %d, %d, %d, %d, %d)", "%s(%d, %d, %d, %d, %d, %d)",
typename, type_name,
GET_YEAR(self), GET_MONTH(self), GET_DAY(self), GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
DATE_GET_HOUR(self), DATE_GET_MINUTE(self), DATE_GET_HOUR(self), DATE_GET_MINUTE(self),
DATE_GET_SECOND(self)); DATE_GET_SECOND(self));
@ -4059,7 +4059,7 @@ datetime_repr(PyDateTime_DateTime *self)
else { else {
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
"%s(%d, %d, %d, %d, %d)", "%s(%d, %d, %d, %d, %d)",
typename, type_name,
GET_YEAR(self), GET_MONTH(self), GET_DAY(self), GET_YEAR(self), GET_MONTH(self), GET_DAY(self),
DATE_GET_HOUR(self), DATE_GET_MINUTE(self)); DATE_GET_HOUR(self), DATE_GET_MINUTE(self));
} }