diff --git a/include/anope.h b/include/anope.h index ec889048b..5fede08a9 100644 --- a/include/anope.h +++ b/include/anope.h @@ -418,9 +418,9 @@ namespace Anope extern CoreExport string Version(); extern CoreExport string VersionShort(); extern CoreExport string VersionBuildString(); - extern CoreExport int VersionMajor(); - extern CoreExport int VersionMinor(); - extern CoreExport int VersionPatch(); + extern CoreExport unsigned VersionMajor(); + extern CoreExport unsigned VersionMinor(); + extern CoreExport unsigned VersionPatch(); /** Determines if we are still attached to the terminal, and can print * messages to the user via stderr/stdout. diff --git a/include/modules.h b/include/modules.h index 2eeffa5da..5e14f41f0 100644 --- a/include/modules.h +++ b/include/modules.h @@ -169,7 +169,7 @@ typedef unsigned short ModType; struct ModuleVersionC final { - int version_major, version_minor, version_patch; + unsigned version_major, version_minor, version_patch; }; /** Returned by Module::GetVersion, used to see what version of Anope @@ -178,9 +178,9 @@ struct ModuleVersionC final class ModuleVersion final { private: - int version_major; - int version_minor; - int version_patch; + unsigned version_major; + unsigned version_minor; + unsigned version_patch; public: ModuleVersion(const ModuleVersionC &); @@ -188,17 +188,17 @@ public: /** Get the major version of Anope this was built against * @return The major version */ - int GetMajor() const; + unsigned GetMajor() const; /** Get the minor version of Anope this was built against * @return The minor version */ - int GetMinor() const; + unsigned GetMinor() const; /** Get the patch version this was built against * @return The patch version */ - int GetPatch() const; + unsigned GetPatch() const; }; class CoreExport NotImplementedException final diff --git a/src/misc.cpp b/src/misc.cpp index 1f8895548..91e32277a 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -916,9 +916,9 @@ Anope::string Anope::VersionBuildString() return s; } -int Anope::VersionMajor() { return VERSION_MAJOR; } -int Anope::VersionMinor() { return VERSION_MINOR; } -int Anope::VersionPatch() { return VERSION_PATCH; } +unsigned Anope::VersionMajor() { return VERSION_MAJOR; } +unsigned Anope::VersionMinor() { return VERSION_MINOR; } +unsigned Anope::VersionPatch() { return VERSION_PATCH; } Anope::string Anope::RemoveFormatting(const Anope::string &buf) { diff --git a/src/module.cpp b/src/module.cpp index 6158cafd0..47a5945a3 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -117,23 +117,23 @@ void Module::Prioritize() } ModuleVersion::ModuleVersion(const ModuleVersionC &ver) + : version_major(ver.version_major) + , version_minor(ver.version_minor) + , version_patch(ver.version_patch) { - version_major = ver.version_major; - version_minor = ver.version_minor; - version_patch = ver.version_patch; } -int ModuleVersion::GetMajor() const +unsigned ModuleVersion::GetMajor() const { return this->version_major; } -int ModuleVersion::GetMinor() const +unsigned ModuleVersion::GetMinor() const { return this->version_minor; } -int ModuleVersion::GetPatch() const +unsigned ModuleVersion::GetPatch() const { return this->version_patch; }