[Python-checkins] r41915 - in python/trunk: Misc/NEWS Modules/_bsddb.c

neal.norwitz python-checkins at python.org
Thu Jan 5 06:43:37 CET 2006


Author: neal.norwitz
Date: Thu Jan  5 06:43:35 2006
New Revision: 41915

Modified:
   python/trunk/Misc/NEWS
   python/trunk/Modules/_bsddb.c
Log:
Fix errors on 64-bit platforms.  Will backport

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Thu Jan  5 06:43:35 2006
@@ -209,6 +209,8 @@
 Extension Modules
 -----------------
 
+- Fix 64-bit problems in bsddb.
+
 - Patch #1365916: fix some unsafe 64-bit mmap methods.
 
 - Bug #1290333: Added a workaround for cjkcodecs' _codecs_cn build

Modified: python/trunk/Modules/_bsddb.c
==============================================================================
--- python/trunk/Modules/_bsddb.c	(original)
+++ python/trunk/Modules/_bsddb.c	Thu Jan  5 06:43:35 2006
@@ -1522,7 +1522,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);
 
@@ -1531,7 +1531,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);
@@ -3172,7 +3172,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);
 
@@ -3181,7 +3181,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