[sword-svn] r2666 - in trunk: . include src/keys src/modules
scribe at crosswire.org
scribe at crosswire.org
Sat Nov 5 16:57:38 MST 2011
Author: scribe
Date: 2011-11-05 16:57:38 -0700 (Sat, 05 Nov 2011)
New Revision: 2666
Modified:
trunk/configure.ac
trunk/include/swkey.h
trunk/include/sysdata.h
trunk/src/keys/versekey.cpp
trunk/src/modules/swmodule.cpp
Log:
fix for clucene builds on f16
fix for pointer conversion warning on f16. changed userData generic store from void * to __u64 to be consistent on every arch and should have enough space for any size it used to be compiled to on any arch (we're not compile for 128 bit yet, right? :)
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2011-11-02 14:53:20 UTC (rev 2665)
+++ trunk/configure.ac 2011-11-05 23:57:38 UTC (rev 2666)
@@ -252,18 +252,19 @@
# Check for clucene for lucene searching support
# ---------------------------------------------------------------------
+# NOTE the $libdir hack at the end of the c[xx]flags. Apparently F16 finds that clucene is not multilib-save and places some include files in /usr/lib[64]/
with_clucene=no
if test "x$CLUCENE2_LIBS" != x; then
echo "clucene 2.x found - lucene searching options available"
- AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2"
- AM_CFLAGS="$AM_CFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I$libdir"
+ AM_CFLAGS="$AM_CFLAGS $CLUCENE2_CFLAGS -DUSELUCENE -DCLUCENE2 -I$libdir"
LIBS="$LIBS $CLUCENE2_LIBS"
with_clucene="yes 2.x"
else
if test "x$CLUCENE_LIBS" != x; then
echo "lucene 0.x found - lucene searching options available"
- AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE_CXXFLAGS -DUSELUCENE"
- AM_CFLAGS="$AM_CFLAGS -DUSELUCENE"
+ AM_CXXFLAGS="$AM_CXXFLAGS $CLUCENE_CXXFLAGS -DUSELUCENE -I$libdir"
+ AM_CFLAGS="$AM_CFLAGS -DUSELUCENE -I$libdir"
LIBS="$LIBS $CLUCENE_LIBS"
with_clucene="yes 0.x"
else
@@ -344,6 +345,7 @@
echo
echo
echo "Configuration:"
+echo " LIBDIR: $libdir"
echo " DEBUG: $enable_debug"
echo " PROFILE: $enable_profile"
echo " BUILD TESTS: $enable_tests"
Modified: trunk/include/swkey.h
===================================================================
--- trunk/include/swkey.h 2011-11-02 14:53:20 UTC (rev 2665)
+++ trunk/include/swkey.h 2011-11-05 23:57:38 UTC (rev 2666)
@@ -27,6 +27,7 @@
#include <swobject.h>
#include <defs.h>
+#include <sysdata.h>
#include <utilstr.h>
SWORD_NAMESPACE_START
@@ -111,8 +112,8 @@
public:
- // misc pointer for whatever
- void *userData;
+ // misc storage for whatever
+ __u64 userData;
/** initializes instance of SWKey from a string
* All keys can be reduced to a string representation which should be able
Modified: trunk/include/sysdata.h
===================================================================
--- trunk/include/sysdata.h 2011-11-02 14:53:20 UTC (rev 2665)
+++ trunk/include/sysdata.h 2011-11-05 23:57:38 UTC (rev 2666)
@@ -18,9 +18,12 @@
typedef signed int __s32;
typedef unsigned int __u32;
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-//typedef __signed__ long long __s64;
-//typedef unsigned long long __u64;
+#ifdef __GNUC__
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
+#else
+typedef signed long long __s64;
+typedef unsigned long long __u64;
#endif
#undef __swswap16
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2011-11-02 14:53:20 UTC (rev 2665)
+++ trunk/src/keys/versekey.cpp 2011-11-05 23:57:38 UTC (rev 2666)
@@ -696,7 +696,7 @@
lastKey->LowerBound(*curKey);
lastKey->setPosition(TOP);
tmpListKey << *lastKey;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
else {
if (!dash) { // if last separator was not a dash just add
@@ -709,7 +709,7 @@
lastKey->UpperBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
else {
bool f = false;
@@ -723,7 +723,7 @@
lastKey->UpperBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
}
else if (expandRange) {
@@ -735,7 +735,7 @@
*curKey = MAXVERSE;
newElement->UpperBound(*curKey);
*newElement = TOP;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
}
}
@@ -921,7 +921,7 @@
lastKey->LowerBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
else {
if (!dash) { // if last separator was not a dash just add
@@ -934,7 +934,7 @@
lastKey->UpperBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
else {
bool f = false;
@@ -948,7 +948,7 @@
lastKey->UpperBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
}
else if (expandRange) {
@@ -960,7 +960,7 @@
*curKey = MAXVERSE;
newElement->UpperBound(*curKey);
*newElement = TOP;
- tmpListKey.GetElement()->userData = (void *)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.GetElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
}
}
}
Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp 2011-11-02 14:53:20 UTC (rev 2665)
+++ trunk/src/modules/swmodule.cpp 2011-11-05 23:57:38 UTC (rev 2666)
@@ -529,7 +529,7 @@
}
}
listKey << *resultKey;
- listKey.GetElement()->userData = (void *)((__u32)(h->score(i)*100));
+ listKey.GetElement()->userData = (__u64)((__u32)(h->score(i)*100));
}
(*percent)(98, percentUserData);
}
More information about the sword-cvs
mailing list