From ebf8529b8bf9054cf77b7b0cda1efe7cbf687e73 Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Tue, 27 Sep 2016 12:55:54 +0200 Subject: [PATCH] Replace checks for and Instead of checking for the availability of stdint.h and inttypes.h with HAVE_STDINT_H and HAVE_INTTYPES_H, simply include stdint.h. The header stdint.h is part of the C99 standard, so it can be safely assumed that this header is present. inttypes.h contains everything stdint.h includes, but in all cases here, stdint.h suffices. --- cmd/lefty/ws/x11/libfilereq/Draw.c | 5 ----- cmd/lefty/ws/x11/libfilereq/Path.c | 5 ----- cmd/lefty/ws/x11/libfilereq/SelFile.c | 5 ----- configure.ac | 11 +++-------- lib/cgraph/cghdr.h | 5 ----- lib/gvpr/compile.c | 5 ----- lib/rbtree/stack.h | 5 ----- lib/vmalloc/vmdebug.c | 5 ----- plugin.demo/xgtk/src/gvdevice_xgtk.c | 5 ----- plugin/gd/gvrender_gd.c | 5 ----- plugin/gs/gvloadimage_gs.c | 5 ----- plugin/gtk/gvdevice_gtk.c | 5 ----- windows/include/config.h | 6 ------ 13 files changed, 3 insertions(+), 69 deletions(-) diff --git a/cmd/lefty/ws/x11/libfilereq/Draw.c b/cmd/lefty/ws/x11/libfilereq/Draw.c index cb913e2f1..25b93b96e 100644 --- a/cmd/lefty/ws/x11/libfilereq/Draw.c +++ b/cmd/lefty/ws/x11/libfilereq/Draw.c @@ -42,12 +42,7 @@ #include "config.h" #include -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #include "SFinternal.h" #include "xstat.h" #include diff --git a/cmd/lefty/ws/x11/libfilereq/Path.c b/cmd/lefty/ws/x11/libfilereq/Path.c index 2f604f579..e8cd8ee51 100644 --- a/cmd/lefty/ws/x11/libfilereq/Path.c +++ b/cmd/lefty/ws/x11/libfilereq/Path.c @@ -62,12 +62,7 @@ extern void qsort (); #include "SFDecls.h" -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #ifdef HAVE_INTPTR_T #define INT2PTR(t,v) ((t)(intptr_t)(v)) #define PTR2INT(v) ((Sflong_t)(intptr_t)(v)) diff --git a/cmd/lefty/ws/x11/libfilereq/SelFile.c b/cmd/lefty/ws/x11/libfilereq/SelFile.c index e76d97d05..b9535b9c7 100644 --- a/cmd/lefty/ws/x11/libfilereq/SelFile.c +++ b/cmd/lefty/ws/x11/libfilereq/SelFile.c @@ -103,12 +103,7 @@ extern char *getwd (char *); #include -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #ifdef HAVE_INTPTR_T #define INT2PTR(t,v) ((t)(intptr_t)(v)) #define PTR2INT(v) ((Sflong_t)(intptr_t)(v)) diff --git a/configure.ac b/configure.ac index 1960613e3..0ba83fd11 100644 --- a/configure.ac +++ b/configure.ac @@ -425,9 +425,9 @@ dnl ----------------------------------- dnl Checks for header files # AC_HEADER_STDC -AC_CHECK_HEADERS(stdarg.h stddef.h stddef.h stdint.h malloc.h \ +AC_CHECK_HEADERS(stdarg.h stddef.h stddef.h malloc.h \ fcntl.h search.h pthread.h values.h float.h limits.h termios.h \ - errno.h time.h unistd.h fenv.h strings.h inttypes.h setjmp.h \ + errno.h time.h unistd.h fenv.h strings.h setjmp.h \ sys/time.h sys/times.h sys/types.h sys/select.h fpu_control.h \ sys/fpu.h sys/socket.h sys/stat.h sys/mman.h \ sys/ioctl.h sys/inotify.h langinfo.h libintl.h crt_externs.h) @@ -3039,12 +3039,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include AC_MSG_CHECKING(if intptr_t is declared) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include - #if HAVE_STDINT_H - #include - #endif - #if HAVE_INTTYPES_H - #include - #endif + #include #if HAVE_UNISTD_H #include #endif diff --git a/lib/cgraph/cghdr.h b/lib/cgraph/cghdr.h index 4a0d6729c..3947ee5a6 100644 --- a/lib/cgraph/cghdr.h +++ b/lib/cgraph/cghdr.h @@ -36,12 +36,7 @@ #else #define assert(x) #endif -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #ifndef streq #define streq(s,t) ((*s == *t) && !strcmp((s),(t))) diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 749bfce91..01b0d25ff 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -18,12 +18,7 @@ #include "config.h" #include -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #ifdef HAVE_UNISTD_H #include #endif diff --git a/lib/rbtree/stack.h b/lib/rbtree/stack.h index e067530c3..fe9395eaa 100755 --- a/lib/rbtree/stack.h +++ b/lib/rbtree/stack.h @@ -14,12 +14,7 @@ extern "C" { /* needed for intptr_t */ #include "config.h" -#ifdef HAVE_STDINT_H #include -#endif -#if HAVE_INTTYPES_H -#include -#endif #include "misc.h" diff --git a/lib/vmalloc/vmdebug.c b/lib/vmalloc/vmdebug.c index 561f02c25..2d67c190c 100644 --- a/lib/vmalloc/vmdebug.c +++ b/lib/vmalloc/vmdebug.c @@ -12,12 +12,7 @@ *************************************************************************/ #include "config.h" -#ifdef HAVE_STDINT_H #include -#endif -#if HAVE_INTTYPES_H -#include -#endif #ifdef HAVE_INTPTR_T #define INT2PTR(t,v) ((t)(intptr_t)(v)) #else diff --git a/plugin.demo/xgtk/src/gvdevice_xgtk.c b/plugin.demo/xgtk/src/gvdevice_xgtk.c index 15d0e877a..3507e6676 100644 --- a/plugin.demo/xgtk/src/gvdevice_xgtk.c +++ b/plugin.demo/xgtk/src/gvdevice_xgtk.c @@ -13,12 +13,7 @@ #include "config.h" -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #ifdef HAVE_UNISTD_H #include #endif diff --git a/plugin/gd/gvrender_gd.c b/plugin/gd/gvrender_gd.c index c194c97b5..e230dd8d2 100644 --- a/plugin/gd/gvrender_gd.c +++ b/plugin/gd/gvrender_gd.c @@ -18,12 +18,7 @@ #endif #include #include -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #include #include diff --git a/plugin/gs/gvloadimage_gs.c b/plugin/gs/gvloadimage_gs.c index abb6bfa57..83eee38ce 100644 --- a/plugin/gs/gvloadimage_gs.c +++ b/plugin/gs/gvloadimage_gs.c @@ -14,12 +14,7 @@ #include "config.h" #include -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #include #include "gvplugin_loadimage.h" diff --git a/plugin/gtk/gvdevice_gtk.c b/plugin/gtk/gvdevice_gtk.c index c32ea1843..a20c9aa88 100644 --- a/plugin/gtk/gvdevice_gtk.c +++ b/plugin/gtk/gvdevice_gtk.c @@ -13,12 +13,7 @@ #include "config.h" -#ifdef HAVE_STDINT_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #ifdef HAVE_UNISTD_H #include #endif diff --git a/windows/include/config.h b/windows/include/config.h index a70ea0e49..5910204a9 100644 --- a/windows/include/config.h +++ b/windows/include/config.h @@ -174,9 +174,6 @@ /* Define if intptr_t is declared */ #define HAVE_INTPTR_T 1 -/* Define to 1 if you have the header file. */ -//#define HAVE_INTTYPES_H 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_LANGINFO_H */ @@ -282,9 +279,6 @@ /* Define to 1 if you have the header file. */ #define HAVE_STDDEF_H 1 -/* Define to 1 if you have the header file. */ -//#define HAVE_STDINT_H 1 - /* Define to 1 if you have the `strcasecmp' function. */ //#define HAVE_STRCASECMP 1 -- 2.40.0