[Python-checkins] CVS: python/dist/src/Modules structmodule.c,2.44,2.45

Tim Peters tim_one@users.sourceforge.net
Mon, 11 Jun 2001 09:51:58 -0700


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

Modified Files:
	structmodule.c 
Log Message:
Simplify some convolution by simply not recognizing 'q' and 'Q' at all
in native mode on platforms that don't HAVE_LONG_LONG.


Index: structmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v
retrieving revision 2.44
retrieving revision 2.45
diff -C2 -r2.44 -r2.45
*** structmodule.c	2001/06/11 16:45:33	2.44
--- structmodule.c	2001/06/11 16:51:56	2.45
***************
*** 73,81 ****
  typedef struct { char c; LONG_LONG x; } s_long_long;
  #define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(LONG_LONG))
- 
- #else
- static char qQ_error_msg[] =
- "q and Q unavailable in native mode on this platform; use a standard mode.\0";
- 
  #endif
  
--- 73,76 ----
***************
*** 579,592 ****
  	return PyLong_FromUnsignedLongLong(*(unsigned LONG_LONG *)p);
  }
- 
- #else
-  
- static PyObject *
- nu_qQerror(const char *p, const formatdef *f)
- {
- 	PyErr_SetString(StructError, qQ_error_msg);
- 	return NULL;
- }
- 
  #endif
  
--- 574,577 ----
***************
*** 747,760 ****
  	return 0;
  }
- 
- #else
- 
- static int
- np_qQerror(char *p, PyObject *v, const formatdef *f)
- {
- 	PyErr_SetString(StructError, qQ_error_msg);
-  	return -1;
- }
- 
  #endif
  
--- 732,735 ----
***************
*** 819,830 ****
  	{'q',	sizeof(LONG_LONG), LONG_LONG_ALIGN, nu_longlong, np_longlong},
  	{'Q',	sizeof(LONG_LONG), LONG_LONG_ALIGN, nu_ulonglong,np_ulonglong},
- #else
- 	/* n[pu]_qQerror just raise errors, but give them "the expected" size
- 	   and alignment anyway so that calcsize returns something reasonable,
- 	   and so unpack code that works on a 'long long' platform ends up in
- 	   the error routine instead of with a mysterious "unpack str size
- 	   does not match format" msg when run on a non-'long long' box. */
- 	{'q',	8,		8, 		nu_qQerror,	 np_qQerror},
- 	{'Q',	8,		8, 		nu_qQerror,	 np_qQerror},
  #endif
  	{0}
--- 794,797 ----