# HG changeset patch # User Paul Eggert # Date 1063061890 0 # Node ID 069117fb861f8a7474bb1a2b228b1fb6c9f808b0 # Parent 323dc2337076691fb12571578b47f7dba11d678a Remove K&R cruft. diff --git a/lib/alloca.c b/lib/alloca.c --- a/lib/alloca.c +++ b/lib/alloca.c @@ -25,12 +25,8 @@ # include #endif -#if HAVE_STRING_H -# include -#endif -#if HAVE_STDLIB_H -# include -#endif +#include +#include #ifdef emacs # include "lisp.h" @@ -77,19 +73,6 @@ # define ADDRESS_FUNCTION(arg) &(arg) # endif -# ifndef POINTER_TYPE -# ifdef __STDC__ -# define POINTER_TYPE void -# else -# define POINTER_TYPE char -# endif -# endif -typedef POINTER_TYPE *pointer; - -# ifndef NULL -# define NULL 0 -# endif - /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. @@ -112,7 +95,7 @@ # define STACK_DIR stack_dir static void -find_stack_direction () +find_stack_direction (void) { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ @@ -165,9 +148,8 @@ caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ -pointer -alloca (size) - size_t size; +void * +alloca (size_t size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); @@ -214,7 +196,7 @@ { /* Address of header. */ - register pointer new; + register void *new; size_t combined_size = sizeof (header) + size; if (combined_size < sizeof (header)) @@ -232,7 +214,7 @@ /* User storage begins just after header. */ - return (pointer) ((char *) new + sizeof (header)); + return (void *) ((char *) new + sizeof (header)); } } diff --git a/m4/alloca.m4 b/m4/alloca.m4 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,4 +1,4 @@ -# alloca.m4 serial 2 (gettext-0.12) +# alloca.m4 serial 3 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -31,6 +31,4 @@ # Prerequisites of lib/alloca.c. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. -AC_DEFUN([gl_PREREQ_ALLOCA], [ - AC_CHECK_HEADERS_ONCE(stdlib.h string.h) -]) +AC_DEFUN([gl_PREREQ_ALLOCA], [:])