Skip to content

Commit

Permalink
fix "unused-parameter" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Jan 19, 2024
1 parent 548ac6a commit 64ff95b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions apriltag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] });
}
}

Expand Down
18 changes: 9 additions & 9 deletions apriltag_quad_thresh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion common/homography.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion common/homography.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion common/image_u8x3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion common/image_u8x3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 64ff95b

Please sign in to comment.