From: Matthew Fernandez Date: Sun, 20 Nov 2022 19:29:55 +0000 (-0800) Subject: remove 'intptr_t' existence checks X-Git-Tag: 7.0.3~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ba81fcb874e1acb5c5c5d2c49af4472d58dd1ae;p=graphviz remove 'intptr_t' existence checks The majority of Graphviz code was using the types `intptr_t` and `uintptr_t` unconditionally. So it seems safe to assume that any compliant C99 environment has both of these. --- diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index ab4150d95..337af26d0 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -32,7 +32,6 @@ check_function_exists( srand48 HAVE_SRAND48 ) include(CheckTypeSize) check_type_size( ssize_t SSIZE_T ) -check_type_size( intptr_t INTPTR_T ) # Library checks set( HAVE_ANN ${ANN_FOUND} ) diff --git a/config-cmake.h.in b/config-cmake.h.in index af276ecac..5d17cc5c5 100644 --- a/config-cmake.h.in +++ b/config-cmake.h.in @@ -24,7 +24,6 @@ // Types #cmakedefine HAVE_SSIZE_T -#cmakedefine HAVE_INTPTR_T // Typedefs for missing types #ifndef HAVE_SSIZE_T diff --git a/configure.ac b/configure.ac index eb6032619..fe48b50bc 100644 --- a/configure.ac +++ b/configure.ac @@ -2472,17 +2472,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ],[AC_MSG_RESULT(no) ]) -# ----------------------------------- - -AC_MSG_CHECKING(if intptr_t is declared) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include - #include - ]], [[intptr_t abc; - ]])],[AC_MSG_RESULT(yes) - AC_DEFINE_UNQUOTED(HAVE_INTPTR_T,1,Define if intptr_t is declared) - ],[AC_MSG_RESULT(no) - ]) - # ----------------------------------------------------------------------- # This is a historical artifact ... there are no other choices these days diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index e6548fc6c..4a143c46b 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -49,19 +49,11 @@ static int isedge(Agobj_t *obj) { #define BITS_PER_BYTE 8 static void *int2ptr(Sflong_t i) { -#ifdef HAVE_INTPTR_T return (void*)(intptr_t)i; -#else - return (void*)i; -#endif } static Sflong_t ptr2int(const void *p) { -#ifdef HAVE_INTPTR_T return (Sflong_t)(intptr_t)p; -#else - return (Sflong_t)p; -#endif } static int iofread(void *chan, char *buf, int bufsize) diff --git a/windows/include/config.h b/windows/include/config.h index d67a9a25b..98c1bc14e 100644 --- a/windows/include/config.h +++ b/windows/include/config.h @@ -108,9 +108,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_IL_IL_H */ -/* Define if intptr_t is declared */ -#define HAVE_INTPTR_T 1 - /* Define if you have the lasi library */ /* #undef HAVE_LASI */