[Python-checkins] python/dist/src/Python structmember.c,2.24,2.25

loewis at users.sourceforge.net loewis at users.sourceforge.net
Fri Mar 4 00:00:29 CET 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14423/Python

Modified Files:
	structmember.c 
Log Message:
Patch #1115086: support PY_LONGLONG in structmember.


Index: structmember.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/structmember.c,v
retrieving revision 2.24
retrieving revision 2.25
diff -u -d -r2.24 -r2.25
--- structmember.c	20 Nov 2003 01:44:58 -0000	2.24
+++ structmember.c	3 Mar 2005 23:00:26 -0000	2.25
@@ -118,6 +118,14 @@
 			PyErr_SetString(PyExc_AttributeError, l->name);
 		Py_XINCREF(v);
 		break;
+#ifdef HAVE_LONG_LONG
+	case T_LONGLONG:
+		v = PyLong_FromLongLong(*(PY_LONG_LONG *)addr);
+		break;
+	case T_ULONGLONG:
+		v = PyLong_FromUnsignedLongLong(*(unsigned PY_LONG_LONG *)addr);
+		break;
+#endif /* HAVE_LONG_LONG */
 	default:
 		PyErr_SetString(PyExc_SystemError, "bad memberdescr type");
 		v = NULL;
@@ -246,6 +254,30 @@
 			return -1;
 		}
 		break;
+#ifdef HAVE_LONG_LONG
+	case T_LONGLONG:
+		if (!PyLong_Check(v)) {
+			PyErr_BadArgument();
+			return -1;
+		} else {
+                        *(PY_LONG_LONG*)addr = PyLong_AsLongLong(v);
+                        if ((*addr == -1) && PyErr_Occurred()) {
+                                return -1;
+                        }
+                }
+                break;
+	case T_ULONGLONG:
+                if (!PyLong_Check(v)) {
+                        PyErr_BadArgument();
+                        return -1;
+                } else {
+                        *(unsigned PY_LONG_LONG*)addr = PyLong_AsUnsignedLongLong(v);
+                        if ((*addr == -1) && PyErr_Occurred()) {
+                                return -1;
+                        }
+                }
+                break;
+#endif /* HAVE_LONG_LONG */
 	default:
 		PyErr_Format(PyExc_SystemError,
 			     "bad memberdescr type for %s", l->name);



More information about the Python-checkins mailing list