[upstream_utils] Add AprilTag library (#6816)

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
Jade
2024-07-21 13:12:49 +08:00
committed by GitHub
parent 6922b9dd5e
commit eda63dc162
72 changed files with 20189 additions and 96 deletions

94
upstream_utils/apriltag.py Executable file
View File

@@ -0,0 +1,94 @@
#!/usr/bin/env python3
import os
import shutil
from upstream_utils import (
comment_out_invalid_includes,
walk_cwd_and_copy_if,
Lib,
)
def remove_tag(f: str):
if "apriltag" in f:
return False
if "36h11" in f:
return False
if "16h5" in f:
return False
if "tag" in f:
return True
return False
def copy_upstream_src(wpilib_root):
apriltag = os.path.join(wpilib_root, "apriltag")
# Delete old install
shutil.rmtree(
os.path.join(apriltag, "src/main/native/thirdparty/apriltag"),
ignore_errors=True,
)
shutil.rmtree(
os.path.join(apriltag, "src/main/include/thirdparty/apriltag"),
ignore_errors=True,
)
# Copy apriltag source files into allwpilib
src_files = walk_cwd_and_copy_if(
lambda dp, f: (f.endswith(".c") or f.endswith(".cpp"))
and not dp.startswith("./example")
and not f.endswith("getopt.c")
and not "py" in f
and not remove_tag(f),
os.path.join(apriltag, "src/main/native/thirdparty/apriltag/src"),
)
# Copy apriltag header files into allwpilib
walk_cwd_and_copy_if(
lambda dp, f: f.endswith(".h")
and not f.endswith("getopt.h")
and not f.endswith("postscript_utils.h")
and not remove_tag(f),
os.path.join(apriltag, "src/main/native/thirdparty/apriltag/include"),
)
for f in src_files:
comment_out_invalid_includes(
f,
[
os.path.join(apriltag, "src/main/native/thirdparty/apriltag/include"),
os.path.join(
apriltag, "src/main/native/thirdparty/apriltag/include/common"
),
],
)
def main():
name = "apriltag"
url = "https://github.com/AprilRobotics/apriltag.git"
tag = "ebdb2017e04b8e36f7d8a12ce60060416a905e12"
patch_list = [
"0001-apriltag_pose.c-Set-NULL-when-second-solution-could-.patch",
"0002-zmaxheapify-Avoid-return-of-void-expression.patch",
"0003-Avoid-unused-variable-warnings-in-release-builds.patch",
"0004-Make-orthogonal_iteration-exit-early-upon-convergenc.patch",
"0005-Fix-signed-left-shift-warning.patch",
"0006-Avoid-incompatible-pointer-warning.patch",
"0007-Fix-GCC-14-calloc-warning.patch",
"0008-Remove-calls-to-postscript_image.patch",
"0009-Fix-clang-16-warnings.patch",
]
patch_options = {
"ignore_whitespace": True,
}
apriltag = Lib(name, url, tag, patch_list, copy_upstream_src, patch_options)
apriltag.main()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sun, 4 Dec 2022 11:01:56 -0800
Subject: [PATCH 1/9] apriltag_pose.c: Set NULL when second solution could not
be determined
---
apriltag_pose.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/apriltag_pose.c b/apriltag_pose.c
index 6043cb857fbb28304b7e28419f62462f7f0bd05d..f0003a2d187df13236992026ee6ff7f9d6f7aff9 100644
--- a/apriltag_pose.c
+++ b/apriltag_pose.c
@@ -513,6 +513,7 @@ void estimate_tag_pose_orthogonal_iteration(
solution2->t = matd_create(3, 1);
*err2 = orthogonal_iteration(v, p, &solution2->t, &solution2->R, 4, nIters);
} else {
+ solution2->t = NULL;
*err2 = HUGE_VAL;
}

View File

@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sun, 4 Dec 2022 11:25:12 -0800
Subject: [PATCH 2/9] zmaxheapify: Avoid return of void expression
---
common/zmaxheap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/zmaxheap.c b/common/zmaxheap.c
index e04d03efa8a79163293eb306e9f4beab6e4a27df..e410664fd57dfa5ebd30e0680d77b008bb41801c 100644
--- a/common/zmaxheap.c
+++ b/common/zmaxheap.c
@@ -320,7 +320,8 @@ static void maxheapify(zmaxheap_t *heap, int parent)
if (betterchild != parent) {
heap->swap(heap, parent, betterchild);
- return maxheapify(heap, betterchild);
+ maxheapify(heap, betterchild);
+ return;
}
}

View File

