App: Add #include <climit> and switch to std::numeric_limits (#27742)
* add missing include to fix compilation on Fedora 44 * change short limit notation
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <limits>
|
||||
#include <Base/Persistence.h>
|
||||
|
||||
#include "DynamicProperty.h"
|
||||
@@ -143,7 +144,7 @@ struct AppExport PropertyData
|
||||
short int getOffsetTo(const App::Property* prop) const {
|
||||
auto *pt = (const char*)prop;
|
||||
auto *base = (const char *)m_container;
|
||||
if(pt<base || pt>base+SHRT_MAX)
|
||||
if(pt<base || pt>base+std::numeric_limits<short>::max())
|
||||
return -1;
|
||||
return (short) (pt-base);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user