diff options
author | joerg <joerg@pkgsrc.org> | 2016-12-17 14:22:39 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2016-12-17 14:22:39 +0000 |
commit | fd2db1427d238a244a241c6c1042df5307c18a8c (patch) | |
tree | c15f840cff01f7c26131988273bc41ad3000b997 | |
parent | 3ec081cccd397a2bdfa0b98fafecd8551277711a (diff) | |
download | pkgsrc-fd2db1427d238a244a241c6c1042df5307c18a8c.tar.gz |
Don't try to order pointers, check for NULLness.
-rw-r--r-- | misc/sword/distinfo | 10 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_keys_treekeyidx.cpp | 49 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_mgr_swmgr.cpp | 13 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_modules_common_rawstr.cpp | 31 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_modules_common_rawstr4.cpp | 31 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_modules_common_zstr.cpp | 31 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp | 13 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp | 13 | ||||
-rw-r--r-- | misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp | 13 |
9 files changed, 203 insertions, 1 deletions
diff --git a/misc/sword/distinfo b/misc/sword/distinfo index 3af6c5ec705..c640f268ded 100644 --- a/misc/sword/distinfo +++ b/misc/sword/distinfo @@ -1,7 +1,15 @@ -$NetBSD: distinfo,v 1.2 2015/11/03 23:49:52 agc Exp $ +$NetBSD: distinfo,v 1.3 2016/12/17 14:22:39 joerg Exp $ SHA1 (sword-1.7.4.tar.gz) = 9fc1070baaa9f991056c1dc0d0455022de2610db RMD160 (sword-1.7.4.tar.gz) = 55a0b741a97e58f29cfa5eca4572719660447393 SHA512 (sword-1.7.4.tar.gz) = 4c8b183e613367364439cc7a8a842012f75180fccc8eb775b9af2dc4c10f39c152261d35f0aadaaa91a11df36ab1a4057c2edc50ea4b0b3bb0ab0a847ff68f75 Size (sword-1.7.4.tar.gz) = 2157882 bytes SHA1 (patch-Makefile.in) = 512be822cb96144244cb93f70ca2ba409a90db9b +SHA1 (patch-src_keys_treekeyidx.cpp) = 2bae86876bfb4a1c74faf709d016e7665514cd90 +SHA1 (patch-src_mgr_swmgr.cpp) = e0e63ec4df6b07c89678a33827cc925f3ccb2369 +SHA1 (patch-src_modules_common_rawstr.cpp) = 89bf3b3bf389393dc0d826f6aa0ab1a4737d30bd +SHA1 (patch-src_modules_common_rawstr4.cpp) = 966d0f6b52ac888abb27376ec0cedd2336bc6b99 +SHA1 (patch-src_modules_common_zstr.cpp) = 591cbf710dade59c5249d8c15ae2db5ac791db03 +SHA1 (patch-src_modules_lexdict_rawld4_rawld4.cpp) = d2cebbe1ddd5456d52f651079fc6e4eec46905d4 +SHA1 (patch-src_modules_lexdict_rawld_rawld.cpp) = 48a55530444b6e10412bdb08d2036395554a7299 +SHA1 (patch-src_modules_lexdict_zld_zld.cpp) = a4f4075da1011728ff6fde8c0a13b4c9d45fe3cd diff --git a/misc/sword/patches/patch-src_keys_treekeyidx.cpp b/misc/sword/patches/patch-src_keys_treekeyidx.cpp new file mode 100644 index 00000000000..fc5dffc1e66 --- /dev/null +++ b/misc/sword/patches/patch-src_keys_treekeyidx.cpp @@ -0,0 +1,49 @@ +$NetBSD: patch-src_keys_treekeyidx.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/keys/treekeyidx.cpp.orig 2016-12-17 11:16:23.463483505 +0000 ++++ src/keys/treekeyidx.cpp +@@ -61,7 +61,7 @@ TreeKeyIdx::TreeKeyIdx(const char *idxPa + buf.setFormatted("%s.dat", path); + datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); + +- if (datfd <= 0) { ++ if (!datfd) { + SWLog::getSystemLog()->logError("%d", errno); + error = errno; + } +@@ -331,7 +331,7 @@ void TreeKeyIdx::getTreeNodeFromDatOffse + __s32 tmp; + __u16 tmp2; + +- if (datfd > 0) { ++ if (datfd) { + + datfd->seek(ioffset, SEEK_SET); + +@@ -385,7 +385,7 @@ char TreeKeyIdx::getTreeNodeFromIdxOffse + } + + node->offset = ioffset; +- if (idxfd > 0) { ++ if (idxfd) { + if (idxfd->getFd() > 0) { + idxfd->seek(ioffset, SEEK_SET); + if (idxfd->read(&offset, 4) == 4) { +@@ -422,7 +422,7 @@ void TreeKeyIdx::saveTreeNodeOffsets(Tre + long datOffset = 0; + __s32 tmp; + +- if (idxfd > 0) { ++ if (idxfd) { + idxfd->seek(node->offset, SEEK_SET); + if (idxfd->read(&tmp, 4) != 4) { + datOffset = datfd->seek(0, SEEK_END); +@@ -488,7 +488,7 @@ void TreeKeyIdx::copyFrom(const TreeKeyI + void TreeKeyIdx::saveTreeNode(TreeNode *node) { + long datOffset = 0; + __s32 tmp; +- if (idxfd > 0) { ++ if (idxfd) { + + idxfd->seek(node->offset, SEEK_SET); + datOffset = datfd->seek(0, SEEK_END); diff --git a/misc/sword/patches/patch-src_mgr_swmgr.cpp b/misc/sword/patches/patch-src_mgr_swmgr.cpp new file mode 100644 index 00000000000..f96879f9017 --- /dev/null +++ b/misc/sword/patches/patch-src_mgr_swmgr.cpp @@ -0,0 +1,13 @@ +$NetBSD: patch-src_mgr_swmgr.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/mgr/swmgr.cpp.orig 2016-12-17 11:17:23.119076977 +0000 ++++ src/mgr/swmgr.cpp +@@ -1362,7 +1362,7 @@ void SWMgr::InstallScan(const char *dirn + else { + if (!conffd) { + conffd = FileMgr::getSystemFileMgr()->open(config->filename.c_str(), FileMgr::WRONLY|FileMgr::APPEND); +- if (conffd > 0) ++ if (conffd) + conffd->seek(0L, SEEK_END); + else { + FileMgr::getSystemFileMgr()->close(conffd); diff --git a/misc/sword/patches/patch-src_modules_common_rawstr.cpp b/misc/sword/patches/patch-src_modules_common_rawstr.cpp new file mode 100644 index 00000000000..1d15a22f39b --- /dev/null +++ b/misc/sword/patches/patch-src_modules_common_rawstr.cpp @@ -0,0 +1,31 @@ +$NetBSD: patch-src_modules_common_rawstr.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/modules/common/rawstr.cpp.orig 2016-12-17 11:18:57.855699237 +0000 ++++ src/modules/common/rawstr.cpp +@@ -74,7 +74,7 @@ RawStr::RawStr(const char *ipath, int fi + buf.setFormatted("%s.dat", path); + datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); + +- if (datfd < 0) { ++ if (!datfd) { + SWLog::getSystemLog()->logError("%d", errno); + } + +@@ -111,7 +111,7 @@ void RawStr::getIDXBufDat(long ioffset, + { + int size; + char ch; +- if (datfd > 0) { ++ if (datfd) { + datfd->seek(ioffset, SEEK_SET); + for (size = 0; datfd->read(&ch, 1) == 1; size++) { + if ((ch == '\\') || (ch == 10) || (ch == 13)) +@@ -145,7 +145,7 @@ void RawStr::getIDXBuf(long ioffset, cha + { + __u32 offset; + +- if (idxfd > 0) { ++ if (idxfd) { + idxfd->seek(ioffset, SEEK_SET); + idxfd->read(&offset, 4); + diff --git a/misc/sword/patches/patch-src_modules_common_rawstr4.cpp b/misc/sword/patches/patch-src_modules_common_rawstr4.cpp new file mode 100644 index 00000000000..7220d000b07 --- /dev/null +++ b/misc/sword/patches/patch-src_modules_common_rawstr4.cpp @@ -0,0 +1,31 @@ +$NetBSD: patch-src_modules_common_rawstr4.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/modules/common/rawstr4.cpp.orig 2016-12-17 11:19:27.919536682 +0000 ++++ src/modules/common/rawstr4.cpp +@@ -74,7 +74,7 @@ RawStr4::RawStr4(const char *ipath, int + buf.setFormatted("%s.dat", path); + datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); + +- if (datfd < 0) { ++ if (!datfd) { + SWLog::getSystemLog()->logError("%d", errno); + } + +@@ -111,7 +111,7 @@ void RawStr4::getIDXBufDat(long ioffset, + { + int size; + char ch; +- if (datfd > 0) { ++ if (datfd) { + datfd->seek(ioffset, SEEK_SET); + for (size = 0; datfd->read(&ch, 1) == 1; size++) { + if ((ch == '\\') || (ch == 10) || (ch == 13)) +@@ -145,7 +145,7 @@ void RawStr4::getIDXBuf(long ioffset, ch + { + __u32 offset; + +- if (idxfd > 0) { ++ if (idxfd) { + idxfd->seek(ioffset, SEEK_SET); + + idxfd->read(&offset, 4); diff --git a/misc/sword/patches/patch-src_modules_common_zstr.cpp b/misc/sword/patches/patch-src_modules_common_zstr.cpp new file mode 100644 index 00000000000..7975ce0da92 --- /dev/null +++ b/misc/sword/patches/patch-src_modules_common_zstr.cpp @@ -0,0 +1,31 @@ +$NetBSD: patch-src_modules_common_zstr.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/modules/common/zstr.cpp.orig 2016-12-17 11:20:39.892321366 +0000 ++++ src/modules/common/zstr.cpp +@@ -83,7 +83,7 @@ zStr::zStr(const char *ipath, int fileMo + buf.setFormatted("%s.zdt", path); + zdtfd = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); + +- if (datfd <= 0) { ++ if (!datfd) { + SWLog::getSystemLog()->logError("%d", errno); + } + +@@ -133,7 +133,7 @@ void zStr::getKeyFromDatOffset(long ioff + { + int size; + char ch; +- if (datfd > 0) { ++ if (datfd) { + datfd->seek(ioffset, SEEK_SET); + for (size = 0; datfd->read(&ch, 1) == 1; size++) { + if ((ch == '\\') || (ch == 10) || (ch == 13)) +@@ -167,7 +167,7 @@ void zStr::getKeyFromIdxOffset(long ioff + { + __u32 offset; + +- if (idxfd > 0) { ++ if (idxfd) { + idxfd->seek(ioffset, SEEK_SET); + idxfd->read(&offset, 4); + offset = swordtoarch32(offset); diff --git a/misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp b/misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp new file mode 100644 index 00000000000..de9791f61bd --- /dev/null +++ b/misc/sword/patches/patch-src_modules_lexdict_rawld4_rawld4.cpp @@ -0,0 +1,13 @@ +$NetBSD: patch-src_modules_lexdict_rawld4_rawld4.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/modules/lexdict/rawld4/rawld4.cpp.orig 2016-12-17 11:25:37.737259594 +0000 ++++ src/modules/lexdict/rawld4/rawld4.cpp +@@ -166,7 +166,7 @@ void RawLD4::deleteEntry() { + + + long RawLD4::getEntryCount() const { +- if (idxfd < 0) return 0; ++ if (!idxfd) return 0; + return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE; + } + diff --git a/misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp b/misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp new file mode 100644 index 00000000000..6407ef164e6 --- /dev/null +++ b/misc/sword/patches/patch-src_modules_lexdict_rawld_rawld.cpp @@ -0,0 +1,13 @@ +$NetBSD: patch-src_modules_lexdict_rawld_rawld.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/modules/lexdict/rawld/rawld.cpp.orig 2016-12-17 11:25:49.864362105 +0000 ++++ src/modules/lexdict/rawld/rawld.cpp +@@ -168,7 +168,7 @@ void RawLD::deleteEntry() { + + + long RawLD::getEntryCount() const { +- if (idxfd < 0) return 0; ++ if (!idxfd) return 0; + return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE; + } + diff --git a/misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp b/misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp new file mode 100644 index 00000000000..a82b976eaef --- /dev/null +++ b/misc/sword/patches/patch-src_modules_lexdict_zld_zld.cpp @@ -0,0 +1,13 @@ +$NetBSD: patch-src_modules_lexdict_zld_zld.cpp,v 1.1 2016/12/17 14:22:39 joerg Exp $ + +--- src/modules/lexdict/zld/zld.cpp.orig 2016-12-17 11:25:18.042867195 +0000 ++++ src/modules/lexdict/zld/zld.cpp +@@ -166,7 +166,7 @@ void zLD::deleteEntry() { + + long zLD::getEntryCount() const + { +- if (idxfd < 0) return 0; ++ if (!idxfd) return 0; + return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE; + } + |