Skip to content

Commit

Permalink
Changing subrelease variable to unsigned
Browse files Browse the repository at this point in the history
To allow for more than 128 versions of FW  minor releases,
the `m_minor` variable type is changed from `epicsInt8` to `epicsUInt8`.
  • Loading branch information
zioven authored and jerzyjamroz committed Dec 15, 2023
1 parent 7f59d47 commit f264755
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions mrfCommon/src/mrfCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ std::ostream& operator<<(std::ostream& strm, const MRFVersion& ver)
strm<<std::hex<<ver.firmware()
<<std::hex<<std::setfill('0')<<std::setw(2)<<ver.revision()
<<'.'
<<((ver.subrelease()<0) ? "-" : "")
<<abs(ver.subrelease());
<<ver.subrelease();
return strm;
}

Expand Down
4 changes: 2 additions & 2 deletions mrfCommon/src/mrfCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ struct SB {
class epicsShareClass MRFVersion
{
const epicsUInt16 m_major;
const epicsInt8 m_minor;
const epicsUInt8 m_minor;
public:

explicit MRFVersion(epicsUInt32 regval)
Expand All @@ -271,7 +271,7 @@ class epicsShareClass MRFVersion

inline unsigned firmware() const { return m_major>>8; }
inline unsigned revision() const { return m_major&0xff; }
inline int subrelease() const { return m_minor; }
inline unsigned subrelease() const { return m_minor; }

int compare(const MRFVersion& o) const;
inline bool operator>(const MRFVersion& o) const { return compare(o)==1; }
Expand Down

0 comments on commit f264755

Please sign in to comment.