[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.16.8.11,2.16.8.12

Guido van Rossum gvanrossum@users.sourceforge.net
Sat, 05 May 2001 19:52:06 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv11331

Modified Files:
      Tag: descr-branch
	typeobject.c 
Log Message:
Th Windows compiler doesn't like adding offsets to a void*, so use
char* instead for the memset() arg in type_construct().


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.16.8.11
retrieving revision 2.16.8.12
diff -C2 -r2.16.8.11 -r2.16.8.12
*** typeobject.c	2001/05/06 02:31:13	2.16.8.11
--- typeobject.c	2001/05/06 02:52:04	2.16.8.12
***************
*** 189,193 ****
  	if (type == NULL)
  		return NULL;
! 	memset(((void *)type) + offsetof(PyTypeObject, tp_name), '\0',
  	       sizeof(PyTypeObject) - offsetof(PyTypeObject, tp_name));
  	type->tp_name = PyString_AS_STRING(name);
--- 189,193 ----
  	if (type == NULL)
  		return NULL;
! 	memset(((char *)type) + offsetof(PyTypeObject, tp_name), '\0',
  	       sizeof(PyTypeObject) - offsetof(PyTypeObject, tp_name));
  	type->tp_name = PyString_AS_STRING(name);