[Python-checkins] python/dist/src/Include longobject.h,2.29,2.30 intobject.h,2.29,2.30

theller@users.sourceforge.net theller@users.sourceforge.net
Thu, 17 Apr 2003 11:55:15 -0700


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1:/tmp/cvs-serv6765

Modified Files:
	longobject.h intobject.h 
Log Message:
SF # 595026: support for masks in getargs.c.

New functions:
  unsigned long PyInt_AsUnsignedLongMask(PyObject *);
  unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
  unsigned long PyLong_AsUnsignedLongMask(PyObject *);
  unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);

New and changed format codes:

b unsigned char 0..UCHAR_MAX
B unsigned char none **
h unsigned short 0..USHRT_MAX
H unsigned short none **
i int INT_MIN..INT_MAX
I * unsigned int 0..UINT_MAX
l long LONG_MIN..LONG_MAX
k * unsigned long none
L long long LLONG_MIN..LLONG_MAX
K * unsigned long long none

Notes:

* New format codes.

** Changed from previous "range-and-a-half" to "none"; the
range-and-a-half checking wasn't particularly useful.

New test test_getargs2.py, to verify all this.


Index: longobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v
retrieving revision 2.29
retrieving revision 2.30
diff -C2 -d -r2.29 -r2.30
*** longobject.h	29 Mar 2003 10:04:54 -0000	2.29
--- longobject.h	17 Apr 2003 18:55:11 -0000	2.30
***************
*** 20,23 ****
--- 20,24 ----
  PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
  PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
+ PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
  
  /* _PyLong_AsScaledDouble returns a double x and an exponent e such that
***************
*** 38,41 ****
--- 39,43 ----
  PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
  PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
+ PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
  #endif /* HAVE_LONG_LONG */
  

Index: intobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/intobject.h,v
retrieving revision 2.29
retrieving revision 2.30
diff -C2 -d -r2.29 -r2.30
*** intobject.h	1 Jan 2003 15:18:32 -0000	2.29
--- intobject.h	17 Apr 2003 18:55:11 -0000	2.30
***************
*** 37,40 ****
--- 37,45 ----
  PyAPI_FUNC(PyObject *) PyInt_FromLong(long);
  PyAPI_FUNC(long) PyInt_AsLong(PyObject *);
+ PyAPI_FUNC(unsigned long) PyInt_AsUnsignedLongMask(PyObject *);
+ #ifdef HAVE_LONG_LONG
+ PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
+ #endif
+ 
  PyAPI_FUNC(long) PyInt_GetMax(void);