fileapi: Use unsigned int consistently for version numbers

The file API code used unsigned long to hold the major version in most
places, but not all. Some places used unsigned int, and an important one
of those is the cmFileApi::BuildVersion() function. As a result, it has never
been safe for a large value not representable by an unsigned int to be
used in these variables.

Convert all of the file API version number variables and function arguments
to use unsigned int consistently. This avoids any size mismatch warnings
when passing values around. They also don't need to be unsigned long,
as we never expect version numbers to be anything even close to what
an unsigned int cannot represent.
This commit is contained in:
Craig Scott
2025-07-13 14:24:35 +10:00
parent 7fcc90c99c
commit 892fa0bb88
17 changed files with 42 additions and 43 deletions

View File

@@ -25,7 +25,7 @@ public:
void ReadQueries();
/** Get the list of configureLog object kind versions requested. */
std::vector<unsigned long> GetConfigureLogVersions();
std::vector<unsigned int> GetConfigureLogVersions();
/** Identify the situation in which WriteReplies is called. */
enum class IndexFor
@@ -83,7 +83,7 @@ private:
struct Object
{
ObjectKind Kind;
unsigned long Version = 0;
unsigned int Version = 0;
friend bool operator<(Object const& l, Object const& r)
{
if (l.Kind != r.Kind) {