[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - _helper.c:1.3
Barry Warsaw
barry@wooz.org
Sat, 9 Nov 2002 00:44:05 -0500
Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv28111
Modified Files:
_helper.c
Log Message:
Minor formatting, and a copyright notice.
=== ZODB3/bsddb3Storage/bsddb3Storage/_helper.c 1.2 => 1.3 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/_helper.c:1.2 Fri Aug 23 13:14:49 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/_helper.c Sat Nov 9 00:44:05 2002
@@ -1,8 +1,23 @@
+/*****************************************************************************
+
+ Copyright (c) 2002 Zope Corporation and Contributors.
+ All Rights Reserved.
+
+ This software is subject to the provisions of the Zope Public License,
+ Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+ WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+ FOR A PARTICULAR PURPOSE
+
+ ****************************************************************************/
+
#include <Python.h>
-/* This helper only works for Python 2.2. If using an older version, crap
- * out now so we don't leave a broken, but compiled and importable module
- * laying about.
+/* This helper only works for Python 2.2 and beyond. If we're using an
+ * older version of Python, stop out now so we don't leave a broken, but
+ * compiled and importable module laying about. Full.py has a workaround
+ * for when this extension isn't available.
*/
#if PY_VERSION_HEX < 0x020200F0
#error "Must be using at least Python 2.2"
@@ -20,12 +35,13 @@
assert(len == 8);
- /* there seems to be no direct route from byte array to long long, so
+ /* There seems to be no direct route from byte array to long long, so
* first convert it to a PyLongObject*, then convert /that/ thing to a
- * long long
+ * long long.
*/
pylong = _PyLong_FromByteArray(s, len,
- 0 /* big endian */, 0 /* unsigned */);
+ 0 /* big endian */,
+ 0 /* unsigned */);
if (!pylong)
return NULL;
@@ -35,7 +51,8 @@
return NULL;
res = _PyLong_AsByteArray((PyLongObject*)sum, x, 8,
- 0 /* big endian */, 0 /* unsigned */);
+ 0 /* big endian */,
+ 0 /* unsigned */);
if (res < 0)
return NULL;