@@ -0,0 +1,70 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Sun, 4 Dec 2022 11:42:13 -0800
Subject: [PATCH 3/9] Avoid unused variable warnings in release builds
---
common/matd.c | 4 +++-
common/pjpeg.c | 1 +
common/string_util.c | 1 +
common/zmaxheap.c | 1 +
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/common/matd.c b/common/matd.c
index 54449d9f27a4dae6d1422c37c71bdeeb046c94ba..f426890416dd021d7392b78bd19959c70f44247b 100644
--- a/common/matd.c
+++ b/common/matd.c
@@ -874,7 +874,8 @@ double matd_vec_dist_n(const matd_t *a, const matd_t *b, int n)
int lena = a->nrows*a->ncols;
int lenb = b->nrows*b->ncols;
-
+ (void) lena;
+ (void) lenb;
assert(n <= lena && n <= lenb);
double mag = 0.0;
@@ -909,6 +910,7 @@ double matd_vec_dot_product(const matd_t *a, const matd_t *b)
assert(matd_is_vector(a) && matd_is_vector(b));
int adim = a->ncols*a->nrows;
int bdim = b->ncols*b->nrows;
+ (void) bdim;
assert(adim == bdim);
double acc = 0;
diff --git a/common/pjpeg.c b/common/pjpeg.c
index 7e3d089ad849df67549a58873eb6574c85fda6ee..4a5dd028ee8a3d79fbe7a5abed30886cc6e40dae 100644
--- a/common/pjpeg.c
+++ b/common/pjpeg.c
@@ -863,6 +863,7 @@ pjpeg_t *pjpeg_create_from_buffer(uint8_t *buf, int buflen, uint32_t flags, int
pjd.in = mjpeg_dht;
pjd.inlen = sizeof(mjpeg_dht);
int result = pjpeg_decode_buffer(&pjd);
+ (void) result;
assert(result == 0);
}
diff --git a/common/string_util.c b/common/string_util.c
index 4f0c98056b084af62a9a04bc8425e16dbdf9041a..3d86eb2f2d602a5b00c29952808368dc73c0b0cd 100644
--- a/common/string_util.c
+++ b/common/string_util.c
@@ -552,6 +552,7 @@ void string_feeder_require(string_feeder_t *sf, const char *str)
for (int i = 0; i < len; i++) {
char c = string_feeder_next(sf);
+ (void) c;
assert(c == str[i]);
}
}
diff --git a/common/zmaxheap.c b/common/zmaxheap.c
index e410664fd57dfa5ebd30e0680d77b008bb41801c..2c671236bf07ed4c43e15c02f4bf10df76880cb9 100644
--- a/common/zmaxheap.c
+++ b/common/zmaxheap.c
@@ -399,6 +399,7 @@ void zmaxheap_test()
float outfv;
int res = zmaxheap_remove_max(heap, &outv, &outfv);
if (sz == 0) {
+ (void) res;
assert(res == 0);
} else {
// printf("%d %d %d %f\n", sz, maxv, outv, outfv);

View File

@@ -0,0 +1,141 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Tue, 10 Jan 2023 18:36:36 -0800
Subject: [PATCH 4/9] Make orthogonal_iteration() exit early upon convergence
The current approach wastes iterations doing no work. Exiting early can
give lower latencies and higher FPS.
Co-authored-by: Matt <matthew.morley.ca@gmail.com>
---
apriltag_pose.c | 23 +++++++++++++++++------
apriltag_pose.h | 3 ++-
example/apriltag_demo.c | 22 ++++++++++++++++++++++
3 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/apriltag_pose.c b/apriltag_pose.c
index f0003a2d187df13236992026ee6ff7f9d6f7aff9..782729225c3555edcfebb7d8a21f847aad0e328f 100644
--- a/apriltag_pose.c
+++ b/apriltag_pose.c
@@ -35,12 +35,13 @@ double matd_to_double(matd_t *a)
* @param R In/Outparam. Should be set to initial guess at R. Will be modified to be the optimal translation.
* @param n_points Number of points.
* @param n_steps Number of iterations.
+ * @param min_improvement_per_iteration Min object-space error improvement; if less than this, solver will exit early
*
* @return Object-space error after iteration.
*
* Implementation of Orthogonal Iteration from Lu, 2000.
*/
-double orthogonal_iteration(matd_t** v, matd_t** p, matd_t** t, matd_t** R, int n_points, int n_steps) {
+double orthogonal_iteration(matd_t** v, matd_t** p, matd_t** t, matd_t** R, int n_points, int n_steps, double min_improvement_per_iteration) {
matd_t* p_mean = matd_create(3, 1);
for (int i = 0; i < n_points; i++) {
matd_add_inplace(p_mean, p[i]);
@@ -120,9 +121,16 @@ double orthogonal_iteration(matd_t** v, matd_t** p, matd_t** t, matd_t** R, int
error += matd_to_double(matd_op("M'M", err_vec, err_vec));
matd_destroy(err_vec);
}
- prev_error = error;
free(q);
+
+ // Return early if the iterations converged
+ if (fabs(error - prev_error) < min_improvement_per_iteration) {
+ prev_error = error;
+ break;
+ }
+
+ prev_error = error;
}
matd_destroy(I3);
@@ -493,7 +501,8 @@ void estimate_tag_pose_orthogonal_iteration(
apriltag_pose_t* solution1,
double* err2,
apriltag_pose_t* solution2,
- int nIters) {
+ int nIters,
+ double min_improvement_per_iteration) {
double scale = info->tagsize/2.0;
matd_t* p[4] = {
matd_create_data(3, 1, (double[]) {-scale, scale, 0}),
@@ -507,11 +516,11 @@ void estimate_tag_pose_orthogonal_iteration(
}
estimate_pose_for_tag_homography(info, solution1);
- *err1 = orthogonal_iteration(v, p, &solution1->t, &solution1->R, 4, nIters);
+ *err1 = orthogonal_iteration(v, p, &solution1->t, &solution1->R, 4, nIters, min_improvement_per_iteration);
solution2->R = fix_pose_ambiguities(v, p, solution1->t, solution1->R, 4);
if (solution2->R) {
solution2->t = matd_create(3, 1);
- *err2 = orthogonal_iteration(v, p, &solution2->t, &solution2->R, 4, nIters);
+ *err2 = orthogonal_iteration(v, p, &solution2->t, &solution2->R, 4, nIters, min_improvement_per_iteration);
} else {
solution2->t = NULL;
*err2 = HUGE_VAL;
@@ -529,7 +538,9 @@ void estimate_tag_pose_orthogonal_iteration(
double estimate_tag_pose(apriltag_detection_info_t* info, apriltag_pose_t* pose) {
double err1, err2;
apriltag_pose_t pose1, pose2;
- estimate_tag_pose_orthogonal_iteration(info, &err1, &pose1, &err2, &pose2, 50);
+ // 50 iterations is a good sensible default
+ // 1e-7 improvement per iteration is also pretty sane
+ estimate_tag_pose_orthogonal_iteration(info, &err1, &pose1, &err2, &pose2, 50, 1e-7);
if (err1 <= err2) {
pose->R = pose1.R;
pose->t = pose1.t;
diff --git a/apriltag_pose.h b/apriltag_pose.h
index 07ee37b2cb4185bcbdb46d1c9ccec306f0f2e96d..72993f11514199754c452369bad32157b6d64eb1 100644
--- a/apriltag_pose.h
+++ b/apriltag_pose.h
@@ -63,7 +63,8 @@ void estimate_tag_pose_orthogonal_iteration(
apriltag_pose_t* pose1,
double* err2,
apriltag_pose_t* pose2,
- int nIters);
+ int nIters,
+ double min_improvement_per_iteration);
/**
* Estimate tag pose.
diff --git a/example/apriltag_demo.c b/example/apriltag_demo.c
index 6de90540fe2f22f5160f725bce03d50bb3967c74..841d7788756011b0c7237e989242d87de76b14ef 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.
#endif
#include "apriltag.h"
+#include "apriltag_pose.h"
#include "tag36h11.h"
#include "tag25h9.h"
#include "tag16h5.h"
@@ -218,6 +219,27 @@ int main(int argc, char *argv[])
hamm_hist[det->hamming]++;
total_hamm_hist[det->hamming]++;
+
+ apriltag_detection_info_t info = { det, 0.15, 1000, 1000, 1280/2, 720/2 };
+ double err1 = HUGE_VAL; //Should get overwritten if pose estimation is happening
+ double err2 = HUGE_VAL;
+ apriltag_pose_t pose1 = { 0 };
+ apriltag_pose_t pose2 = { 0 };
+ int nIters = 200;
+ estimate_tag_pose_orthogonal_iteration(&info, &err1, &pose1, &err2, &pose2, nIters, 1e-7);
+
+ printf("Primary translation %f %f %f\nerror: %f\n",
+ pose1.t->data[0],
+ pose1.t->data[1],
+ pose1.t->data[2],
+ err1
+ );
+ printf("Alt translation %f %f %f\nerror: %f\n",
+ pose2.t->data[0],
+ pose2.t->data[1],
+ pose2.t->data[2],
+ err2
+ );
}
apriltag_detections_destroy(detections);

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Wed, 19 Jul 2023 20:48:21 -0700
Subject: [PATCH 5/9] Fix signed left shift warning
---
common/pjpeg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/pjpeg.c b/common/pjpeg.c
index 4a5dd028ee8a3d79fbe7a5abed30886cc6e40dae..1941c27b7752a6a2420e8370451b0d29268f324d 100644
--- a/common/pjpeg.c
+++ b/common/pjpeg.c
@@ -594,7 +594,7 @@ static int pjpeg_decode_buffer(struct pjpeg_decode_state *pjd)
// if high bit is clear, it's negative
if ((value & (1 << (ssss-1))) == 0)
- value += ((-1) << ssss) + 1;
+ value += (int32_t)(UINT32_MAX << ssss) + 1;
dcpred[nsidx] += value;
block[0] = dcpred[nsidx] * pjd->qtab[qtabidx][0];
@@ -620,7 +620,7 @@ static int pjpeg_decode_buffer(struct pjpeg_decode_state *pjd)
// if high bit is clear, it's negative
if ((value & (1 << (ssss-1))) == 0)
- value += ((-1) << ssss) + 1;
+ value += (int32_t)(UINT32_MAX << ssss) + 1;
coeff += rrrr;

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Wed, 19 Jul 2023 21:28:43 -0700
Subject: [PATCH 6/9] Avoid incompatible pointer warning
---
common/getopt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/getopt.c b/common/getopt.c
index 7613b69c346f3f818688bb9f4704463367d877f6..71ae57bd83b2ed50c7f80f3e3952ddfcc53cb7bc 100644
--- a/common/getopt.c
+++ b/common/getopt.c
@@ -76,8 +76,9 @@ getopt_t *getopt_create()
return gopt;
}
-void getopt_option_destroy(getopt_option_t *goo)
+void getopt_option_destroy(void *vgoo)
{
+ getopt_option_t* goo = (getopt_option_t*)vgoo;
free(goo->sname);
free(goo->lname);
free(goo->svalue);

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Sun, 23 Jun 2024 05:53:42 -0700
Subject: [PATCH 7/9] Fix GCC 14 calloc() warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
```
/home/tav/frc/wpilib/allwpilib/build-cmake-release/_deps/apriltaglib-src/common/zmaxheap.c: In function zmaxheap_test:
/home/tav/frc/wpilib/allwpilib/build-cmake-release/_deps/apriltaglib-src/common/zmaxheap.c:365:35: error: calloc sizes specified with sizeof in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
365 | int32_t *vals = calloc(sizeof(int32_t), cap);
| ^~~~~~~
/home/tav/frc/wpilib/allwpilib/build-cmake-release/_deps/apriltaglib-src/common/zmaxheap.c:365:35: note: earlier argument should specify number of elements, later size of each element
```
---
common/zmaxheap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/zmaxheap.c b/common/zmaxheap.c
index 2c671236bf07ed4c43e15c02f4bf10df76880cb9..ed271420d229a98b56c7027f47d9830a78a97db1 100644
--- a/common/zmaxheap.c
+++ b/common/zmaxheap.c
@@ -362,7 +362,7 @@ void zmaxheap_test()
{
int cap = 10000;
int sz = 0;
- int32_t *vals = calloc(sizeof(int32_t), cap);
+ int32_t *vals = calloc(cap, sizeof(int32_t));
zmaxheap_t *heap = zmaxheap_create(sizeof(int32_t));

View File

@@ -0,0 +1,61 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Fri, 19 Jul 2024 21:45:29 -0700
Subject: [PATCH 8/9] Remove calls to postscript_image()
---
apriltag.c | 5 -----
apriltag_quad_thresh.c | 3 ---
2 files changed, 8 deletions(-)
diff --git a/apriltag.c b/apriltag.c
index 3086228868281eaad5cc5382d305227757d4a5cf..b514d974971827e6a4f4f0a4fa12e6b0392d7282 100644
--- a/apriltag.c
+++ b/apriltag.c
@@ -51,8 +51,6 @@ either expressed or implied, of the Regents of The University of Michigan.
#include "apriltag_math.h"
-#include "common/postscript_utils.h"
-
#ifndef M_PI
# define M_PI 3.141592653589793238462643383279502884196
#endif
@@ -1282,7 +1280,6 @@ zarray_t *apriltag_detector_detect(apriltag_detector_t *td, image_u8_t *im_orig)
fprintf(f, "%f %f scale\n", scale, scale);
fprintf(f, "0 %d translate\n", darker->height);
fprintf(f, "1 -1 scale\n");
- postscript_image(f, darker);
image_u8_destroy(darker);
@@ -1365,8 +1362,6 @@ zarray_t *apriltag_detector_detect(apriltag_detector_t *td, image_u8_t *im_orig)
fprintf(f, "0 %d translate\n", darker->height);
fprintf(f, "1 -1 scale\n");
- postscript_image(f, darker);
-
image_u8_destroy(darker);
for (int i = 0; i < zarray_size(quads); i++) {
diff --git a/apriltag_quad_thresh.c b/apriltag_quad_thresh.c
index 735520c6b1dd7387c837e8922d2ecd68130b9b5c..677f365765493bcbf043b0841bb28016a0d3acde 100644
--- a/apriltag_quad_thresh.c
+++ b/apriltag_quad_thresh.c
@@ -40,7 +40,6 @@ either expressed or implied, of the Regents of The University of Michigan.
#include "common/unionfind.h"
#include "common/timeprofile.h"
#include "common/zmaxheap.h"
-#include "common/postscript_utils.h"
#include "common/math_util.h"
#ifdef _WIN32
@@ -1979,8 +1978,6 @@ zarray_t *apriltag_quad_thresh(apriltag_detector_t *td, image_u8_t *im)
fprintf(f, "0 %d translate\n", im2->height);
fprintf(f, "1 -1 scale\n");
- postscript_image(f, im2);
-
image_u8_destroy(im2);
for (int i = 0; i < zarray_size(quads); i++) {

View File

@@ -0,0 +1,691 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Johnson <johnson.peter@gmail.com>
Date: Thu, 29 Jun 2023 22:14:05 -0700
Subject: [PATCH 9/9] Fix clang 16 warnings
---
apriltag.c | 2 +-
apriltag.h | 2 +-
common/g2d.c | 2 +-
common/g2d.h | 2 +-
common/getopt.c | 2 +-
common/getopt.h | 2 +-
common/math_util.h | 4 ++--
common/pthreads_cross.cpp | 6 +++---
common/pthreads_cross.h | 2 +-
common/string_util.c | 2 +-
common/string_util.h | 2 +-
common/time_util.c | 4 ++--
common/time_util.h | 4 ++--
common/timeprofile.h | 2 +-
common/workerpool.c | 8 ++++----
common/workerpool.h | 2 +-
common/zarray.c | 2 +-
common/zarray.h | 2 +-
common/zhash.c | 8 ++++----
common/zhash.h | 8 ++++----
common/zmaxheap.c | 4 ++--
common/zmaxheap.h | 2 +-
tag16h5.c | 2 +-
tag16h5.h | 2 +-
tag25h9.c | 2 +-
tag25h9.h | 2 +-
tag36h10.c | 2 +-
tag36h10.h | 2 +-
tag36h11.c | 2 +-
tag36h11.h | 2 +-
tagCircle21h7.c | 2 +-
tagCircle21h7.h | 2 +-
tagCircle49h12.c | 2 +-
tagCircle49h12.h | 2 +-
tagCustom48h12.c | 2 +-
tagCustom48h12.h | 2 +-
tagStandard41h12.c | 2 +-
tagStandard41h12.h | 2 +-
tagStandard52h13.c | 2 +-
tagStandard52h13.h | 2 +-
40 files changed, 55 insertions(+), 55 deletions(-)
diff --git a/apriltag.c b/apriltag.c
index b514d974971827e6a4f4f0a4fa12e6b0392d7282..bfff1ea9d502b8ef08d00e61d4c75a967c06462b 100644
--- a/apriltag.c
+++ b/apriltag.c
@@ -352,7 +352,7 @@ void apriltag_detector_clear_families(apriltag_detector_t *td)
zarray_clear(td->tag_families);
}
-apriltag_detector_t *apriltag_detector_create()
+apriltag_detector_t *apriltag_detector_create(void)
{
apriltag_detector_t *td = (apriltag_detector_t*) calloc(1, sizeof(apriltag_detector_t));
diff --git a/apriltag.h b/apriltag.h
index 2d772cda60185de81fb279e83134074284b8e491..eb58a71d976ee84b94a232e3c778120a52f2b609 100644
--- a/apriltag.h
+++ b/apriltag.h
@@ -231,7 +231,7 @@ struct apriltag_detection
};
// don't forget to add a family!
-apriltag_detector_t *apriltag_detector_create();
+apriltag_detector_t *apriltag_detector_create(void);
// add a family to the apriltag detector. caller still "owns" the family.
// a single instance should only be provided to one apriltag detector instance.
diff --git a/common/g2d.c b/common/g2d.c
index 4645f206e52ff14c20c04ec9601d20725339197b..e0106437717b872b8b9823135c076da7ba0a1e84 100644
--- a/common/g2d.c
+++ b/common/g2d.c
@@ -45,7 +45,7 @@ double g2d_distance(const double a[2], const double b[2])
return sqrtf(sq(a[0]-b[0]) + sq(a[1]-b[1]));
}
-zarray_t *g2d_polygon_create_empty()
+zarray_t *g2d_polygon_create_empty(void)
{
return zarray_create(sizeof(double[2]));
}
diff --git a/common/g2d.h b/common/g2d.h
index 21c21ac64d8988578f3c2d108a7a07d54e780954..5a0dd0b59869099e24453eda78ada1e565fe7aae 100644
--- a/common/g2d.h
+++ b/common/g2d.h
@@ -96,7 +96,7 @@ zarray_t *g2d_polygon_create_data(double v[][2], int sz);
zarray_t *g2d_polygon_create_zeros(int sz);
-zarray_t *g2d_polygon_create_empty();
+zarray_t *g2d_polygon_create_empty(void);
void g2d_polygon_add(zarray_t *poly, double v[2]);
diff --git a/common/getopt.c b/common/getopt.c
index 71ae57bd83b2ed50c7f80f3e3952ddfcc53cb7bc..458ef7705019b73dcd4c9fa03fe15555ea087fcf 100644
--- a/common/getopt.c
+++ b/common/getopt.c
@@ -64,7 +64,7 @@ struct getopt
zarray_t *options;
};
-getopt_t *getopt_create()
+getopt_t *getopt_create(void)
{
getopt_t *gopt = (getopt_t*) calloc(1, sizeof(getopt_t));
diff --git a/common/getopt.h b/common/getopt.h
index 69dbb05c8286a9d5d301382fc44fdea8c8f7875e..75266f033a0485b22cc34ec08e894781b6658894 100644
--- a/common/getopt.h
+++ b/common/getopt.h
@@ -36,7 +36,7 @@ extern "C" {
typedef struct getopt getopt_t;
-getopt_t *getopt_create();
+getopt_t *getopt_create(void);
void getopt_destroy(getopt_t *gopt);
// Parse args. Returns 1 on success
diff --git a/common/math_util.h b/common/math_util.h
index 9271a01834501a311f28525ca460f61117524eab..5434355a512c1a6225bbfbf335caa279d17ed7aa 100644
--- a/common/math_util.h
+++ b/common/math_util.h
@@ -86,13 +86,13 @@ static inline double sgn(double v)
}
// random number between [0, 1)
-static inline float randf()
+static inline float randf(void)
{
return (float)(rand() / (RAND_MAX + 1.0));
}
-static inline float signed_randf()
+static inline float signed_randf(void)
{
return randf()*2 - 1;
}
diff --git a/common/pthreads_cross.cpp b/common/pthreads_cross.cpp
index f7721912f9088bf84224943aa836a69356949f18..09d6ce6e97074f4ffbcef1ef6e06fd53ee22ff0f 100644
--- a/common/pthreads_cross.cpp
+++ b/common/pthreads_cross.cpp
@@ -216,7 +216,7 @@ int pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
return 0;
}
-int sched_yield() {
+int sched_yield(void) {
return (int)SwitchToThread();
}
@@ -241,7 +241,7 @@ unsigned int timespec_to_ms(const struct timespec *abstime)
return t;
}
-unsigned int pcthread_get_num_procs()
+unsigned int pcthread_get_num_procs(void)
{
SYSTEM_INFO sysinfo;
@@ -252,7 +252,7 @@ unsigned int pcthread_get_num_procs()
#else
#include <unistd.h>
-unsigned int pcthread_get_num_procs()
+unsigned int pcthread_get_num_procs(void)
{
return (unsigned int)sysconf(_SC_NPROCESSORS_ONLN);
}
diff --git a/common/pthreads_cross.h b/common/pthreads_cross.h
index 897a333573e88263b6ba58ec3d31031304c50e54..209c28f855efcbdf41424f11a302ba2794836796 100644
--- a/common/pthreads_cross.h
+++ b/common/pthreads_cross.h
@@ -70,7 +70,7 @@ int sched_yield(void);
#ifdef __cplusplus
extern "C" {
#endif
-unsigned int pcthread_get_num_procs();
+unsigned int pcthread_get_num_procs(void);
void ms_to_timespec(struct timespec *ts, unsigned int ms);
unsigned int timespec_to_ms(const struct timespec *abstime);
diff --git a/common/string_util.c b/common/string_util.c
index 3d86eb2f2d602a5b00c29952808368dc73c0b0cd..14726e7a7f66a330b28ef326734cd7fd25e8d4dd 100644
--- a/common/string_util.c
+++ b/common/string_util.c
@@ -314,7 +314,7 @@ char *str_touppercase(char *s)
return s;
}
-string_buffer_t* string_buffer_create()
+string_buffer_t* string_buffer_create(void)
{
string_buffer_t *sb = (string_buffer_t*) calloc(1, sizeof(string_buffer_t));
assert(sb != NULL);
diff --git a/common/string_util.h b/common/string_util.h
index 9a7cd1e4509e3eba102316330cd50df918f56aed..d0363b03f23a94c35ed3581ea40f6d8f3f2d4110 100644
--- a/common/string_util.h
+++ b/common/string_util.h
@@ -262,7 +262,7 @@ char *str_replace(const char *haystack, const char *needle, const char *replacem
* It is the caller's responsibility to free the string buffer resources with
* a call to string_buffer_destroy() when it is no longer needed.
*/
-string_buffer_t *string_buffer_create();
+string_buffer_t *string_buffer_create(void);
/**
* Frees the resources associated with a string buffer object, including space
diff --git a/common/time_util.c b/common/time_util.c
index 7a25f424068d798a8c65c69c6c17dd05b2e2b950..f3e3b0849bb8442ca1be6fda29ffcc79d52ec949 100644
--- a/common/time_util.c
+++ b/common/time_util.c
@@ -35,7 +35,7 @@ struct timeutil_rest
int64_t start_time;
};
-timeutil_rest_t *timeutil_rest_create()
+timeutil_rest_t *timeutil_rest_create(void)
{
timeutil_rest_t *rest = calloc(1, sizeof(timeutil_rest_t));
return rest;
@@ -46,7 +46,7 @@ void timeutil_rest_destroy(timeutil_rest_t *rest)
free(rest);
}
-int64_t utime_now() // blacklist-ignore
+int64_t utime_now(void) // blacklist-ignore
{
struct timeval tv;
gettimeofday (&tv, NULL); // blacklist-ignore
diff --git a/common/time_util.h b/common/time_util.h
index 207e95838126a503567bf21b4bc8a3f32774afd8..c42466b3a0acdd322bd33aa9c77df09adc6585f1 100644
--- a/common/time_util.h
+++ b/common/time_util.h
@@ -56,10 +56,10 @@ extern "C" {
#endif
typedef struct timeutil_rest timeutil_rest_t;
-timeutil_rest_t *timeutil_rest_create();
+timeutil_rest_t *timeutil_rest_create(void);
void timeutil_rest_destroy(timeutil_rest_t * rest);
-int64_t utime_now(); // blacklist-ignore
+int64_t utime_now(void); // blacklist-ignore
int64_t utime_get_seconds(int64_t v);
int64_t utime_get_useconds(int64_t v);
void utime_to_timeval(int64_t v, struct timeval *tv);
diff --git a/common/timeprofile.h b/common/timeprofile.h
index 8016386ed214de371eae619f4e887aef01852408..197d6ceb330a4414483bd9db66e091d4fe911bf2 100644
--- a/common/timeprofile.h
+++ b/common/timeprofile.h
@@ -51,7 +51,7 @@ struct timeprofile
zarray_t *stamps;
};
-static inline timeprofile_t *timeprofile_create()
+static inline timeprofile_t *timeprofile_create(void)
{
timeprofile_t *tp = (timeprofile_t*) calloc(1, sizeof(timeprofile_t));
tp->stamps = zarray_create(sizeof(struct timeprofile_entry));
diff --git a/common/workerpool.c b/common/workerpool.c
index a0170ef87978cb4cd2d3d8a198ffea471b6e40b2..23415eb5610751ae7f861f1deb7b25c8e56774a3 100644
--- a/common/workerpool.c
+++ b/common/workerpool.c
@@ -66,7 +66,7 @@ void *worker_thread(void *p)
{
workerpool_t *wp = (workerpool_t*) p;
- int cnt = 0;
+// int cnt = 0;
while (1) {
struct task *task;
@@ -77,13 +77,13 @@ void *worker_thread(void *p)
// printf("%"PRId64" thread %d did %d\n", utime_now(), pthread_self(), cnt);
pthread_cond_broadcast(&wp->endcond);
pthread_cond_wait(&wp->startcond, &wp->mutex);
- cnt = 0;
+// cnt = 0;
// printf("%"PRId64" thread %d awake\n", utime_now(), pthread_self());
}
zarray_get_volatile(wp->tasks, wp->taskspos, &task);
wp->taskspos++;
- cnt++;
+// cnt++;
pthread_mutex_unlock(&wp->mutex);
// pthread_yield();
sched_yield();
@@ -203,7 +203,7 @@ void workerpool_run(workerpool_t *wp)
}
}
-int workerpool_get_nprocs()
+int workerpool_get_nprocs(void)
{
#ifdef WIN32
SYSTEM_INFO sysinfo;
diff --git a/common/workerpool.h b/common/workerpool.h
index 2c32ab1eb7f9fe1e803aef187d4af3aea9284238..070a983cbb0ce24450297dba2f58a903977c5a24 100644
--- a/common/workerpool.h
+++ b/common/workerpool.h
@@ -46,4 +46,4 @@ void workerpool_run_single(workerpool_t *wp);
int workerpool_get_nthreads(workerpool_t *wp);
-int workerpool_get_nprocs();
+int workerpool_get_nprocs(void);
diff --git a/common/zarray.c b/common/zarray.c
index 43e6a7e0c6fb6d06414d6910e511d362ccc35354..fa1f8a25b6cad5661d70aa81b40b991126a9ac7c 100644
--- a/common/zarray.c
+++ b/common/zarray.c
@@ -41,7 +41,7 @@ int zstrcmp(const void * a_pp, const void * b_pp)
return strcmp(a,b);
}
-void zarray_vmap(zarray_t *za, void (*f)())
+void zarray_vmap(zarray_t *za, void (*f)(void*))
{
assert(za != NULL);
assert(f != NULL);
diff --git a/common/zarray.h b/common/zarray.h
index 22b4c2bb4773d5d80e33c14a7b4945ab18586939..411ee7b6495b4b37813d08dc42848ce96734fb39 100644
--- a/common/zarray.h
+++ b/common/zarray.h
@@ -355,7 +355,7 @@ static inline void zarray_map(zarray_t *za, void (*f)(void*))
*
* void map_function(element_type *element)
*/
- void zarray_vmap(zarray_t *za, void (*f)());
+ void zarray_vmap(zarray_t *za, void (*f)(void*));
/**
* Removes all elements from the array and sets its size to zero. Pointers to
diff --git a/common/zhash.c b/common/zhash.c
index faf52233ed92f64b87ddbab255121c8202b13019..10eb6eb8a6e3ce70e51a117009dcbea3aa381d4c 100644
--- a/common/zhash.c
+++ b/common/zhash.c
@@ -352,7 +352,7 @@ void zhash_iterator_remove(zhash_iterator_t *zit)
zit->last_entry--;
}
-void zhash_map_keys(zhash_t *zh, void (*f)())
+void zhash_map_keys(zhash_t *zh, void (*f)(void *))
{
assert(zh != NULL);
if (f == NULL)
@@ -368,7 +368,7 @@ void zhash_map_keys(zhash_t *zh, void (*f)())
}
}
-void zhash_vmap_keys(zhash_t * zh, void (*f)())
+void zhash_vmap_keys(zhash_t * zh, void (*f)(void *))
{
assert(zh != NULL);
if (f == NULL)
@@ -385,7 +385,7 @@ void zhash_vmap_keys(zhash_t * zh, void (*f)())
}
}
-void zhash_map_values(zhash_t * zh, void (*f)())
+void zhash_map_values(zhash_t * zh, void (*f)(void *))
{
assert(zh != NULL);
if (f == NULL)
@@ -400,7 +400,7 @@ void zhash_map_values(zhash_t * zh, void (*f)())
}
}
-void zhash_vmap_values(zhash_t * zh, void (*f)())
+void zhash_vmap_values(zhash_t * zh, void (*f)(void *))
{
assert(zh != NULL);
if (f == NULL)
diff --git a/common/zhash.h b/common/zhash.h
index f3dee1aa40f6f2717fa23d7e7f856bd8864a99b3..9993a66e4aed22d998d58e10a5d0db0193fcff95 100644
--- a/common/zhash.h
+++ b/common/zhash.h
@@ -259,7 +259,7 @@ void zhash_iterator_remove(zhash_iterator_t *zit);
* for the key, which the caller should not modify, as the hash table will not be
* re-indexed. The function may be NULL, in which case no action is taken.
*/
-void zhash_map_keys(zhash_t *zh, void (*f)());
+void zhash_map_keys(zhash_t *zh, void (*f)(void *));
/**
* Calls the supplied function with a pointer to every value in the hash table in
@@ -267,7 +267,7 @@ void zhash_map_keys(zhash_t *zh, void (*f)());
* for the value, which the caller may safely modify. The function may be NULL,
* in which case no action is taken.
*/
-void zhash_map_values(zhash_t *zh, void (*f)());
+void zhash_map_values(zhash_t *zh, void (*f)(void *));
/**
* Calls the supplied function with a copy of every key in the hash table in
@@ -280,7 +280,7 @@ void zhash_map_values(zhash_t *zh, void (*f)());
* Use with non-pointer keys (i.e. integer, double, etc.) will likely cause a
* segmentation fault.
*/
-void zhash_vmap_keys(zhash_t *vh, void (*f)());
+void zhash_vmap_keys(zhash_t *vh, void (*f)(void *));
/**
* Calls the supplied function with a copy of every value in the hash table in
@@ -293,7 +293,7 @@ void zhash_vmap_keys(zhash_t *vh, void (*f)());
* Use with non-pointer values (i.e. integer, double, etc.) will likely cause a
* segmentation fault.
*/
-void zhash_vmap_values(zhash_t *vh, void (*f)());
+void zhash_vmap_values(zhash_t *vh, void (*f)(void *));
/**
* Returns an array which contains copies of all of the hash table's keys, in no
diff --git a/common/zmaxheap.c b/common/zmaxheap.c
index ed271420d229a98b56c7027f47d9830a78a97db1..a073ae5a17fdd5f11f4e17d56cc05548113f6a6c 100644
--- a/common/zmaxheap.c
+++ b/common/zmaxheap.c
@@ -167,7 +167,7 @@ void zmaxheap_add(zmaxheap_t *heap, void *p, float v)
}
}
-void zmaxheap_vmap(zmaxheap_t *heap, void (*f)())
+void zmaxheap_vmap(zmaxheap_t *heap, void (*f)(void*))
{
assert(heap != NULL);
assert(f != NULL);
@@ -358,7 +358,7 @@ void zmaxheap_iterator_finish(zmaxheap_iterator_t *it)
maxheapify(heap, i);
}
-void zmaxheap_test()
+void zmaxheap_test(void)
{
int cap = 10000;
int sz = 0;
diff --git a/common/zmaxheap.h b/common/zmaxheap.h
index f0020f92e7a46c4814f30d77c189931e0e276d18..af9d1458c518e365828a5dd3bb7050cf57d2ce9b 100644
--- a/common/zmaxheap.h
+++ b/common/zmaxheap.h
@@ -39,7 +39,7 @@ struct zmaxheap_iterator {
zmaxheap_t *zmaxheap_create(size_t el_sz);
-void zmaxheap_vmap(zmaxheap_t *heap, void (*f)());
+void zmaxheap_vmap(zmaxheap_t *heap, void (*f)(void*));
void zmaxheap_destroy(zmaxheap_t *heap);
diff --git a/tag16h5.c b/tag16h5.c
index 775f33c7e2d91af83e4a62949cadebdce34e3eb9..e38302a1d2ca2a2344a775569aed266d063a8861 100644
--- a/tag16h5.c
+++ b/tag16h5.c
@@ -60,7 +60,7 @@ static uint64_t codedata[30] = {
0x000000000000154dUL,
0x000000000000b57aUL,
};
-apriltag_family_t *tag16h5_create()
+apriltag_family_t *tag16h5_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tag16h5");
diff --git a/tag16h5.h b/tag16h5.h
index d868c81839d0f982ed1f7de129efe3a3a7d92c71..6661080b66cae147b2b63be5d6d2d0b8b4f2a85d 100644
--- a/tag16h5.h
+++ b/tag16h5.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tag16h5_create();
+apriltag_family_t *tag16h5_create(void);
void tag16h5_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tag25h9.c b/tag25h9.c
index ddf31a2e45cb64934000f42d15ba62619ee9c68e..2478f4ab17bbbe6e224e14ed2dcd593eb0dbba9f 100644
--- a/tag25h9.c
+++ b/tag25h9.c
@@ -65,7 +65,7 @@ static uint64_t codedata[35] = {
0x0000000001bcc0f6UL,
0x0000000000a64f8dUL,
};
-apriltag_family_t *tag25h9_create()
+apriltag_family_t *tag25h9_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tag25h9");
diff --git a/tag25h9.h b/tag25h9.h
index 9197c8b367d4b2047cb7d9882dfc11092f0b3dce..6e0107d28f3c3da6ae148a90050774277147addd 100644
--- a/tag25h9.h
+++ b/tag25h9.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tag25h9_create();
+apriltag_family_t *tag25h9_create(void);
void tag25h9_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tag36h10.c b/tag36h10.c
index 44a129e74b135e803e2324cea179ac3001718e14..843dc4e9dcb3fbde3d86ce0a7d18703f7c358c15 100644
--- a/tag36h10.c
+++ b/tag36h10.c
@@ -2323,7 +2323,7 @@ static uint64_t codedata[2320] = {
0x0000000447b9e7acUL,
0x0000000d9f564f30UL,
};
-apriltag_family_t *tag36h10_create()
+apriltag_family_t *tag36h10_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tag36h10");
diff --git a/tag36h10.h b/tag36h10.h
index a60ae6c5ade78804ed2ba406fcbef83a086e32c1..cc8a2805a1836550d5a0530497ae007797fb71b6 100644
--- a/tag36h10.h
+++ b/tag36h10.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tag36h10_create();
+apriltag_family_t *tag36h10_create(void);
void tag36h10_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tag36h11.c b/tag36h11.c
index 94acacaaa473d5b1bc530dee625eb7ea388f4928..f1347a5bc141ff88a831147114c0d78c374d9607 100644
--- a/tag36h11.c
+++ b/tag36h11.c
@@ -617,7 +617,7 @@ static uint64_t codedata[587] = {
0x00000002164f73a0UL,
0x0000000e8b772fe0UL,
};
-apriltag_family_t *tag36h11_create()
+apriltag_family_t *tag36h11_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tag36h11");
diff --git a/tag36h11.h b/tag36h11.h
index 620387822dfd1a43fac265dd3609ead848bdeb2e..45f9e5698e2657f10e7887ae1ee67debf0d69de7 100644
--- a/tag36h11.h
+++ b/tag36h11.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tag36h11_create();
+apriltag_family_t *tag36h11_create(void);
void tag36h11_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tagCircle21h7.c b/tagCircle21h7.c
index 8dad3feb11b3e9d9cea9e2863bec087b806bd3d2..9459176e00ad898edc85c3fcb01a0985fc242f5a 100644
--- a/tagCircle21h7.c
+++ b/tagCircle21h7.c
@@ -68,7 +68,7 @@ static uint64_t codedata[38] = {
0x0000000000015b39UL,
0x00000000001ec1e3UL,
};
-apriltag_family_t *tagCircle21h7_create()
+apriltag_family_t *tagCircle21h7_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tagCircle21h7");
diff --git a/tagCircle21h7.h b/tagCircle21h7.h
index a051db64f9119983d95e59bd5f2569c78435cd70..f002a51abde4cc27a7113d6822be2d7a71cad5c3 100644
--- a/tagCircle21h7.h
+++ b/tagCircle21h7.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tagCircle21h7_create();
+apriltag_family_t *tagCircle21h7_create(void);
void tagCircle21h7_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tagCircle49h12.c b/tagCircle49h12.c
index 02456fab0ff32fba8d9ed5fcca0a1e09a4017228..c703431e3d7237d22b8231f72b80b63ae3702027 100644
--- a/tagCircle49h12.c
+++ b/tagCircle49h12.c
@@ -65565,7 +65565,7 @@ static uint64_t codedata[65535] = {
0x0001719f5eec237fUL,
0x0001e520c2997b43UL,
};
-apriltag_family_t *tagCircle49h12_create()
+apriltag_family_t *tagCircle49h12_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tagCircle49h12");
diff --git a/tagCircle49h12.h b/tagCircle49h12.h
index 4b4c0846b670d94eee7dc8996130b41dd7a1a2ee..c69e57065e55182f81629fdd82c03ea281e3d907 100644
--- a/tagCircle49h12.h
+++ b/tagCircle49h12.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tagCircle49h12_create();
+apriltag_family_t *tagCircle49h12_create(void);
void tagCircle49h12_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tagCustom48h12.c b/tagCustom48h12.c
index cd908e10772663732f8130aa9d100908ce8e3825..7b31f014f69ed34261549a2c178d3d3f504d4637 100644
--- a/tagCustom48h12.c
+++ b/tagCustom48h12.c
@@ -42241,7 +42241,7 @@ static uint64_t codedata[42211] = {
0x0000bb8c4e2f373cUL,
0x000018bccac8b0f5UL,
};
-apriltag_family_t *tagCustom48h12_create()
+apriltag_family_t *tagCustom48h12_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tagCustom48h12");
diff --git a/tagCustom48h12.h b/tagCustom48h12.h
index 564a98a6869677e020261ba39a0e0bbe8468e3a5..5fca82d4d67d6eaceee7b1e8640ad233dd3b5284 100644
--- a/tagCustom48h12.h
+++ b/tagCustom48h12.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tagCustom48h12_create();
+apriltag_family_t *tagCustom48h12_create(void);
void tagCustom48h12_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tagStandard41h12.c b/tagStandard41h12.c
index 6d77eb95aa3d3c6235e66ddc67da83c794a4800e..f9c0b896360068074da23f1a36ebb3404dbbb650 100644
--- a/tagStandard41h12.c
+++ b/tagStandard41h12.c
@@ -2145,7 +2145,7 @@ static uint64_t codedata[2115] = {
0x0000015cff6a6f12UL,
0x000001ee40155a64UL,
};
-apriltag_family_t *tagStandard41h12_create()
+apriltag_family_t *tagStandard41h12_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tagStandard41h12");
diff --git a/tagStandard41h12.h b/tagStandard41h12.h
index 7f2c33b209faf16d0c27589420baab6300342da3..a764fcb9a3dde966985ffb8abe3f489028861a1c 100644
--- a/tagStandard41h12.h
+++ b/tagStandard41h12.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tagStandard41h12_create();
+apriltag_family_t *tagStandard41h12_create(void);
void tagStandard41h12_destroy(apriltag_family_t *tf);
#ifdef __cplusplus
diff --git a/tagStandard52h13.c b/tagStandard52h13.c
index 30e2b62f3121d1ab8c7a846157f1e97d0c2cb353..ce5ea491ebbb4c15536bb0f6ffac8706cdb4ea25 100644
--- a/tagStandard52h13.c
+++ b/tagStandard52h13.c
@@ -48744,7 +48744,7 @@ static uint64_t codedata[48714] = {
0x000c0d162da0e26dUL,
0x000cdc7a163acc66UL,
};
-apriltag_family_t *tagStandard52h13_create()
+apriltag_family_t *tagStandard52h13_create(void)
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tagStandard52h13");
diff --git a/tagStandard52h13.h b/tagStandard52h13.h
index aeeb8e3e1d6b6e76288ce1ce673be9189d5acafd..0f239f3d866e49a66d1dc385438d6f12f755f3a3 100644
--- a/tagStandard52h13.h
+++ b/tagStandard52h13.h
@@ -34,7 +34,7 @@ either expressed or implied, of the Regents of The University of Michigan.
extern "C" {
#endif
-apriltag_family_t *tagStandard52h13_create();
+apriltag_family_t *tagStandard52h13_create(void);
void tagStandard52h13_destroy(apriltag_family_t *tf);
#ifdef __cplusplus