aboutsummaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-03-16 22:54:05 -0700
committerLarry Hastings <larry@hastings.org>2014-03-16 22:54:05 -0700
commit3c5c56f3c068bc13daea2275b951113b43a91e85 (patch)
tree1395bfb10902b7087a4ca1551f4bdb271b55ed43 /Include
parente41b73caca2b543422f423a2ac07c29de834f44d (diff)
parent2221f666eba4a6f46f2095a801bc3e4bdbdb97d2 (diff)
downloadcpython3-3c5c56f3c068bc13daea2275b951113b43a91e85.tar.gz
Merged default into 3.4 branch. 3.4 branch is now effectively 3.4.1rc1.
Diffstat (limited to 'Include')
-rw-r--r--Include/objimpl.h2
-rw-r--r--Include/pytime.h17
2 files changed, 15 insertions, 4 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 9a27ec384f..3f21b70e07 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -265,7 +265,7 @@ extern PyGC_Head *_PyGC_generation0;
#define _PyGCHead_REFS(g) ((g)->gc.gc_refs >> _PyGC_REFS_SHIFT)
#define _PyGCHead_SET_REFS(g, v) do { \
(g)->gc.gc_refs = ((g)->gc.gc_refs & ~_PyGC_REFS_MASK) \
- | (v << _PyGC_REFS_SHIFT); \
+ | (((size_t)(v)) << _PyGC_REFS_SHIFT); \
} while (0)
#define _PyGCHead_DECREF(g) ((g)->gc.gc_refs -= 1 << _PyGC_REFS_SHIFT)
diff --git a/Include/pytime.h b/Include/pytime.h
index 52902f5e3a..b0fc6d0354 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -53,10 +53,19 @@ do { \
(tv_end.tv_usec - tv_start.tv_usec) * 0.000001)
#ifndef Py_LIMITED_API
+
+typedef enum {
+ /* Round towards zero. */
+ _PyTime_ROUND_DOWN=0,
+ /* Round away from zero. */
+ _PyTime_ROUND_UP
+} _PyTime_round_t;
+
/* Convert a number of seconds, int or float, to time_t. */
PyAPI_FUNC(int) _PyTime_ObjectToTime_t(
PyObject *obj,
- time_t *sec);
+ time_t *sec,
+ _PyTime_round_t);
/* Convert a time_t to a PyLong. */
PyAPI_FUNC(PyObject *) _PyLong_FromTime_t(
@@ -72,7 +81,8 @@ PyAPI_FUNC(time_t) _PyLong_AsTime_t(
PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
PyObject *obj,
time_t *sec,
- long *usec);
+ long *usec,
+ _PyTime_round_t);
/* Convert a number of seconds, int or float, to a timespec structure.
nsec is in the range [0; 999999999] and rounded towards zero.
@@ -80,7 +90,8 @@ PyAPI_FUNC(int) _PyTime_ObjectToTimeval(
PyAPI_FUNC(int) _PyTime_ObjectToTimespec(
PyObject *obj,
time_t *sec,
- long *nsec);
+ long *nsec,
+ _PyTime_round_t);
#endif
/* Dummy to force linking. */