[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108326: Assume C89 or later.
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108326: Assume C89 or later. |
Date: |
Mon, 21 May 2012 08:36:54 -0700 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 108326
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2012-05-21 08:36:54 -0700
message:
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.
modified:
ChangeLog
admin/CPP-DEFINES
admin/ChangeLog
configure.in
lib-src/ChangeLog
lib-src/etags.c
src/ChangeLog
src/alloc.c
src/buffer.c
src/editfns.c
src/fns.c
src/gmalloc.c
src/insdel.c
src/lisp.h
src/ralloc.c
src/regex.c
src/regex.h
src/sysdep.c
src/termcap.c
src/textprop.c
src/tparam.c
src/unexelf.c
src/vm-limit.c
src/xterm.c
=== modified file 'ChangeLog'
--- a/ChangeLog 2012-05-21 07:30:23 +0000
+++ b/ChangeLog 2012-05-21 15:36:54 +0000
@@ -1,10 +1,9 @@
-2012-05-21 Glenn Morris <address@hidden>
-
- * configure.in (LEIM_INSTALLDIR):
- Rename to leimdir, treat like lispdir.
-
2012-05-21 Paul Eggert <address@hidden>
+ 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.
@@ -15,6 +14,11 @@
2012-05-21 Glenn Morris <address@hidden>
+ * configure.in (LEIM_INSTALLDIR):
+ Rename to leimdir, treat like lispdir.
+
+2012-05-21 Glenn Morris <address@hidden>
+
* Makefile.in (install-arch-indep, install-doc, install-info)
(uninstall): Scrap superfluous subshells.
=== modified file 'admin/CPP-DEFINES'
--- a/admin/CPP-DEFINES 2012-05-19 18:04:49 +0000
+++ b/admin/CPP-DEFINES 2012-05-21 15:36:54 +0000
@@ -201,7 +201,6 @@
NO_TERMIO
NSIG
NSIG_MINIMUM
-NULL
NULL_DEVICE
ORDINARY_LINK
O_APPEND
@@ -272,7 +271,6 @@
chmod
chown
close
-const
creat
ctime
dup
=== modified file 'admin/ChangeLog'
--- a/admin/ChangeLog 2012-05-21 02:33:13 +0000
+++ b/admin/ChangeLog 2012-05-21 15:36:54 +0000
@@ -1,5 +1,8 @@
2012-05-21 Paul Eggert <address@hidden>
+ 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.
=== modified file 'configure.in'
--- a/configure.in 2012-05-21 07:30:23 +0000
+++ b/configure.in 2012-05-21 15:36:54 +0000
@@ -1355,27 +1355,6 @@
#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 @@
#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>
=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2012-05-21 00:44:34 +0000
+++ b/lib-src/ChangeLog 2012-05-21 15:36:54 +0000
@@ -1,3 +1,9 @@
+2012-05-21 Paul Eggert <address@hidden>
+
+ 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 <address@hidden>
* Makefile.in (insrcdir, $(DESTDIR)${archlibdir}):
=== modified file 'lib-src/etags.c'
--- a/lib-src/etags.c 2012-05-10 00:27:32 +0000
+++ b/lib-src/etags.c 2012-05-21 15:36:54 +0000
@@ -93,22 +93,6 @@
#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 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 @@
}
/* 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;
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-05-21 13:35:40 +0000
+++ b/src/ChangeLog 2012-05-21 15:36:54 +0000
@@ -1,3 +1,18 @@
+2012-05-21 Paul Eggert <address@hidden>
+
+ 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 <address@hidden>
* xgselect.c (xg_select): Fix first argument in call to 'select'
=== modified file 'src/alloc.c'
--- a/src/alloc.c 2012-04-23 05:44:49 +0000
+++ b/src/alloc.c 2012-05-21 15:36:54 +0000
@@ -66,7 +66,7 @@
#include <unistd.h>
#ifndef HAVE_UNISTD_H
-extern POINTER_TYPE *sbrk ();
+extern void *sbrk ();
#endif
#include <fcntl.h>
@@ -306,7 +306,7 @@
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 @@
#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 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 @@
/* 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 @@
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 @@
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 @@
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 @@
/* 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 @@
/* 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 @@
/* Like free but block interrupt input. */
void
-xfree (POINTER_TYPE *block)
+xfree (void *block)
{
if (!block)
return;
@@ -893,7 +893,7 @@
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 @@
call to lisp_malloc. */
static void
-lisp_free (POINTER_TYPE *block)
+lisp_free (void *block)
{
MALLOC_BLOCK_INPUT;
free (block);
@@ -1034,7 +1034,7 @@
/* 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 @@
}
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 @@
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
=== modified file 'src/buffer.c'
--- a/src/buffer.c 2012-05-02 17:21:54 +0000
+++ b/src/buffer.c 2012-05-21 15:36:54 +0000
@@ -2051,10 +2051,10 @@
eassert (current_buffer->text == ¤t_buffer->own_text);
eassert (other_buffer->text == &other_buffer->own_text);
#ifdef REL_ALLOC
- r_alloc_reset_variable ((POINTER_TYPE **) ¤t_buffer->own_text.beg,
- (POINTER_TYPE **) &other_buffer->own_text.beg);
- r_alloc_reset_variable ((POINTER_TYPE **) &other_buffer->own_text.beg,
- (POINTER_TYPE **) ¤t_buffer->own_text.beg);
+ r_alloc_reset_variable ((void **) ¤t_buffer->own_text.beg,
+ (void **) &other_buffer->own_text.beg);
+ r_alloc_reset_variable ((void **) &other_buffer->own_text.beg,
+ (void **) ¤t_buffer->own_text.beg);
#endif /* REL_ALLOC */
swapfield (pt, EMACS_INT);
@@ -4383,7 +4383,7 @@
/* 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
=== modified file 'src/editfns.c'
--- a/src/editfns.c 2012-05-03 20:04:29 +0000
+++ b/src/editfns.c 2012-05-21 15:36:54 +0000
@@ -59,10 +59,6 @@
#include "window.h"
#include "blockinput.h"
-#ifndef NULL
-#define NULL 0
-#endif
-
#ifndef USER_FULL_NAME
#define USER_FULL_NAME pw->pw_gecos
#endif
=== modified file 'src/fns.c'
--- a/src/fns.c 2012-04-09 13:05:48 +0000
+++ b/src/fns.c 2012-05-21 15:36:54 +0000
@@ -42,10 +42,6 @@
#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;
=== modified file 'src/gmalloc.c'
--- a/src/gmalloc.c 2012-05-20 12:19:13 +0000
+++ b/src/gmalloc.c 2012-05-21 15:36:54 +0000
@@ -1531,10 +1531,6 @@
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. */
=== modified file 'src/insdel.c'
--- a/src/insdel.c 2012-01-19 07:21:25 +0000
+++ b/src/insdel.c 2012-05-21 15:36:54 +0000
@@ -31,10 +31,6 @@
#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,
=== modified file 'src/lisp.h'
--- a/src/lisp.h 2012-05-09 17:51:30 +0000
+++ b/src/lisp.h 2012-05-21 15:36:54 +0000
@@ -2780,7 +2780,7 @@
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 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);
=== modified file 'src/ralloc.c'
--- a/src/ralloc.c 2012-04-16 01:18:13 +0000
+++ b/src/ralloc.c 2012-05-21 15:36:54 +0000
@@ -31,9 +31,6 @@
#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 @@
#include <stddef.h>
-typedef size_t SIZE;
-typedef void *POINTER;
-
#include <unistd.h>
#include <malloc.h>
@@ -58,6 +52,8 @@
#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
=== modified file 'src/regex.c'
--- a/src/regex.c 2012-04-09 07:45:59 +0000
+++ b/src/regex.c 2012-05-21 15:36:54 +0000
@@ -434,17 +434,7 @@
#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 @@
#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 @@
} 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 @@
} 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 @@
/* 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);
+static void store_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2);
+static void insert_op1 (re_opcode_t op, unsigned char *loc,
+ int arg, unsigned char *end);
+static void insert_op2 (re_opcode_t op, unsigned char *loc,
+ int arg1, int arg2, unsigned char *end);
+static boolean at_begline_loc_p (re_char *pattern, re_char *p,
+ reg_syntax_t syntax);
+static boolean at_endline_loc_p (re_char *p, re_char *pend,
+ reg_syntax_t syntax);
+static re_char *skip_one_char (re_char *p);
+static int analyse_first (re_char *p, re_char *pend,
+ char *fastmap, const int multibyte);
/* Fetch the next character in the uncompiled pattern, with no
translation. */
@@ -2442,9 +2422,8 @@
#endif /* not MATCH_MAY_ALLOCATE */
-static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type
- compile_stack,
- regnum_t regnum));
+static boolean group_in_compile_stack (compile_stack_type compile_stack,
+ regnum_t regnum);
/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
Returns one of error codes defined in `regex.h', or zero for success.
@@ -4554,10 +4533,10 @@
/* Declarations and macros for re_match_2. */
-static int bcmp_translate _RE_ARGS ((re_char *s1, re_char *s2,
- register ssize_t len,
- RE_TRANSLATE_TYPE translate,
- const int multibyte));
+static int bcmp_translate (re_char *s1, re_char *s2,
+ register ssize_t len,
+ RE_TRANSLATE_TYPE translate,
+ const int multibyte);
/* This converts PTR, a pointer into one of the search strings `string1'
and `string2' into an offset from the beginning of that string. */
=== modified file 'src/regex.h'
--- a/src/regex.h 2012-01-19 07:21:25 +0000
+++ b/src/regex.h 2012-05-21 15:36:54 +0000
@@ -451,38 +451,21 @@
/* Declarations for routines. */
-/* To avoid duplicating every routine declaration -- once with a
- prototype (if we are ANSI), and once without (if we aren't) -- we
- use the following macro to declare argument types. This
- unfortunately clutters up the declarations a bit, but I think it's
- worth it. */
-
-#if defined __STDC__ || defined PROTOTYPES
-
-# define _RE_ARGS(args) args
-
-#else /* not __STDC__ || PROTOTYPES */
-
-# define _RE_ARGS(args) ()
-
-#endif /* not __STDC__ || PROTOTYPES */
-
/* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the `re_syntax_options' variable. */
-extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
/* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global `re_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
-extern const char *re_compile_pattern
- _RE_ARGS ((const char *pattern, size_t length,
- struct re_pattern_buffer *buffer));
+extern const char *re_compile_pattern (const char *__pattern, size_t __length,
+ struct re_pattern_buffer *__buffer);
/* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an
internal error. */
-extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
+extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
/* Search in the string STRING (with length LENGTH) for the pattern
@@ -490,33 +473,35 @@
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
-extern regoff_t re_search
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
- size_t length, ssize_t start, ssize_t range,
- struct re_registers *regs));
+extern regoff_t re_search (struct re_pattern_buffer *__buffer,
+ const char *__string, size_t __length,
+ ssize_t __start, ssize_t __range,
+ struct re_registers *__regs);
/* Like `re_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */
-extern regoff_t re_search_2
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
- size_t length1, const char *string2, size_t length2,
- ssize_t start, ssize_t range, struct re_registers *regs,
- ssize_t stop));
+extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, size_t __length1,
+ const char *__string2, size_t __length2,
+ ssize_t __start, ssize_t __range,
+ struct re_registers *__regs,
+ ssize_t __stop);
/* Like `re_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */
-extern regoff_t re_match
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
- size_t length, ssize_t start, struct re_registers *regs));
+extern regoff_t re_match (struct re_pattern_buffer *__buffer,
+ const char *__string, size_t __length,
+ ssize_t __start, struct re_registers *__regs);
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern regoff_t re_match_2
- _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
- size_t length1, const char *string2, size_t length2,
- ssize_t start, struct re_registers *regs, ssize_t stop));
+extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
+ const char *__string1, size_t __length1,
+ const char *__string2, size_t __length2,
+ ssize_t __start, struct re_registers *__regs,
+ ssize_t __stop);
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
@@ -531,15 +516,16 @@
Unless this function is called, the first search or match using
PATTERN_BUFFER will allocate its own register data, without
freeing the old data. */
-extern void re_set_registers
- _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
- unsigned num_regs, regoff_t *starts, regoff_t *ends));
+extern void re_set_registers (struct re_pattern_buffer *__buffer,
+ struct re_registers *__regs,
+ unsigned __num_regs,
+ regoff_t *__starts, regoff_t *__ends);
#if defined _REGEX_RE_COMP || defined _LIBC
# ifndef _CRAY
/* 4.2 bsd compatibility. */
-extern char *re_comp _RE_ARGS ((const char *));
-extern int re_exec _RE_ARGS ((const char *));
+extern char *re_comp (const char *);
+extern int re_exec (const char *);
# endif
#endif
@@ -562,20 +548,19 @@
#endif
/* POSIX compatibility. */
-extern reg_errcode_t regcomp _RE_ARGS ((regex_t *__restrict __preg,
- const char *__restrict __pattern,
- int __cflags));
-
-extern reg_errcode_t regexec _RE_ARGS ((const regex_t *__restrict __preg,
- const char *__restrict __string,
- size_t __nmatch,
- regmatch_t __pmatch[__restrict_arr],
- int __eflags));
-
-extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
- char *__errbuf, size_t __errbuf_size));
-
-extern void regfree _RE_ARGS ((regex_t *__preg));
+extern reg_errcode_t regcomp (regex_t *__restrict __preg,
+ const char *__restrict __pattern,
+ int __cflags);
+
+extern reg_errcode_t regexec (const regex_t *__restrict __preg,
+ const char *__restrict __string, size_t __nmatch,
+ regmatch_t __pmatch[__restrict_arr],
+ int __eflags);
+
+extern size_t regerror (int __errcode, const regex_t * __preg,
+ char *__errbuf, size_t __errbuf_size);
+
+extern void regfree (regex_t *__preg);
#ifdef __cplusplus
=== modified file 'src/sysdep.c'
--- a/src/sysdep.c 2012-04-22 02:58:23 +0000
+++ b/src/sysdep.c 2012-05-21 15:36:54 +0000
@@ -52,9 +52,6 @@
#define read sys_read
#define write sys_write
#include <windows.h>
-#ifndef NULL
-#define NULL 0
-#endif
#endif /* not WINDOWSNT */
#include <sys/types.h>
=== modified file 'src/termcap.c'
--- a/src/termcap.c 2011-09-09 01:06:52 +0000
+++ b/src/termcap.c 2012-05-21 15:36:54 +0000
@@ -30,10 +30,6 @@
#include "msdos.h"
#endif
-#ifndef NULL
-#define NULL (char *) 0
-#endif
-
/* BUFSIZE is the initial size allocated for the buffer
for reading the termcap file.
It is not a limit.
@@ -661,10 +657,6 @@
#ifdef TEST
-#ifdef NULL
-#undef NULL
-#endif
-
#include <stdio.h>
static void
=== modified file 'src/textprop.c'
--- a/src/textprop.c 2012-01-19 07:21:25 +0000
+++ b/src/textprop.c 2012-05-21 15:36:54 +0000
@@ -23,10 +23,6 @@
#include "buffer.h"
#include "window.h"
-#ifndef NULL
-#define NULL (void *)0
-#endif
-
/* Test for membership, allowing for t (actually any non-cons) to mean the
universal set. */
=== modified file 'src/tparam.c'
--- a/src/tparam.c 2011-08-05 02:15:35 +0000
+++ b/src/tparam.c 2012-05-21 15:36:54 +0000
@@ -22,10 +22,6 @@
#include <setjmp.h>
#include "lisp.h" /* for xmalloc */
#include "tparam.h"
-
-#ifndef NULL
-#define NULL (char *) 0
-#endif
/* Assuming STRING is the value of a termcap string entry
containing `%' constructs to expand parameters,
=== modified file 'src/unexelf.c'
--- a/src/unexelf.c 2012-01-19 07:21:25 +0000
+++ b/src/unexelf.c 2012-05-21 15:36:54 +0000
@@ -506,11 +506,7 @@
#endif
#ifndef ElfW
-# ifdef __STDC__
-# define ElfBitsW(bits, type) Elf##bits##_##type
-# else
-# define ElfBitsW(bits, type) Elf/**/bits/**/_/**/type
-# endif
+# define ElfBitsW(bits, type) Elf##bits##_##type
# ifdef _LP64
# define ELFSIZE 64
# else
=== modified file 'src/vm-limit.c'
--- a/src/vm-limit.c 2012-01-19 07:21:25 +0000
+++ b/src/vm-limit.c 2012-05-21 15:36:54 +0000
@@ -31,7 +31,7 @@
enum warnlevel { not_warned, warned_75, warned_85, warned_95 };
static enum warnlevel warnlevel;
-typedef POINTER_TYPE *POINTER;
+typedef void *POINTER;
/* Function to call to issue a warning;
0 means don't issue them. */
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2012-05-02 10:17:03 +0000
+++ b/src/xterm.c 2012-05-21 15:36:54 +0000
@@ -256,11 +256,7 @@
/* Incremented by XTread_socket whenever it really tries to read
events. */
-#ifdef __STDC__
static int volatile input_signal_count;
-#else
-static int input_signal_count;
-#endif
/* Used locally within XTread_socket. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108326: Assume C89 or later.,
Paul Eggert <=