Skip to content

Commit

Permalink
Remove useless const on binio::detect_system_flags() return type
Browse files Browse the repository at this point in the history
A const qualifier on function return type is ignored and generates
a warning with some compilers/options (e.g. -Wignored-qualifiers
or -Wextra for g++). Just remove it.
  • Loading branch information
miller-alex committed Nov 17, 2020
1 parent 04ce03c commit d663c35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/binio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

const binio::Flags binio::system_flags = binio::detect_system_flags();

const binio::Flags binio::detect_system_flags()
binio::Flags binio::detect_system_flags()
{
Flags f = 0;

Expand All @@ -68,9 +68,10 @@ const binio::Flags binio::detect_system_flags()
if(f & BigEndian) {
if(dat[0] == 0x40 && dat[1] == 0xD0 && !dat[2] && !dat[3])
f |= FloatIEEE;
} else
} else {
if(dat[3] == 0x40 && dat[2] == 0xD0 && !dat[1] && !dat[0])
f |= FloatIEEE;
f |= FloatIEEE;
}

return f;
}
Expand Down
2 changes: 1 addition & 1 deletion src/binio.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected:
#endif

private:
static const Flags detect_system_flags();
static Flags detect_system_flags();
};

class binistream: virtual public binio
Expand Down

0 comments on commit d663c35

Please sign in to comment.