diff --git a/components/nif/nifstream.cpp b/components/nif/nifstream.cpp index 4ecb0e373..44be4b241 100644 --- a/components/nif/nifstream.cpp +++ b/components/nif/nifstream.cpp @@ -38,7 +38,7 @@ namespace Nif } // Convenience utility functions: get the versions of the currently read file - unsigned int NIFStream::getVersion() { return file->getVersion(); } - unsigned int NIFStream::getUserVersion() { return file->getBethVersion(); } - unsigned int NIFStream::getBethVersion() { return file->getBethVersion(); } + unsigned int NIFStream::getVersion() const { return file->getVersion(); } + unsigned int NIFStream::getUserVersion() const { return file->getBethVersion(); } + unsigned int NIFStream::getBethVersion() const { return file->getBethVersion(); } } diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index 62e334e01..c78377448 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -159,12 +159,12 @@ public: std::string getString(); - unsigned int getVersion(); - unsigned int getUserVersion(); - unsigned int getBethVersion(); + unsigned int getVersion() const; + unsigned int getUserVersion() const; + unsigned int getBethVersion() const; // Convert human-readable version numbers into a number that can be compared. - uint32_t generateVersion(uint8_t major, uint8_t minor, uint8_t patch, uint8_t rev) + static constexpr uint32_t generateVersion(uint8_t major, uint8_t minor, uint8_t patch, uint8_t rev) { return (major << 24) + (minor << 16) + (patch << 8) + rev; }