[issue22125] Cure signedness warnings introduced by #22003

2016-07-13 Thread Berker Peksag

Berker Peksag added the comment:

Since 2e29d54843a4 this is no longer needed. Thanks for the patches!

--
nosy: +berker.peksag
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22125] Cure signedness warnings introduced by #22003

2014-08-04 Thread Zachary Ware

Zachary Ware added the comment:

Either patch makes MSVC happy; Meador's gets points from me for simplicity.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22125
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22125] Cure signedness warnings introduced by #22003

2014-08-02 Thread David Wilson

New submission from David Wilson:

The attached patch (hopefully) silences the signedness warnings generated by 
Visual Studio and reported on python-dev in 
https://mail.python.org/pipermail/python-dev/2014-July/135603.html. 

This was sloppiness on my part, I even noted the problem in the original ticket 
and never fixed it. :)

I don't have a local dev environment setup for MSVC and Python, but at least 
the attached patch cures the signedness errors on Clang. They don't seem to 
occur at all with GCC on my Mac.

The added casts ensure comparisons uniformly compare in the unsigned domain. It 
seems size_t buf_size is pretty redundant in the original struct, it just 
introduces lots of casting when it only appears to be required during 
write_bytes() to avoid signed overflow (undefined behaviour)

--
components: Library (Lib)
files: cow-sign.patch
keywords: patch
messages: 224593
nosy: dw, pitrou, zach.ware
priority: normal
severity: normal
status: open
title: Cure signedness warnings introduced by #22003
type: compile error
versions: Python 3.5
Added file: http://bugs.python.org/file36217/cow-sign.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22125
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22125] Cure signedness warnings introduced by #22003

2014-08-02 Thread Meador Inge

Meador Inge added the comment:

H, maybe I am missing some context, but why not avoid the casting and do?

diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -47,7 +47,7 @@ typedef struct {
  * exception and returns -1 on failure. Existing state is preserved on failure.
  */
 static int
-unshare(bytesio *self, size_t preferred_size, int truncate)
+unshare(bytesio *self, Py_ssize_t preferred_size, int truncate)
 {
 if (self-initvalue) {
 Py_ssize_t copy_size;

--
nosy: +meador.inge
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22125
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com