Skip to content

Commit

Permalink
Fix bad return type for Square() template
Browse files Browse the repository at this point in the history
It didn't take into account promotion to integer for types smaller than
int.

Fixes #1533.
  • Loading branch information
slipher committed Jan 29, 2025
1 parent e9c9324 commit edf1bfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/engine/qcommon/q_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ inline void CrossProduct( const vec3_t v1, const vec3_t v2, vec3_t cross )
}

template<typename A>
A Square( A a )
decltype(std::declval<A>() * std::declval<A>()) Square( const A &a )
{
return a * a;
}
Expand Down

0 comments on commit edf1bfe

Please sign in to comment.