common: constify mp_rect_equals

This commit is contained in:
Kacper Michajłow 2023-08-25 18:56:41 +02:00 committed by Dudemanguy
parent 3ab5401b38
commit 8920ee5944
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2)
return rc->x1 > rc->x0 && rc->y1 > rc->y0;
}
bool mp_rect_equals(struct mp_rect *rc1, struct mp_rect *rc2)
bool mp_rect_equals(const struct mp_rect *rc1, const struct mp_rect *rc2)
{
return rc1->x0 == rc2->x0 && rc1->y0 == rc2->y0 &&
rc1->x1 == rc2->x1 && rc1->y1 == rc2->y1;

View File

@ -106,7 +106,7 @@ struct mp_rect {
void mp_rect_union(struct mp_rect *rc, const struct mp_rect *src);
bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2);
bool mp_rect_contains(struct mp_rect *rc, int x, int y);
bool mp_rect_equals(struct mp_rect *rc1, struct mp_rect *rc2);
bool mp_rect_equals(const struct mp_rect *rc1, const struct mp_rect *rc2);
int mp_rect_subtract(const struct mp_rect *rc1, const struct mp_rect *rc2,
struct mp_rect res_array[4]);