Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
76646102
Commit
76646102
authored
Feb 27, 2013
by
zaur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix inline getters for timedelta
parent
d6bb5f89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
Cython/Includes/cpython/datetime.pxd
Cython/Includes/cpython/datetime.pxd
+13
-9
No files found.
Cython/Includes/cpython/datetime.pxd
View file @
76646102
...
...
@@ -25,16 +25,20 @@ cdef extern from "datetime.h":
pass
ctypedef
struct
PyDateTime_Time
:
char
hastzinfo
# boolean flag
char
hastzinfo
PyObject
*
tzinfo
ctypedef
struct
PyDateTime_DateTime
:
char
hastzinfo
# boolean flag
char
hastzinfo
PyObject
*
tzinfo
ctypedef
struct
PyDateTime_Delta
:
int
days
int
seconds
int
microseconds
# Define structure for C API.
ctypedef
struct
PyDateTime_CAPI
:
long
hashcode
# type objects
PyTypeObject
*
DateType
PyTypeObject
*
DateTimeType
...
...
@@ -86,9 +90,9 @@ cdef extern from "datetime.h":
int
PyDateTime_TIME_GET_MICROSECOND
(
object
o
)
# Getters for timedelta (C macros).
int
PyDateTime_DELTA_GET_DAYS
(
object
o
)
int
PyDateTime_DELTA_GET_SECONDS
(
object
o
)
int
PyDateTime_DELTA_GET_MICROSECONDS
(
object
o
)
#
int PyDateTime_DELTA_GET_DAYS(object o)
#
int PyDateTime_DELTA_GET_SECONDS(object o)
#
int PyDateTime_DELTA_GET_MICROSECONDS(object o)
# PyDateTime CAPI object.
PyDateTime_CAPI
*
PyDateTimeAPI
...
...
@@ -195,12 +199,12 @@ cdef inline int datetime_microsecond(object o):
# Get days of timedelta
cdef
inline
int
timedelta_days
(
object
o
):
return
PyDateTime_DELTA_GET_DAYS
(
o
)
return
(
<
PyDateTime_Delta
*>
o
).
days
# Get seconds of timedelta
cdef
inline
int
timedelta_seconds
(
object
o
):
return
PyDateTime_DELTA_GET_SECONDS
(
o
)
return
(
<
PyDateTime_Delta
*>
o
).
seconds
# Get microseconds of timedelta
cdef
inline
int
timedelta_microseconds
(
object
o
):
return
PyDateTime_DELTA_GET_MICROSECONDS
(
o
)
return
(
<
PyDateTime_Delta
*>
o
).
microseconds
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment