summaryrefslogtreecommitdiffstats
path: root/Source/cmGraphAdjacencyList.h
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-01-26 18:25:37 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-01-31 14:27:06 (GMT)
commit91a26ce04136ccafbe37a17afc2efb01abf0992e (patch)
tree91a84614802b2e83d3d4a60010ae520b6d18e850 /Source/cmGraphAdjacencyList.h
parent65c0a64dc5bc7cb0e13721500bdd754b6630e8ea (diff)
downloadCMake-91a26ce04136ccafbe37a17afc2efb01abf0992e.zip
CMake-91a26ce04136ccafbe37a17afc2efb01abf0992e.tar.gz
CMake-91a26ce04136ccafbe37a17afc2efb01abf0992e.tar.bz2
cmComputeComponentGraph: use `size_t` for component indices
This avoids using casts everywhere when dealing with the sizes.
Diffstat (limited to 'Source/cmGraphAdjacencyList.h')
-rw-r--r--Source/cmGraphAdjacencyList.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h
index fe9fbe2..01fc5f9 100644
--- a/Source/cmGraphAdjacencyList.h
+++ b/Source/cmGraphAdjacencyList.h
@@ -4,6 +4,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <cstddef>
#include <utility>
#include <vector>
@@ -17,14 +18,14 @@
class cmGraphEdge
{
public:
- cmGraphEdge(int n, bool s, bool c, cmListFileBacktrace bt)
+ cmGraphEdge(size_t n, bool s, bool c, cmListFileBacktrace bt)
: Dest(n)
, Strong(s)
, Cross(c)
, Backtrace(std::move(bt))
{
}
- operator int() const { return this->Dest; }
+ operator size_t() const { return this->Dest; }
bool IsStrong() const { return this->Strong; }
@@ -33,7 +34,7 @@ public:
cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
private:
- int Dest;
+ size_t Dest;
bool Strong;
bool Cross;
cmListFileBacktrace Backtrace;
@@ -41,7 +42,7 @@ private:
struct cmGraphEdgeList : public std::vector<cmGraphEdge>
{
};
-struct cmGraphNodeList : public std::vector<int>
+struct cmGraphNodeList : public std::vector<size_t>
{
};
struct cmGraphAdjacencyList : public std::vector<cmGraphEdgeList>