]> granicus.if.org Git - graphviz/commitdiff
Use <type>_MAX instead of <type>_SIZE, rectangle.c
authorErwin Janssen <erwinjanssen@outlook.com>
Fri, 10 Feb 2017 09:57:03 +0000 (10:57 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Mon, 6 Mar 2017 10:12:55 +0000 (11:12 +0100)
Instead of using the custom defined <type>_SIZE defines in
lib/label/rectangle.c function RectAra, we now use the defines
<type>_MAX from the standard library. The meaning is the same, but it is
more portable and requires less checks.

configure.ac
lib/label/rectangle.c

index af0ea13d1dc0e8bedacb25ae06155ba53ca0bc26..846d74222429d873312ef1ba4c27a8ffc7f293ef 100644 (file)
@@ -3039,11 +3039,6 @@ else
 fi
 rm -f conftest*
 
-# -----------------------------------------------------------------------
-AC_CHECK_SIZEOF([long long])
-AC_CHECK_SIZEOF([int])
-SIZEOF_INT_BITS=$(( $ac_cv_sizeof_int * 8 ))
-AC_SUBST([SIZEOF_INT_BITS])
 # -----------------------------------------------------------------------
 
 # This is a historical artifact ... there are no other choices these days
index 8d7e3e32762e17d1e7d8561c88ce39e65119826a..cbc58ef0e246fda7195b43485c762d0e48461dda 100644 (file)
@@ -120,7 +120,7 @@ void PrintRect(Rect_t * r)
 | Calculate the n-dimensional area of a rectangle
 -----------------------------------------------------------------------------*/
 
-#if SIZEOF_LONG_LONG > SIZEOF_INT
+#if LLONG_MAX > UINT_MAX
 unsigned int RectArea(Rect_t * r)
 {
   register int i;
@@ -168,7 +168,7 @@ unsigned int RectArea(Rect_t * r)
     }
     return area;
 }
-#endif /*SIZEOF_LONG_LONG > SIZEOF_INT*/
+#endif /*LLONG_MAX > UINT_MAX*/
 #if 0 /*original code*/
 int RectArea(Rect_t * r)
 {