[pypy-svn] r78800 - in pypy/branch/fast-forward/pypy/module/cpyext: . include

afa at codespeak.net afa at codespeak.net
Sun Nov 7 00:04:15 CET 2010


Author: afa
Date: Sun Nov  7 00:04:14 2010
New Revision: 78800

Modified:
   pypy/branch/fast-forward/pypy/module/cpyext/include/structmember.h
   pypy/branch/fast-forward/pypy/module/cpyext/structmember.py
   pypy/branch/fast-forward/pypy/module/cpyext/structmemberdefs.py
Log:
More types in structmembers


Modified: pypy/branch/fast-forward/pypy/module/cpyext/include/structmember.h
==============================================================================
--- pypy/branch/fast-forward/pypy/module/cpyext/include/structmember.h	(original)
+++ pypy/branch/fast-forward/pypy/module/cpyext/include/structmember.h	Sun Nov  7 00:04:14 2010
@@ -24,17 +24,23 @@
 #define T_SHORT		0
 #define T_INT		1
 #define T_LONG		2
+#define T_FLOAT		3
+#define T_DOUBLE	4
 #define T_STRING	5
 #define T_OBJECT	6
 #define T_CHAR		7	/* 1-character string */
 #define T_BYTE		8	/* 8-bit signed int */
+#define T_UBYTE		9
 #define T_USHORT	10
 #define T_UINT		11
 #define T_ULONG		12
-#define T_STRING_INPLACE 13     /* Strings contained in the structure */
+#define T_STRING_INPLACE 13	/* Strings contained in the structure */
+#define T_BOOL		14
 #define T_OBJECT_EX	16	/* Like T_OBJECT, but raises AttributeError
 				   when the value is NULL, instead of
 				   converting to None. */
+#define T_LONGLONG	17
+#define T_ULONGLONG	 18
 
 /* Flags */
 #define READONLY      1

Modified: pypy/branch/fast-forward/pypy/module/cpyext/structmember.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/cpyext/structmember.py	(original)
+++ pypy/branch/fast-forward/pypy/module/cpyext/structmember.py	Sun Nov  7 00:04:14 2010
@@ -6,8 +6,11 @@
 from pypy.module.cpyext.intobject import PyInt_AsLong, PyInt_AsUnsignedLong
 from pypy.module.cpyext.pyerrors import PyErr_Occurred
 from pypy.module.cpyext.pyobject import PyObject, Py_DecRef, from_ref, make_ref
-from pypy.module.cpyext.stringobject import (PyString_FromString,
-                                             PyString_FromStringAndSize)
+from pypy.module.cpyext.stringobject import (
+    PyString_FromString, PyString_FromStringAndSize)
+from pypy.module.cpyext.floatobject import PyFloat_AsDouble
+from pypy.module.cpyext.longobject import (
+    PyLong_AsLongLong, PyLong_AsUnsignedLongLong)
 from pypy.module.cpyext.typeobjectdefs import PyMemberDef
 from pypy.rlib.unroll import unrolling_iterable
 
@@ -19,6 +22,12 @@
     (T_UINT,   rffi.UINT,   PyInt_AsUnsignedLong),
     (T_ULONG,  rffi.ULONG,  PyInt_AsUnsignedLong),
     (T_BYTE,   rffi.UCHAR,  PyInt_AsLong),
+    (T_UBYTE,  rffi.UCHAR,  PyInt_AsUnsignedLong),
+    (T_BOOL,   rffi.UCHAR,  PyInt_AsLong),
+    (T_FLOAT,  rffi.FLOAT,  PyFloat_AsDouble),
+    (T_DOUBLE, rffi.DOUBLE, PyFloat_AsDouble),
+    (T_LONGLONG,  rffi.LONGLONG,  PyLong_AsLongLong),
+    (T_ULONGLONG, rffi.ULONGLONG, PyLong_AsUnsignedLongLong),
     ])
 
 

Modified: pypy/branch/fast-forward/pypy/module/cpyext/structmemberdefs.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/cpyext/structmemberdefs.py	(original)
+++ pypy/branch/fast-forward/pypy/module/cpyext/structmemberdefs.py	Sun Nov  7 00:04:14 2010
@@ -1,14 +1,20 @@
 T_SHORT = 0
 T_INT = 1
 T_LONG = 2
+T_FLOAT = 3
+T_DOUBLE = 4
 T_STRING = 5
 T_OBJECT = 6
 T_CHAR = 7
 T_BYTE = 8
+T_UBYTE = 9
 T_USHORT = 10
 T_UINT = 11
 T_ULONG = 12
 T_STRING_INPLACE = 13
+T_BOOL = 14
 T_OBJECT_EX = 16
+T_LONGLONG = 17
+T_ULONGLONG = 18
 
 READONLY = RO = 1



More information about the Pypy-commit mailing list