diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-15 23:16:58 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-15 23:16:58 (GMT) |
commit | 042cb465f667652df23c2e9d9ba347efeebba5a8 (patch) | |
tree | 9fcd022cb3d486b8d4e325c68489f6e5e256cb77 | |
parent | da062558db08e8374fa0880bf93f16896da0720e (diff) | |
download | cpython-042cb465f667652df23c2e9d9ba347efeebba5a8.zip cpython-042cb465f667652df23c2e9d9ba347efeebba5a8.tar.gz cpython-042cb465f667652df23c2e9d9ba347efeebba5a8.tar.bz2 |
Fix compiler warning on Windows 64-bit: asdl_seq_SET() stores the index parameter
into a Py_ssize_t, instead of an int
-rw-r--r-- | Include/asdl.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Include/asdl.h b/Include/asdl.h index 7c3b6d1..495153c 100644 --- a/Include/asdl.h +++ b/Include/asdl.h @@ -31,11 +31,13 @@ asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); #define asdl_seq_GET(S, I) (S)->elements[(I)] #define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) #ifdef Py_DEBUG -#define asdl_seq_SET(S, I, V) { \ - int _asdl_i = (I); \ - assert((S) && _asdl_i < (S)->size); \ +#define asdl_seq_SET(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(_asdl_i < (S)->size); \ (S)->elements[_asdl_i] = (V); \ -} + } while (0) #else #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V) #endif |