From 31b2f8d1f6e251f1f4092da9d18e28911fc014d6 Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Tue, 22 Aug 2017 15:32:33 +0200 Subject: [PATCH] logic: fixed generating IDs of fulltextsearch locations due to type conversion the IDs have been set to 0 on Windows with the previous implementation --- src/lib/data/storage/PersistentStorage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/data/storage/PersistentStorage.cpp b/src/lib/data/storage/PersistentStorage.cpp index 85b5e151..9a11e697 100644 --- a/src/lib/data/storage/PersistentStorage.cpp +++ b/src/lib/data/storage/PersistentStorage.cpp @@ -530,7 +530,7 @@ std::shared_ptr PersistentStorage::getFullTextSearchLo if ( addHit ) { // Set first bit to 1 to avoid collisions - Id locationId = ~(~size_t(0) >> 1) + collection->getSourceLocationCount(); + Id locationId = ~(~Id(0) >> 1) + collection->getSourceLocationCount() + 1; collection->addSourceLocation( LOCATION_FULLTEXT, @@ -1344,7 +1344,7 @@ std::shared_ptr PersistentStorage::getErrorSourceLocat errors->push_back(error); // Set first bit to 1 to avoid collisions - Id locationId = ~(~size_t(0) >> 1) + error.id; + Id locationId = ~(~Id(0) >> 1) + error.id; collection->addSourceLocation( LOCATION_ERROR, @@ -2252,7 +2252,7 @@ void PersistentStorage::addAggregationEdgesToGraph( } // Set first bit to 1 to avoid collisions - Id aggregationId = ~(~size_t(0) >> 1) + *componentAggregation->getAggregationIds().begin(); + Id aggregationId = ~(~Id(0) >> 1) + *componentAggregation->getAggregationIds().begin(); Edge* edge = graph->createEdge(aggregationId, Edge::EDGE_AGGREGATION, sourceNode, targetNode); edge->addComponentAggregation(componentAggregation); @@ -2349,7 +2349,7 @@ void PersistentStorage::addInheritanceChainsToGraph(const std::vector& activ } // Set first 2 bits to 1 to avoid collisions - Id inheritanceEdgeId = ~(~size_t(0) >> 2) + inheritanceEdgeCount++; + Id inheritanceEdgeId = ~(~Id(0) >> 2) + inheritanceEdgeCount++; Edge* inheritanceEdge = graph->createEdge( inheritanceEdgeId, Edge::EDGE_INHERITANCE, graph->getNodeById(sourceId), graph->getNodeById(targetId));