From b6692b9842c37c86b5be8738ef24756ea84c2388 Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Tue, 24 Apr 2018 17:34:21 +0200 Subject: [PATCH] src: fixed typedef for Id because bitshift syntax for generated node ids failed on 64 bit windows --- src/lib/component/controller/GraphController.cpp | 6 +++--- src/lib/utility/types.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index aa814c49..583f78f4 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -1186,7 +1186,7 @@ void GraphController::bundleNodesAndEdgesMatching( DummyNode* firstNode = bundleNode->bundledNodes.begin()->get(); // Use token Id of first node and make first bit 1 - bundleNode->tokenId = ~(~size_t(0) >> 1) + firstNode->data->getId(); + bundleNode->tokenId = ~(~Id(0) >> 1) + firstNode->data->getId(); bundleNode->bundleInfo.layoutVertical = firstNode->bundleInfo.layoutVertical; bundleNode->bundleInfo.isReferenced = firstNode->bundleInfo.isReferenced; bundleNode->bundleInfo.isReferencing = firstNode->bundleInfo.isReferencing; @@ -1272,7 +1272,7 @@ std::shared_ptr GraphController::bundleNodesMatching( } // Use token Id of first node and make first bit 1 - bundleNode->tokenId = ~(~size_t(0) >> 1) + (*bundleNode->bundledNodes.begin())->data->getId(); + bundleNode->tokenId = ~(~Id(0) >> 1) + (*bundleNode->bundledNodes.begin())->data->getId(); return bundleNode; } @@ -2128,7 +2128,7 @@ void GraphController::relayoutGraph( if (withCharacterIndex && m_dummyNodes.size()) { // Use token Id of first node and make first 2 bits 1 - Id groupId = ~(~size_t(0) >> 2) + m_dummyNodes[0]->tokenId; + Id groupId = ~(~Id(0) >> 2) + m_dummyNodes[0]->tokenId; DummyNode* group = groupAllNodes(GroupType::DEFAULT, groupId); group->groupLayout = GroupLayout::LIST; diff --git a/src/lib/utility/types.h b/src/lib/utility/types.h index 9633087e..e853233c 100644 --- a/src/lib/utility/types.h +++ b/src/lib/utility/types.h @@ -1,7 +1,7 @@ #ifndef TYPES_H #define TYPES_H -typedef unsigned long Id; +typedef size_t Id; typedef unsigned int uint;