Skip to content

Commit 9b19537

Browse files
committed
Merge branch 'develop' into develop-64
# Conflicts: # libhdt/src/libdcs/CSD_PFC.cpp # libhdt/src/triples/TripleIterators.cpp
2 parents 24912a8 + 9e8315b commit 9b19537

14 files changed

Lines changed: 64 additions & 54 deletions

File tree

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ language: cpp
22
env:
33
global:
44
- LOCAL=$HOME/local
5-
- TESTS_HDT="bit375 bitutiltest listener logarr serd streamtest testmax"
6-
- TESTS_CDS="testArray testBitSequence testHuffman testLCP testNPR testSequence testSuffixTree testTextIndex timeSequence toArray2 toArray"
75
matrix:
86
include:
97
- os: osx
@@ -50,8 +48,8 @@ script:
5048
- ./configure --prefix=$LOCAL CXX=$HDT_CPP
5149
- make -j2
5250
# Make and run selected tests. Most tests in HDT are failing
53-
- TESTS=$TESTS_CDS make -e check -j2 -C libcds || ( cat libcds/tests/test-suite.log && exit -1)
54-
- TESTS=$TESTS_HDT make -e check -j2 -C libhdt || ( cat libhdt/tests/test-suite.log && exit -1)
51+
- make check -j2 -C libcds || ( cat libcds/tests/test-suite.log && exit -1)
52+
- make check -j2 -C libhdt || ( cat libhdt/tests/test-suite.log && exit -1)
5553
# Install
5654
- make install
5755
- hdtSearch -q 0 libhdt/data/literals.hdt

