Fix build of textproc/randlm with recent versions of clang.

Approved by:	portmgr blanket
Submitted by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
PR:		216056
MFH:		2017Q4
This commit is contained in:
Dimitry Andric 2017-12-21 21:17:31 +00:00
parent b2c3984a64
commit e44ddcc2e7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=456948
6 changed files with 56 additions and 2 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= randlm
PORTVERSION= 0.2.5
PORTREVISION= 8
PORTREVISION= 9
CATEGORIES= textproc
MASTER_SITES= SF/${PORTNAME}
@ -16,7 +16,6 @@ RUN_DEPENDS= ${LOCALBASE}/include/google/sparse_hash_map:devel/sparsehash
BROKEN_aarch64= fails to compile: invalid output constraint =a in assembler
BROKEN_armv6= fails to compile: invalid output constraint =a in assembler
BROKEN_armv7= fails to compile: BloomMap.cpp:275:58: error: ordered comparison between pointer and zero ('int *' and 'int')
BROKEN_powerpc64= fails to compile: 'itr' does not name a type
GNU_CONFIGURE= yes

View File

@ -0,0 +1,11 @@
--- src/LDHT/BitArray.cpp.orig 2017-03-07 01:14:52 UTC
+++ src/LDHT/BitArray.cpp
@@ -115,7 +115,7 @@ uint64_t BitArray::getLength() {
}
bool BitArray::validArrayIndex(uint64_t index) {
- if (index >= 0 && index <= getLength())
+ if (index >= 1 && index <= getLength())
return true;
else
return false;

View File

@ -0,0 +1,11 @@
--- src/RandLM/BloomMap.cpp.orig 2017-03-07 00:13:58 UTC
+++ src/RandLM/BloomMap.cpp
@@ -272,7 +272,7 @@ namespace randlm {
bool BloomMap::computePaths() {
// determine the path lengths based on distribution for codes of each type
- assert(stats_counters_ && root_ == NULL && max_code_ > 0);
+ assert(stats_counters_ && root_ == NULL && max_code_ != NULL);
code_to_leaf_ = new uint64_t*[num_events_];
code_to_path_len_ = new int*[num_events_];
code_to_bound_ = new int*[num_events_];

View File

@ -0,0 +1,11 @@
--- src/RandLM/LogFreqBloomFilter.cpp.orig 2017-03-07 00:13:45 UTC
+++ src/RandLM/LogFreqBloomFilter.cpp
@@ -207,7 +207,7 @@ namespace randlm {
int LogFreqBloomFilter::getMaxHashes(int event_idx) {
// simple for unary encoding
- assert(max_alpha_ > 0 && max_k_ > 0 && max_code_ > 0);
+ assert(max_alpha_ > 0 && max_k_ > 0 && max_code_ != NULL);
return max_alpha_ + (max_k_ * max_code_[event_idx]);
}

View File

@ -0,0 +1,11 @@
--- src/RandLM/RandLM.cpp.orig 2017-03-07 02:01:18 UTC
+++ src/RandLM/RandLM.cpp
@@ -66,7 +66,7 @@ namespace randlm {
smoothing_name = kStupidBackoffSmoothing;
break;
case kWittenBellSmoothingCode:
- smoothing_name == kWittenBellSmoothing;
+ smoothing_name = kWittenBellSmoothing;
break;
case kBackoffSmoothingCode:
smoothing_name = kBackoffSmoothing;

View File

@ -0,0 +1,11 @@
--- src/LDHT/TableChunkLocator.h.orig 2017-03-07 01:06:04 UTC
+++ src/LDHT/TableChunkLocator.h
@@ -21,7 +21,7 @@ public:
int num_cells,
int num_chunks) = 0;
virtual int locateTableChunkForKey(uint64_t key) = 0;
-
+ virtual ~TableChunkLocator(){};
};
} // namespace LDHT.