From b125d40c3d6ebd3979d18b6d8b1775ceb17febf0 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 23 Mar 2021 20:57:45 -0700 Subject: [PATCH] RectArea: move definitions closer to their use --- lib/label/rectangle.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/label/rectangle.c b/lib/label/rectangle.c index 881165253..633c888c1 100644 --- a/lib/label/rectangle.c +++ b/lib/label/rectangle.c @@ -64,15 +64,13 @@ void PrintRect(Rect_t * r) unsigned int RectArea(Rect_t * r) { - int i; - unsigned int area; assert(r); if (Undefined(r)) return 0; - area = 1; - for (i = 0; i < NUMDIMS; i++) { + unsigned area = 1; + for (size_t i = 0; i < NUMDIMS; i++) { unsigned int dim = r->boundary[i + NUMDIMS] - r->boundary[i]; if (dim == 0) return 0; if (UINT_MAX / dim < area) { -- 2.40.0