[Python-checkins] cpython: Switch the state variable to unsigned for defined wrap-around behavior.
raymond.hettinger
python-checkins at python.org
Tue Mar 3 07:47:51 CET 2015
https://hg.python.org/cpython/rev/a4f9c98f08e2
changeset: 94840:a4f9c98f08e2
user: Raymond Hettinger <python at rcn.com>
date: Mon Mar 02 22:47:46 2015 -0800
summary:
Switch the state variable to unsigned for defined wrap-around behavior.
files:
Modules/_collectionsmodule.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -62,7 +62,7 @@
block *rightblock;
Py_ssize_t leftindex; /* in range(BLOCKLEN) */
Py_ssize_t rightindex; /* in range(BLOCKLEN) */
- long state; /* incremented whenever the indices move */
+ size_t state; /* incremented whenever the indices move */
Py_ssize_t maxlen;
PyObject *weakreflist; /* List of weak references */
} dequeobject;
@@ -692,8 +692,8 @@
Py_ssize_t n = Py_SIZE(deque);
Py_ssize_t i;
Py_ssize_t count = 0;
+ size_t start_state = deque->state;
PyObject *item;
- long start_state = deque->state;
int cmp;
for (i=0 ; i<n ; i++) {
@@ -1257,7 +1257,7 @@
Py_ssize_t index;
block *b;
dequeobject *deque;
- long state; /* state when the iterator is created */
+ size_t state; /* state when the iterator is created */
Py_ssize_t counter; /* number of items remaining for iteration */
} dequeiterobject;
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list