summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-06-28 22:26:21 (GMT)
committerGuido van Rossum <guido@python.org>2000-06-28 22:26:21 (GMT)
commitcc6a438d7f33749859653d12ab963b014b1458bd (patch)
treec448a9e7475925a504b5136d781c411617591733 /Modules/signalmodule.c
parent534b7c5c96006365a713a808022363b057a0bf12 (diff)
downloadcpython-cc6a438d7f33749859653d12ab963b014b1458bd.zip
cpython-cc6a438d7f33749859653d12ab963b014b1458bd.tar.gz
cpython-cc6a438d7f33749859653d12ab963b014b1458bd.tar.bz2
Trent Mick:
Fix warnings on 64-bit build build of signalmodule.c - Though I know that SIG_DFL and SIG_IGN are just small constants, there are cast to function pointers so the appropriate Python call is PyLong_FromVoidPtr so that the pointer value cannot overflow on Win64 where sizeof(long) < sizeof(void*).
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 26bb940..88f2b9c 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -356,11 +356,11 @@ initsignal()
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
- x = DefaultHandler = PyInt_FromLong((long)SIG_DFL);
+ x = DefaultHandler = PyLong_FromVoidPtr(SIG_DFL);
if (!x || PyDict_SetItemString(d, "SIG_DFL", x) < 0)
goto finally;
- x = IgnoreHandler = PyInt_FromLong((long)SIG_IGN);
+ x = IgnoreHandler = PyLong_FromVoidPtr(SIG_IGN);
if (!x || PyDict_SetItemString(d, "SIG_IGN", x) < 0)
goto finally;