From: David Lawrence Ramsey Date: Thu, 8 Dec 2005 02:47:10 +0000 (+0000) Subject: since proto.h includes nano.h, and nano.h includes config.h first, X-Git-Tag: v1.3.10~10 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=034b994eb55006364c20b0baa0ad018b380ea2ef;p=nano.git since proto.h includes nano.h, and nano.h includes config.h first, include proto.h first and remove redundant includes of config.h in all non-header source files git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3236 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index e87c958d..751f85b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -124,6 +124,9 @@ CVS code - problems with its being defined as the wrong type aren't nano's fault. Changes to handle_hupterm(), do_suspend(), do_continue(), handle_sigwinch(), and cancel_command(). (DLR) + - Since proto.h includes nano.h, and nano.h includes config.h + first, include proto.h first and remove redundant includes of + config.h in all non-header source files. (DLR) - browser.c: do_browser() - When setting the width of each file, use the "?" operator diff --git a/src/browser.c b/src/browser.c index c6812f23..6be43596 100644 --- a/src/browser.c +++ b/src/browser.c @@ -21,15 +21,12 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include #include #include -#include "proto.h" #ifndef DISABLE_BROWSER diff --git a/src/chars.c b/src/chars.c index a232fe1a..1331fffd 100644 --- a/src/chars.c +++ b/src/chars.c @@ -21,13 +21,10 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include -#include "proto.h" #ifdef ENABLE_UTF8 #ifdef HAVE_WCHAR_H diff --git a/src/color.c b/src/color.c index 816560e9..32226e09 100644 --- a/src/color.c +++ b/src/color.c @@ -21,13 +21,10 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include -#include "proto.h" #ifdef ENABLE_COLOR diff --git a/src/cut.c b/src/cut.c index 47c91d0e..23e7b54a 100644 --- a/src/cut.c +++ b/src/cut.c @@ -21,13 +21,10 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include -#include "proto.h" static bool keep_cutbuffer = FALSE; /* Should we keep the contents of the cutbuffer? */ diff --git a/src/files.c b/src/files.c index c693a98d..0c80e120 100644 --- a/src/files.c +++ b/src/files.c @@ -21,9 +21,7 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include @@ -33,7 +31,6 @@ #include #include #include -#include "proto.h" /* Add an entry to the openfile openfilestruct. This should only be * called from open_buffer(). */ diff --git a/src/global.c b/src/global.c index 155a2b43..7f31f30c 100644 --- a/src/global.c +++ b/src/global.c @@ -21,10 +21,6 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif - #include "proto.h" /* Global variables */ diff --git a/src/help.c b/src/help.c index 574bbc9f..1aa17659 100644 --- a/src/help.c +++ b/src/help.c @@ -21,14 +21,11 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include #include -#include "proto.h" #ifndef DISABLE_HELP diff --git a/src/move.c b/src/move.c index f4615196..fafe5da3 100644 --- a/src/move.c +++ b/src/move.c @@ -21,13 +21,10 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include -#include "proto.h" void do_first_line(void) { diff --git a/src/nano.c b/src/nano.c index c1c73402..647a354e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -21,9 +21,7 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include @@ -36,16 +34,15 @@ #include #include #include -#include "proto.h" - -#ifdef HAVE_TERMIOS_H -#include -#endif #ifdef HAVE_GETOPT_H #include #endif +#ifdef HAVE_TERMIOS_H +#include +#endif + #ifndef NANO_TINY #include #endif diff --git a/src/prompt.c b/src/prompt.c index 3c2c91c3..b4e06763 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -21,14 +21,11 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include #include -#include "proto.h" static char *prompt = NULL; /* The prompt string for statusbar diff --git a/src/rcfile.c b/src/rcfile.c index 656036dd..4e59de0a 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -21,9 +21,7 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include @@ -31,7 +29,6 @@ #include #include #include -#include "proto.h" #ifdef ENABLE_NANORC diff --git a/src/search.c b/src/search.c index be2b2dc3..77dc5c19 100644 --- a/src/search.c +++ b/src/search.c @@ -21,16 +21,13 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include #include #include #include -#include "proto.h" static bool search_last_line = FALSE; /* Have we gone past the last line while searching? */ diff --git a/src/text.c b/src/text.c index 83eacd4f..9cd7944e 100644 --- a/src/text.c +++ b/src/text.c @@ -21,9 +21,7 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include @@ -32,7 +30,6 @@ #include #include #include -#include "proto.h" #ifndef NANO_TINY static pid_t pid = -1; diff --git a/src/utils.c b/src/utils.c index a7ffc746..33c92c22 100644 --- a/src/utils.c +++ b/src/utils.c @@ -21,9 +21,7 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include @@ -31,7 +29,6 @@ #include #include #include -#include "proto.h" int digits(size_t n) { diff --git a/src/winio.c b/src/winio.c index 794c8965..7b505614 100644 --- a/src/winio.c +++ b/src/winio.c @@ -21,9 +21,7 @@ * * **************************************************************************/ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "proto.h" #include #include @@ -31,7 +29,6 @@ #include #include #include -#include "proto.h" static int *key_buffer = NULL; /* The default keystroke buffer,