Commit 261cb4bb authored by Paul Eggert's avatar Paul Eggert

Assume C89 or later.

* configure.in (AC_C_PROTOTYPES, AC_C_VOLATILE, AC_C_CONST)
(POINTER_TYPE, PROTOTYPES): Remove.
* admin/CPP-DEFINES: Remove NULL, const.
* lib-src/etags.c (static, const): Remove macros.
(PTR): Remove; all uses replaced with void *.  Omit needless casts.
* src/alloc.c, src/buffer.c, lisp.h: Replace POINTER_TYPE with void.
* alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
(xrealloc):
* buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
* editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
* textprop.c, tparam.c (NULL): Remove.
* ralloc.c, vm-limit.c (POINTER): Assume void * works.
* regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
* regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
* unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
* xterm.c (input_signal_count): Assume volatile works.
parent ff23cd9f
2012-05-21 Glenn Morris <rgm@gnu.org>
* configure.in (LEIM_INSTALLDIR):
Rename to leimdir, treat like lispdir.
2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
Assume C89 or later.
* configure.in (AC_C_PROTOTYPES, AC_C_VOLATILE, AC_C_CONST)
(POINTER_TYPE, PROTOTYPES): Remove.
Make merging from gnulib a script, not a makefile action.
Putting it in a makefile has some problems with reflection, as
merging from gnulib updates 'configure', which can update the makefile.
......@@ -13,6 +12,11 @@
(GNULIB_MODULES, GNULIB_TOOL_FLAGS, sync-from-gnulib):
Remove, moving the actions to the script admin/merge-gnulib.
2012-05-21 Glenn Morris <rgm@gnu.org>
* configure.in (LEIM_INSTALLDIR):
Rename to leimdir, treat like lispdir.
2012-05-21 Glenn Morris <rgm@gnu.org>
* Makefile.in (install-arch-indep, install-doc, install-info)
......
......@@ -201,7 +201,6 @@ NO_MATHERR
NO_TERMIO
NSIG
NSIG_MINIMUM
NULL
NULL_DEVICE
ORDINARY_LINK
O_APPEND
......@@ -272,7 +271,6 @@ chdir
chmod
chown
close
const
creat
ctime
dup
......
2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
Assume C89 or later.
* CPP-DEFINES: Remove NULL, const.
Make merging from gnulib a script, not a makefile action.
* merge-gnulib: New script, with actions moved here from
../Makefile.in.
......
......@@ -1355,27 +1355,6 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_flags, struct ifreq.ifr_hwaddr,
#include <net/if.h>
#endif])
dnl checks for compiler characteristics
dnl Testing __STDC__ to determine prototype support isn't good enough.
dnl DEC C, for instance, doesn't define it with default options, and
dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile
dnl and void *.
AC_C_PROTOTYPES
AC_C_VOLATILE
AC_C_CONST
AC_CACHE_CHECK([for void * support], emacs_cv_void_star,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void * foo;]])],
emacs_cv_void_star=yes, emacs_cv_void_star=no)])
if test $emacs_cv_void_star = yes; then
AC_DEFINE(POINTER_TYPE, void)
else
AC_DEFINE(POINTER_TYPE, char)
fi
AH_TEMPLATE(POINTER_TYPE,
[Define as `void' if your compiler accepts `void *'; otherwise
define as `char'.])dnl
dnl Check for endianness.
AC_C_BIGENDIAN
......@@ -3663,10 +3642,6 @@ AH_BOTTOM([
#define BITS_PER_LONG_LONG 64
#endif
/* Define if the compiler supports function prototypes. It may do so but
not define __STDC__ (e.g. DEC C by default) or may define it as zero. */
#undef PROTOTYPES
#include <string.h>
#include <stdlib.h>
......
2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
Assume C89 or later.
* etags.c (static, const): Remove macros.
(PTR): Remove; all uses replaced with void *. Omit needless casts.
2012-05-21 Glenn Morris <rgm@gnu.org>
* Makefile.in (insrcdir, $(DESTDIR)${archlibdir}):
......
......@@ -93,22 +93,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
#ifdef HAVE_CONFIG_H
# include <config.h>
/* This is probably not necessary any more. On some systems, config.h
used to define static as nothing for the sake of unexec. We don't
want that here since we don't use unexec. None of these systems
are supported any more, but the idea is still mentioned in
etc/PROBLEMS. */
# undef static
# ifndef PTR /* for XEmacs */
# define PTR void *
# endif
#else /* no config.h */
# if defined (__STDC__) && (__STDC__ || defined (__SUNPRO_C))
# define PTR void * /* for generic pointers */
# else /* not standard C */
# define const /* remove const for old compilers' sake */
# define PTR long * /* don't use void* */
# endif
#endif /* !HAVE_CONFIG_H */
#ifndef _GNU_SOURCE
......@@ -415,8 +399,8 @@ static bool filename_is_absolute (char *f);
static void canonicalize_filename (char *);
static void linebuffer_init (linebuffer *);
static void linebuffer_setlen (linebuffer *, int);
static PTR xmalloc (size_t);
static PTR xrealloc (char *, size_t);
static void *xmalloc (size_t);
static void *xrealloc (char *, size_t);
static char searchar = '/'; /* use /.../ searches */
......@@ -6686,19 +6670,19 @@ linebuffer_setlen (linebuffer *lbp, int toksize)
}
/* Like malloc but get fatal error if memory is exhausted. */
static PTR
static void *
xmalloc (size_t size)
{
PTR result = (PTR) malloc (size);
void *result = malloc (size);
if (result == NULL)
fatal ("virtual memory exhausted", (char *)NULL);
return result;
}
static PTR
static void *
xrealloc (char *ptr, size_t size)
{
PTR result = (PTR) realloc (ptr, size);
void *result = realloc (ptr, size);
if (result == NULL)
fatal ("virtual memory exhausted", (char *)NULL);
return result;
......
2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
Assume C89 or later.
* alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
* alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
(xrealloc):
* buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
* editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
* textprop.c, tparam.c (NULL): Remove.
* ralloc.c, vm-limit.c (POINTER): Assume void * works.
* regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
* regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
* unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
* xterm.c (input_signal_count): Assume volatile works.
2012-05-21 Ken Brown <kbrown@cornell.edu>
* xgselect.c (xg_select): Fix first argument in call to 'select'
......
......@@ -66,7 +66,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#ifndef HAVE_UNISTD_H
extern POINTER_TYPE *sbrk ();
extern void *sbrk ();
#endif
#include <fcntl.h>
......@@ -306,7 +306,7 @@ enum mem_type
MEM_TYPE_VECTORLIKE
};
static POINTER_TYPE *lisp_malloc (size_t, enum mem_type);
static void *lisp_malloc (size_t, enum mem_type);
#if GC_MARK_STACK || defined GC_MALLOC_CHECK
......@@ -388,7 +388,7 @@ static struct mem_node mem_z;
#define MEM_NIL &mem_z
static struct Lisp_Vector *allocate_vectorlike (EMACS_INT);
static void lisp_free (POINTER_TYPE *);
static void lisp_free (void *);
static void mark_stack (void);
static int live_vector_p (struct mem_node *, void *);
static int live_buffer_p (struct mem_node *, void *);
......@@ -435,15 +435,15 @@ static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
static int staticidx = 0;
static POINTER_TYPE *pure_alloc (size_t, int);
static void *pure_alloc (size_t, int);
/* Value is SZ rounded up to the next multiple of ALIGNMENT.
ALIGNMENT must be a power of 2. */
#define ALIGN(ptr, ALIGNMENT) \
((POINTER_TYPE *) ((((uintptr_t) (ptr)) + (ALIGNMENT) - 1) \
& ~((ALIGNMENT) - 1)))
((void *) (((uintptr_t) (ptr) + (ALIGNMENT) - 1) \
& ~ ((ALIGNMENT) - 1)))
......@@ -604,7 +604,7 @@ static ptrdiff_t check_depth;
/* Like malloc, but wraps allocated block with header and trailer. */
static POINTER_TYPE *
static void *
overrun_check_malloc (size_t size)
{
register unsigned char *val;
......@@ -622,15 +622,15 @@ overrun_check_malloc (size_t size)
XMALLOC_OVERRUN_CHECK_SIZE);
}
--check_depth;
return (POINTER_TYPE *)val;
return val;
}
/* Like realloc, but checks old block for overrun, and wraps new block
with header and trailer. */
static POINTER_TYPE *
overrun_check_realloc (POINTER_TYPE *block, size_t size)
static void *
overrun_check_realloc (void *block, size_t size)
{
register unsigned char *val = (unsigned char *) block;
int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0;
......@@ -652,7 +652,7 @@ overrun_check_realloc (POINTER_TYPE *block, size_t size)
memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE);
}
val = (unsigned char *) realloc ((POINTER_TYPE *)val, size + overhead);
val = realloc (val, size + overhead);
if (val && check_depth == 1)
{
......@@ -663,13 +663,13 @@ overrun_check_realloc (POINTER_TYPE *block, size_t size)
XMALLOC_OVERRUN_CHECK_SIZE);
}
--check_depth;
return (POINTER_TYPE *)val;
return val;
}
/* Like free, but checks block for overrun. */
static void
overrun_check_free (POINTER_TYPE *block)
overrun_check_free (void *block)
{
unsigned char *val = (unsigned char *) block;
......@@ -718,13 +718,13 @@ overrun_check_free (POINTER_TYPE *block)
/* Like malloc but check for no memory and block interrupt input.. */
POINTER_TYPE *
void *
xmalloc (size_t size)
{
register POINTER_TYPE *val;
void *val;
MALLOC_BLOCK_INPUT;
val = (POINTER_TYPE *) malloc (size);
val = malloc (size);
MALLOC_UNBLOCK_INPUT;
if (!val && size)
......@@ -735,18 +735,18 @@ xmalloc (size_t size)
/* Like realloc but check for no memory and block interrupt input.. */
POINTER_TYPE *
xrealloc (POINTER_TYPE *block, size_t size)
void *
xrealloc (void *block, size_t size)
{
register POINTER_TYPE *val;
void *val;
MALLOC_BLOCK_INPUT;
/* We must call malloc explicitly when BLOCK is 0, since some
reallocs don't do this. */
if (! block)
val = (POINTER_TYPE *) malloc (size);
val = malloc (size);
else
val = (POINTER_TYPE *) realloc (block, size);
val = realloc (block, size);
MALLOC_UNBLOCK_INPUT;
if (!val && size)
......@@ -758,7 +758,7 @@ xrealloc (POINTER_TYPE *block, size_t size)
/* Like free but block interrupt input. */
void
xfree (POINTER_TYPE *block)
xfree (void *block)
{
if (!block)
return;
......@@ -893,7 +893,7 @@ safe_alloca_unwind (Lisp_Object arg)
static void *lisp_malloc_loser;
#endif
static POINTER_TYPE *
static void *
lisp_malloc (size_t nbytes, enum mem_type type)
{
register void *val;
......@@ -938,7 +938,7 @@ lisp_malloc (size_t nbytes, enum mem_type type)
call to lisp_malloc. */
static void
lisp_free (POINTER_TYPE *block)
lisp_free (void *block)
{
MALLOC_BLOCK_INPUT;
free (block);
......@@ -1034,7 +1034,7 @@ static struct ablock *free_ablock;
/* Allocate an aligned block of nbytes.
Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be
smaller or equal to BLOCK_BYTES. */
static POINTER_TYPE *
static void *
lisp_align_malloc (size_t nbytes, enum mem_type type)
{
void *base, *val;
......@@ -1141,7 +1141,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
}
static void
lisp_align_free (POINTER_TYPE *block)
lisp_align_free (void *block)
{
struct ablock *ablock = block;
struct ablocks *abase = ABLOCK_ABASE (ablock);
......@@ -4722,10 +4722,10 @@ valid_lisp_object_p (Lisp_Object obj)
pointer to it. TYPE is the Lisp type for which the memory is
allocated. TYPE < 0 means it's not used for a Lisp object. */
static POINTER_TYPE *
static void *
pure_alloc (size_t size, int type)
{
POINTER_TYPE *result;
void *result;
#ifdef USE_LSB_TAG
size_t alignment = (1 << GCTYPEBITS);
#else
......
......@@ -2051,10 +2051,10 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
eassert (current_buffer->text == &current_buffer->own_text);
eassert (other_buffer->text == &other_buffer->own_text);
#ifdef REL_ALLOC
r_alloc_reset_variable ((POINTER_TYPE **) &current_buffer->own_text.beg,
(POINTER_TYPE **) &other_buffer->own_text.beg);
r_alloc_reset_variable ((POINTER_TYPE **) &other_buffer->own_text.beg,
(POINTER_TYPE **) &current_buffer->own_text.beg);
r_alloc_reset_variable ((void **) &current_buffer->own_text.beg,
(void **) &other_buffer->own_text.beg);
r_alloc_reset_variable ((void **) &other_buffer->own_text.beg,
(void **) &current_buffer->own_text.beg);
#endif /* REL_ALLOC */
swapfield (pt, EMACS_INT);
......@@ -4383,7 +4383,7 @@ struct mmap_region
/* Pointer to the location holding the address of the memory
allocated with the mmap'd block. The variable actually points
after this structure. */
POINTER_TYPE **var;
void **var;
/* Next and previous in list of all mmap'd regions. */
struct mmap_region *next, *prev;
......@@ -4430,7 +4430,7 @@ static int mmap_initialized_p;
to the start of the user-visible part of the region. */
#define MMAP_USER_AREA(P) \
((POINTER_TYPE *) ((char *) (P) + MMAP_REGION_STRUCT_SIZE))
((void *) ((char *) (P) + MMAP_REGION_STRUCT_SIZE))
#define MEM_ALIGN sizeof (double)
......@@ -4479,7 +4479,7 @@ mmap_init (void)
is at END - 1. */
static struct mmap_region *
mmap_find (POINTER_TYPE *start, POINTER_TYPE *end)
mmap_find (void *start, void *end)
{
struct mmap_region *r;
char *s = (char *) start, *e = (char *) end;
......@@ -4517,7 +4517,7 @@ mmap_free_1 (struct mmap_region *r)
else
mmap_regions = r->next;
if (munmap ((POINTER_TYPE *) r, r->nbytes_mapped) == -1)
if (munmap (r, r->nbytes_mapped) == -1)
{
fprintf (stderr, "munmap: %s\n", emacs_strerror (errno));
return 0;
......@@ -4559,13 +4559,13 @@ mmap_enlarge (struct mmap_region *r, int npages)
I'm not sure this is worth doing, let's see. */
if (!MMAP_ALLOCATED_P (region_end, region_end + nbytes))
{
POINTER_TYPE *p;
void *p;
p = mmap (region_end, nbytes, PROT_READ | PROT_WRITE,
MAP_ANON | MAP_PRIVATE | MAP_FIXED, mmap_fd, 0);
if (p == MAP_FAILED)
; /* fprintf (stderr, "mmap: %s\n", emacs_strerror (errno)); */
else if (p != (POINTER_TYPE *) region_end)
else if (p != region_end)
{
/* Kernels are free to choose a different address. In
that case, unmap what we've mapped above; we have
......@@ -4627,8 +4627,8 @@ mmap_set_vars (int restore_p)
If we can't allocate the necessary memory, set *VAR to null, and
return null. */
static POINTER_TYPE *
mmap_alloc (POINTER_TYPE **var, size_t nbytes)
static void *
mmap_alloc (void **var, size_t nbytes)
{
void *p;
size_t map;
......@@ -4669,7 +4669,7 @@ mmap_alloc (POINTER_TYPE **var, size_t nbytes)
PTR. Store 0 in *PTR to show there's no block allocated. */
static void
mmap_free (POINTER_TYPE **var)
mmap_free (void **var)
{
mmap_init ();
......@@ -4686,10 +4686,10 @@ mmap_free (POINTER_TYPE **var)
and return this value. If more memory cannot be allocated, then
leave *VAR unchanged, and return null. */
static POINTER_TYPE *
mmap_realloc (POINTER_TYPE **var, size_t nbytes)
static void *
mmap_realloc (void **var, size_t nbytes)
{
POINTER_TYPE *result;
void *result;
mmap_init ();
......@@ -4708,7 +4708,7 @@ mmap_realloc (POINTER_TYPE **var, size_t nbytes)
if (room < nbytes)
{
/* Must enlarge. */
POINTER_TYPE *old_ptr = *var;
void *old_ptr = *var;
/* Try to map additional pages at the end of the region.
If that fails, allocate a new region, copy data
......@@ -4770,13 +4770,13 @@ mmap_realloc (POINTER_TYPE **var, size_t nbytes)
static void
alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes)
{
POINTER_TYPE *p;
void *p;
BLOCK_INPUT;
#if defined USE_MMAP_FOR_BUFFERS
p = mmap_alloc ((POINTER_TYPE **) &b->text->beg, nbytes);
p = mmap_alloc ((void **) &b->text->beg, nbytes);
#elif defined REL_ALLOC
p = r_alloc ((POINTER_TYPE **) &b->text->beg, nbytes);
p = r_alloc ((void **) &b->text->beg, nbytes);
#else
p = xmalloc (nbytes);
#endif
......@@ -4797,14 +4797,14 @@ alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes)
void
enlarge_buffer_text (struct buffer *b, EMACS_INT delta)
{
POINTER_TYPE *p;
void *p;
ptrdiff_t nbytes = (BUF_Z_BYTE (b) - BUF_BEG_BYTE (b) + BUF_GAP_SIZE (b) + 1
+ delta);
BLOCK_INPUT;
#if defined USE_MMAP_FOR_BUFFERS
p = mmap_realloc ((POINTER_TYPE **) &b->text->beg, nbytes);
p = mmap_realloc ((void **) &b->text->beg, nbytes);
#elif defined REL_ALLOC
p = r_re_alloc ((POINTER_TYPE **) &b->text->beg, nbytes);
p = r_re_alloc ((void **) &b->text->beg, nbytes);
#else
p = xrealloc (b->text->beg, nbytes);
#endif
......@@ -4828,9 +4828,9 @@ free_buffer_text (struct buffer *b)
BLOCK_INPUT;
#if defined USE_MMAP_FOR_BUFFERS
mmap_free ((POINTER_TYPE **) &b->text->beg);
mmap_free ((void **) &b->text->beg);
#elif defined REL_ALLOC
r_alloc_free ((POINTER_TYPE **) &b->text->beg);
r_alloc_free ((void **) &b->text->beg);
#else
xfree (b->text->beg);
#endif
......
......@@ -59,10 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "window.h"
#include "blockinput.h"
#ifndef NULL
#define NULL 0
#endif
#ifndef USER_FULL_NAME
#define USER_FULL_NAME pw->pw_gecos
#endif
......
......@@ -42,10 +42,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif
#endif /* HAVE_MENUS */
#ifndef NULL
#define NULL ((POINTER_TYPE *)0)
#endif
Lisp_Object Qstring_lessp;
static Lisp_Object Qprovide, Qrequire;
static Lisp_Object Qyes_or_no_p_history;
......
......@@ -1531,10 +1531,6 @@ MA 02110-1301, USA. */
extern void *__sbrk (ptrdiff_t increment);
#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */
#ifndef NULL
#define NULL 0
#endif
/* Allocate INCREMENT more bytes of data space,
and return the start of data space, or NULL on errors.
If INCREMENT is negative, shrink data space. */
......
......@@ -31,10 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "blockinput.h"
#include "region-cache.h"
#ifndef NULL
#define NULL 0
#endif
static void insert_from_string_1 (Lisp_Object string,
EMACS_INT pos, EMACS_INT pos_byte,
EMACS_INT nchars, EMACS_INT nbytes,
......
......@@ -2780,7 +2780,7 @@ extern int pos_visible_p (struct window *, EMACS_INT, int *,
extern void syms_of_xsettings (void);
/* Defined in vm-limit.c. */
extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *));
extern void memory_warnings (void *, void (*warnfun) (const char *));
/* Defined in alloc.c */
extern void check_pure_size (void);
......@@ -3597,9 +3597,9 @@ extern int initialized;
extern int immediate_quit; /* Nonzero means ^G can quit instantly */
extern POINTER_TYPE *xmalloc (size_t);
extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t);
extern void xfree (POINTER_TYPE *);
extern void *xmalloc (size_t);
extern void *xrealloc (void *, size_t);
extern void xfree (void *);
extern void *xnmalloc (ptrdiff_t, ptrdiff_t);
extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t);
extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
......
......@@ -31,9 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
typedef POINTER_TYPE *POINTER;
typedef size_t SIZE;
#ifdef DOUG_LEA_MALLOC
#define M_TOP_PAD -2
extern int mallopt (int, int);
......@@ -47,9 +44,6 @@ extern size_t __malloc_extra_blocks;
#include <stddef.h>
typedef size_t SIZE;
typedef void *POINTER;
#include <unistd.h>
#include <malloc.h>
......@@ -58,6 +52,8 @@ typedef void *POINTER;
#include "getpagesize.h"
typedef size_t SIZE;
typedef void *POINTER;
#define NIL ((POINTER) 0)
/* A flag to indicate whether we have initialized ralloc yet. For
......
......@@ -434,17 +434,7 @@ init_syntax_once (void)
#endif /* not emacs */
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
since ours (we hope) works properly with all combinations of
machines, compilers, `char' and `unsigned char' argument types.
(Per Bothner suggested the basic approach.) */
#undef SIGN_EXTEND_CHAR
#if __STDC__
# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
#else /* not __STDC__ */
/* As in Harbison and Steele. */
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
#endif
#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
use `alloca' instead of `malloc'. This is because using malloc in
......@@ -553,12 +543,12 @@ typedef char boolean;
#define false 0
#define true 1
static regoff_t re_match_2_internal _RE_ARGS ((struct re_pattern_buffer *bufp,
re_char *string1, size_t size1,
re_char *string2, size_t size2,
ssize_t pos,
struct re_registers *regs,
ssize_t stop));
static regoff_t re_match_2_internal (struct re_pattern_buffer *bufp,
re_char *string1, size_t size1,
re_char *string2, size_t size2,
ssize_t pos,
struct re_registers *regs,
ssize_t stop);
/* These are the command codes that appear in compiled regular
expressions. Some opcodes are followed by argument bytes. A
......@@ -735,11 +725,8 @@ typedef enum
} while (0)
#ifdef DEBUG
static void extract_number _RE_ARGS ((int *dest, re_char *source));
static void
extract_number (dest, source)
int *dest;
re_char *source;
extract_number (int *dest, re_char *source)
{
int temp = SIGN_EXTEND_CHAR (*(source + 1));
*dest = *source & 0377;
......@@ -763,12 +750,8 @@ extract_number (dest, source)
} while (0)
#ifdef DEBUG
static void extract_number_and_incr _RE_ARGS ((int *destination,
re_char **source));
static void
extract_number_and_incr (destination, source)
int *destination;
re_char **source;
extract_number_and_incr (int *destination, re_char **source)
{
extract_number (destination, *source);
*source += 2;
......@@ -1672,25 +1655,22 @@ do { \
/* Subroutine declarations and macros for regex_compile. */
static reg_errcode_t regex_compile _RE_ARGS ((re_char *pattern, size_t size,
reg_syntax_t syntax,
struct re_pattern_buffer *bufp));
static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg));
static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
int arg1, int arg2));
static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
int arg, unsigned char *end));
static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc,
int arg1, int arg2, unsigned char *end));
static boolean at_begline_loc_p _RE_ARGS ((re_char *pattern,
re_char *p,
reg_syntax_t syntax));
static boolean at_endline_loc_p _RE_ARGS ((re_char *p,
re_char *pend,
reg_syntax_t syntax));
static re_char *skip_one_char _RE_ARGS ((re_char *p));
static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
char *fastmap, const int multibyte));
static reg_errcode_t regex_compile (re_char *pattern, size_t size,
reg_syntax_t syntax,
struct re_pattern_buffer *bufp);
static void store_op1 (re_opcode_t op, unsigned char *loc, int arg);