[Python-checkins] r41916 - in python/branches/release24-maint: Misc/NEWS Modules/_bsddb.c

neal.norwitz python-checkins at python.org
Thu Jan 5 06:45:14 CET 2006


Author: neal.norwitz
Date: Thu Jan  5 06:45:12 2006
New Revision: 41916

Modified:
   python/branches/release24-maint/Misc/NEWS
   python/branches/release24-maint/Modules/_bsddb.c
Log:
Backport: Fix errors on 64-bit platforms.  (There are still some test problems

Modified: python/branches/release24-maint/Misc/NEWS
==============================================================================
--- python/branches/release24-maint/Misc/NEWS	(original)
+++ python/branches/release24-maint/Misc/NEWS	Thu Jan  5 06:45:12 2006
@@ -38,6 +38,8 @@
 Extension Modules
 -----------------
 
+- Fix 64-bit problems in bsddb.
+
 - Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build
   problem on AIX.
 

Modified: python/branches/release24-maint/Modules/_bsddb.c
==============================================================================
--- python/branches/release24-maint/Modules/_bsddb.c	(original)
+++ python/branches/release24-maint/Modules/_bsddb.c	Thu Jan  5 06:45:12 2006
@@ -1510,7 +1510,7 @@
 
         if (self->primaryDBType == DB_RECNO ||
             self->primaryDBType == DB_QUEUE)
-            pkeyObj = PyInt_FromLong(*(long *)pkey.data);
+            pkeyObj = PyInt_FromLong(*(int *)pkey.data);
         else
             pkeyObj = PyString_FromStringAndSize(pkey.data, pkey.size);
 
@@ -1519,7 +1519,7 @@
             PyObject *keyObj;
             int type = _DB_get_type(self);
             if (type == DB_RECNO || type == DB_QUEUE)
-                keyObj = PyInt_FromLong(*(long *)key.data);
+                keyObj = PyInt_FromLong(*(int *)key.data);
             else
                 keyObj = PyString_FromStringAndSize(key.data, key.size);
             retval = Py_BuildValue("OOO", keyObj, pkeyObj, dataObj);
@@ -2991,7 +2991,7 @@
 
         if (self->mydb->primaryDBType == DB_RECNO ||
             self->mydb->primaryDBType == DB_QUEUE)
-            pkeyObj = PyInt_FromLong(*(long *)pkey.data);
+            pkeyObj = PyInt_FromLong(*(int *)pkey.data);
         else
             pkeyObj = PyString_FromStringAndSize(pkey.data, pkey.size);
 
@@ -3000,7 +3000,7 @@
             PyObject *keyObj;
             int type = _DB_get_type(self->mydb);
             if (type == DB_RECNO || type == DB_QUEUE)
-                keyObj = PyInt_FromLong(*(long *)key.data);
+                keyObj = PyInt_FromLong(*(int *)key.data);
             else
                 keyObj = PyString_FromStringAndSize(key.data, key.size);
             retval = Py_BuildValue("OOO", keyObj, pkeyObj, dataObj);


More information about the Python-checkins mailing list