<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/cpython-git.git/Modules/arraymodule.c, branch travis-macOS</title>
<subtitle>github.com: python/cpython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/'/>
<entry>
<title>Remove redundant check from arraymodule b_getitem (GH-14676)</title>
<updated>2019-07-11T21:57:42+00:00</updated>
<author>
<name>Disconnect3d</name>
<email>dominik.b.czarnota@gmail.com</email>
</author>
<published>2019-07-11T21:57:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=13ab570febac64bb55fb46d866a9ba5a46ab8902'/>
<id>13ab570febac64bb55fb46d866a9ba5a46ab8902</id>
<content type='text'>
The `arraymodule`'s `b_getitem` function returns a `PyLong` converted 
from `arrayobject`'s array, by dereferencing a pointer to `char`.

When the `char` type is `signed char`, the `if (x &gt;= 128) x -= 256;` comparison/code is redundant because a `signed char` will have a value of `[-128, 127]` and so `x` will never be greater or equal than 128.

This check was indeed needed for situations where a given compiler would assume `char` being `unsigned char` which would make `x` in `[0, 256]` range.

However, the check can be removed if we cast the `ob_item` into a signed char pointer (`signed char*`) instead of `char*`.

This PR/commit introduces this change.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `arraymodule`'s `b_getitem` function returns a `PyLong` converted 
from `arrayobject`'s array, by dereferencing a pointer to `char`.

When the `char` type is `signed char`, the `if (x &gt;= 128) x -= 256;` comparison/code is redundant because a `signed char` will have a value of `[-128, 127]` and so `x` will never be greater or equal than 128.

This check was indeed needed for situations where a given compiler would assume `char` being `unsigned char` which would make `x` in `[0, 256]` range.

However, the check can be removed if we cast the `ob_item` into a signed char pointer (`signed char*`) instead of `char*`.

This PR/commit introduces this change.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-37547: add _PyObject_CallMethodOneArg (GH-14685)</title>
<updated>2019-07-11T08:59:05+00:00</updated>
<author>
<name>Jeroen Demeyer</name>
<email>J.Demeyer@UGent.be</email>
</author>
<published>2019-07-11T08:59:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=59ad110d7a7784d53d0b502eebce0346597a6bef'/>
<id>59ad110d7a7784d53d0b502eebce0346597a6bef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36974: tp_print -&gt; tp_vectorcall_offset and tp_reserved -&gt; tp_as_async (GH-13464)</title>
<updated>2019-05-31T02:13:39+00:00</updated>
<author>
<name>Jeroen Demeyer</name>
<email>J.Demeyer@UGent.be</email>
</author>
<published>2019-05-31T02:13:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=530f506ac91338b55cf2be71b1cdf50cb077512f'/>
<id>530f506ac91338b55cf2be71b1cdf50cb077512f</id>
<content type='text'>
Automatically replace
tp_print -&gt; tp_vectorcall_offset
tp_compare -&gt; tp_as_async
tp_reserved -&gt; tp_as_async
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Automatically replace
tp_print -&gt; tp_vectorcall_offset
tp_compare -&gt; tp_as_async
tp_reserved -&gt; tp_as_async
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36842: Implement PEP 578 (GH-12613)</title>
<updated>2019-05-23T15:45:22+00:00</updated>
<author>
<name>Steve Dower</name>
<email>steve.dower@microsoft.com</email>
</author>
<published>2019-05-23T15:45:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184'/>
<id>b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184</id>
<content type='text'>
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)</title>
<updated>2019-05-17T07:13:03+00:00</updated>
<author>
<name>Zackery Spytz</name>
<email>zspytz@gmail.com</email>
</author>
<published>2019-05-17T07:13:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=14514d9084a40f599c57da853a305aa264562a43'/>
<id>14514d9084a40f599c57da853a305aa264562a43</id>
<content type='text'>
The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.

Co-Authored-By: Martin Panter &lt;vadmium+py@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The final addition (cur += step) may overflow, so use size_t for "cur".
"cur" is always positive (even for negative steps), so it is safe to use
size_t here.

Co-Authored-By: Martin Panter &lt;vadmium+py@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36285: Fix integer overflow in the array module. (GH-12317)</title>
<updated>2019-03-20T19:49:39+00:00</updated>
<author>
<name>sth</name>
<email>sth.dev@tejp.de</email>
</author>
<published>2019-03-20T19:49:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=aa3ecb80416958eb6fe8cc1b0dfbbfdfbcccead1'/>
<id>aa3ecb80416958eb6fe8cc1b0dfbbfdfbcccead1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. (GH-11952)</title>
<updated>2019-02-25T15:57:58+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2019-02-25T15:57:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=6a44f6eef3d0958d88882347190b3e2d1222c2e9'/>
<id>6a44f6eef3d0958d88882347190b3e2d1222c2e9</id>
<content type='text'>
Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Deprecate using the __int__() method in implicit conversions of Python
numbers to C integers.</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. (GH-11150)</title>
<updated>2018-12-14T09:19:51+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-12-14T09:19:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=afb3e71a1710c444fbe789b51df43ee16ee9ede7'/>
<id>afb3e71a1710c444fbe789b51df43ee16ee9ede7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35444: Unify and optimize the helper for getting a builtin object. (GH-11047)</title>
<updated>2018-12-11T06:28:18+00:00</updated>
<author>
<name>Serhiy Storchaka</name>
<email>storchaka@gmail.com</email>
</author>
<published>2018-12-11T06:28:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d'/>
<id>bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d</id>
<content type='text'>
This speeds up pickling of some iterators.

This fixes also error handling in pickling methods when fail to
look up builtin "getattr".</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This speeds up pickling of some iterators.

This fixes also error handling in pickling methods when fail to
look up builtin "getattr".</pre>
</div>
</content>
</entry>
<entry>
<title>bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)</title>
<updated>2018-12-08T14:16:55+00:00</updated>
<author>
<name>Zackery Spytz</name>
<email>zspytz@gmail.com</email>
</author>
<published>2018-12-08T14:16:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/cpython-git.git/commit/?id=99d56b53560b3867844472ae381fb3f858760621'/>
<id>99d56b53560b3867844472ae381fb3f858760621</id>
<content type='text'>
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.

In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.

In addition, check if the list changed size in the loop in array_array_fromlist().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.

In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.

In addition, check if the list changed size in the loop in array_array_fromlist().
</pre>
</div>
</content>
</entry>
</feed>
