From 64ff95be2c8604d0b609b17a1ec6951840a2aa27 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Fri, 19 Jan 2024 14:33:04 +0100 Subject: [PATCH] fix "unused-parameter" errors --- apriltag.c | 3 +-- apriltag_quad_thresh.c | 18 +++++++++--------- common/homography.c | 2 +- common/homography.h | 2 +- common/image_u8x3.c | 2 +- common/image_u8x3.h | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/apriltag.c b/apriltag.c index 30245821..3aea694b 100644 --- a/apriltag.c +++ b/apriltag.c @@ -1341,8 +1341,7 @@ zarray_t *apriltag_detector_detect(apriltag_detector_t *td, image_u8_t *im_orig) int k = (j + 1) & 3; image_u8x3_draw_line(out, det->p[j][0], det->p[j][1], det->p[k][0], det->p[k][1], - (uint8_t[]) { rgb[0], rgb[1], rgb[2] }, - 1); + (uint8_t[]) { rgb[0], rgb[1], rgb[2] }); } } diff --git a/apriltag_quad_thresh.c b/apriltag_quad_thresh.c index ec361a1d..56aece84 100644 --- a/apriltag_quad_thresh.c +++ b/apriltag_quad_thresh.c @@ -502,7 +502,7 @@ int quad_segment_maxima(apriltag_detector_t *td, zarray_t *cluster, struct line_ } // returns 0 if the cluster looks bad. -int quad_segment_agg(apriltag_detector_t *td, zarray_t *cluster, struct line_fit_pt *lfps, int indices[4]) +int quad_segment_agg(zarray_t *cluster, struct line_fit_pt *lfps, int indices[4]) { int sz = zarray_size(cluster); @@ -893,7 +893,7 @@ int fit_quad( if (!quad_segment_maxima(td, cluster, lfps, indices)) goto finish; } else { - if (!quad_segment_agg(td, cluster, lfps, indices)) + if (!quad_segment_agg(cluster, lfps, indices)) goto finish; } @@ -1014,7 +1014,7 @@ int fit_quad( #define DO_UNIONFIND2(dx, dy) if (im->buf[(y + dy)*s + x + dx] == v) unionfind_connect(uf, y*w + x, (y + dy)*w + x + dx); -static void do_unionfind_first_line(unionfind_t *uf, image_u8_t *im, int h, int w, int s) +static void do_unionfind_first_line(unionfind_t *uf, image_u8_t *im, int w, int s) { int y = 0; uint8_t v; @@ -1029,7 +1029,7 @@ static void do_unionfind_first_line(unionfind_t *uf, image_u8_t *im, int h, int } } -static void do_unionfind_line2(unionfind_t *uf, image_u8_t *im, int h, int w, int s, int y) +static void do_unionfind_line2(unionfind_t *uf, image_u8_t *im, int w, int s, int y) { assert(y > 0); @@ -1075,7 +1075,7 @@ static void do_unionfind_task2(void *p) struct unionfind_task *task = (struct unionfind_task*) p; for (int y = task->y0; y < task->y1; y++) { - do_unionfind_line2(task->uf, task->im, task->h, task->w, task->s, y); + do_unionfind_line2(task->uf, task->im, task->w, task->s, y); } } @@ -1532,12 +1532,12 @@ unionfind_t* connected_components(apriltag_detector_t *td, image_u8_t* threshim, unionfind_t *uf = unionfind_create(w * h); if (td->nthreads <= 1) { - do_unionfind_first_line(uf, threshim, h, w, ts); + do_unionfind_first_line(uf, threshim, w, ts); for (int y = 1; y < h; y++) { - do_unionfind_line2(uf, threshim, h, w, ts, y); + do_unionfind_line2(uf, threshim, w, ts, y); } } else { - do_unionfind_first_line(uf, threshim, h, w, ts); + do_unionfind_first_line(uf, threshim, w, ts); int sz = h; int chunksize = 1 + sz / (APRILTAG_TASKS_PER_THREAD_TARGET * td->nthreads); @@ -1567,7 +1567,7 @@ unionfind_t* connected_components(apriltag_detector_t *td, image_u8_t* threshim, // XXX stitch together the different chunks. for (int i = 1; i < ntasks; i++) { - do_unionfind_line2(uf, threshim, h, w, ts, tasks[i].y0 - 1); + do_unionfind_line2(uf, threshim, w, ts, tasks[i].y0 - 1); } free(tasks); diff --git a/common/homography.c b/common/homography.c index 54ab47eb..5a34f68f 100644 --- a/common/homography.c +++ b/common/homography.c @@ -357,7 +357,7 @@ matd_t *homography_to_pose(const matd_t *H, double fx, double fy, double cx, dou // [ 0 0 C D ] // [ 0 0 -1 0 ] -matd_t *homography_to_model_view(const matd_t *H, double F, double G, double A, double B, double C, double D) +matd_t *homography_to_model_view(const matd_t *H, double F, double G, double A, double B) { // Note that every variable that we compute is proportional to the scale factor of H. double R20 = -MATD_EL(H, 2, 0); diff --git a/common/homography.h b/common/homography.h index b1560c37..c8cf2b71 100644 --- a/common/homography.h +++ b/common/homography.h @@ -176,7 +176,7 @@ matd_t *homography_to_pose(const matd_t *H, double fx, double fy, double cx, dou // [ 0 0 C D ] // [ 0 0 -1 0 ] -matd_t *homography_to_model_view(const matd_t *H, double F, double G, double A, double B, double C, double D); +matd_t *homography_to_model_view(const matd_t *H, double F, double G, double A, double B); #ifdef __cplusplus } diff --git a/common/image_u8x3.c b/common/image_u8x3.c index faabc739..65556812 100644 --- a/common/image_u8x3.c +++ b/common/image_u8x3.c @@ -163,7 +163,7 @@ int image_u8x3_write_pnm(const image_u8x3_t *im, const char *path) } // only width 1 supported -void image_u8x3_draw_line(image_u8x3_t *im, float x0, float y0, float x1, float y1, uint8_t rgb[3], int width) +void image_u8x3_draw_line(image_u8x3_t *im, float x0, float y0, float x1, float y1, uint8_t rgb[3]) { double dist = sqrtf((y1-y0)*(y1-y0) + (x1-x0)*(x1-x0)); double delta = 0.5 / dist; diff --git a/common/image_u8x3.h b/common/image_u8x3.h index 4d1713dc..64977947 100644 --- a/common/image_u8x3.h +++ b/common/image_u8x3.h @@ -57,7 +57,7 @@ void image_u8x3_destroy(image_u8x3_t *im); int image_u8x3_write_pnm(const image_u8x3_t *im, const char *path); // only width 1 supported -void image_u8x3_draw_line(image_u8x3_t *im, float x0, float y0, float x1, float y1, uint8_t rgb[3], int width); +void image_u8x3_draw_line(image_u8x3_t *im, float x0, float y0, float x1, float y1, uint8_t rgb[3]); #ifdef __cplusplus }