After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780591 - Fixes for 64bit Windows compiler warnings
Fixes for 64bit Windows compiler warnings
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-27 13:00 UTC by Christoph Reiter (lazka)
Modified: 2017-03-29 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix PyLong <-> GPid conversion on 64bit Windows (2.27 KB, patch)
2017-03-27 13:00 UTC, Christoph Reiter (lazka)
committed Details | Review
Fix conversion from pointers to hashfunc return values. (3.32 KB, patch)
2017-03-27 13:01 UTC, Christoph Reiter (lazka)
committed Details | Review
Don't use long format string for formatting pointers (900 bytes, patch)
2017-03-27 13:01 UTC, Christoph Reiter (lazka)
committed Details | Review
test_gi: use correct min/max constants for gsize/gssize (1.07 KB, patch)
2017-03-27 13:55 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2017-03-27 13:00:36 UTC
Created attachment 348798 [details] [review]
Fix PyLong <-> GPid conversion on 64bit Windows

GPid on Windows is a pointer and not int, and pointers don't fit long
on 64bit so use PyLong_AsVoidPtr/PyLong_FromVoidPtr there instead.
Comment 1 Christoph Reiter (lazka) 2017-03-27 13:01:05 UTC
Created attachment 348799 [details] [review]
Fix conversion from pointers to hashfunc return values.

Fixes comiler warnings on 64bit Windows.

Python 3 now uses Py_hash_t as return value for hashfunc. Use
a compat define so we can use the right type depending on the
Python version.

On Python 2 + 64bit Windows the pointer doesn't fit the long
return type. Add a macro which handles the casting for that case
to prevent compiler warnings.
Comment 2 Christoph Reiter (lazka) 2017-03-27 13:01:48 UTC
Created attachment 348800 [details] [review]
Don't use long format string for formatting pointers

long is too small on 64bit Windows
Comment 3 Christoph Reiter (lazka) 2017-03-27 13:55:09 UTC
Created attachment 348802 [details] [review]
test_gi: use correct min/max constants for gsize/gssize

This made these tests on 64bit Windows fail because sizeof(gsize) != sizeof(glong)
Comment 4 Christoph Reiter (lazka) 2017-03-28 06:51:01 UTC
The test suite on 64bit still fails because some glib symbols are missing there. I've filed bug 780634 for this.