[sword-svn] r3749 - in trunk: . include src/keys src/mgr src/modules src/modules/comments/rawfiles src/modules/common src/modules/filters src/modules/genbook/rawgenbook src/modules/lexdict/rawld src/modules/lexdict/rawld4 tests
scribe at crosswire.org
scribe at crosswire.org
Mon Jul 6 19:51:56 EDT 2020
Author: scribe
Date: 2020-07-06 19:51:56 -0400 (Mon, 06 Jul 2020)
New Revision: 3749
Modified:
trunk/ChangeLog
trunk/include/rawstr.h
trunk/include/rawstr4.h
trunk/include/stringmgr.h
trunk/include/swkey.h
trunk/include/sysdata.h
trunk/include/treekeyidx.h
trunk/include/utilstr.h
trunk/include/xzcomprs.h
trunk/src/keys/treekeyidx.cpp
trunk/src/keys/versekey.cpp
trunk/src/mgr/stringmgr.cpp
trunk/src/modules/comments/rawfiles/rawfiles.cpp
trunk/src/modules/common/entriesblk.cpp
trunk/src/modules/common/rawstr.cpp
trunk/src/modules/common/rawstr4.cpp
trunk/src/modules/common/rawverse.cpp
trunk/src/modules/common/rawverse4.cpp
trunk/src/modules/common/zstr.cpp
trunk/src/modules/common/zverse.cpp
trunk/src/modules/common/zverse4.cpp
trunk/src/modules/filters/rtfhtml.cpp
trunk/src/modules/filters/utf8greekaccents.cpp
trunk/src/modules/filters/utf8utf16.cpp
trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp
trunk/src/modules/lexdict/rawld/rawld.cpp
trunk/src/modules/lexdict/rawld4/rawld4.cpp
trunk/src/modules/swmodule.cpp
trunk/tests/utf8norm.cpp
Log:
Renamed __[su][8,16,32,64] defines to SW_[su][8,16,32,64]
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/ChangeLog 2020-07-06 23:51:56 UTC (rev 3749)
@@ -1,5 +1,7 @@
API ChangeLog
+07-Jul-2020 Troy A. Griffitts <scribe at crosswire.org>
+ Renamed __[su][8,16,32,64] defines to SW_[su][8,16,32,64]
01-Nov-2017 Troy A. Griffitts <scribe at crosswire.org>
Added bindings: Android and cordova
Modified: trunk/include/rawstr.h
===================================================================
--- trunk/include/rawstr.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/rawstr.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -54,8 +54,8 @@
virtual ~RawStr();
void getIDXBuf(long ioffset, char **buf) const;
void getIDXBufDat(long ioffset, char **buf) const;
- signed char findOffset(const char *key, __u32 *start, __u16 *size, long away = 0, __u32 *idxoff = 0) const;
- void readText(__u32 start, __u16 *size, char **idxbuf, SWBuf &buf) const;
+ signed char findOffset(const char *key, SW_u32 *start, SW_u16 *size, long away = 0, SW_u32 *idxoff = 0) const;
+ void readText(SW_u32 start, SW_u16 *size, char **idxbuf, SWBuf &buf) const;
static signed char createModule(const char *path);
};
Modified: trunk/include/rawstr4.h
===================================================================
--- trunk/include/rawstr4.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/rawstr4.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -53,8 +53,8 @@
virtual ~RawStr4();
void getIDXBuf(long ioffset, char **buf) const;
void getIDXBufDat(long ioffset, char **buf) const;
- signed char findOffset(const char *key, __u32 *start, __u32 *size, long away = 0, __u32 *idxoff = 0) const;
- void readText(__u32 start, __u32 *size, char **idxbuf, SWBuf &buf) const;
+ signed char findOffset(const char *key, SW_u32 *start, SW_u32 *size, long away = 0, SW_u32 *idxoff = 0) const;
+ void readText(SW_u32 start, SW_u32 *size, char **idxbuf, SWBuf &buf) const;
static signed char createModule(const char *path);
};
Modified: trunk/include/stringmgr.h
===================================================================
--- trunk/include/stringmgr.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/stringmgr.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -70,10 +70,10 @@
*/
virtual char *lowerUTF8(char *text, unsigned int max = 0) const;
- virtual bool isUpper(__u32 character) const;
- virtual bool isLower(__u32 character) const;
- virtual bool isDigit(__u32 character) const;
- virtual bool isAlpha(__u32 character) const;
+ virtual bool isUpper(SW_u32 character) const;
+ virtual bool isLower(SW_u32 character) const;
+ virtual bool isDigit(SW_u32 character) const;
+ virtual bool isAlpha(SW_u32 character) const;
/** Converts the param to an uppercase latin1 string
* @param text The text encoded in latin1 which should be turned into an upper case string
Modified: trunk/include/swkey.h
===================================================================
--- trunk/include/swkey.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/swkey.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -114,7 +114,7 @@
public:
// misc storage for whatever
- __u64 userData;
+ SW_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 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/sysdata.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -23,7 +23,7 @@
#ifndef SIZEDTYPES_H
#define SIZEDTYPES_H
/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * __xx is apparently not ok: it does pollute the POSIX namespace, changed to SW_xx. Use these in the
* header files exported to user space
*/
#ifdef USE_AUTOTOOLS
@@ -31,25 +31,25 @@
#endif
-typedef signed char __s8;
-typedef unsigned char __u8;
+typedef signed char SW_s8;
+typedef unsigned char SW_u8;
-typedef signed short __s16;
-typedef unsigned short __u16;
+typedef signed short SW_s16;
+typedef unsigned short SW_u16;
-typedef signed int __s32;
-typedef unsigned int __u32;
+typedef signed int SW_s32;
+typedef unsigned int SW_u32;
#ifdef OS_ANDROID
#elif defined(__GNUC__)
-__extension__ typedef __signed__ long long __s64;
-__extension__ typedef unsigned long long __u64;
+__extension__ typedef __signed__ long long SW_s64;
+__extension__ typedef unsigned long long SW_u64;
#elif defined(__BORLANDC__)
-typedef signed __int64 __s64;
-typedef unsigned __int64 __u64;
+typedef signed __int64 SW_s64;
+typedef unsigned __int64 SW_u64;
#else
-typedef signed long long __s64;
-typedef unsigned long long __u64;
+typedef signed long long SW_s64;
+typedef unsigned long long SW_u64;
#endif
#undef __swswap16
@@ -57,29 +57,29 @@
#undef __swswap64
#define __swswap16(x) \
- ((__u16)( \
- (((__u16)(x) & (__u16)0x00ffU) << 8) | \
- (((__u16)(x) & (__u16)0xff00U) >> 8) ))
+ ((SW_u16)( \
+ (((SW_u16)(x) & (SW_u16)0x00ffU) << 8) | \
+ (((SW_u16)(x) & (SW_u16)0xff00U) >> 8) ))
#define __swswap32(x) \
- ((__u32)( \
- (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
- (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
- (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
- (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+ ((SW_u32)( \
+ (((SW_u32)(x) & (SW_u32)0x000000ffUL) << 24) | \
+ (((SW_u32)(x) & (SW_u32)0x0000ff00UL) << 8) | \
+ (((SW_u32)(x) & (SW_u32)0x00ff0000UL) >> 8) | \
+ (((SW_u32)(x) & (SW_u32)0xff000000UL) >> 24) ))
#define __swswap64(x) \
- ((__u64)( \
- (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
- (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
- (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
- (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
- (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
- (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
- (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
- (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+ ((SW_u64)( \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x00000000000000ffULL) << 56) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x000000000000ff00ULL) << 40) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x0000000000ff0000ULL) << 24) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x00000000ff000000ULL) << 8) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x000000ff00000000ULL) >> 8) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x0000ff0000000000ULL) >> 24) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0x00ff000000000000ULL) >> 40) | \
+ (SW_u64)(((SW_u64)(x) & (SW_u64)0xff00000000000000ULL) >> 56) ))
Modified: trunk/include/treekeyidx.h
===================================================================
--- trunk/include/treekeyidx.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/treekeyidx.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -42,12 +42,12 @@
TreeNode();
~TreeNode();
void clear();
- __s32 offset;
- __s32 parent;
- __s32 next;
- __s32 firstChild;
+ SW_s32 offset;
+ SW_s32 parent;
+ SW_s32 next;
+ SW_s32 firstChild;
char *name;
- __u16 dsize;
+ SW_u16 dsize;
char *userData;
} currentNode;
Modified: trunk/include/utilstr.h
===================================================================
--- trunk/include/utilstr.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/utilstr.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -85,8 +85,8 @@
* unicode codepoint value (0 with buf incremented is invalid UTF8 byte
*/
-inline __u32 getUniCharFromUTF8(const unsigned char **buf, bool skipValidation = false) {
- __u32 ch = 0;
+inline SW_u32 getUniCharFromUTF8(const unsigned char **buf, bool skipValidation = false) {
+ SW_u32 ch = 0;
//case: We're at the end
if (!(**buf)) {
@@ -162,7 +162,7 @@
* to work with
*/
-inline SWBuf *getUTF8FromUniChar(__u32 uchar, SWBuf *appendTo) {
+inline SWBuf *getUTF8FromUniChar(SW_u32 uchar, SWBuf *appendTo) {
unsigned long base = appendTo->size();
// This would be out of Unicode bounds
Modified: trunk/include/xzcomprs.h
===================================================================
--- trunk/include/xzcomprs.h 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/include/xzcomprs.h 2020-07-06 23:51:56 UTC (rev 3749)
@@ -42,7 +42,7 @@
virtual void Decode(void);
virtual void setLevel(int l);
private:
- __u64 memlimit; // memory usage limit during decompression
+ SW_u64 memlimit; // memory usage limit during decompression
};
SWORD_NAMESPACE_END
Modified: trunk/src/keys/treekeyidx.cpp
===================================================================
--- trunk/src/keys/treekeyidx.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/keys/treekeyidx.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -177,7 +177,7 @@
bool TreeKeyIdx::previousSibling() {
TreeNode iterator;
- __s32 target = currentNode.offset;
+ SW_s32 target = currentNode.offset;
if (currentNode.parent > -1) {
getTreeNodeFromIdxOffset(currentNode.parent, &iterator);
getTreeNodeFromIdxOffset(iterator.firstChild, &iterator);
@@ -207,10 +207,10 @@
while (lastSib.next > -1) {
getTreeNodeFromIdxOffset(lastSib.next, &lastSib);
}
- __u32 idxOffset = (__u32)idxfd->seek(0, SEEK_END);
+ SW_u32 idxOffset = (SW_u32)idxfd->seek(0, SEEK_END);
lastSib.next = idxOffset;
saveTreeNodeOffsets(&lastSib);
- __u32 parent = currentNode.parent;
+ SW_u32 parent = currentNode.parent;
currentNode.clear();
currentNode.offset = idxOffset;
currentNode.parent = parent;
@@ -224,10 +224,10 @@
append();
}
else {
- __u32 idxOffset = (__u32)idxfd->seek(0, SEEK_END);
+ SW_u32 idxOffset = (SW_u32)idxfd->seek(0, SEEK_END);
currentNode.firstChild = idxOffset;
saveTreeNodeOffsets(¤tNode);
- __u32 parent = currentNode.offset;
+ SW_u32 parent = currentNode.offset;
currentNode.clear();
currentNode.offset = idxOffset;
currentNode.parent = parent;
@@ -257,7 +257,7 @@
}
if (!done) {
TreeNode iterator;
- __s32 target = currentNode.offset;
+ SW_s32 target = currentNode.offset;
if (currentNode.parent > -1) {
getTreeNodeFromIdxOffset(currentNode.parent, &iterator);
getTreeNodeFromIdxOffset(iterator.firstChild, &iterator);
@@ -331,8 +331,8 @@
void TreeKeyIdx::getTreeNodeFromDatOffset(long ioffset, TreeNode *node) const {
unsnappedKeyText = "";
char ch;
- __s32 tmp;
- __u16 tmp2;
+ SW_s32 tmp;
+ SW_u16 tmp2;
if (datfd && datfd->getFd() >= 0) {
@@ -379,7 +379,7 @@
char TreeKeyIdx::getTreeNodeFromIdxOffset(long ioffset, TreeNode *node) const {
unsnappedKeyText = "";
- __u32 offset;
+ SW_u32 offset;
char error = KEYERR_OUTOFBOUNDS;
if (ioffset < 0) {
@@ -387,7 +387,7 @@
error = 77; // out of bounds but still position to 0;
}
- node->offset = (__s32)ioffset;
+ node->offset = (SW_s32)ioffset;
if (idxfd && idxfd->getFd() >= 0) {
idxfd->seek(ioffset, SEEK_SET);
if (idxfd->read(&offset, 4) == 4) {
@@ -421,13 +421,13 @@
void TreeKeyIdx::saveTreeNodeOffsets(TreeNode *node) {
unsnappedKeyText = "";
long datOffset = 0;
- __s32 tmp;
+ SW_s32 tmp;
if (idxfd && idxfd->getFd() >= 0) {
idxfd->seek(node->offset, SEEK_SET);
if (idxfd->read(&tmp, 4) != 4) {
datOffset = datfd->seek(0, SEEK_END);
- tmp = (__s32)archtosword32(datOffset);
+ tmp = (SW_s32)archtosword32(datOffset);
idxfd->write(&tmp, 4);
}
else {
@@ -435,13 +435,13 @@
datfd->seek(datOffset, SEEK_SET);
}
- tmp = (__s32)archtosword32(node->parent);
+ tmp = (SW_s32)archtosword32(node->parent);
datfd->write(&tmp, 4);
- tmp = (__s32)archtosword32(node->next);
+ tmp = (SW_s32)archtosword32(node->next);
datfd->write(&tmp, 4);
- tmp = (__s32)archtosword32(node->firstChild);
+ tmp = (SW_s32)archtosword32(node->firstChild);
datfd->write(&tmp, 4);
}
}
@@ -488,12 +488,12 @@
void TreeKeyIdx::saveTreeNode(TreeNode *node) {
long datOffset = 0;
- __s32 tmp;
+ SW_s32 tmp;
if (idxfd && idxfd->getFd() >= 0) {
idxfd->seek(node->offset, SEEK_SET);
datOffset = datfd->seek(0, SEEK_END);
- tmp = (__s32)archtosword32(datOffset);
+ tmp = (SW_s32)archtosword32(datOffset);
idxfd->write(&tmp, 4);
saveTreeNodeOffsets(node);
@@ -502,7 +502,7 @@
char null = 0;
datfd->write(&null, 1);
- __u16 tmp2 = archtosword16(node->dsize);
+ SW_u16 tmp2 = archtosword16(node->dsize);
datfd->write(&tmp2, 2);
if (node->dsize) {
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/keys/versekey.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -776,7 +776,7 @@
lastKey->setPosition(TOP);
tmpListKey << *lastKey;
((VerseKey *)tmpListKey.getElement())->setAutoNormalize(isAutoNormalize());
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
else {
if (!dash) { // if last separator was not a dash just add
@@ -790,7 +790,7 @@
*lastKey = TOP;
tmpListKey << *lastKey;
((VerseKey *)tmpListKey.getElement())->setAutoNormalize(isAutoNormalize());
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
else {
bool f = false;
@@ -805,7 +805,7 @@
*lastKey = TOP;
tmpListKey << *lastKey;
((VerseKey *)tmpListKey.getElement())->setAutoNormalize(isAutoNormalize());
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
}
else if (expandRange) {
@@ -818,7 +818,7 @@
newElement->setUpperBound(*curKey);
*lastKey = *curKey;
*newElement = TOP;
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
}
}
@@ -1049,7 +1049,7 @@
lastKey->setLowerBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
else {
if (!dash) { // if last separator was not a dash just add
@@ -1062,7 +1062,7 @@
lastKey->setUpperBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
else {
bool f = false;
@@ -1076,7 +1076,7 @@
lastKey->setUpperBound(*curKey);
*lastKey = TOP;
tmpListKey << *lastKey;
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
}
else if (expandRange) {
@@ -1088,7 +1088,7 @@
*curKey = MAXVERSE;
newElement->setUpperBound(*curKey);
*newElement = TOP;
- tmpListKey.getElement()->userData = (__u64)(bufStart+(buf-iBuf.c_str()));
+ tmpListKey.getElement()->userData = (SW_u64)(bufStart + (buf - iBuf.c_str()));
}
}
}
Modified: trunk/src/mgr/stringmgr.cpp
===================================================================
--- trunk/src/mgr/stringmgr.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/mgr/stringmgr.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -145,10 +145,10 @@
public:
virtual char *upperUTF8(char *, unsigned int maxlen = 0) const;
virtual char *lowerUTF8(char *, unsigned int maxlen = 0) const;
- virtual bool isUpper(__u32 character) const;
- virtual bool isLower(__u32 character) const;
- virtual bool isDigit(__u32 character) const;
- virtual bool isAlpha(__u32 character) const;
+ virtual bool isUpper(SW_u32 character) const;
+ virtual bool isLower(SW_u32 character) const;
+ virtual bool isDigit(SW_u32 character) const;
+ virtual bool isAlpha(SW_u32 character) const;
protected:
virtual bool supportsUnicode() const { return true; };
@@ -276,16 +276,16 @@
return t;
}
-bool StringMgr::isUpper(__u32 character) const {
+bool StringMgr::isUpper(SW_u32 character) const {
return isupper(character);
}
-bool StringMgr::isLower(__u32 character) const {
+bool StringMgr::isLower(SW_u32 character) const {
return islower(character);
}
-bool StringMgr::isDigit(__u32 character) const {
+bool StringMgr::isDigit(SW_u32 character) const {
return isdigit(character);
}
-bool StringMgr::isAlpha(__u32 character) const {
+bool StringMgr::isAlpha(SW_u32 character) const {
return isalpha(character);
}
@@ -389,16 +389,16 @@
return ret;
}
-bool ICUStringMgr::isUpper(__u32 character) const {
+bool ICUStringMgr::isUpper(SW_u32 character) const {
return u_isupper(character);
}
-bool ICUStringMgr::isLower(__u32 character) const {
+bool ICUStringMgr::isLower(SW_u32 character) const {
return u_islower(character);
}
-bool ICUStringMgr::isDigit(__u32 character) const {
+bool ICUStringMgr::isDigit(SW_u32 character) const {
return u_isdigit(character);
}
-bool ICUStringMgr::isAlpha(__u32 character) const {
+bool ICUStringMgr::isAlpha(SW_u32 character) const {
return u_isalpha(character);
}
Modified: trunk/src/modules/comments/rawfiles/rawfiles.cpp
===================================================================
--- trunk/src/modules/comments/rawfiles/rawfiles.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/comments/rawfiles/rawfiles.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -187,7 +187,7 @@
const char *RawFiles::getNextFilename() {
static SWBuf incfile;
- __u32 number = 0;
+ SW_u32 number = 0;
FileDesc *datafile;
incfile.setFormatted("%s/incfile", path);
@@ -213,7 +213,7 @@
char RawFiles::createModule(const char *path) {
char *incfile = new char [ strlen (path) + 16 ];
- __u32 zero = 0;
+ SW_u32 zero = 0;
zero = archtosword32(zero);
FileDesc *datafile;
Modified: trunk/src/modules/common/entriesblk.cpp
===================================================================
--- trunk/src/modules/common/entriesblk.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/entriesblk.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -37,13 +37,13 @@
memcpy(block, iBlock, size);
}
else {
- block = (char *)calloc(1, sizeof(__u32));
+ block = (char *)calloc(1, sizeof(SW_u32));
}
}
EntriesBlock::EntriesBlock() {
- block = (char *)calloc(1, sizeof(__u32));
+ block = (char *)calloc(1, sizeof(SW_u32));
}
@@ -53,22 +53,22 @@
void EntriesBlock::setCount(int count) {
- __u32 rawCount = archtosword32(count);
- memcpy(block, &rawCount, sizeof(__u32));
+ SW_u32 rawCount = archtosword32(count);
+ memcpy(block, &rawCount, sizeof(SW_u32));
}
int EntriesBlock::getCount() {
- __u32 count = 0;
- memcpy(&count, block, sizeof(__u32));
+ SW_u32 count = 0;
+ memcpy(&count, block, sizeof(SW_u32));
count = swordtoarch32(count);
return count;
}
void EntriesBlock::getMetaEntry(int index, unsigned long *offset, unsigned long *size) {
- __u32 rawOffset = 0;
- __u32 rawSize = 0;
+ SW_u32 rawOffset = 0;
+ SW_u32 rawSize = 0;
*offset = 0;
*size = 0;
if (index >= getCount()) // assert index < count
@@ -84,8 +84,8 @@
void EntriesBlock::setMetaEntry(int index, unsigned long offset, unsigned long size) {
- __u32 rawOffset = (__u32)archtosword32(offset);
- __u32 rawSize = (__u32)archtosword32(size);
+ SW_u32 rawOffset = (SW_u32)archtosword32(offset);
+ SW_u32 rawSize = (SW_u32)archtosword32(size);
if (index >= getCount()) // assert index < count
return;
Modified: trunk/src/modules/common/rawstr.cpp
===================================================================
--- trunk/src/modules/common/rawstr.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/rawstr.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -145,7 +145,7 @@
void RawStr::getIDXBuf(long ioffset, char **buf) const
{
- __u32 offset;
+ SW_u32 offset;
if (idxfd && idxfd->getFd() >= 0) {
idxfd->seek(ioffset, SEEK_SET);
@@ -170,7 +170,7 @@
* RET: error status -1 general error; -2 new file
*/
-signed char RawStr::findOffset(const char *ikey, __u32 *start, __u16 *size, long away, __u32 *idxoff) const
+signed char RawStr::findOffset(const char *ikey, SW_u32 *start, SW_u16 *size, long away, SW_u32 *idxoff) const
{
char *trybuf, *maxbuf, *key = 0, quitflag = 0;
signed char retval = -1;
@@ -239,13 +239,13 @@
idxfd->seek(tryoff, SEEK_SET);
- __u32 tmpStart;
- __u16 tmpSize;
+ SW_u32 tmpStart;
+ SW_u16 tmpSize;
*start = *size = tmpStart = tmpSize = 0;
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 2);
if (idxoff)
- *idxoff = (__u32)tryoff;
+ *idxoff = (SW_u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch16(tmpSize);
@@ -264,17 +264,17 @@
if (bad) {
if(!awayFromSubstrCheck)
retval = -1;
- *start = (__u32)laststart;
+ *start = (SW_u32)laststart;
*size = lastsize;
tryoff = lasttry;
if (idxoff)
- *idxoff = (__u32)tryoff;
+ *idxoff = (SW_u32)tryoff;
break;
}
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 2);
if (idxoff)
- *idxoff = (__u32)tryoff;
+ *idxoff = (SW_u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch16(tmpSize);
@@ -306,12 +306,12 @@
*
*/
-void RawStr::readText(__u32 istart, __u16 *isize, char **idxbuf, SWBuf &buf) const
+void RawStr::readText(SW_u32 istart, SW_u16 *isize, char **idxbuf, SWBuf &buf) const
{
unsigned int ch;
char *idxbuflocal = 0;
getIDXBufDat(istart, &idxbuflocal);
- __u32 start = istart;
+ SW_u32 start = istart;
do {
if (*idxbuf)
@@ -368,12 +368,12 @@
void RawStr::doSetText(const char *ikey, const char *buf, long len)
{
- __u32 start, outstart;
- __u32 idxoff;
- __u32 endoff;
- __s32 shiftSize;
- __u16 size;
- __u16 outsize;
+ SW_u32 start, outstart;
+ SW_u32 idxoff;
+ SW_u32 endoff;
+ SW_s32 shiftSize;
+ SW_u16 size;
+ SW_u16 outsize;
char *tmpbuf = 0;
char *key = 0;
char *dbKey = 0;
@@ -426,7 +426,7 @@
while (true); // while we're resolving links
}
- endoff = (__u32)idxfd->seek(0, SEEK_END);
+ endoff = (SW_u32)idxfd->seek(0, SEEK_END);
shiftSize = endoff - idxoff;
@@ -442,7 +442,7 @@
memcpy(outbuf + size, buf, len);
size = outsize = size + (len);
- start = outstart = (__u32)datfd->seek(0, SEEK_END);
+ start = outstart = (SW_u32)datfd->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword16(size);
Modified: trunk/src/modules/common/rawstr4.cpp
===================================================================
--- trunk/src/modules/common/rawstr4.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/rawstr4.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -145,7 +145,7 @@
void RawStr4::getIDXBuf(long ioffset, char **buf) const
{
- __u32 offset;
+ SW_u32 offset;
if ((unsigned long)idxfd > 0) {
idxfd->seek(ioffset, SEEK_SET);
@@ -179,7 +179,7 @@
* RET: error status -1 general error; -2 new file
*/
-signed char RawStr4::findOffset(const char *ikey, __u32 *start, __u32 *size, long away, __u32 *idxoff) const
+signed char RawStr4::findOffset(const char *ikey, SW_u32 *start, SW_u32 *size, long away, SW_u32 *idxoff) const
{
char *trybuf, *maxbuf, *key = 0, quitflag = 0;
signed char retval = -1;
@@ -249,12 +249,12 @@
idxfd->seek(tryoff, SEEK_SET);
- __u32 tmpStart, tmpSize;
+ SW_u32 tmpStart, tmpSize;
*start = *size = tmpStart = tmpSize = 0;
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 4);
if (idxoff)
- *idxoff = (__u32)tryoff;
+ *idxoff = (SW_u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch32(tmpSize);
@@ -273,17 +273,17 @@
if (bad) {
if(!awayFromSubstrCheck)
retval = -1;
- *start = (__u32)laststart;
- *size = (__u32)lastsize;
+ *start = (SW_u32)laststart;
+ *size = (SW_u32)lastsize;
tryoff = lasttry;
if (idxoff)
- *idxoff = (__u32)tryoff;
+ *idxoff = (SW_u32)tryoff;
break;
}
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 4);
if (idxoff)
- *idxoff = (__u32)tryoff;
+ *idxoff = (SW_u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch32(tmpSize);
@@ -315,12 +315,12 @@
*
*/
-void RawStr4::readText(__u32 istart, __u32 *isize, char **idxbuf, SWBuf &buf) const
+void RawStr4::readText(SW_u32 istart, SW_u32 *isize, char **idxbuf, SWBuf &buf) const
{
unsigned int ch;
char *idxbuflocal = 0;
getIDXBufDat(istart, &idxbuflocal);
- __u32 start = istart;
+ SW_u32 start = istart;
do {
if (*idxbuf)
@@ -376,12 +376,12 @@
void RawStr4::doSetText(const char *ikey, const char *buf, long len) {
- __u32 start, outstart;
- __u32 idxoff;
- __u32 endoff;
- __s32 shiftSize;
- __u32 size;
- __u32 outsize;
+ SW_u32 start, outstart;
+ SW_u32 idxoff;
+ SW_u32 endoff;
+ SW_s32 shiftSize;
+ SW_u32 size;
+ SW_u32 outsize;
char *tmpbuf = 0;
char *key = 0;
char *dbKey = 0;
@@ -434,7 +434,7 @@
while (true); // while we're resolving links
}
- endoff = (__u32)idxfd->seek(0, SEEK_END);
+ endoff = (SW_u32)idxfd->seek(0, SEEK_END);
shiftSize = endoff - idxoff;
@@ -448,9 +448,9 @@
sprintf(outbuf, "%s%c%c", key, 13, 10);
size = strlen(outbuf);
memcpy(outbuf + size, buf, len);
- size = outsize = size + (__u32)len;
+ size = outsize = size + (SW_u32)len;
- start = outstart = (__u32)datfd->seek(0, SEEK_END);
+ start = outstart = (SW_u32)datfd->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
Modified: trunk/src/modules/common/rawverse.cpp
===================================================================
--- trunk/src/modules/common/rawverse.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/rawverse.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -122,8 +122,8 @@
if (idxfp[testmt-1]->getFd() >= 0) {
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
- __s32 tmpStart;
- __u16 tmpSize;
+ SW_s32 tmpStart;
+ SW_u16 tmpSize;
idxfp[testmt-1]->read(&tmpStart, 4);
long len = idxfp[testmt-1]->read(&tmpSize, 2); // read size
@@ -177,8 +177,8 @@
void RawVerse::doSetText(char testmt, long idxoff, const char *buf, long len)
{
- __s32 start;
- __u16 size;
+ SW_s32 start;
+ SW_u16 size;
idxoff *= 6;
if (!testmt)
@@ -186,7 +186,7 @@
size = (len < 0) ? strlen(buf) : len;
- start = (__s32)textfp[testmt-1]->seek(0, SEEK_END);
+ start = (SW_s32)textfp[testmt - 1]->seek(0, SEEK_END);
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
if (size) {
@@ -217,8 +217,8 @@
*/
void RawVerse::doLinkEntry(char testmt, long destidxoff, long srcidxoff) {
- __s32 start;
- __u16 size;
+ SW_s32 start;
+ SW_u16 size;
destidxoff *= 6;
srcidxoff *= 6;
@@ -282,8 +282,8 @@
vk.setVersificationSystem(v11n);
vk.setIntros(1);
- __s32 offset = 0;
- __u16 size = 0;
+ SW_s32 offset = 0;
+ SW_u16 size = 0;
offset = archtosword32(offset);
size = archtosword16(size);
Modified: trunk/src/modules/common/rawverse4.cpp
===================================================================
--- trunk/src/modules/common/rawverse4.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/rawverse4.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -123,8 +123,8 @@
if (idxfp[testmt-1]->getFd() >= 0) {
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
- __u32 tmpStart;
- __u32 tmpSize;
+ SW_u32 tmpStart;
+ SW_u32 tmpSize;
idxfp[testmt-1]->read(&tmpStart, 4);
long len = idxfp[testmt-1]->read(&tmpSize, 4); // read size
@@ -178,16 +178,16 @@
void RawVerse4::doSetText(char testmt, long idxoff, const char *buf, long len)
{
- __u32 start;
- __u32 size;
+ SW_u32 start;
+ SW_u32 size;
idxoff *= 8;
if (!testmt)
testmt = ((idxfp[1]) ? 1:2);
- size = (__u32)((len < 0) ? strlen(buf) : len);
+ size = (SW_u32)((len < 0) ? strlen(buf) : len);
- start = (__u32)textfp[testmt-1]->seek(0, SEEK_END);
+ start = (SW_u32)textfp[testmt - 1]->seek(0, SEEK_END);
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
if (size) {
@@ -218,8 +218,8 @@
*/
void RawVerse4::doLinkEntry(char testmt, long destidxoff, long srcidxoff) {
- __u32 start;
- __u32 size;
+ SW_u32 start;
+ SW_u32 size;
destidxoff *= 8;
srcidxoff *= 8;
@@ -282,8 +282,8 @@
VerseKey vk;
vk.setVersificationSystem(v11n);
vk.setIntros(1);
- __u32 offset = 0;
- __u32 size = 0;
+ SW_u32 offset = 0;
+ SW_u32 size = 0;
offset = archtosword32(offset);
size = archtosword32(size);
Modified: trunk/src/modules/common/zstr.cpp
===================================================================
--- trunk/src/modules/common/zstr.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/zstr.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -167,7 +167,7 @@
void zStr::getKeyFromIdxOffset(long ioffset, char **buf) const
{
- __u32 offset;
+ SW_u32 offset;
if (idxfd && idxfd->getFd() >= 0) {
idxfd->seek(ioffset, SEEK_SET);
@@ -194,13 +194,13 @@
{
char *maxbuf = 0, *trybuf = 0, *key = 0, quitflag = 0;
signed char retval = 0;
- __s32 headoff, tailoff, tryoff = 0, maxoff = 0;
- __u32 start, size;
+ SW_s32 headoff, tailoff, tryoff = 0, maxoff = 0;
+ SW_u32 start, size;
int diff = 0;
bool awayFromSubstrCheck = false;
if (idxfd->getFd() >= 0) {
- tailoff = maxoff = (__s32)idxfd->seek(0, SEEK_END) - IDXENTRYSIZE;
+ tailoff = maxoff = (SW_s32)idxfd->seek(0, SEEK_END) - IDXENTRYSIZE;
if (*ikey) {
headoff = 0;
stdstr(&key, ikey, 3);
@@ -212,7 +212,7 @@
getKeyFromIdxOffset(maxoff, &maxbuf);
while (headoff < tailoff) {
- tryoff = ((__s32)lastoff == -1) ? headoff + (((((tailoff / IDXENTRYSIZE) - (headoff / IDXENTRYSIZE))) / 2) * IDXENTRYSIZE) : (__s32)lastoff;
+ tryoff = ((SW_s32)lastoff == -1) ? headoff + (((((tailoff / IDXENTRYSIZE) - (headoff / IDXENTRYSIZE))) / 2) * IDXENTRYSIZE) : (SW_s32)lastoff;
lastoff = -1;
getKeyFromIdxOffset(tryoff, &trybuf);
@@ -268,9 +268,9 @@
*idxoff = tryoff;
while (away) {
- __u32 laststart = start;
- __u32 lastsize = size;
- __s32 lasttry = tryoff;
+ SW_u32 laststart = start;
+ SW_u32 lastsize = size;
+ SW_s32 lasttry = tryoff;
tryoff += (away > 0) ? IDXENTRYSIZE : -IDXENTRYSIZE;
bool bad = false;
@@ -328,8 +328,8 @@
char *ch;
char *idxbuflocal = 0;
getKeyFromIdxOffset(offset, &idxbuflocal);
- __u32 start;
- __u32 size;
+ SW_u32 start;
+ SW_u32 size;
do {
idxfd->seek(offset, SEEK_SET);
@@ -368,16 +368,16 @@
while (true); // while we're resolving links
if (idxbuflocal) {
- __u32 localsize = (__u32)strlen(idxbuflocal);
+ SW_u32 localsize = (SW_u32)strlen(idxbuflocal);
localsize = (localsize < (size - 1)) ? localsize : (size - 1);
strncpy(*idxbuf, idxbuflocal, localsize);
(*idxbuf)[localsize] = 0;
free(idxbuflocal);
}
- __u32 block = 0;
- __u32 entry = 0;
- memmove(&block, *buf, sizeof(__u32));
- memmove(&entry, *buf + sizeof(__u32), sizeof(__u32));
+ SW_u32 block = 0;
+ SW_u32 entry = 0;
+ memmove(&block, *buf, sizeof(SW_u32));
+ memmove(&entry, *buf + sizeof(SW_u32), sizeof(SW_u32));
block = swordtoarch32(block);
entry = swordtoarch32(entry);
getCompressedText(block, entry, buf);
@@ -391,10 +391,10 @@
void zStr::getCompressedText(long block, long entry, char **buf) const {
- __u32 size = 0;
+ SW_u32 size = 0;
if (cacheBlockIndex != block) {
- __u32 start = 0;
+ SW_u32 start = 0;
zdxfd->seek(block * ZDXENTRYSIZE, SEEK_SET);
zdxfd->read(&start, 4);
@@ -418,7 +418,7 @@
cacheBlock = new EntriesBlock(rawBuf, len);
cacheBlockIndex = block;
}
- size = (__u32)cacheBlock->getEntrySize(entry);
+ size = (SW_u32)cacheBlock->getEntrySize(entry);
*buf = (*buf) ? (char *)realloc(*buf, size*2 + 1) : (char *)malloc(size*2 + 1);
strcpy(*buf, cacheBlock->getEntry(entry));
}
@@ -436,11 +436,11 @@
static const char nl[] = {13, 10};
- __u32 start, outstart;
- __u32 size, outsize;
- __s32 endoff;
+ SW_u32 start, outstart;
+ SW_u32 size, outsize;
+ SW_s32 endoff;
long idxoff = 0;
- __s32 shiftSize;
+ SW_s32 shiftSize;
char *tmpbuf = 0;
char *key = 0;
char *dbKey = 0;
@@ -499,9 +499,9 @@
}
}
- endoff = (__s32)idxfd->seek(0, SEEK_END);
+ endoff = (SW_s32)idxfd->seek(0, SEEK_END);
- shiftSize = endoff - (__s32)idxoff;
+ shiftSize = endoff - (SW_s32)idxoff;
if (shiftSize > 0) {
idxBytes = new char [ shiftSize ];
@@ -511,7 +511,7 @@
outbuf = new char [ len + strlen(key) + 5 ];
sprintf(outbuf, "%s%c%c", key, 13, 10);
- size = (__u32)strlen(outbuf);
+ size = (SW_u32)strlen(outbuf);
if (len > 0) { // NOT a link
if (!cacheBlock) {
flushCache();
@@ -523,20 +523,20 @@
cacheBlock = new EntriesBlock();
cacheBlockIndex = (zdxfd->seek(0, SEEK_END) / ZDXENTRYSIZE);
}
- __u32 entry = cacheBlock->addEntry(buf);
+ SW_u32 entry = cacheBlock->addEntry(buf);
cacheDirty = true;
- outstart = (__u32)archtosword32(cacheBlockIndex);
+ outstart = (SW_u32)archtosword32(cacheBlockIndex);
outsize = archtosword32(entry);
- memcpy (outbuf + size, &outstart, sizeof(__u32));
- memcpy (outbuf + size + sizeof(__u32), &outsize, sizeof(__u32));
- size += (sizeof(__u32) * 2);
+ memcpy (outbuf + size, &outstart, sizeof(SW_u32));
+ memcpy (outbuf + size + sizeof(SW_u32), &outsize, sizeof(SW_u32));
+ size += (sizeof(SW_u32) * 2);
}
else { // link
memcpy(outbuf + size, buf, len);
size += len;
}
- start = (__u32)datfd->seek(0, SEEK_END);
+ start = (SW_u32)datfd->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
@@ -593,9 +593,9 @@
if (cacheBlock) {
if (cacheDirty) {
- __u32 start = 0;
+ SW_u32 start = 0;
unsigned long size = 0;
- __u32 outstart = 0, outsize = 0;
+ SW_u32 outstart = 0, outsize = 0;
const char *rawBuf = cacheBlock->getRawData(&size);
compressor->Buf(rawBuf, &size);
@@ -611,7 +611,7 @@
unsigned long zdtSize = zdtfd->seek(0, SEEK_END);
if ((cacheBlockIndex * ZDXENTRYSIZE) > (zdxSize - ZDXENTRYSIZE)) { // New Block
- start = (__u32)zdtSize;
+ start = (SW_u32)zdtSize;
}
else {
zdxfd->seek(cacheBlockIndex * ZDXENTRYSIZE, SEEK_SET);
@@ -626,14 +626,14 @@
size = outsize;
}
else { // middle and bigger-- we have serious problems, for now let's put it at the end = lots of wasted space
- start = (__u32)zdtSize;
+ start = (SW_u32)zdtSize;
}
}
outstart = archtosword32(start);
- outsize = archtosword32((__u32)size);
+ outsize = archtosword32((SW_u32)size);
zdxfd->seek(cacheBlockIndex * ZDXENTRYSIZE, SEEK_SET);
zdtfd->seek(start, SEEK_SET);
Modified: trunk/src/modules/common/zverse.cpp
===================================================================
--- trunk/src/modules/common/zverse.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/zverse.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -149,9 +149,9 @@
void zVerse::findOffset(char testmt, long idxoff, long *start, unsigned short *size, unsigned long *buffnum) const
{
- __u32 ulBuffNum = 0; // buffer number
- __u32 ulVerseStart = 0; // verse offset within buffer
- __u16 usVerseSize = 0; // verse size
+ SW_u32 ulBuffNum = 0; // buffer number
+ SW_u32 ulVerseStart = 0; // verse offset within buffer
+ SW_u16 usVerseSize = 0; // verse size
// set start to offset in
// set size to
// set
@@ -204,9 +204,9 @@
*/
void zVerse::zReadText(char testmt, long start, unsigned short size, unsigned long ulBuffNum, SWBuf &inBuf) const {
- __u32 ulCompOffset = 0; // compressed buffer start
- __u32 ulCompSize = 0; // buffer size compressed
- __u32 ulUnCompSize = 0; // buffer size uncompressed
+ SW_u32 ulCompOffset = 0; // compressed buffer start
+ SW_u32 ulCompSize = 0; // buffer size compressed
+ SW_u32 ulUnCompSize = 0; // buffer size uncompressed
if (!testmt) {
testmt = ((idxfp[0]) ? 1:2);
@@ -312,14 +312,14 @@
dirtyCache = true;
- __u32 start;
- __u16 size;
- __u32 outBufIdx = (__u32)cacheBufIdx;
+ SW_u32 start;
+ SW_u16 size;
+ SW_u32 outBufIdx = (SW_u32)cacheBufIdx;
idxoff *= 10;
size = len;
- start = (__u32)strlen(cacheBuf);
+ start = (SW_u32)strlen(cacheBuf);
if (!size)
start = outBufIdx = 0;
@@ -338,14 +338,14 @@
void zVerse::flushCache() const {
if (dirtyCache) {
- __u32 idxoff;
- __u32 start, outstart;
- __u32 size, outsize;
- __u32 zsize, outzsize;
+ SW_u32 idxoff;
+ SW_u32 start, outstart;
+ SW_u32 size, outsize;
+ SW_u32 zsize, outzsize;
- idxoff = (__u32)cacheBufIdx * 12;
+ idxoff = (SW_u32)cacheBufIdx * 12;
if (cacheBuf) {
- size = outsize = zsize = outzsize = (__u32)strlen(cacheBuf);
+ size = outsize = zsize = outzsize = (SW_u32)strlen(cacheBuf);
if (size) {
// if (compressor) {
// delete compressor;
@@ -354,16 +354,16 @@
compressor->Buf(cacheBuf);
unsigned long tmpSize;
compressor->zBuf(&tmpSize);
- outzsize = zsize = (__u32)tmpSize;
+ outzsize = zsize = (SW_u32)tmpSize;
SWBuf buf;
buf.setSize(zsize + 5);
memcpy(buf.getRawData(), compressor->zBuf(&tmpSize), tmpSize);
- outzsize = zsize = (__u32)tmpSize;
+ outzsize = zsize = (SW_u32)tmpSize;
buf.setSize(zsize);
rawZFilter(buf, 1); // 1 = encipher
- start = outstart = (__u32)textfp[cacheTestament-1]->seek(0, SEEK_END);
+ start = outstart = (SW_u32)textfp[cacheTestament - 1]->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
@@ -392,9 +392,9 @@
*/
void zVerse::doLinkEntry(char testmt, long destidxoff, long srcidxoff) {
- __s32 bufidx;
- __s32 start;
- __u16 size;
+ SW_s32 bufidx;
+ SW_s32 start;
+ SW_u16 size;
destidxoff *= 10;
srcidxoff *= 10;
@@ -429,8 +429,8 @@
char *buf = new char [ strlen (ipath) + 20 ];
char retVal = 0;
FileDesc *fd, *fd2;
- __s32 offset = 0;
- __s16 size = 0;
+ SW_s32 offset = 0;
+ SW_s16 size = 0;
VerseKey vk;
stdstr(&path, ipath);
Modified: trunk/src/modules/common/zverse4.cpp
===================================================================
--- trunk/src/modules/common/zverse4.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/common/zverse4.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -147,9 +147,9 @@
void zVerse4::findOffset(char testmt, long idxoff, long *start, unsigned long *size, unsigned long *buffnum) const
{
- __u32 ulBuffNum = 0; // buffer number
- __u32 ulVerseStart = 0; // verse offset within buffer
- __u32 usVerseSize = 0; // verse size
+ SW_u32 ulBuffNum = 0; // buffer number
+ SW_u32 ulVerseStart = 0; // verse offset within buffer
+ SW_u32 usVerseSize = 0; // verse size
// set start to offset in
// set size to
// set
@@ -202,9 +202,9 @@
*/
void zVerse4::zReadText(char testmt, long start, unsigned long size, unsigned long ulBuffNum, SWBuf &inBuf) const {
- __u32 ulCompOffset = 0; // compressed buffer start
- __u32 ulCompSize = 0; // buffer size compressed
- __u32 ulUnCompSize = 0; // buffer size uncompressed
+ SW_u32 ulCompOffset = 0; // compressed buffer start
+ SW_u32 ulCompSize = 0; // buffer size compressed
+ SW_u32 ulUnCompSize = 0; // buffer size uncompressed
if (!testmt) {
testmt = ((idxfp[0]) ? 1:2);
@@ -310,14 +310,14 @@
dirtyCache = true;
- __u32 start;
- __u32 size;
- __u32 outBufIdx = (__u32)cacheBufIdx;
+ SW_u32 start;
+ SW_u32 size;
+ SW_u32 outBufIdx = (SW_u32)cacheBufIdx;
idxoff *= 12;
- size = (__u32)len;
+ size = (SW_u32)len;
- start = (__u32)strlen(cacheBuf);
+ start = (SW_u32)strlen(cacheBuf);
if (!size)
start = outBufIdx = 0;
@@ -336,28 +336,28 @@
void zVerse4::flushCache() const {
if (dirtyCache) {
- __u32 idxoff;
- __u32 start, outstart;
- __u32 size, outsize;
- __u32 zsize, outzsize;
+ SW_u32 idxoff;
+ SW_u32 start, outstart;
+ SW_u32 size, outsize;
+ SW_u32 zsize, outzsize;
- idxoff = (__u32)cacheBufIdx * 12;
+ idxoff = (SW_u32)cacheBufIdx * 12;
if (cacheBuf) {
- size = outsize = zsize = outzsize = (__u32)strlen(cacheBuf);
+ size = outsize = zsize = outzsize = (SW_u32)strlen(cacheBuf);
if (size) {
compressor->Buf(cacheBuf);
unsigned long tmpSize;
compressor->zBuf(&tmpSize);
- outzsize = zsize = (__u32)tmpSize;
+ outzsize = zsize = (SW_u32)tmpSize;
SWBuf buf;
buf.setSize(zsize + 5);
memcpy(buf.getRawData(), compressor->zBuf(&tmpSize), tmpSize);
- outzsize = zsize = (__u32)tmpSize;
+ outzsize = zsize = (SW_u32)tmpSize;
buf.setSize(zsize);
rawZFilter(buf, 1); // 1 = encipher
- start = outstart = (__u32)textfp[cacheTestament-1]->seek(0, SEEK_END);
+ start = outstart = (SW_u32)textfp[cacheTestament - 1]->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
@@ -386,9 +386,9 @@
*/
void zVerse4::doLinkEntry(char testmt, long destidxoff, long srcidxoff) {
- __s32 bufidx;
- __s32 start;
- __u32 size;
+ SW_s32 bufidx;
+ SW_s32 start;
+ SW_u32 size;
destidxoff *= 12;
srcidxoff *= 12;
@@ -423,8 +423,8 @@
char *buf = new char [ strlen (ipath) + 20 ];
char retVal = 0;
FileDesc *fd, *fd2;
- __s32 offset = 0;
- __s32 size = 0;
+ SW_s32 offset = 0;
+ SW_s32 size = 0;
VerseKey vk;
stdstr(&path, ipath);
Modified: trunk/src/modules/filters/rtfhtml.cpp
===================================================================
--- trunk/src/modules/filters/rtfhtml.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/filters/rtfhtml.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -53,8 +53,8 @@
while (isdigit(*++end));
SWBuf num;
num.append(from, end-from);
- __s16 n = atoi(num.c_str());
- __u32 u = (__u16)n;
+ SW_s16 n = atoi(num.c_str());
+ SW_u32 u = (SW_u16)n;
getUTF8FromUniChar(u, &text);
from += (end-from);
continue;
Modified: trunk/src/modules/filters/utf8greekaccents.cpp
===================================================================
--- trunk/src/modules/filters/utf8greekaccents.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/filters/utf8greekaccents.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -42,7 +42,7 @@
return &oVals;
}
- std::map<__u32, SWBuf> converters;
+ std::map<SW_u32, SWBuf> converters;
class converters_init {
public:
converters_init() {
@@ -350,9 +350,9 @@
SWBuf orig = text;
const unsigned char* from = (unsigned char*)orig.c_str();
text = "";
- map<__u32, SWBuf>::const_iterator it = converters.end();
+ map<SW_u32, SWBuf>::const_iterator it = converters.end();
while (*from) {
- __u32 ch = getUniCharFromUTF8(&from, true);
+ SW_u32 ch = getUniCharFromUTF8(&from, true);
// if ch is bad, then convert to replacement char
if (!ch) ch = 0xFFFD;
Modified: trunk/src/modules/filters/utf8utf16.cpp
===================================================================
--- trunk/src/modules/filters/utf8utf16.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/filters/utf8utf16.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -43,25 +43,25 @@
text = "";
while (*from) {
- __u32 ch = getUniCharFromUTF8(&from);
+ SW_u32 ch = getUniCharFromUTF8(&from);
if (!ch) continue; // invalid char
if (ch < 0x10000) {
text.setSize(text.size()+2);
- *((__u16 *)(text.getRawData()+(text.size()-2))) = (__u16)ch;
+ *((SW_u16 *)(text.getRawData() + (text.size() - 2))) = (SW_u16)ch;
}
else {
- __u16 utf16;
- utf16 = (__s16)((ch - 0x10000) / 0x400 + 0xD800);
+ SW_u16 utf16;
+ utf16 = (SW_s16)((ch - 0x10000) / 0x400 + 0xD800);
text.setSize(text.size()+4);
- *((__u16 *)(text.getRawData()+(text.size()-4))) = utf16;
- utf16 = (__s16)((ch - 0x10000) % 0x400 + 0xDC00);
- *((__u16 *)(text.getRawData()+(text.size()-2))) = utf16;
+ *((SW_u16 *)(text.getRawData() + (text.size() - 4))) = utf16;
+ utf16 = (SW_s16)((ch - 0x10000) % 0x400 + 0xDC00);
+ *((SW_u16 *)(text.getRawData() + (text.size() - 2))) = utf16;
}
}
text.setSize(text.size()+2);
- *((__u16 *)(text.getRawData()+(text.size()-2))) = (__u16)0;
+ *((SW_u16 *)(text.getRawData() + (text.size() - 2))) = (SW_u16)0;
text.setSize(text.size()-2);
return 0;
Modified: trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp
===================================================================
--- trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -98,8 +98,8 @@
SWBuf &RawGenBook::getRawEntryBuf() const {
- __u32 offset = 0;
- __u32 size = 0;
+ SW_u32 offset = 0;
+ SW_u32 size = 0;
const TreeKey &key = getTreeKey();
@@ -133,8 +133,8 @@
void RawGenBook::setEntry(const char *inbuf, long len) {
- __u32 offset = (__u32)archtosword32(bdtfd->seek(0, SEEK_END));
- __u32 size = 0;
+ SW_u32 offset = (SW_u32)archtosword32(bdtfd->seek(0, SEEK_END));
+ SW_u32 size = 0;
TreeKeyIdx *key = ((TreeKeyIdx *)&(getTreeKey()));
char userData[8];
@@ -144,7 +144,7 @@
bdtfd->write(inbuf, len);
- size = (__u32)archtosword32(len);
+ size = (SW_u32)archtosword32(len);
memcpy(userData, &offset, 4);
memcpy(userData+4, &size, 4);
key->setUserData(userData, 8);
Modified: trunk/src/modules/lexdict/rawld/rawld.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld/rawld.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/lexdict/rawld/rawld.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -73,8 +73,8 @@
char RawLD::getEntry(long away) const
{
- __u32 start = 0;
- __u16 size = 0;
+ SW_u32 start = 0;
+ SW_u16 size = 0;
char *idxbuf = 0;
char retval = 0;
@@ -195,8 +195,8 @@
long RawLD::getEntryForKey(const char *key) const {
- __u32 start, offset;
- __u16 size;
+ SW_u32 start, offset;
+ SW_u16 size;
char *buf = new char [ strlen(key) + 6 ];
strcpy(buf, key);
Modified: trunk/src/modules/lexdict/rawld4/rawld4.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld4/rawld4.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/lexdict/rawld4/rawld4.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -73,8 +73,8 @@
char RawLD4::getEntry(long away) const
{
- __u32 start = 0;
- __u32 size = 0;
+ SW_u32 start = 0;
+ SW_u32 size = 0;
char *idxbuf = 0;
char retval = 0;
@@ -193,8 +193,8 @@
long RawLD4::getEntryForKey(const char *key) const {
- __u32 start, offset;
- __u32 size;
+ SW_u32 start, offset;
+ SW_u32 size;
char *buf = new char [ strlen(key) + 6 ];
strcpy(buf, key);
Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/src/modules/swmodule.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -556,7 +556,7 @@
Xapian::MSetIterator i;
for (i = h.begin(); i != h.end(); ++i) {
// cout << "Document ID " << *i << "\t";
- __u64 score = i.get_percent();
+ SW_u64 score = i.get_percent();
Xapian::Document doc = i.get_document();
*resultKey = doc.get_data().c_str();
#elif defined USELUCENE
@@ -564,7 +564,7 @@
Document &doc = h->doc(i);
// set a temporary verse key to this module position
*resultKey = wcharToUTF8(doc.get(_T("key"))); //TODO Does a key always accept utf8?
- __u64 score = (__u64)((__u32)(h->score(i)*100));
+ SW_u64 score = (SW_u64)((SW_u32)(h->score(i) * 100));
#endif
// check to see if it sets ok (within our bounds) and if not, skip
Modified: trunk/tests/utf8norm.cpp
===================================================================
--- trunk/tests/utf8norm.cpp 2020-07-02 17:20:40 UTC (rev 3748)
+++ trunk/tests/utf8norm.cpp 2020-07-06 23:51:56 UTC (rev 3749)
@@ -67,7 +67,7 @@
}
const unsigned char *c = (const unsigned char *)filteredContents.getRawData();
// UTF-32 BOM
- __u32 ch = 0xfeff;
+ SW_u32 ch = 0xfeff;
// write(STDOUT_FILENO, &ch, 4);
while (c && *c) {
ch = getUniCharFromUTF8(&c);
More information about the sword-cvs
mailing list