-
Notifications
You must be signed in to change notification settings - Fork 9
NEW: Add version to factory #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| //****************************************************************************** | ||
|
|
||
| #include "version.h" | ||
|
|
||
| #include <sstream> | ||
|
|
||
| namespace smos | ||
|
|
@@ -81,11 +82,28 @@ namespace smos | |
| return result; | ||
| } | ||
| //****************************************************************************** | ||
| void Version::SetVersion(const short &major, const short &minor, const short &revision) | ||
| void Version::SetVersion(const uint16_t major, const uint16_t minor, const uint16_t revision) | ||
| { | ||
| this->m_major = major; | ||
| this->m_minor = minor; | ||
| this->m_revision = revision; | ||
| } | ||
| //****************************************************************************** | ||
| std::ostream &operator<<(std::ostream &os, const Version &obj) | ||
| { | ||
| os << obj.m_major; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if the "short" type is portable - is it always the same size? Maybe it would be better to use int16_t or int8_t or even better uint16_t or uint8_t. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're absolutely right, I'll change this. |
||
| os << obj.m_minor; | ||
| os << obj.m_revision; | ||
| return os; | ||
| } | ||
| //****************************************************************************** | ||
| std::istream &operator>>(std::istream &is, Version &obj) | ||
| { | ||
| is >> obj.m_major; | ||
| is >> obj.m_minor; | ||
| is >> obj.m_revision; | ||
| return is; | ||
| } | ||
| //****************************************************************************** | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we have a similar problem as in line 47 - memory leak. the Options object will never be destroyed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comments for line 47.