Skip to content

Commit

Permalink
- fixed return type of Sgn.
Browse files Browse the repository at this point in the history
This is -1, 0 or 1, so the return type must be int, not the input type.
  • Loading branch information
coelckers committed Aug 9, 2022
1 parent 4e0c513 commit bf4c9fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/common/utility/cmdlib.h
Expand Up @@ -100,7 +100,7 @@ inline void fillshort(void* buff, size_t count, uint16_t clear)
}
}

template<typename T> inline constexpr T Sgn(const T& val) { return (val > 0) - (val < 0); }
template<typename T> inline constexpr int Sgn(const T& val) { return (val > 0) - (val < 0); }


inline int sizeToBits(int w)
Expand Down

0 comments on commit bf4c9fd

Please sign in to comment.