[Python-checkins] python/nondist/sandbox/datetime datetime.c,1.69,1.70 obj_date.c,1.52,1.53 obj_datetime.c,1.54,1.55 obj_datetimetz.c,1.14,1.15 obj_time.c,1.14,1.15 obj_timetz.c,1.26,1.27
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
2002年12月14日 08:23:36 -0800
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv31831
Modified Files:
datetime.c obj_date.c obj_datetime.c obj_datetimetz.c
obj_time.c obj_timetz.c
Log Message:
Repaired int-vs-long mismatches.
Index: datetime.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -C2 -d -r1.69 -r1.70
*** datetime.c 14 Dec 2002 05:45:49 -0000 1.69
--- datetime.c 14 Dec 2002 16:23:34 -0000 1.70
***************
*** 335,339 ****
*/
static int
! check_date_args(int year, int month, int day)
{
--- 335,339 ----
*/
static int
! check_date_args(long year, long month, long day)
{
***************
*** 360,364 ****
*/
static int
! check_time_args(int h, int m, int s, int us)
{
if (h < 0 || h > 23) {
--- 360,364 ----
*/
static int
! check_time_args(long h, long m, long s, long us)
{
if (h < 0 || h > 23) {
Index: obj_date.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_date.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** obj_date.c 13 Dec 2002 19:16:07 -0000 1.52
--- obj_date.c 14 Dec 2002 16:23:34 -0000 1.53
***************
*** 36,40 ****
{
PyObject *self = NULL;
! long int year, month, day;
static char *keywords[] = {
--- 36,42 ----
{
PyObject *self = NULL;
! long year;
! long month;
! long day;
static char *keywords[] = {
***************
*** 46,50 ****
if (check_date_args(year, month, day) < 0)
return NULL;
! self = new_date(year, month, day);
}
return self;
--- 48,52 ----
if (check_date_args(year, month, day) < 0)
return NULL;
! self = new_date((int)year, (int)month, (int)day);
}
return self;
***************
*** 154,158 ****
if (normalize_date(&year, &month, &day) >= 0)
! result = new_date(year, month, day);
return result;
}
--- 156,160 ----
if (normalize_date(&year, &month, &day) >= 0)
! result = new_date((int)year, (int)month, (int)day);
return result;
}
Index: obj_datetime.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_datetime.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** obj_datetime.c 14 Dec 2002 06:31:58 -0000 1.54
--- obj_datetime.c 14 Dec 2002 16:23:34 -0000 1.55
***************
*** 63,68 ****
if (check_time_args(hour, minute, second, usecond) < 0)
return NULL;
! self = new_datetime(year, month, day, hour, minute, second,
! usecond);
}
return self;
--- 63,69 ----
if (check_time_args(hour, minute, second, usecond) < 0)
return NULL;
! self = new_datetime((int)year, (int)month, (int)day,
! (int)hour, (int)minute, (int)second,
! (int)usecond);
}
return self;
***************
*** 255,260 ****
return NULL;
else
! return new_datetime(year, month, day,
! hour, minute, second, microsecond);
}
--- 256,262 ----
return NULL;
else
! return new_datetime((int)year, (int)month, (int)day,
! (int)hour, (int)minute, (int)second,
! (int)microsecond);
}
***************
*** 278,283 ****
return NULL;
else
! return new_datetime(year, month, day,
! hour, minute, second, microsecond);
}
--- 280,286 ----
return NULL;
else
! return new_datetime((int)year, (int)month, (int)day,
! (int)hour, (int)minute, (int)second,
! (int)microsecond);
}
Index: obj_datetimetz.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_datetimetz.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** obj_datetimetz.c 14 Dec 2002 09:09:23 -0000 1.14
--- obj_datetimetz.c 14 Dec 2002 16:23:34 -0000 1.15
***************
*** 50,55 ****
if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
return NULL;
! self = new_datetimetz(year, month, day,
! hour, minute, second, usecond,
tzinfo);
}
--- 50,56 ----
if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
return NULL;
! self = new_datetimetz((int)year, (int)month, (int)day,
! (int)hour, (int)minute, (int)second,
! (int)usecond,
tzinfo);
}
Index: obj_time.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_time.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** obj_time.c 14 Dec 2002 01:09:45 -0000 1.14
--- obj_time.c 14 Dec 2002 16:23:34 -0000 1.15
***************
*** 43,50 ****
{
PyObject *self = NULL;
! int hour = 0;
! int minute = 0;
! int second = 0;
! int usecond = 0;
static char *keywords[] = {
--- 43,50 ----
{
PyObject *self = NULL;
! long hour = 0;
! long minute = 0;
! long second = 0;
! long usecond = 0;
static char *keywords[] = {
***************
*** 52,60 ****
};
! if (PyArg_ParseTupleAndKeywords(args, kw, "|iiii", keywords,
&hour, &minute, &second, &usecond)) {
if (check_time_args(hour, minute, second, usecond) < 0)
return NULL;
! self = new_time(hour, minute, second, usecond);
}
return self;
--- 52,61 ----
};
! if (PyArg_ParseTupleAndKeywords(args, kw, "|llll", keywords,
&hour, &minute, &second, &usecond)) {
if (check_time_args(hour, minute, second, usecond) < 0)
return NULL;
! self = new_time((int)hour, (int)minute, (int)second,
! (int)usecond);
}
return self;
Index: obj_timetz.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_timetz.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** obj_timetz.c 14 Dec 2002 05:45:49 -0000 1.26
--- obj_timetz.c 14 Dec 2002 16:23:34 -0000 1.27
***************
*** 27,34 ****
{
PyObject *self = NULL;
! int hour = 0;
! int minute = 0;
! int second = 0;
! int usecond = 0;
PyObject *tzinfo = Py_None;
--- 27,34 ----
{
PyObject *self = NULL;
! long hour = 0;
! long minute = 0;
! long second = 0;
! long usecond = 0;
PyObject *tzinfo = Py_None;
***************
*** 37,41 ****
};
! if (PyArg_ParseTupleAndKeywords(args, kw, "|iiiiO", keywords,
&hour, &minute, &second, &usecond,
&tzinfo)) {
--- 37,41 ----
};
! if (PyArg_ParseTupleAndKeywords(args, kw, "|llllO", keywords,
&hour, &minute, &second, &usecond,
&tzinfo)) {
***************
*** 44,48 ****
if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
return NULL;
! self = new_timetz(hour, minute, second, usecond, tzinfo);
}
return self;
--- 44,50 ----
if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
return NULL;
! self = new_timetz((int)hour, (int)minute, (int)second,
! (int)usecond,
! tzinfo);
}
return self;