From 295d0d8f2008cbd2deb200fc6ecb30d19847f725 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Wed, 7 Jul 2010 21:55:07 -0700 Subject: [PATCH] Clean up include guards. * src/tparam.c: Remove include guards for config.h, string.h and code that assumes #ifndef emacs. * src/termcap.c: * src/unexalpha.c: * src/sysdep.c: * src/filemode.c: * src/filelock.c: * src/bidi.c: Likewise. --- src/ChangeLog | 10 ++++++++++ src/bidi.c | 7 ------- src/filelock.c | 2 -- src/filemode.c | 3 --- src/sysdep.c | 3 --- src/termcap.c | 56 -------------------------------------------------------- src/tparam.c | 47 ----------------------------------------------- src/unexalpha.c | 2 -- 8 files changed, 10 insertions(+), 120 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 415211558a5..cdbecfc5455 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,15 @@ 2010-07-08 Dan Nicolaescu + Clean up include guards. + * tparam.c: Remove include guards for config.h, string.h and code + that assumes #ifndef emacs. + * termcap.c: + * unexalpha.c: + * sysdep.c: + * filemode.c: + * filelock.c: + * bidi.c: Likewise. + Remove prefix-args.c * prefix-args.c: Remove file. * autodeps.mk (ALLOBJS): Remove reference to prefix-args. diff --git a/src/bidi.c b/src/bidi.c index d47fe9b7d33..e17676ea6d7 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -49,16 +49,9 @@ along with GNU Emacs. If not, see . */ rule X9 and to its modifications decribed in the "Implementation Notes" section of UAX#9, under "Retaining Format Codes". */ -#ifdef HAVE_CONFIG_H #include -#endif - #include - -#ifdef HAVE_STRING_H #include -#endif - #include #include "lisp.h" diff --git a/src/filelock.c b/src/filelock.c index 769e5aa7a92..0ed236f8cc2 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -34,9 +34,7 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H #include -#endif #ifdef HAVE_UNISTD_H #include diff --git a/src/filemode.c b/src/filemode.c index c3a5a924a93..3048077ff52 100644 --- a/src/filemode.c +++ b/src/filemode.c @@ -17,10 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include diff --git a/src/sysdep.c b/src/sysdep.c index ecdb7fcc21b..daca9d12510 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -18,10 +18,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -#ifdef HAVE_CONFIG_H #include -#endif - #include #include #include diff --git a/src/termcap.c b/src/termcap.c index fd8a666d0f2..ea4ef244f64 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -18,12 +18,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ -#ifdef HAVE_CONFIG_H #include -#endif - -#ifdef emacs - #include #include /* xmalloc is here */ /* Get the O_* definitions for open et al. */ @@ -35,26 +30,6 @@ Boston, MA 02110-1301, USA. */ #include #endif -#else /* not emacs */ - -#ifdef STDC_HEADERS -#include -#include -#else -char *getenv (); -char *malloc (); -char *realloc (); -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif - -#endif /* not emacs */ - #ifndef NULL #define NULL (char *) 0 #endif @@ -84,37 +59,6 @@ int bufsize = 128; #define TERMCAP_FILE "/etc/termcap" #endif -#ifndef emacs -static void -memory_out () -{ - write (2, "virtual memory exhausted\n", 25); - exit (1); -} - -static char * -xmalloc (size) - unsigned size; -{ - register char *tem = malloc (size); - - if (!tem) - memory_out (); - return tem; -} - -static char * -xrealloc (ptr, size) - char *ptr; - unsigned size; -{ - register char *tem = realloc (ptr, size); - - if (!tem) - memory_out (); - return tem; -} -#endif /* not emacs */ /* Looking up capabilities in the entry already found. */ diff --git a/src/tparam.c b/src/tparam.c index c768581aeb5..d8a8f0260f0 100644 --- a/src/tparam.c +++ b/src/tparam.c @@ -18,61 +18,14 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ -#ifdef HAVE_CONFIG_H #include -#endif - -#ifdef emacs #include #include "lisp.h" /* for xmalloc */ -#else - -#ifdef STDC_HEADERS -#include -#include -#else -char *malloc (); -char *realloc (); -#endif - -#endif /* not emacs */ #ifndef NULL #define NULL (char *) 0 #endif -#ifndef emacs -static void -memory_out () -{ - write (2, "virtual memory exhausted\n", 25); - exit (1); -} - -static char * -xmalloc (size) - unsigned size; -{ - register char *tem = malloc (size); - - if (!tem) - memory_out (); - return tem; -} - -static char * -xrealloc (ptr, size) - char *ptr; - unsigned size; -{ - register char *tem = realloc (ptr, size); - - if (!tem) - memory_out (); - return tem; -} -#endif /* not emacs */ - /* Assuming STRING is the value of a termcap string entry containing `%' constructs to expand parameters, merge in parameter values and store result in block OUTSTRING points to. diff --git a/src/unexalpha.c b/src/unexalpha.c index 982097a9318..d0faa179931 100644 --- a/src/unexalpha.c +++ b/src/unexalpha.c @@ -28,9 +28,7 @@ along with GNU Emacs. If not, see . */ #include #include #include -#ifdef HAVE_STRING_H #include -#endif #if !defined (__NetBSD__) && !defined (__OpenBSD__) #include #include -- 2.11.4.GIT