[Python-checkins] CVS: python/dist/src/Modules signalmodule.c,2.39,2.40

Guido van Rossum python-dev@python.org
Wed, 28 Jun 2000 15:26:23 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv14036

Modified Files:
	signalmodule.c 
Log Message:
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*).


Index: signalmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/signalmodule.c,v
retrieving revision 2.39
retrieving revision 2.40
diff -C2 -r2.39 -r2.40
*** signalmodule.c	1998/12/21 19:32:39	2.39
--- signalmodule.c	2000/06/28 22:26:21	2.40
***************
*** 357,365 ****
  	d = PyModule_GetDict(m);
  
! 	x = DefaultHandler = PyInt_FromLong((long)SIG_DFL);
          if (!x || PyDict_SetItemString(d, "SIG_DFL", x) < 0)
                  goto finally;
  
! 	x = IgnoreHandler = PyInt_FromLong((long)SIG_IGN);
          if (!x || PyDict_SetItemString(d, "SIG_IGN", x) < 0)
                  goto finally;
--- 357,365 ----
  	d = PyModule_GetDict(m);
  
! 	x = DefaultHandler = PyLong_FromVoidPtr(SIG_DFL);
          if (!x || PyDict_SetItemString(d, "SIG_DFL", x) < 0)
                  goto finally;
  
! 	x = IgnoreHandler = PyLong_FromVoidPtr(SIG_IGN);
          if (!x || PyDict_SetItemString(d, "SIG_IGN", x) < 0)
                  goto finally;