Skip to content

Commit 911ddb0

Browse files
committed
fix constructors
1 parent b125d71 commit 911ddb0

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

Include/datetime.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ typedef struct {
178178

179179
/* constructors */
180180
PyObject *(*Date_FromDate)(int, int, int, PyTypeObject*);
181-
PyObject *(*DateTime_FromDateAndTime)(int, int, int, int, int, int, int, int,
182-
PyObject*, PyTypeObject*);
183-
PyObject *(*Time_FromTime)(int, int, int, int, int, PyObject*, PyTypeObject*);
181+
PyObject *(*DateTime_FromDateAndTime)(int, int, int, int, int, int, int,
182+
PyObject*, int, int, PyTypeObject*);
183+
PyObject *(*Time_FromTime)(int, int, int, int, PyObject*, int, int, PyTypeObject*);
184184
PyObject *(*Delta_FromDelta)(int, int, int, int, int, PyTypeObject*);
185185
PyObject *(*TimeZone_FromTimeZone)(PyObject *offset, PyObject *name);
186186

@@ -189,9 +189,9 @@ typedef struct {
189189
PyObject *(*Date_FromTimestamp)(PyObject*, PyObject*);
190190

191191
/* PEP 495 constructors */
192-
PyObject *(*DateTime_FromDateAndTimeAndFold)(int, int, int, int, int, int, int, int,
193-
PyObject*, int, PyTypeObject*);
194-
PyObject *(*Time_FromTimeAndFold)(int, int, int, int, int, PyObject*, int, PyTypeObject*);
192+
PyObject *(*DateTime_FromDateAndTimeAndFold)(int, int, int, int, int, int, int,
193+
PyObject*, int, int, PyTypeObject*);
194+
PyObject *(*Time_FromTimeAndFold)(int, int, int, int, PyObject*, int, int, PyTypeObject*);
195195

196196
} PyDateTime_CAPI;
197197

@@ -235,15 +235,15 @@ static PyDateTime_CAPI *PyDateTimeAPI = NULL;
235235

236236
#define PyDateTime_FromDateAndTime(year, month, day, hour, min, sec, usec, nanosec) \
237237
PyDateTimeAPI->DateTime_FromDateAndTime((year), (month), (day), (hour), \
238-
(min), (sec), (usec), Py_None, (nanosec), PyDateTimeAPI->DateTimeType)
238+
(min), (sec), (usec), Py_None, 0, (nanosec), PyDateTimeAPI->DateTimeType)
239239

240240
#define PyDateTime_FromDateAndTimeAndFold(year, month, day, hour, min, sec, usec, fold, nanosec) \
241241
PyDateTimeAPI->DateTime_FromDateAndTimeAndFold((year), (month), (day), (hour), \
242242
(min), (sec), (usec), Py_None, (fold), (nanosec), PyDateTimeAPI->DateTimeType)
243243

244244
#define PyTime_FromTime(hour, minute, second, usecond, nanosec) \
245245
PyDateTimeAPI->Time_FromTime((hour), (minute), (second), (usecond), \
246-
Py_None, (nanosec), PyDateTimeAPI->TimeType)
246+
Py_None, 0, (nanosec), PyDateTimeAPI->TimeType)
247247

248248
#define PyTime_FromTimeAndFold(hour, minute, second, usecond, nanosec, fold) \
249249
PyDateTimeAPI->Time_FromTimeAndFold((hour), (minute), (second), (usecond), \

Modules/_datetimemodule.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ parse_isoformat_time(const char *dtstr, size_t dtlen, int *hour, int *minute,
11781178
tzinfo_pos++;
11791179
int tzhour = 0, tzminute = 0, tzsecond = 0;
11801180
rv = parse_hh_mm_ss_ff(tzinfo_pos, p_end, &tzhour, &tzminute, &tzsecond,
1181-
&tzmicrosecond, &tznanosecond);
1181+
tzmicrosecond, tznanosecond);
11821182

11831183
*tzoffset = tzsign * ((tzhour * 3600) + (tzminute * 60) + tzsecond);
11841184
*tzmicrosecond *= tzsign;
@@ -1270,10 +1270,10 @@ new_datetime_ex2(int year, int month, int day, int hour, int minute,
12701270

12711271
static PyObject *
12721272
new_datetime_ex(int year, int month, int day, int hour, int minute,
1273-
int second, int microsecond, PyObject *tzinfo, int nanosecond, PyTypeObject *type)
1273+
int second, int microsecond, PyObject *tzinfo, PyTypeObject *type)
12741274
{
12751275
return new_datetime_ex2(year, month, day, hour, minute, second, microsecond,
1276-
tzinfo, 0, nanosecond, type);
1276+
tzinfo, type);
12771277
}
12781278

12791279
#define new_datetime(y, m, d, hh, mm, ss, us, tzinfo, fold, ns) \
@@ -1376,9 +1376,9 @@ new_time_ex2(int hour, int minute, int second, int microsecond,
13761376

13771377
static PyObject *
13781378
new_time_ex(int hour, int minute, int second, int microsecond,
1379-
PyObject *tzinfo, int nanosecond, PyTypeObject *type)
1379+
PyObject *tzinfo, PyTypeObject *type)
13801380
{
1381-
return new_time_ex2(hour, minute, second, microsecond, tzinfo, 0, nanosecond, type);
1381+
return new_time_ex2(hour, minute, second, microsecond, tzinfo, type);
13821382
}
13831383

13841384
#define new_time(hh, mm, ss, us, tzinfo, fold, ns) \

Modules/_testcapi/datetime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ get_datetime_fromdateandtime(PyObject *self, PyObject *args)
225225
rv = PyDateTimeAPI->DateTime_FromDateAndTime(
226226
year, month, day,
227227
hour, minute, second, microsecond,
228-
Py_None, nanosecond,
228+
Py_None, 0, nanosecond,
229229
PyDateTimeAPI->DateTimeType);
230230
}
231231
return rv;
@@ -284,7 +284,7 @@ get_time_fromtime(PyObject *self, PyObject *args)
284284
else {
285285
rv = PyDateTimeAPI->Time_FromTime(
286286
hour, minute, second, microsecond,
287-
Py_None, nanosecond,
287+
Py_None, 0, nanosecond,
288288
PyDateTimeAPI->TimeType);
289289
}
290290
return rv;

0 commit comments

Comments
 (0)