Skip to content

Commit 681f576

Browse files
yuvaltassacopybara-github
authored andcommitted
Remove -Wno-extra-semi, add workaround for mjSORT confusing some IDEs
PiperOrigin-RevId: 808689636 Change-Id: Ia091fb597c171a33842e62690d06f32614fbe4eb
1 parent 60cb976 commit 681f576

File tree

9 files changed

+10
-13
lines changed

9 files changed

+10
-13
lines changed

cmake/MujocoOptions.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang
9292
-Wimplicit-fallthrough
9393
-Wunused
9494
-Wvla
95-
-Wno-extra-semi
9695
-Wno-int-in-bool-context
9796
-Wno-sign-compare
9897
-Wno-unknown-pragmas

sample/cmake/SampleOptions.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang
9292
-Wimplicit-fallthrough
9393
-Wunused
9494
-Wvla
95-
-Wno-extra-semi
9695
-Wno-int-in-bool-context
9796
-Wno-sign-compare
9897
-Wno-unknown-pragmas

simulate/cmake/SimulateOptions.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang
9292
-Wimplicit-fallthrough
9393
-Wunused
9494
-Wvla
95-
-Wno-extra-semi
9695
-Wno-int-in-bool-context
9796
-Wno-sign-compare
9897
-Wno-unknown-pragmas

src/engine/engine_collision_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ static inline int SAPcmp(mjtSAP* obj1, mjtSAP* obj2, void* context) {
10121012
}
10131013

10141014
// define SAPsort function for sorting SAP sorting
1015-
mjSORT(SAPsort, mjtSAP, SAPcmp)
1015+
mjSORT(SAPsort, mjtSAP, SAPcmp);
10161016

10171017

10181018
// given list of axis-aligned bounding boxes in AAMM (xmin[3], xmax[3]) format,

src/engine/engine_sensor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int ContactInfoCompare(const ContactInfo* a, const ContactInfo* b, void*
5656

5757
return 0;
5858
}
59-
mjPARTIAL_SORT(ContactSelect, ContactInfo, ContactInfoCompare)
59+
mjPARTIAL_SORT(ContactSelect, ContactInfo, ContactInfoCompare);
6060

6161

6262
// apply cutoff after each stage

src/engine/engine_sort.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
tmp = src; src = dest; dest = tmp; \
7171
} \
7272
if (src != arr) memcpy(arr, src, n * sizeof(type)); \
73-
}
73+
} static inline void name(type* arr, type* buf, int n, void* context)
7474

7575

7676
// sub-macro that sifts down a node in a max heap to its correct position
@@ -106,6 +106,6 @@
106106
/* copy back and sort the result */ \
107107
for (int j = 0; j < k; j++) arr[j] = buf[j]; \
108108
_mjINSERTION_SORT(type, arr, 0, k, cmp, context); \
109-
}
109+
} static inline void name(type* arr, type* buf, int n, int k, void* context)
110110

111111
#endif // MUJOCO_SRC_ENGINE_ENGINE_SORT_H_

src/render/render_gl3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ static inline int geomcmp(int* i, int* j, void* context) {
789789
}
790790

791791
// define geomSort function for sorting geoms
792-
mjSORT(geomSort, int, geomcmp)
792+
mjSORT(geomSort, int, geomcmp);
793793

794794

795795

test/benchmark/sort_benchmark_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int CompareSortable(const Sortable* a, const Sortable* b, void* context) {
4343
}
4444

4545
// Instantiate the sort function.
46-
mjSORT(SortSortable, Sortable, CompareSortable)
46+
mjSORT(SortSortable, Sortable, CompareSortable);
4747

4848
// Generate data for sorting benchmarks.
4949
std::vector<Sortable> GenerateData(int n, double unsorted_fraction) {

test/engine/engine_sort_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ int IntCompare(int* i, int* j, void* context) {
7777
return 1;
7878
}
7979
}
80-
mjSORT(IntSort, int, IntCompare)
81-
mjPARTIAL_SORT(IntSelect, int, IntCompare)
80+
mjSORT(IntSort, int, IntCompare);
81+
mjPARTIAL_SORT(IntSelect, int, IntCompare);
8282

8383
int IntStructCompare(const IntStruct* x, const IntStruct* y, void* context) {
8484
IntStruct* a = (IntStruct*)x;
@@ -91,8 +91,8 @@ int IntStructCompare(const IntStruct* x, const IntStruct* y, void* context) {
9191
return 1;
9292
}
9393
}
94-
mjSORT(IntStructSort, IntStruct, IntStructCompare)
95-
mjPARTIAL_SORT(IntStructSelect, IntStruct, IntStructCompare)
94+
mjSORT(IntStructSort, IntStruct, IntStructCompare);
95+
mjPARTIAL_SORT(IntStructSelect, IntStruct, IntStructCompare);
9696

9797
TEST_F(EngineSortTest, Sort) {
9898
int total = 0;

0 commit comments

Comments
 (0)