Use std::abs instead of mju_abs to compare integerst in fixture.cc.
PiperOrigin-RevId: 659534808 Change-Id: I4eb9f72078f2d7224bcfd3b537e4053d220750c8
This commit is contained in:
committed by
Copybara-Service
parent
20011a2f53
commit
0610c1d0e9
+4
-2
@@ -17,6 +17,7 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <filesystem> // NOLINT
|
#include <filesystem> // NOLINT
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@@ -220,9 +221,10 @@ mjtNum CompareModel(const mjModel* m1, const mjModel* m2,
|
|||||||
|
|
||||||
// compare ints, exclude nbuffer because it hides the actual difference
|
// compare ints, exclude nbuffer because it hides the actual difference
|
||||||
#define X(name) \
|
#define X(name) \
|
||||||
if (strncmp(#name, "nbuffer", 7)) { \
|
if constexpr (std::string_view(#name) != "nbuffer") { \
|
||||||
if (m1->name != m2->name) { \
|
if (m1->name != m2->name) { \
|
||||||
maxdif = mju_abs(m1->name - m2->name); field = #name; \
|
maxdif = std::abs((long)m1->name - (long)m2->name); \
|
||||||
|
field = #name; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
MJMODEL_INTS
|
MJMODEL_INTS
|
||||||
|
|||||||
Reference in New Issue
Block a user