]> granicus.if.org Git - python/commit
SF # 595026: support for masks in getargs.c.
authorThomas Heller <theller@ctypes.org>
Thu, 17 Apr 2003 18:55:45 +0000 (18:55 +0000)
committerThomas Heller <theller@ctypes.org>
Thu, 17 Apr 2003 18:55:45 +0000 (18:55 +0000)
commita4ea603b055533e71920a088acb1c106e4895dbd
treec50efc24264738dee727367ed0e55bc3e6aedf84
parente13ddc9ec85287b17fd03454f836f495c1167de9
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.
Include/intobject.h
Include/longobject.h
Lib/test/test_getargs2.py [new file with mode: 0644]
Modules/_testcapimodule.c
Objects/intobject.c
Objects/longobject.c
Python/getargs.c