]> granicus.if.org Git - graphviz/commitdiff
RectArea: move definitions closer to their use
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 24 Mar 2021 03:57:45 +0000 (20:57 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 31 Mar 2021 00:14:01 +0000 (17:14 -0700)
lib/label/rectangle.c

index 881165253db99879afb2a0a6144ee41c2bca24dc..633c888c19a5276201e7eb6985851b83be7a74ad 100644 (file)
@@ -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) {