Skip to content

Commit

Permalink
Fixed compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpintroniK committed Jul 18, 2019
1 parent d5cf0c5 commit f7d4628
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions IO/Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ namespace IO

if(::write(this->handle, &port, 1) == 1)
{
::read(this->handle, &this->buf, 1);
if(this->buf == 's')
::read(this->handle, &this->buf, 1);
auto res = ::read(this->handle, &this->buf, 1);

if(res != -1)
{
if(this->buf == 's')
{
auto resValue = ::read(this->handle, &this->buf, 1);
if(resValue < 0)
{
return 0;
}
}
}
}
else
return 0;
Expand Down
4 changes: 2 additions & 2 deletions Util/Xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace Util
template <typename T>
inline T GetValue() const
{
T value;
T value{};
GetValue(value);
return value;
}
Expand All @@ -103,7 +103,7 @@ namespace Util
template <typename T>
inline T Attribute(const std::string& name) const
{
T value;
T value{};
Attribute<T>(name, value);
return value;
}
Expand Down

0 comments on commit f7d4628

Please sign in to comment.