libcds/src/static/coders/huff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ namespace cds_static
235235
if (!enc) {
236236
H.fst = new uint[H.depth+1];
237237
H.fst[H.depth] = 0; dold = 0;
238-
for (d=H.depth-1;d>=0;d--) {
238+
for (d=H.depth-1;d!=(uint)-1;d--) {
239239
dact = H.num[d+1];
240240
H.fst[d] = (H.fst[d+1]+dact) >> 1;
241241
H.num[d+1] = dold;

libcds/tests/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ testBitSequence \
44
testHuffman \
55
testLCP \
66
testNPR \
7-
testQuantile \
87
testSequence \
98
testSuffixTree \
109
testTextIndex \
1110
timeSequence \
1211
toArray2 \
1312
toArray
13+
#testQuantile
1414

1515
AM_DEFAULT_SOURCE_EXT = .cpp
1616
AM_CPPFLAGS = -I@top_srcdir@/libcds/include $(WARN_CFLAGS)

libhdt/src/bitsequence/BitSequence375.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ BitSequence375 * BitSequence375::load(istream & in)
288288
// Read array from file, byte-aligned.
289289
size_t bytes = ret->numBytes(ret->numbits);
290290
in.read((char*)&ret->data[0], bytes);
291-
if(in.gcount()!=bytes) {
291+
streamsize gc = in.gcount();
292+
if(gc < 0 || static_cast<size_t>(gc)!=bytes) {
292293
throw std::runtime_error("BitSequence375 error reading array of bits.");
293294
}
294295

libhdt/src/dictionary/FourSectionDictionary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ void FourSectionDictionary::getSuggestions(const char *base, hdt::TripleComponen
582582
merge(v1.begin(),v1.end(), v2.begin(), v2.end(), std::back_inserter(out));
583583

584584
// Remove possible extra items
585-
if(out.size()>maxResults) {
585+
if((maxResults>=0) && (out.size()>static_cast<size_t>(maxResults))) {
586586
out.resize(maxResults);
587587
}
588588
}

libhdt/src/dictionary/LiteralDictionary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ size_t LiteralDictionary::substringToId(unsigned char *s, size_t len, size_t off
430430

431431
if(fmIndex!=NULL) {
432432
uint32_t ret = fmIndex->locate_substring(s, len, offset, limit, deduplicate, occs, num_occ);
433-
for (int i=0;i<*num_occ;i++){
433+
for (size_t i=0;i<*num_occ;i++){
434434
(*occs)[i] = this->getGlobalId((*occs)[i], NOT_SHARED_OBJECT);
435435
}
436436
return ret;
@@ -706,7 +706,7 @@ void LiteralDictionary::getSuggestions(const char *base, hdt::TripleComponentRol
706706
merge(v1.begin(), v1.end(), v2.begin(), v2.end(), std::back_inserter(out));
707707

708708
// Remove possible extra items
709-
if (out.size() > maxResults) {
709+
if ((maxResults >= 0) && (out.size() > static_cast<size_t>(maxResults))) {
710710
out.resize(maxResults);
711711
}
712712
}

libhdt/src/libdcs/CSD_FMIndex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,9 @@ void csd::CSD_FMIndex::fillSuggestions(const char *base,
445445
uint32_t *results = NULL;
446446
size_t numresults = this->locate_substring(n_s, len + 1, &results);
447447
int maxIter = maxResults;
448-
if (numresults < maxIter)
448+
if (maxIter >= 0 && numresults < static_cast<size_t>(maxIter))
449449
maxIter = numresults;
450-
for (int i = 0; i < numresults; i++) {
450+
for (size_t i = 0; i < numresults; i++) {
451451
out.push_back((char*) (this->extract(results[i])));
452452
}
453453
}

libhdt/src/sequence/AdjacencyList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ size_t AdjacencyList::findNextAppearance(size_t oldpos, size_t element) {
233233

234234
size_t AdjacencyList::findPreviousAppearance(size_t oldpos, size_t element) {
235235
long long old=oldpos;
236-
if(oldpos==-1 || element==0) {
236+
if(oldpos==(size_t)-1 || element==0) {
237237
return -1;
238238
}
239239

libhdt/src/triples/BitmapTriples.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ void BitmapTriples::generateIndexFast(ProgressListener *listener) {
488488

489489
//cerr << "Item " << i << " in adjlist " << adjZlist << endl;
490490
unsigned int pred = arrayY->get(adjZlist);
491-
maxpred = pred>maxpred ? pred : maxpred;
491+
maxpred = ((maxpred<0) || (pred>static_cast<size_t>(maxpred))) ? pred : maxpred;
492492

493493
index[val-1].push_back(std::make_pair(adjZlist, pred));
494494
NOTIFYCOND(&iListener, "Generating Object lists", i, arrayZ->getNumberOfElements());

libhdt/src/triples/BitmapTriplesIterators.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ void MiddleWaveletIterator::skip(size_t pos) {
456456

457457
int numJumps = 0;
458458
unsigned int posLeft = pos;
459-
while ((numJumps<pos)&&(posZ<maxZ)){
459+
while ((numJumps<0 || static_cast<size_t>(numJumps)<pos)&&(posZ<maxZ)){
460460
if((posZ+posLeft)>nextZ) {
461461
numJumps += (nextZ-posZ)+1; // count current jump
462462
predicateOcurrence++; // jump to the next occurrence
@@ -611,7 +611,7 @@ void IteratorY::updateOutput() {
611611

612612
bool IteratorY::hasNext()
613613
{
614-
return nextY!=-1 || posZ<=nextZ;
614+
return nextY!=(size_t)-1 || posZ<=nextZ;
615615
}
616616

617617
TripleID *IteratorY::next()
@@ -639,7 +639,7 @@ TripleID *IteratorY::next()
639639

640640
bool IteratorY::hasPrevious()
641641
{
642-
return prevY!=-1 || posZ>=prevZ;
642+
return prevY!=(size_t)-1 || posZ>=prevZ;
643643
}
644644

645645
TripleID *IteratorY::previous()
@@ -785,7 +785,7 @@ void ObjectIndexIterator::updateOutput() {
785785

786786
bool ObjectIndexIterator::hasNext()
787787
{
788-
return posIndex <= maxIndex && maxIndex >= 0;
788+
return maxIndex >= 0 && posIndex <= static_cast<size_t>(maxIndex);
789789
}
790790

791791
TripleID *ObjectIndexIterator::next()
@@ -804,7 +804,7 @@ TripleID *ObjectIndexIterator::next()
804804

805805
bool ObjectIndexIterator::hasPrevious()
806806
{
807-
return posIndex>minIndex;
807+
return minIndex<0 || posIndex>static_cast<size_t>(minIndex);
808808
}
809809

810810
TripleID *ObjectIndexIterator::previous()

0 commit comments

Comments
 (0)