wxCHECK_MSG instead of assert

This commit is contained in:
Roberto Fernandez Bautista 2021-08-02 20:37:57 +01:00
parent 6a9a177fa3
commit 3747cb50c9
1 changed files with 2 additions and 5 deletions

View File

@ -26,9 +26,9 @@
#define INCLUDE_CORE_KICAD_ALGO_H_
#include <algorithm>
#include <assert.h>
#include <functional> // std::function
#include <utility> // std::pair
#include <wx/debug.h> // wxCHECK_MSG
namespace alg
{
@ -127,10 +127,7 @@ bool pair_contains( const std::pair<_Type, _Type> __pair, _Value __value )
template <class T>
bool within_wrapped_range( T __val, T __minval, T __maxval, T __wrap )
{
assert( __wrap > 0 ); // Wrap must be positive!
if( __wrap <= 0 )
return false;
wxCHECK_MSG( __wrap > 0, false, "Wrap must be positive!" );
while( __maxval >= __wrap )
__maxval -= __wrap;