aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2012-05-21 08:36:54 -0700
committerPaul Eggert2012-05-21 08:36:54 -0700
commit261cb4bb750143d8078bb27a343e0d9560b884df (patch)
tree0d295abf946d52c178be2f7b95e85bfcc5fc63cc /src
parentff23cd9f452b6d2b5001a67d7b14e0af7f61b194 (diff)
downloademacs-261cb4bb750143d8078bb27a343e0d9560b884df.tar.gz
emacs-261cb4bb750143d8078bb27a343e0d9560b884df.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog15
-rw-r--r--src/alloc.c56
-rw-r--r--src/buffer.c50
-rw-r--r--src/editfns.c4
-rw-r--r--src/fns.c4
-rw-r--r--src/gmalloc.c4
-rw-r--r--src/insdel.c4
-rw-r--r--src/lisp.h8
-rw-r--r--src/ralloc.c8
-rw-r--r--src/regex.c83
-rw-r--r--src/regex.h91
-rw-r--r--src/sysdep.c3
-rw-r--r--src/termcap.c8
-rw-r--r--src/textprop.c4
-rw-r--r--src/tparam.c4
-rw-r--r--src/unexelf.c6
-rw-r--r--src/vm-limit.c2
-rw-r--r--src/xterm.c4
18 files changed, 145 insertions, 213 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b9e91d308cc..3054f4a284f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,18 @@
12012-05-21 Paul Eggert <eggert@cs.ucla.edu>
2
3 Assume C89 or later.
4 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6 (xrealloc):
7 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9 * textprop.c, tparam.c (NULL): Remove.
10 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
11 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14 * xterm.c (input_signal_count): Assume volatile works.
15
12012-05-21 Ken Brown <kbrown@cornell.edu> 162012-05-21 Ken Brown <kbrown@cornell.edu>
2 17
3 * xgselect.c (xg_select): Fix first argument in call to 'select' 18 * xgselect.c (xg_select): Fix first argument in call to 'select'
diff --git a/src/alloc.c b/src/alloc.c
index a120ce9b61f..3601c256c41 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -66,7 +66,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
66 66
67#include <unistd.h> 67#include <unistd.h>
68#ifndef HAVE_UNISTD_H 68#ifndef HAVE_UNISTD_H
69extern POINTER_TYPE *sbrk (); 69extern void *sbrk ();
70#endif 70#endif
71 71
72#include <fcntl.h> 72#include <fcntl.h>
@@ -306,7 +306,7 @@ enum mem_type
306 MEM_TYPE_VECTORLIKE 306 MEM_TYPE_VECTORLIKE
307}; 307};
308 308
309static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); 309static void *lisp_malloc (size_t, enum mem_type);
310 310
311 311
312#if GC_MARK_STACK || defined GC_MALLOC_CHECK 312#if GC_MARK_STACK || defined GC_MALLOC_CHECK
@@ -388,7 +388,7 @@ static struct mem_node mem_z;
388#define MEM_NIL &mem_z 388#define MEM_NIL &mem_z
389 389
390static struct Lisp_Vector *allocate_vectorlike (EMACS_INT); 390static struct Lisp_Vector *allocate_vectorlike (EMACS_INT);
391static void lisp_free (POINTER_TYPE *); 391static void lisp_free (void *);
392static void mark_stack (void); 392static void mark_stack (void);
393static int live_vector_p (struct mem_node *, void *); 393static int live_vector_p (struct mem_node *, void *);
394static int live_buffer_p (struct mem_node *, void *); 394static int live_buffer_p (struct mem_node *, void *);
@@ -435,15 +435,15 @@ static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
435 435
436static int staticidx = 0; 436static int staticidx = 0;
437 437
438static POINTER_TYPE *pure_alloc (size_t, int); 438static void *pure_alloc (size_t, int);
439 439
440 440
441/* Value is SZ rounded up to the next multiple of ALIGNMENT. 441/* Value is SZ rounded up to the next multiple of ALIGNMENT.
442 ALIGNMENT must be a power of 2. */ 442 ALIGNMENT must be a power of 2. */
443 443
444#define ALIGN(ptr, ALIGNMENT) \ 444#define ALIGN(ptr, ALIGNMENT) \
445 ((POINTER_TYPE *) ((((uintptr_t) (ptr)) + (ALIGNMENT) - 1) \ 445 ((void *) (((uintptr_t) (ptr) + (ALIGNMENT) - 1) \
446 & ~((ALIGNMENT) - 1))) 446 & ~ ((ALIGNMENT) - 1)))
447 447
448 448
449 449
@@ -604,7 +604,7 @@ static ptrdiff_t check_depth;
604 604
605/* Like malloc, but wraps allocated block with header and trailer. */ 605/* Like malloc, but wraps allocated block with header and trailer. */
606 606
607static POINTER_TYPE * 607static void *
608overrun_check_malloc (size_t size) 608overrun_check_malloc (size_t size)
609{ 609{
610 register unsigned char *val; 610 register unsigned char *val;
@@ -622,15 +622,15 @@ overrun_check_malloc (size_t size)
622 XMALLOC_OVERRUN_CHECK_SIZE); 622 XMALLOC_OVERRUN_CHECK_SIZE);
623 } 623 }
624 --check_depth; 624 --check_depth;
625 return (POINTER_TYPE *)val; 625 return val;
626} 626}
627 627
628 628
629/* Like realloc, but checks old block for overrun, and wraps new block 629/* Like realloc, but checks old block for overrun, and wraps new block
630 with header and trailer. */ 630 with header and trailer. */
631 631
632static POINTER_TYPE * 632static void *
633overrun_check_realloc (POINTER_TYPE *block, size_t size) 633overrun_check_realloc (void *block, size_t size)
634{ 634{
635 register unsigned char *val = (unsigned char *) block; 635 register unsigned char *val = (unsigned char *) block;
636 int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; 636 int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0;
@@ -652,7 +652,7 @@ overrun_check_realloc (POINTER_TYPE *block, size_t size)
652 memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE); 652 memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE);
653 } 653 }
654 654
655 val = (unsigned char *) realloc ((POINTER_TYPE *)val, size + overhead); 655 val = realloc (val, size + overhead);
656 656
657 if (val && check_depth == 1) 657 if (val && check_depth == 1)
658 { 658 {
@@ -663,13 +663,13 @@ overrun_check_realloc (POINTER_TYPE *block, size_t size)
663 XMALLOC_OVERRUN_CHECK_SIZE); 663 XMALLOC_OVERRUN_CHECK_SIZE);
664 } 664 }
665 --check_depth; 665 --check_depth;
666 return (POINTER_TYPE *)val; 666 return val;
667} 667}
668 668
669/* Like free, but checks block for overrun. */ 669/* Like free, but checks block for overrun. */
670 670
671static void 671static void
672overrun_check_free (POINTER_TYPE *block) 672overrun_check_free (void *block)
673{ 673{
674 unsigned char *val = (unsigned char *) block; 674 unsigned char *val = (unsigned char *) block;
675 675
@@ -718,13 +718,13 @@ overrun_check_free (POINTER_TYPE *block)
718 718
719/* Like malloc but check for no memory and block interrupt input.. */ 719/* Like malloc but check for no memory and block interrupt input.. */
720 720
721POINTER_TYPE * 721void *
722xmalloc (size_t size) 722xmalloc (size_t size)
723{ 723{
724 register POINTER_TYPE *val; 724 void *val;
725 725
726 MALLOC_BLOCK_INPUT; 726 MALLOC_BLOCK_INPUT;
727 val = (POINTER_TYPE *) malloc (size); 727 val = malloc (size);
728 MALLOC_UNBLOCK_INPUT; 728 MALLOC_UNBLOCK_INPUT;
729 729
730 if (!val && size) 730 if (!val && size)
@@ -735,18 +735,18 @@ xmalloc (size_t size)
735 735
736/* Like realloc but check for no memory and block interrupt input.. */ 736/* Like realloc but check for no memory and block interrupt input.. */
737 737
738POINTER_TYPE * 738void *
739xrealloc (POINTER_TYPE *block, size_t size) 739xrealloc (void *block, size_t size)
740{ 740{
741 register POINTER_TYPE *val; 741 void *val;
742 742
743 MALLOC_BLOCK_INPUT; 743 MALLOC_BLOCK_INPUT;
744 /* We must call malloc explicitly when BLOCK is 0, since some 744 /* We must call malloc explicitly when BLOCK is 0, since some
745 reallocs don't do this. */ 745 reallocs don't do this. */
746 if (! block) 746 if (! block)
747 val = (POINTER_TYPE *) malloc (size); 747 val = malloc (size);
748 else 748 else
749 val = (POINTER_TYPE *) realloc (block, size); 749 val = realloc (block, size);
750 MALLOC_UNBLOCK_INPUT; 750 MALLOC_UNBLOCK_INPUT;
751 751
752 if (!val && size) 752 if (!val && size)
@@ -758,7 +758,7 @@ xrealloc (POINTER_TYPE *block, size_t size)
758/* Like free but block interrupt input. */ 758/* Like free but block interrupt input. */
759 759
760void 760void
761xfree (POINTER_TYPE *block) 761xfree (void *block)
762{ 762{
763 if (!block) 763 if (!block)
764 return; 764 return;
@@ -893,7 +893,7 @@ safe_alloca_unwind (Lisp_Object arg)
893static void *lisp_malloc_loser; 893static void *lisp_malloc_loser;
894#endif 894#endif
895 895
896static POINTER_TYPE * 896static void *
897lisp_malloc (size_t nbytes, enum mem_type type) 897lisp_malloc (size_t nbytes, enum mem_type type)
898{ 898{
899 register void *val; 899 register void *val;
@@ -938,7 +938,7 @@ lisp_malloc (size_t nbytes, enum mem_type type)
938 call to lisp_malloc. */ 938 call to lisp_malloc. */
939 939
940static void 940static void
941lisp_free (POINTER_TYPE *block) 941lisp_free (void *block)
942{ 942{
943 MALLOC_BLOCK_INPUT; 943 MALLOC_BLOCK_INPUT;
944 free (block); 944 free (block);
@@ -1034,7 +1034,7 @@ static struct ablock *free_ablock;
1034/* Allocate an aligned block of nbytes. 1034/* Allocate an aligned block of nbytes.
1035 Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be 1035 Alignment is on a multiple of BLOCK_ALIGN and `nbytes' has to be
1036 smaller or equal to BLOCK_BYTES. */ 1036 smaller or equal to BLOCK_BYTES. */
1037static POINTER_TYPE * 1037static void *
1038lisp_align_malloc (size_t nbytes, enum mem_type type) 1038lisp_align_malloc (size_t nbytes, enum mem_type type)
1039{ 1039{
1040 void *base, *val; 1040 void *base, *val;
@@ -1141,7 +1141,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
1141} 1141}
1142 1142
1143static void 1143static void
1144lisp_align_free (POINTER_TYPE *block) 1144lisp_align_free (void *block)
1145{ 1145{
1146 struct ablock *ablock = block; 1146 struct ablock *ablock = block;
1147 struct ablocks *abase = ABLOCK_ABASE (ablock); 1147 struct ablocks *abase = ABLOCK_ABASE (ablock);
@@ -4722,10 +4722,10 @@ valid_lisp_object_p (Lisp_Object obj)
4722 pointer to it. TYPE is the Lisp type for which the memory is 4722 pointer to it. TYPE is the Lisp type for which the memory is
4723 allocated. TYPE < 0 means it's not used for a Lisp object. */ 4723 allocated. TYPE < 0 means it's not used for a Lisp object. */
4724 4724
4725static POINTER_TYPE * 4725static void *
4726pure_alloc (size_t size, int type) 4726pure_alloc (size_t size, int type)
4727{ 4727{
4728 POINTER_TYPE *result; 4728 void *result;
4729#ifdef USE_LSB_TAG 4729#ifdef USE_LSB_TAG
4730 size_t alignment = (1 << GCTYPEBITS); 4730 size_t alignment = (1 << GCTYPEBITS);
4731#else 4731#else
diff --git a/src/buffer.c b/src/buffer.c
index 2ddbc699481..4dcdf7bae69 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2051,10 +2051,10 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text,
2051 eassert (current_buffer->text == &current_buffer->own_text); 2051 eassert (current_buffer->text == &current_buffer->own_text);
2052 eassert (other_buffer->text == &other_buffer->own_text); 2052 eassert (other_buffer->text == &other_buffer->own_text);
2053#ifdef REL_ALLOC 2053#ifdef REL_ALLOC
2054 r_alloc_reset_variable ((POINTER_TYPE **) &current_buffer->own_text.beg, 2054 r_alloc_reset_variable ((void **) &current_buffer->own_text.beg,
2055 (POINTER_TYPE **) &other_buffer->own_text.beg); 2055 (void **) &other_buffer->own_text.beg);
2056 r_alloc_reset_variable ((POINTER_TYPE **) &other_buffer->own_text.beg, 2056 r_alloc_reset_variable ((void **) &other_buffer->own_text.beg,
2057 (POINTER_TYPE **) &current_buffer->own_text.beg); 2057 (void **) &current_buffer->own_text.beg);
2058#endif /* REL_ALLOC */ 2058#endif /* REL_ALLOC */
2059 2059
2060 swapfield (pt, EMACS_INT); 2060 swapfield (pt, EMACS_INT);
@@ -4383,7 +4383,7 @@ struct mmap_region
4383 /* Pointer to the location holding the address of the memory 4383 /* Pointer to the location holding the address of the memory
4384 allocated with the mmap'd block. The variable actually points 4384 allocated with the mmap'd block. The variable actually points
4385 after this structure. */ 4385 after this structure. */
4386 POINTER_TYPE **var; 4386 void **var;
4387 4387
4388 /* Next and previous in list of all mmap'd regions. */ 4388 /* Next and previous in list of all mmap'd regions. */
4389 struct mmap_region *next, *prev; 4389 struct mmap_region *next, *prev;
@@ -4430,7 +4430,7 @@ static int mmap_initialized_p;
4430 to the start of the user-visible part of the region. */ 4430 to the start of the user-visible part of the region. */
4431 4431
4432#define MMAP_USER_AREA(P) \ 4432#define MMAP_USER_AREA(P) \
4433 ((POINTER_TYPE *) ((char *) (P) + MMAP_REGION_STRUCT_SIZE)) 4433 ((void *) ((char *) (P) + MMAP_REGION_STRUCT_SIZE))
4434 4434
4435#define MEM_ALIGN sizeof (double) 4435#define MEM_ALIGN sizeof (double)
4436 4436
@@ -4479,7 +4479,7 @@ mmap_init (void)
4479 is at END - 1. */ 4479 is at END - 1. */
4480 4480
4481static struct mmap_region * 4481static struct mmap_region *
4482mmap_find (POINTER_TYPE *start, POINTER_TYPE *end) 4482mmap_find (void *start, void *end)
4483{ 4483{
4484 struct mmap_region *r; 4484 struct mmap_region *r;
4485 char *s = (char *) start, *e = (char *) end; 4485 char *s = (char *) start, *e = (char *) end;
@@ -4517,7 +4517,7 @@ mmap_free_1 (struct mmap_region *r)
4517 else 4517 else
4518 mmap_regions = r->next; 4518 mmap_regions = r->next;
4519 4519
4520 if (munmap ((POINTER_TYPE *) r, r->nbytes_mapped) == -1) 4520 if (munmap (r, r->nbytes_mapped) == -1)
4521 { 4521 {
4522 fprintf (stderr, "munmap: %s\n", emacs_strerror (errno)); 4522 fprintf (stderr, "munmap: %s\n", emacs_strerror (errno));
4523 return 0; 4523 return 0;
@@ -4559,13 +4559,13 @@ mmap_enlarge (struct mmap_region *r, int npages)
4559 I'm not sure this is worth doing, let's see. */ 4559 I'm not sure this is worth doing, let's see. */
4560 if (!MMAP_ALLOCATED_P (region_end, region_end + nbytes)) 4560 if (!MMAP_ALLOCATED_P (region_end, region_end + nbytes))
4561 { 4561 {
4562 POINTER_TYPE *p; 4562 void *p;
4563 4563
4564 p = mmap (region_end, nbytes, PROT_READ | PROT_WRITE, 4564 p = mmap (region_end, nbytes, PROT_READ | PROT_WRITE,
4565 MAP_ANON | MAP_PRIVATE | MAP_FIXED, mmap_fd, 0); 4565 MAP_ANON | MAP_PRIVATE | MAP_FIXED, mmap_fd, 0);
4566 if (p == MAP_FAILED) 4566 if (p == MAP_FAILED)
4567 ; /* fprintf (stderr, "mmap: %s\n", emacs_strerror (errno)); */ 4567 ; /* fprintf (stderr, "mmap: %s\n", emacs_strerror (errno)); */
4568 else if (p != (POINTER_TYPE *) region_end) 4568 else if (p != region_end)
4569 { 4569 {
4570 /* Kernels are free to choose a different address. In 4570 /* Kernels are free to choose a different address. In
4571 that case, unmap what we've mapped above; we have 4571 that case, unmap what we've mapped above; we have
@@ -4627,8 +4627,8 @@ mmap_set_vars (int restore_p)
4627 If we can't allocate the necessary memory, set *VAR to null, and 4627 If we can't allocate the necessary memory, set *VAR to null, and
4628 return null. */ 4628 return null. */
4629 4629
4630static POINTER_TYPE * 4630static void *
4631mmap_alloc (POINTER_TYPE **var, size_t nbytes) 4631mmap_alloc (void **var, size_t nbytes)
4632{ 4632{
4633 void *p; 4633 void *p;
4634 size_t map; 4634 size_t map;
@@ -4669,7 +4669,7 @@ mmap_alloc (POINTER_TYPE **var, size_t nbytes)
4669 PTR. Store 0 in *PTR to show there's no block allocated. */ 4669 PTR. Store 0 in *PTR to show there's no block allocated. */
4670 4670
4671static void 4671static void
4672mmap_free (POINTER_TYPE **var) 4672mmap_free (void **var)
4673{ 4673{
4674 mmap_init (); 4674 mmap_init ();
4675 4675
@@ -4686,10 +4686,10 @@ mmap_free (POINTER_TYPE **var)
4686 and return this value. If more memory cannot be allocated, then 4686 and return this value. If more memory cannot be allocated, then
4687 leave *VAR unchanged, and return null. */ 4687 leave *VAR unchanged, and return null. */
4688 4688
4689static POINTER_TYPE * 4689static void *
4690mmap_realloc (POINTER_TYPE **var, size_t nbytes) 4690mmap_realloc (void **var, size_t nbytes)
4691{ 4691{
4692 POINTER_TYPE *result; 4692 void *result;
4693 4693
4694 mmap_init (); 4694 mmap_init ();
4695 4695
@@ -4708,7 +4708,7 @@ mmap_realloc (POINTER_TYPE **var, size_t nbytes)
4708 if (room < nbytes) 4708 if (room < nbytes)
4709 { 4709 {
4710 /* Must enlarge. */ 4710 /* Must enlarge. */
4711 POINTER_TYPE *old_ptr = *var; 4711 void *old_ptr = *var;
4712 4712
4713 /* Try to map additional pages at the end of the region. 4713 /* Try to map additional pages at the end of the region.
4714 If that fails, allocate a new region, copy data 4714 If that fails, allocate a new region, copy data
@@ -4770,13 +4770,13 @@ mmap_realloc (POINTER_TYPE **var, size_t nbytes)
4770static void 4770static void
4771alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes) 4771alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes)
4772{ 4772{
4773 POINTER_TYPE *p; 4773 void *p;
4774 4774
4775 BLOCK_INPUT; 4775 BLOCK_INPUT;
4776#if defined USE_MMAP_FOR_BUFFERS 4776#if defined USE_MMAP_FOR_BUFFERS
4777 p = mmap_alloc ((POINTER_TYPE **) &b->text->beg, nbytes); 4777 p = mmap_alloc ((void **) &b->text->beg, nbytes);
4778#elif defined REL_ALLOC 4778#elif defined REL_ALLOC
4779 p = r_alloc ((POINTER_TYPE **) &b->text->beg, nbytes); 4779 p = r_alloc ((void **) &b->text->beg, nbytes);
4780#else 4780#else
4781 p = xmalloc (nbytes); 4781 p = xmalloc (nbytes);
4782#endif 4782#endif
@@ -4797,14 +4797,14 @@ alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes)
4797void 4797void
4798enlarge_buffer_text (struct buffer *b, EMACS_INT delta) 4798enlarge_buffer_text (struct buffer *b, EMACS_INT delta)
4799{ 4799{
4800 POINTER_TYPE *p; 4800 void *p;
4801 ptrdiff_t nbytes = (BUF_Z_BYTE (b) - BUF_BEG_BYTE (b) + BUF_GAP_SIZE (b) + 1 4801 ptrdiff_t nbytes = (BUF_Z_BYTE (b) - BUF_BEG_BYTE (b) + BUF_GAP_SIZE (b) + 1
4802 + delta); 4802 + delta);
4803 BLOCK_INPUT; 4803 BLOCK_INPUT;
4804#if defined USE_MMAP_FOR_BUFFERS 4804#if defined USE_MMAP_FOR_BUFFERS
4805 p = mmap_realloc ((POINTER_TYPE **) &b->text->beg, nbytes); 4805 p = mmap_realloc ((void **) &b->text->beg, nbytes);
4806#elif defined REL_ALLOC 4806#elif defined REL_ALLOC
4807 p = r_re_alloc ((POINTER_TYPE **) &b->text->beg, nbytes); 4807 p = r_re_alloc ((void **) &b->text->beg, nbytes);
4808#else 4808#else
4809 p = xrealloc (b->text->beg, nbytes); 4809 p = xrealloc (b->text->beg, nbytes);
4810#endif 4810#endif
@@ -4828,9 +4828,9 @@ free_buffer_text (struct buffer *b)
4828 BLOCK_INPUT; 4828 BLOCK_INPUT;
4829 4829
4830#if defined USE_MMAP_FOR_BUFFERS 4830#if defined USE_MMAP_FOR_BUFFERS
4831 mmap_free ((POINTER_TYPE **) &b->text->beg); 4831 mmap_free ((void **) &b->text->beg);
4832#elif defined REL_ALLOC 4832#elif defined REL_ALLOC
4833 r_alloc_free ((POINTER_TYPE **) &b->text->beg); 4833 r_alloc_free ((void **) &b->text->beg);
4834#else 4834#else
4835 xfree (b->text->beg); 4835 xfree (b->text->beg);
4836#endif 4836#endif
diff --git a/src/editfns.c b/src/editfns.c
index d266ca9951d..c5ba280c178 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -59,10 +59,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59#include "window.h" 59#include "window.h"
60#include "blockinput.h" 60#include "blockinput.h"
61 61
62#ifndef NULL
63#define NULL 0
64#endif
65
66#ifndef USER_FULL_NAME 62#ifndef USER_FULL_NAME
67#define USER_FULL_NAME pw->pw_gecos 63#define USER_FULL_NAME pw->pw_gecos
68#endif 64#endif
diff --git a/src/fns.c b/src/fns.c
index a92a1c882fd..aa7284f7ce0 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -42,10 +42,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
42#endif 42#endif
43#endif /* HAVE_MENUS */ 43#endif /* HAVE_MENUS */
44 44
45#ifndef NULL
46#define NULL ((POINTER_TYPE *)0)
47#endif
48
49Lisp_Object Qstring_lessp; 45Lisp_Object Qstring_lessp;
50static Lisp_Object Qprovide, Qrequire; 46static Lisp_Object Qprovide, Qrequire;
51static Lisp_Object Qyes_or_no_p_history; 47static Lisp_Object Qyes_or_no_p_history;
diff --git a/src/gmalloc.c b/src/gmalloc.c
index b53199e7312..0df050e127a 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1531,10 +1531,6 @@ MA 02110-1301, USA. */
1531extern void *__sbrk (ptrdiff_t increment); 1531extern void *__sbrk (ptrdiff_t increment);
1532#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */ 1532#endif /* __GNU_LIBRARY__ && ! defined (__UCLIBC__) */
1533 1533
1534#ifndef NULL
1535#define NULL 0
1536#endif
1537
1538/* Allocate INCREMENT more bytes of data space, 1534/* Allocate INCREMENT more bytes of data space,
1539 and return the start of data space, or NULL on errors. 1535 and return the start of data space, or NULL on errors.
1540 If INCREMENT is negative, shrink data space. */ 1536 If INCREMENT is negative, shrink data space. */
diff --git a/src/insdel.c b/src/insdel.c
index 34d82fa017d..373b3848f05 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -31,10 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include "blockinput.h" 31#include "blockinput.h"
32#include "region-cache.h" 32#include "region-cache.h"
33 33
34#ifndef NULL
35#define NULL 0
36#endif
37
38static void insert_from_string_1 (Lisp_Object string, 34static void insert_from_string_1 (Lisp_Object string,
39 EMACS_INT pos, EMACS_INT pos_byte, 35 EMACS_INT pos, EMACS_INT pos_byte,
40 EMACS_INT nchars, EMACS_INT nbytes, 36 EMACS_INT nchars, EMACS_INT nbytes,
diff --git a/src/lisp.h b/src/lisp.h
index 6376862949a..fd5219adf4c 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2780,7 +2780,7 @@ extern int pos_visible_p (struct window *, EMACS_INT, int *,
2780extern void syms_of_xsettings (void); 2780extern void syms_of_xsettings (void);
2781 2781
2782/* Defined in vm-limit.c. */ 2782/* Defined in vm-limit.c. */
2783extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *)); 2783extern void memory_warnings (void *, void (*warnfun) (const char *));
2784 2784
2785/* Defined in alloc.c */ 2785/* Defined in alloc.c */
2786extern void check_pure_size (void); 2786extern void check_pure_size (void);
@@ -3597,9 +3597,9 @@ extern int initialized;
3597 3597
3598extern int immediate_quit; /* Nonzero means ^G can quit instantly */ 3598extern int immediate_quit; /* Nonzero means ^G can quit instantly */
3599 3599
3600extern POINTER_TYPE *xmalloc (size_t); 3600extern void *xmalloc (size_t);
3601extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t); 3601extern void *xrealloc (void *, size_t);
3602extern void xfree (POINTER_TYPE *); 3602extern void xfree (void *);
3603extern void *xnmalloc (ptrdiff_t, ptrdiff_t); 3603extern void *xnmalloc (ptrdiff_t, ptrdiff_t);
3604extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t); 3604extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t);
3605extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t); 3605extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
diff --git a/src/ralloc.c b/src/ralloc.c
index 4bb2f240438..d736e279520 100644
--- a/src/ralloc.c
+++ b/src/ralloc.c
@@ -31,9 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31 31
32#include <unistd.h> 32#include <unistd.h>
33 33
34typedef POINTER_TYPE *POINTER;
35typedef size_t SIZE;
36
37#ifdef DOUG_LEA_MALLOC 34#ifdef DOUG_LEA_MALLOC
38#define M_TOP_PAD -2 35#define M_TOP_PAD -2
39extern int mallopt (int, int); 36extern int mallopt (int, int);
@@ -47,9 +44,6 @@ extern size_t __malloc_extra_blocks;
47 44
48#include <stddef.h> 45#include <stddef.h>
49 46
50typedef size_t SIZE;
51typedef void *POINTER;
52
53#include <unistd.h> 47#include <unistd.h>
54#include <malloc.h> 48#include <malloc.h>
55 49
@@ -58,6 +52,8 @@ typedef void *POINTER;
58 52
59#include "getpagesize.h" 53#include "getpagesize.h"
60 54
55typedef size_t SIZE;
56typedef void *POINTER;
61#define NIL ((POINTER) 0) 57#define NIL ((POINTER) 0)
62 58
63/* A flag to indicate whether we have initialized ralloc yet. For 59/* A flag to indicate whether we have initialized ralloc yet. For
diff --git a/src/regex.c b/src/regex.c
index d16a5148054..f9a12a3c2dc 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -434,17 +434,7 @@ init_syntax_once (void)
434 434
435#endif /* not emacs */ 435#endif /* not emacs */
436 436
437/* We remove any previous definition of `SIGN_EXTEND_CHAR', 437#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
438 since ours (we hope) works properly with all combinations of
439 machines, compilers, `char' and `unsigned char' argument types.
440 (Per Bothner suggested the basic approach.) */
441#undef SIGN_EXTEND_CHAR
442#if __STDC__
443# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
444#else /* not __STDC__ */
445/* As in Harbison and Steele. */
446# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
447#endif
448 438
449/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we 439/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
450 use `alloca' instead of `malloc'. This is because using malloc in 440 use `alloca' instead of `malloc'. This is because using malloc in
@@ -553,12 +543,12 @@ typedef char boolean;
553#define false 0 543#define false 0
554#define true 1 544#define true 1
555 545
556static regoff_t re_match_2_internal _RE_ARGS ((struct re_pattern_buffer *bufp, 546static regoff_t re_match_2_internal (struct re_pattern_buffer *bufp,
557 re_char *string1, size_t size1, 547 re_char *string1, size_t size1,
558 re_char *string2, size_t size2, 548 re_char *string2, size_t size2,
559 ssize_t pos, 549 ssize_t pos,
560 struct re_registers *regs, 550 struct re_registers *regs,
561 ssize_t stop)); 551 ssize_t stop);
562 552
563/* These are the command codes that appear in compiled regular 553/* These are the command codes that appear in compiled regular
564 expressions. Some opcodes are followed by argument bytes. A 554 expressions. Some opcodes are followed by argument bytes. A
@@ -735,11 +725,8 @@ typedef enum
735 } while (0) 725 } while (0)
736 726
737#ifdef DEBUG 727#ifdef DEBUG
738static void extract_number _RE_ARGS ((int *dest, re_char *source));
739static void 728static void
740extract_number (dest, source) 729extract_number (int *dest, re_char *source)
741 int *dest;
742 re_char *source;
743{ 730{
744 int temp = SIGN_EXTEND_CHAR (*(source + 1)); 731 int temp = SIGN_EXTEND_CHAR (*(source + 1));
745 *dest = *source & 0377; 732 *dest = *source & 0377;
@@ -763,12 +750,8 @@ extract_number (dest, source)
763 } while (0) 750 } while (0)
764 751
765#ifdef DEBUG 752#ifdef DEBUG
766static void extract_number_and_incr _RE_ARGS ((int *destination,
767 re_char **source));
768static void 753static void
769extract_number_and_incr (destination, source) 754extract_number_and_incr (int *destination, re_char **source)
770 int *destination;
771 re_char **source;
772{ 755{
773 extract_number (destination, *source); 756 extract_number (destination, *source);
774 *source += 2; 757 *source += 2;
@@ -1672,25 +1655,22 @@ do { \
1672 1655
1673/* Subroutine declarations and macros for regex_compile. */ 1656/* Subroutine declarations and macros for regex_compile. */
1674 1657
1675static reg_errcode_t regex_compile _RE_ARGS ((re_char *pattern, size_t size, 1658static reg_errcode_t regex_compile (re_char *pattern, size_t size,
1676 reg_syntax_t syntax, 1659 reg_syntax_t syntax,
1677 struct re_pattern_buffer *bufp)); 1660 struct re_pattern_buffer *bufp);
1678static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg)); 1661static void store_op1 (re_opcode_t op, unsigned char *loc, int arg);
1679static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, 1662static void store_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2);
1680 int arg1, int arg2)); 1663static void insert_op1 (re_opcode_t op, unsigned char *loc,
1681static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, 1664 int arg, unsigned char *end);
1682 int arg, unsigned char *end)); 1665static void insert_op2 (re_opcode_t op, unsigned char *loc,
1683static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, 1666 int arg1, int arg2, unsigned char *end);
1684 int arg1, int arg2, unsigned char *end)); 1667static boolean at_begline_loc_p (re_char *pattern, re_char *p,
1685static boolean at_begline_loc_p _RE_ARGS ((re_char *pattern, 1668 reg_syntax_t syntax);
1686 re_char *p, 1669static boolean at_endline_loc_p (re_char *p, re_char *pend,
1687 reg_syntax_t syntax)); 1670 reg_syntax_t syntax);
1688static boolean at_endline_loc_p _RE_ARGS ((re_char *p, 1671static re_char *skip_one_char (re_char *p);
1689 re_char *pend, 1672static int analyse_first (re_char *p, re_char *pend,
1690 reg_syntax_t syntax)); 1673 char *fastmap, const int multibyte);
1691static re_char *skip_one_char _RE_ARGS ((re_char *p));
1692static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
1693 char *fastmap, const int multibyte));
1694 1674
1695/* Fetch the next character in the uncompiled pattern, with no 1675/* Fetch the next character in the uncompiled pattern, with no
1696 translation. */ 1676 translation. */
@@ -2442,9 +2422,8 @@ regex_grow_registers (int num_regs)
2442 2422
2443#endif /* not MATCH_MAY_ALLOCATE */ 2423#endif /* not MATCH_MAY_ALLOCATE */
2444 2424
2445static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type 2425static boolean group_in_compile_stack (compile_stack_type compile_stack,
2446 compile_stack, 2426 regnum_t regnum);
2447 regnum_t regnum));
2448 2427
2449/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. 2428/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
2450 Returns one of error codes defined in `regex.h', or zero for success. 2429 Returns one of error codes defined in `regex.h', or zero for success.
@@ -4554,10 +4533,10 @@ WEAK_ALIAS (__re_search_2, re_search_2)
4554 4533
4555/* Declarations and macros for re_match_2. */ 4534/* Declarations and macros for re_match_2. */
4556 4535
4557static int bcmp_translate _RE_ARGS ((re_char *s1, re_char *s2, 4536static int bcmp_translate (re_char *s1, re_char *s2,
4558 register ssize_t len, 4537 register ssize_t len,
4559 RE_TRANSLATE_TYPE translate, 4538 RE_TRANSLATE_TYPE translate,
4560 const int multibyte)); 4539 const int multibyte);
4561 4540
4562/* This converts PTR, a pointer into one of the search strings `string1' 4541/* This converts PTR, a pointer into one of the search strings `string1'
4563 and `string2' into an offset from the beginning of that string. */ 4542 and `string2' into an offset from the beginning of that string. */
diff --git a/src/regex.h b/src/regex.h
index 643d0b7b5ab..e0ede012b20 100644
--- a/src/regex.h
+++ b/src/regex.h
@@ -451,38 +451,21 @@ typedef struct
451 451
452/* Declarations for routines. */ 452/* Declarations for routines. */
453 453
454/* To avoid duplicating every routine declaration -- once with a
455 prototype (if we are ANSI), and once without (if we aren't) -- we
456 use the following macro to declare argument types. This
457 unfortunately clutters up the declarations a bit, but I think it's
458 worth it. */
459
460#if defined __STDC__ || defined PROTOTYPES
461
462# define _RE_ARGS(args) args
463
464#else /* not __STDC__ || PROTOTYPES */
465
466# define _RE_ARGS(args) ()
467
468#endif /* not __STDC__ || PROTOTYPES */
469
470/* Sets the current default syntax to SYNTAX, and return the old syntax. 454/* Sets the current default syntax to SYNTAX, and return the old syntax.
471 You can also simply assign to the `re_syntax_options' variable. */ 455 You can also simply assign to the `re_syntax_options' variable. */
472extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); 456extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
473 457
474/* Compile the regular expression PATTERN, with length LENGTH 458/* Compile the regular expression PATTERN, with length LENGTH
475 and syntax given by the global `re_syntax_options', into the buffer 459 and syntax given by the global `re_syntax_options', into the buffer
476 BUFFER. Return NULL if successful, and an error string if not. */ 460 BUFFER. Return NULL if successful, and an error string if not. */
477extern const char *re_compile_pattern 461extern const char *re_compile_pattern (const char *__pattern, size_t __length,
478 _RE_ARGS ((const char *pattern, size_t length, 462 struct re_pattern_buffer *__buffer);
479 struct re_pattern_buffer *buffer));
480 463
481 464
482/* Compile a fastmap for the compiled pattern in BUFFER; used to 465/* Compile a fastmap for the compiled pattern in BUFFER; used to
483 accelerate searches. Return 0 if successful and -2 if was an 466 accelerate searches. Return 0 if successful and -2 if was an
484 internal error. */ 467 internal error. */
485extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); 468extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
486 469
487 470
488/* Search in the string STRING (with length LENGTH) for the pattern 471/* Search in the string STRING (with length LENGTH) for the pattern
@@ -490,33 +473,35 @@ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
490 characters. Return the starting position of the match, -1 for no 473 characters. Return the starting position of the match, -1 for no
491 match, or -2 for an internal error. Also return register 474 match, or -2 for an internal error. Also return register
492 information in REGS (if REGS and BUFFER->no_sub are nonzero). */ 475 information in REGS (if REGS and BUFFER->no_sub are nonzero). */
493extern regoff_t re_search 476extern regoff_t re_search (struct re_pattern_buffer *__buffer,
494 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 477 const char *__string, size_t __length,
495 size_t length, ssize_t start, ssize_t range, 478 ssize_t __start, ssize_t __range,
496 struct re_registers *regs)); 479 struct re_registers *__regs);
497 480
498 481
499/* Like `re_search', but search in the concatenation of STRING1 and 482/* Like `re_search', but search in the concatenation of STRING1 and
500 STRING2. Also, stop searching at index START + STOP. */ 483 STRING2. Also, stop searching at index START + STOP. */
501extern regoff_t re_search_2 484extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
502 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, 485 const char *__string1, size_t __length1,
503 size_t length1, const char *string2, size_t length2, 486 const char *__string2, size_t __length2,
504 ssize_t start, ssize_t range, struct re_registers *regs, 487 ssize_t __start, ssize_t __range,
505 ssize_t stop)); 488 struct re_registers *__regs,
489 ssize_t __stop);
506 490
507 491
508/* Like `re_search', but return how many characters in STRING the regexp 492/* Like `re_search', but return how many characters in STRING the regexp
509 in BUFFER matched, starting at position START. */ 493 in BUFFER matched, starting at position START. */
510extern regoff_t re_match 494extern regoff_t re_match (struct re_pattern_buffer *__buffer,
511 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, 495 const char *__string, size_t __length,
512 size_t length, ssize_t start, struct re_registers *regs)); 496 ssize_t __start, struct re_registers *__regs);
513 497
514 498
515/* Relates to `re_match' as `re_search_2' relates to `re_search'. */ 499/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
516extern regoff_t re_match_2 500extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
517 _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, 501 const char *__string1, size_t __length1,
518 size_t length1, const char *string2, size_t length2, 502 const char *__string2, size_t __length2,
519 ssize_t start, struct re_registers *regs, ssize_t stop)); 503 ssize_t __start, struct re_registers *__regs,
504 ssize_t __stop);
520 505
521 506
522/* Set REGS to hold NUM_REGS registers, storing them in STARTS and 507/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
@@ -531,15 +516,16 @@ extern regoff_t re_match_2
531 Unless this function is called, the first search or match using 516 Unless this function is called, the first search or match using
532 PATTERN_BUFFER will allocate its own register data, without 517 PATTERN_BUFFER will allocate its own register data, without
533 freeing the old data. */ 518 freeing the old data. */
534extern void re_set_registers 519extern void re_set_registers (struct re_pattern_buffer *__buffer,
535 _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, 520 struct re_registers *__regs,
536 unsigned num_regs, regoff_t *starts, regoff_t *ends)); 521 unsigned __num_regs,
522 regoff_t *__starts, regoff_t *__ends);
537 523
538#if defined _REGEX_RE_COMP || defined _LIBC 524#if defined _REGEX_RE_COMP || defined _LIBC
539# ifndef _CRAY 525# ifndef _CRAY
540/* 4.2 bsd compatibility. */ 526/* 4.2 bsd compatibility. */
541extern char *re_comp _RE_ARGS ((const char *)); 527extern char *re_comp (const char *);
542extern int re_exec _RE_ARGS ((const char *)); 528extern int re_exec (const char *);
543# endif 529# endif
544#endif 530#endif
545 531
@@ -562,20 +548,19 @@ extern int re_exec _RE_ARGS ((const char *));
562#endif 548#endif
563 549
564/* POSIX compatibility. */ 550/* POSIX compatibility. */
565extern reg_errcode_t regcomp _RE_ARGS ((regex_t *__restrict __preg, 551extern reg_errcode_t regcomp (regex_t *__restrict __preg,
566 const char *__restrict __pattern, 552 const char *__restrict __pattern,
567 int __cflags)); 553 int __cflags);
568 554
569extern reg_errcode_t regexec _RE_ARGS ((const regex_t *__restrict __preg, 555extern reg_errcode_t regexec (const regex_t *__restrict __preg,
570 const char *__restrict __string, 556 const char *__restrict __string, size_t __nmatch,
571 size_t __nmatch, 557 regmatch_t __pmatch[__restrict_arr],
572 regmatch_t __pmatch[__restrict_arr], 558 int __eflags);
573 int __eflags));
574 559
575extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg, 560extern size_t regerror (int __errcode, const regex_t * __preg,
576 char *__errbuf, size_t __errbuf_size)); 561 char *__errbuf, size_t __errbuf_size);
577 562
578extern void regfree _RE_ARGS ((regex_t *__preg)); 563extern void regfree (regex_t *__preg);
579 564
580 565
581#ifdef __cplusplus 566#ifdef __cplusplus
diff --git a/src/sysdep.c b/src/sysdep.c
index 81529fc7d9b..6d1ed3aeb86 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -52,9 +52,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
52#define read sys_read 52#define read sys_read
53#define write sys_write 53#define write sys_write
54#include <windows.h> 54#include <windows.h>
55#ifndef NULL
56#define NULL 0
57#endif
58#endif /* not WINDOWSNT */ 55#endif /* not WINDOWSNT */
59 56
60#include <sys/types.h> 57#include <sys/types.h>
diff --git a/src/termcap.c b/src/termcap.c
index 10c195eebe2..61f9d9a31ea 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -30,10 +30,6 @@ Boston, MA 02110-1301, USA. */
30#include "msdos.h" 30#include "msdos.h"
31#endif 31#endif
32 32
33#ifndef NULL
34#define NULL (char *) 0
35#endif
36
37/* BUFSIZE is the initial size allocated for the buffer 33/* BUFSIZE is the initial size allocated for the buffer
38 for reading the termcap file. 34 for reading the termcap file.
39 It is not a limit. 35 It is not a limit.
@@ -661,10 +657,6 @@ gobble_line (int fd, register struct termcap_buffer *bufp, char *append_end)
661 657
662#ifdef TEST 658#ifdef TEST
663 659
664#ifdef NULL
665#undef NULL
666#endif
667
668#include <stdio.h> 660#include <stdio.h>
669 661
670static void 662static void
diff --git a/src/textprop.c b/src/textprop.c
index 688b32eb4ec..1e5e4577a00 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -23,10 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include "buffer.h" 23#include "buffer.h"
24#include "window.h" 24#include "window.h"
25 25
26#ifndef NULL
27#define NULL (void *)0
28#endif
29
30/* Test for membership, allowing for t (actually any non-cons) to mean the 26/* Test for membership, allowing for t (actually any non-cons) to mean the
31 universal set. */ 27 universal set. */
32 28
diff --git a/src/tparam.c b/src/tparam.c
index ac21667d65b..4d26ef524fb 100644
--- a/src/tparam.c
+++ b/src/tparam.c
@@ -22,10 +22,6 @@ Boston, MA 02110-1301, USA. */
22#include <setjmp.h> 22#include <setjmp.h>
23#include "lisp.h" /* for xmalloc */ 23#include "lisp.h" /* for xmalloc */
24#include "tparam.h" 24#include "tparam.h"
25
26#ifndef NULL
27#define NULL (char *) 0
28#endif
29 25
30/* Assuming STRING is the value of a termcap string entry 26/* Assuming STRING is the value of a termcap string entry
31 containing `%' constructs to expand parameters, 27 containing `%' constructs to expand parameters,
diff --git a/src/unexelf.c b/src/unexelf.c
index ac9c9e75764..f35b53aeab3 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -506,11 +506,7 @@ typedef struct {
506#endif 506#endif
507 507
508#ifndef ElfW 508#ifndef ElfW
509# ifdef __STDC__ 509# define ElfBitsW(bits, type) Elf##bits##_##type
510# define ElfBitsW(bits, type) Elf##bits##_##type
511# else
512# define ElfBitsW(bits, type) Elf/**/bits/**/_/**/type
513# endif
514# ifdef _LP64 510# ifdef _LP64
515# define ELFSIZE 64 511# define ELFSIZE 64
516# else 512# else
diff --git a/src/vm-limit.c b/src/vm-limit.c
index 94725044048..c313a900f2c 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -31,7 +31,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31enum warnlevel { not_warned, warned_75, warned_85, warned_95 }; 31enum warnlevel { not_warned, warned_75, warned_85, warned_95 };
32static enum warnlevel warnlevel; 32static enum warnlevel warnlevel;
33 33
34typedef POINTER_TYPE *POINTER; 34typedef void *POINTER;
35 35
36/* Function to call to issue a warning; 36/* Function to call to issue a warning;
37 0 means don't issue them. */ 37 0 means don't issue them. */
diff --git a/src/xterm.c b/src/xterm.c
index 02fa137d6a7..d030df55748 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -256,11 +256,7 @@ static Time last_user_time;
256/* Incremented by XTread_socket whenever it really tries to read 256/* Incremented by XTread_socket whenever it really tries to read
257 events. */ 257 events. */
258 258
259#ifdef __STDC__
260static int volatile input_signal_count; 259static int volatile input_signal_count;
261#else
262static int input_signal_count;
263#endif
264 260
265/* Used locally within XTread_socket. */ 261/* Used locally within XTread_socket. */
266 262