summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-08-13 09:36:06 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2014-08-13 09:36:06 +0300
commit5be034cf6165724587beb18dca9e5b7682442a74 (patch)
tree6b6cef1d5851e7f5770aa78f9290dba4f546bb01 /Python/marshal.c
parentb1ec624fe7b26b6a23658840b50b15b372de670e (diff)
parent8128e231900edc5b5f035f83186cb7507271ab84 (diff)
downloadcpython-5be034cf6165724587beb18dca9e5b7682442a74.tar.gz
Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems()
in the mailbox module. This is partial rollback of changeset f340cb045bf9.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index dc5411c1ff..ca64be3948 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -13,8 +13,6 @@
#include "code.h"
#include "marshal.h"
-#define ABS(x) ((x) < 0 ? -(x) : (x))
-
/* High water mark to determine when the marshalled object is dangerously deep
* and risks coring the interpreter. When the object stack gets this deep,
* raise an exception instead of continuing.
@@ -192,7 +190,7 @@ w_PyLong(const PyLongObject *ob, char flag, WFILE *p)
}
/* set l to number of base PyLong_MARSHAL_BASE digits */
- n = ABS(Py_SIZE(ob));
+ n = Py_ABS(Py_SIZE(ob));
l = (n-1) * PyLong_MARSHAL_RATIO;
d = ob->ob_digit[n-1];
assert(d != 0); /* a PyLong is always normalized */
@@ -727,8 +725,8 @@ r_PyLong(RFILE *p)
return NULL;
}
- size = 1 + (ABS(n) - 1) / PyLong_MARSHAL_RATIO;
- shorts_in_top_digit = 1 + (ABS(n) - 1) % PyLong_MARSHAL_RATIO;
+ size = 1 + (Py_ABS(n) - 1) / PyLong_MARSHAL_RATIO;
+ shorts_in_top_digit = 1 + (Py_ABS(n) - 1) % PyLong_MARSHAL_RATIO;
ob = _PyLong_New(size);
if (ob == NULL)
return NULL;