Store unsigned ints in list (fixes #237)

This commit is contained in:
Sebastian Ramacher 2021-07-15 21:14:44 +02:00
parent 495f1f9b12
commit 2713de2f6c

View file

@ -401,7 +401,7 @@ rectangle_to_points(void* vrect, void* vlist) {
static void static void
append_unique_uint(girara_list_t* list, const unsigned int v) { append_unique_uint(girara_list_t* list, const unsigned int v) {
double* p = g_try_malloc(sizeof(v)); unsigned int* p = g_try_malloc(sizeof(unsigned int));
if (p == NULL) { if (p == NULL) {
return; return;
} }
@ -433,16 +433,16 @@ cut_rectangle(const zathura_rectangle_t* rect, girara_list_t* points, girara_lis
GIRARA_LIST_FOREACH_END(points, zathura_point_t*, i_pt, pt); GIRARA_LIST_FOREACH_END(points, zathura_point_t*, i_pt, pt);
double x = ufloor(rect->x1); double x = ufloor(rect->x1);
GIRARA_LIST_FOREACH(xs, const double*, ix, cx) GIRARA_LIST_FOREACH(xs, const unsigned int*, ix, cx)
double y = ufloor(rect->y1); double y = ufloor(rect->y1);
GIRARA_LIST_FOREACH(ys, const double*, iy, cy) GIRARA_LIST_FOREACH(ys, const unsigned int*, iy, cy)
zathura_rectangle_t* r = g_try_malloc(sizeof(zathura_rectangle_t)); zathura_rectangle_t* r = g_try_malloc(sizeof(zathura_rectangle_t));
*r = (zathura_rectangle_t) {x, y, *cx, *cy}; *r = (zathura_rectangle_t) {x, y, *cx, *cy};
y = *cy; y = *cy;
girara_list_append_unique(rectangles, cmp_rectangle, r); girara_list_append_unique(rectangles, cmp_rectangle, r);
GIRARA_LIST_FOREACH_END(ys, const double*, iy, cy); GIRARA_LIST_FOREACH_END(ys, const unsigned int*, iy, cy);
x = *cx; x = *cx;
GIRARA_LIST_FOREACH_END(xs, const double*, ix, cx); GIRARA_LIST_FOREACH_END(xs, const unsigned int*, ix, cx);
girara_list_free(xs); girara_list_free(xs);
girara_list_free(ys); girara_list_free(ys);