changeset 109170:76e072dbe342

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.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 07 Jul 2010 21:55:07 -0700
parents 5df3f77a9df9
children d8a16c4fa9b1
files src/ChangeLog src/bidi.c src/filelock.c src/filemode.c src/sysdep.c src/termcap.c src/tparam.c src/unexalpha.c
diffstat 8 files changed, 10 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/ChangeLog	Wed Jul 07 21:55:07 2010 -0700
@@ -1,5 +1,15 @@
 2010-07-08  Dan Nicolaescu  <dann@ics.uci.edu>
 
+	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.
--- a/src/bidi.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/bidi.c	Wed Jul 07 21:55:07 2010 -0700
@@ -49,16 +49,9 @@
    rule X9 and to its modifications decribed in the "Implementation
    Notes" section of UAX#9, under "Retaining Format Codes".  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <stdio.h>
-
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
-
 #include <setjmp.h>
 
 #include "lisp.h"
--- a/src/filelock.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/filelock.c	Wed Jul 07 21:55:07 2010 -0700
@@ -34,9 +34,7 @@
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
--- a/src/filemode.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/filemode.c	Wed Jul 07 21:55:07 2010 -0700
@@ -17,10 +17,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
    USA.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <sys/types.h>
 #include <sys/stat.h>
 
--- a/src/sysdep.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/sysdep.c	Wed Jul 07 21:55:07 2010 -0700
@@ -18,10 +18,7 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <ctype.h>
 #include <signal.h>
 #include <stdio.h>
--- a/src/termcap.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/termcap.c	Wed Jul 07 21:55:07 2010 -0700
@@ -18,12 +18,7 @@
 Boston, MA 02110-1301, USA.  */
 
 /* Emacs config.h may rename various library functions such as malloc.  */
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
-#ifdef emacs
-
 #include <setjmp.h>
 #include <lisp.h>		/* xmalloc is here */
 /* Get the O_* definitions for open et al.  */
@@ -35,26 +30,6 @@
 #include <unistd.h>
 #endif
 
-#else /* not emacs */
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <string.h>
-#else
-char *getenv ();
-char *malloc ();
-char *realloc ();
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#endif /* not emacs */
-
 #ifndef NULL
 #define NULL (char *) 0
 #endif
@@ -84,37 +59,6 @@
 #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.  */
 
--- a/src/tparam.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/tparam.c	Wed Jul 07 21:55:07 2010 -0700
@@ -18,61 +18,14 @@
 Boston, MA 02110-1301, USA.  */
 
 /* Emacs config.h may rename various library functions such as malloc.  */
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
-#ifdef emacs
 #include <setjmp.h>
 #include "lisp.h"		/* for xmalloc */
-#else
-
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <string.h>
-#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.
--- a/src/unexalpha.c	Wed Jul 07 20:31:04 2010 -0700
+++ b/src/unexalpha.c	Wed Jul 07 21:55:07 2010 -0700
@@ -28,9 +28,7 @@
 #include <sys/mman.h>
 #include <stdio.h>
 #include <errno.h>
-#ifdef HAVE_STRING_H
 #include <string.h>
-#endif
 #if !defined (__NetBSD__) && !defined (__OpenBSD__)
 #include <filehdr.h>
 #include <aouthdr.h>