diff --git a/apriltag/src/main/native/thirdparty/apriltag/src/common/pthreads_cross.c b/apriltag/src/main/native/thirdparty/apriltag/src/common/pthreads_cross.c index a7f76c5abec..d3734d294de 100644 --- a/apriltag/src/main/native/thirdparty/apriltag/src/common/pthreads_cross.c +++ b/apriltag/src/main/native/thirdparty/apriltag/src/common/pthreads_cross.c @@ -44,10 +44,7 @@ int pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routin if (thread == NULL || start_routine == NULL) return 1; -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wcast-function-type" *thread = (HANDLE) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, NULL); -#pragma GCC diagnostic pop if (*thread == NULL) return 1; return 0; diff --git a/upstream_utils/apriltag_patches/0001-apriltag_pose.c-Set-NULL-when-second-solution-could-.patch b/upstream_utils/apriltag_patches/0001-apriltag_pose.c-Set-NULL-when-second-solution-could-.patch index 1c08f917461..b10eb7cc306 100644 --- a/upstream_utils/apriltag_patches/0001-apriltag_pose.c-Set-NULL-when-second-solution-could-.patch +++ b/upstream_utils/apriltag_patches/0001-apriltag_pose.c-Set-NULL-when-second-solution-could-.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 4 Dec 2022 11:01:56 -0800 -Subject: [PATCH 1/7] apriltag_pose.c: Set NULL when second solution could not +Subject: [PATCH 1/8] apriltag_pose.c: Set NULL when second solution could not be determined --- diff --git a/upstream_utils/apriltag_patches/0002-Avoid-unused-variable-warnings-in-release-builds.patch b/upstream_utils/apriltag_patches/0002-Avoid-unused-variable-warnings-in-release-builds.patch index e2073820165..afaabc79dc7 100644 --- a/upstream_utils/apriltag_patches/0002-Avoid-unused-variable-warnings-in-release-builds.patch +++ b/upstream_utils/apriltag_patches/0002-Avoid-unused-variable-warnings-in-release-builds.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 4 Dec 2022 11:42:13 -0800 -Subject: [PATCH 2/7] Avoid unused variable warnings in release builds +Subject: [PATCH 2/8] Avoid unused variable warnings in release builds --- common/matd.c | 4 +++- diff --git a/upstream_utils/apriltag_patches/0003-Make-orthogonal_iteration-exit-early-upon-convergenc.patch b/upstream_utils/apriltag_patches/0003-Make-orthogonal_iteration-exit-early-upon-convergenc.patch index ed2281e03c4..a962c86e51c 100644 --- a/upstream_utils/apriltag_patches/0003-Make-orthogonal_iteration-exit-early-upon-convergenc.patch +++ b/upstream_utils/apriltag_patches/0003-Make-orthogonal_iteration-exit-early-upon-convergenc.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Tue, 10 Jan 2023 18:36:36 -0800 -Subject: [PATCH 3/7] Make orthogonal_iteration() exit early upon convergence +Subject: [PATCH 3/8] Make orthogonal_iteration() exit early upon convergence The current approach wastes iterations doing no work. Exiting early can give lower latencies and higher FPS. @@ -86,7 +86,7 @@ index f0003a2d187df13236992026ee6ff7f9d6f7aff9..782729225c3555edcfebb7d8a21f847a pose->R = pose1.R; pose->t = pose1.t; diff --git a/apriltag_pose.h b/apriltag_pose.h -index 07ee37b2cb4185bcbdb46d1c9ccec306f0f2e96d..72993f11514199754c452369bad32157b6d64eb1 100644 +index 07ee37b2cb4185bcbdb46d1c9ccec306f0f2e96d..6bbe4a4e000402f990b0a13b8b87e6becc8c48a8 100644 --- a/apriltag_pose.h +++ b/apriltag_pose.h @@ -63,7 +63,8 @@ void estimate_tag_pose_orthogonal_iteration( @@ -100,7 +100,7 @@ index 07ee37b2cb4185bcbdb46d1c9ccec306f0f2e96d..72993f11514199754c452369bad32157 /** * Estimate tag pose. diff --git a/example/apriltag_demo.c b/example/apriltag_demo.c -index 6de90540fe2f22f5160f725bce03d50bb3967c74..841d7788756011b0c7237e989242d87de76b14ef 100644 +index 6de90540fe2f22f5160f725bce03d50bb3967c74..ccd55cdceeaf46712891a7fab971b8b3c6afa950 100644 --- a/example/apriltag_demo.c +++ b/example/apriltag_demo.c @@ -42,6 +42,7 @@ either expressed or implied, of the Regents of The University of Michigan. diff --git a/upstream_utils/apriltag_patches/0004-Fix-signed-left-shift-warning.patch b/upstream_utils/apriltag_patches/0004-Fix-signed-left-shift-warning.patch index f88fbba32af..f14873186ee 100644 --- a/upstream_utils/apriltag_patches/0004-Fix-signed-left-shift-warning.patch +++ b/upstream_utils/apriltag_patches/0004-Fix-signed-left-shift-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 19 Jul 2023 20:48:21 -0700 -Subject: [PATCH 4/7] Fix signed left shift warning +Subject: [PATCH 4/8] Fix signed left shift warning --- common/pjpeg.c | 4 ++-- diff --git a/upstream_utils/apriltag_patches/0005-Avoid-incompatible-pointer-warning.patch b/upstream_utils/apriltag_patches/0005-Avoid-incompatible-pointer-warning.patch index bd6faf3df43..5713fe88f33 100644 --- a/upstream_utils/apriltag_patches/0005-Avoid-incompatible-pointer-warning.patch +++ b/upstream_utils/apriltag_patches/0005-Avoid-incompatible-pointer-warning.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 19 Jul 2023 21:28:43 -0700 -Subject: [PATCH 5/7] Avoid incompatible pointer warning +Subject: [PATCH 5/8] Avoid incompatible pointer warning --- common/getopt.c | 3 ++- diff --git a/upstream_utils/apriltag_patches/0006-Remove-calls-to-postscript_image.patch b/upstream_utils/apriltag_patches/0006-Remove-calls-to-postscript_image.patch index 71999da953f..0463ae4cbab 100644 --- a/upstream_utils/apriltag_patches/0006-Remove-calls-to-postscript_image.patch +++ b/upstream_utils/apriltag_patches/0006-Remove-calls-to-postscript_image.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 19 Jul 2024 21:45:29 -0700 -Subject: [PATCH 6/7] Remove calls to postscript_image() +Subject: [PATCH 6/8] Remove calls to postscript_image() --- apriltag.c | 5 ----- diff --git a/upstream_utils/apriltag_patches/0007-Fix-clang-16-warnings.patch b/upstream_utils/apriltag_patches/0007-Fix-clang-16-warnings.patch index 13fab045a68..79679488787 100644 --- a/upstream_utils/apriltag_patches/0007-Fix-clang-16-warnings.patch +++ b/upstream_utils/apriltag_patches/0007-Fix-clang-16-warnings.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 29 Jun 2023 22:14:05 -0700 -Subject: [PATCH 7/7] Fix clang 16 warnings +Subject: [PATCH 7/8] Fix clang 16 warnings --- apriltag.c | 2 +- diff --git a/upstream_utils/apriltag_patches/0008-Remove-GCC-diagnostic-pragmas-on-windows.patch b/upstream_utils/apriltag_patches/0008-Remove-GCC-diagnostic-pragmas-on-windows.patch new file mode 100644 index 00000000000..167ceba0ccf --- /dev/null +++ b/upstream_utils/apriltag_patches/0008-Remove-GCC-diagnostic-pragmas-on-windows.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ryan Blue +Date: Fri, 23 Aug 2024 02:50:24 -0400 +Subject: [PATCH 8/8] Remove GCC diagnostic pragmas on windows + +--- + common/pthreads_cross.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/common/pthreads_cross.c b/common/pthreads_cross.c +index d48b81a1bbafa15f1c8a5b4fec6a755847947ce6..4c30def848cdfbe49dd3cec1785a343fbab908eb 100644 +--- a/common/pthreads_cross.c ++++ b/common/pthreads_cross.c +@@ -44,10 +44,7 @@ int pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routin + if (thread == NULL || start_routine == NULL) + return 1; + +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wcast-function-type" + *thread = (HANDLE) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, NULL); +-#pragma GCC diagnostic pop + if (*thread == NULL) + return 1; + return 0; +@@ -218,7 +215,7 @@ int pthread_rwlock_unlock(pthread_rwlock_t *rwlock) + return 0; + } + +-int sched_yield(void) { ++int sched_yield(void) { + return (int)SwitchToThread(); + } + +@@ -238,7 +235,7 @@ unsigned int timespec_to_ms(const struct timespec *abstime) + return ((abstime->tv_sec - time(NULL)) * 1000) + (abstime->tv_nsec / 1000000); + } + +-unsigned int pcthread_get_num_procs(void) ++unsigned int pcthread_get_num_procs(void) + { + SYSTEM_INFO sysinfo; + +@@ -249,7 +246,7 @@ unsigned int pcthread_get_num_procs(void) + #else + + #include +-unsigned int pcthread_get_num_procs(void) ++unsigned int pcthread_get_num_procs(void) + { + return (unsigned int)sysconf(_SC_NPROCESSORS_ONLN); + }