diff options
| author | Paul Eggert | 2012-05-21 08:36:54 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-05-21 08:36:54 -0700 |
| commit | 261cb4bb750143d8078bb27a343e0d9560b884df (patch) | |
| tree | 0d295abf946d52c178be2f7b95e85bfcc5fc63cc | |
| parent | ff23cd9f452b6d2b5001a67d7b14e0af7f61b194 (diff) | |
| download | emacs-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.
| -rw-r--r-- | ChangeLog | 14 | ||||
| -rw-r--r-- | admin/CPP-DEFINES | 2 | ||||
| -rw-r--r-- | admin/ChangeLog | 3 | ||||
| -rw-r--r-- | configure.in | 25 | ||||
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/etags.c | 28 | ||||
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/alloc.c | 56 | ||||
| -rw-r--r-- | src/buffer.c | 50 | ||||
| -rw-r--r-- | src/editfns.c | 4 | ||||
| -rw-r--r-- | src/fns.c | 4 | ||||
| -rw-r--r-- | src/gmalloc.c | 4 | ||||
| -rw-r--r-- | src/insdel.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 8 | ||||
| -rw-r--r-- | src/ralloc.c | 8 | ||||
| -rw-r--r-- | src/regex.c | 83 | ||||
| -rw-r--r-- | src/regex.h | 91 | ||||
| -rw-r--r-- | src/sysdep.c | 3 | ||||
| -rw-r--r-- | src/termcap.c | 8 | ||||
| -rw-r--r-- | src/textprop.c | 4 | ||||
| -rw-r--r-- | src/tparam.c | 4 | ||||
| -rw-r--r-- | src/unexelf.c | 6 | ||||
| -rw-r--r-- | src/vm-limit.c | 2 | ||||
| -rw-r--r-- | src/xterm.c | 4 |
24 files changed, 169 insertions, 267 deletions
| @@ -1,10 +1,9 @@ | |||
| 1 | 2012-05-21 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * configure.in (LEIM_INSTALLDIR): | ||
| 4 | Rename to leimdir, treat like lispdir. | ||
| 5 | |||
| 6 | 2012-05-21 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-05-21 Paul Eggert <eggert@cs.ucla.edu> |
| 7 | 2 | ||
| 3 | Assume C89 or later. | ||
| 4 | * configure.in (AC_C_PROTOTYPES, AC_C_VOLATILE, AC_C_CONST) | ||
| 5 | (POINTER_TYPE, PROTOTYPES): Remove. | ||
| 6 | |||
| 8 | Make merging from gnulib a script, not a makefile action. | 7 | Make merging from gnulib a script, not a makefile action. |
| 9 | Putting it in a makefile has some problems with reflection, as | 8 | Putting it in a makefile has some problems with reflection, as |
| 10 | merging from gnulib updates 'configure', which can update the makefile. | 9 | merging from gnulib updates 'configure', which can update the makefile. |
| @@ -15,6 +14,11 @@ | |||
| 15 | 14 | ||
| 16 | 2012-05-21 Glenn Morris <rgm@gnu.org> | 15 | 2012-05-21 Glenn Morris <rgm@gnu.org> |
| 17 | 16 | ||
| 17 | * configure.in (LEIM_INSTALLDIR): | ||
| 18 | Rename to leimdir, treat like lispdir. | ||
| 19 | |||
| 20 | 2012-05-21 Glenn Morris <rgm@gnu.org> | ||
| 21 | |||
| 18 | * Makefile.in (install-arch-indep, install-doc, install-info) | 22 | * Makefile.in (install-arch-indep, install-doc, install-info) |
| 19 | (uninstall): Scrap superfluous subshells. | 23 | (uninstall): Scrap superfluous subshells. |
| 20 | 24 | ||
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 71ba4bf8ece..d736f2354f7 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -201,7 +201,6 @@ NO_MATHERR | |||
| 201 | NO_TERMIO | 201 | NO_TERMIO |
| 202 | NSIG | 202 | NSIG |
| 203 | NSIG_MINIMUM | 203 | NSIG_MINIMUM |
| 204 | NULL | ||
| 205 | NULL_DEVICE | 204 | NULL_DEVICE |
| 206 | ORDINARY_LINK | 205 | ORDINARY_LINK |
| 207 | O_APPEND | 206 | O_APPEND |
| @@ -272,7 +271,6 @@ chdir | |||
| 272 | chmod | 271 | chmod |
| 273 | chown | 272 | chown |
| 274 | close | 273 | close |
| 275 | const | ||
| 276 | creat | 274 | creat |
| 277 | ctime | 275 | ctime |
| 278 | dup | 276 | dup |
diff --git a/admin/ChangeLog b/admin/ChangeLog index 86069da7f0b..1da647a803d 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-05-21 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-05-21 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Assume C89 or later. | ||
| 4 | * CPP-DEFINES: Remove NULL, const. | ||
| 5 | |||
| 3 | Make merging from gnulib a script, not a makefile action. | 6 | Make merging from gnulib a script, not a makefile action. |
| 4 | * merge-gnulib: New script, with actions moved here from | 7 | * merge-gnulib: New script, with actions moved here from |
| 5 | ../Makefile.in. | 8 | ../Makefile.in. |
diff --git a/configure.in b/configure.in index ab11b9d6431..eb5e8482e9b 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -1355,27 +1355,6 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_flags, struct ifreq.ifr_hwaddr, | |||
| 1355 | #include <net/if.h> | 1355 | #include <net/if.h> |
| 1356 | #endif]) | 1356 | #endif]) |
| 1357 | 1357 | ||
| 1358 | dnl checks for compiler characteristics | ||
| 1359 | |||
| 1360 | dnl Testing __STDC__ to determine prototype support isn't good enough. | ||
| 1361 | dnl DEC C, for instance, doesn't define it with default options, and | ||
| 1362 | dnl is used on 64-bit systems (OSF Alphas). Similarly for volatile | ||
| 1363 | dnl and void *. | ||
| 1364 | AC_C_PROTOTYPES | ||
| 1365 | AC_C_VOLATILE | ||
| 1366 | AC_C_CONST | ||
| 1367 | AC_CACHE_CHECK([for void * support], emacs_cv_void_star, | ||
| 1368 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void * foo;]])], | ||
| 1369 | emacs_cv_void_star=yes, emacs_cv_void_star=no)]) | ||
| 1370 | if test $emacs_cv_void_star = yes; then | ||
| 1371 | AC_DEFINE(POINTER_TYPE, void) | ||
| 1372 | else | ||
| 1373 | AC_DEFINE(POINTER_TYPE, char) | ||
| 1374 | fi | ||
| 1375 | AH_TEMPLATE(POINTER_TYPE, | ||
| 1376 | [Define as `void' if your compiler accepts `void *'; otherwise | ||
| 1377 | define as `char'.])dnl | ||
| 1378 | |||
| 1379 | dnl Check for endianness. | 1358 | dnl Check for endianness. |
| 1380 | AC_C_BIGENDIAN | 1359 | AC_C_BIGENDIAN |
| 1381 | 1360 | ||
| @@ -3663,10 +3642,6 @@ AH_BOTTOM([ | |||
| 3663 | #define BITS_PER_LONG_LONG 64 | 3642 | #define BITS_PER_LONG_LONG 64 |
| 3664 | #endif | 3643 | #endif |
| 3665 | 3644 | ||
| 3666 | /* Define if the compiler supports function prototypes. It may do so but | ||
| 3667 | not define __STDC__ (e.g. DEC C by default) or may define it as zero. */ | ||
| 3668 | #undef PROTOTYPES | ||
| 3669 | |||
| 3670 | #include <string.h> | 3645 | #include <string.h> |
| 3671 | #include <stdlib.h> | 3646 | #include <stdlib.h> |
| 3672 | 3647 | ||
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 1b4cd548a99..c3ddc9bfbab 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-05-21 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Assume C89 or later. | ||
| 4 | * etags.c (static, const): Remove macros. | ||
| 5 | (PTR): Remove; all uses replaced with void *. Omit needless casts. | ||
| 6 | |||
| 1 | 2012-05-21 Glenn Morris <rgm@gnu.org> | 7 | 2012-05-21 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * Makefile.in (insrcdir, $(DESTDIR)${archlibdir}): | 9 | * Makefile.in (insrcdir, $(DESTDIR)${archlibdir}): |
diff --git a/lib-src/etags.c b/lib-src/etags.c index ccf97a8357f..7d2a5a90999 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -93,22 +93,6 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4"; | |||
| 93 | 93 | ||
| 94 | #ifdef HAVE_CONFIG_H | 94 | #ifdef HAVE_CONFIG_H |
| 95 | # include <config.h> | 95 | # include <config.h> |
| 96 | /* This is probably not necessary any more. On some systems, config.h | ||
| 97 | used to define static as nothing for the sake of unexec. We don't | ||
| 98 | want that here since we don't use unexec. None of these systems | ||
| 99 | are supported any more, but the idea is still mentioned in | ||
| 100 | etc/PROBLEMS. */ | ||
| 101 | # undef static | ||
| 102 | # ifndef PTR /* for XEmacs */ | ||
| 103 | # define PTR void * | ||
| 104 | # endif | ||
| 105 | #else /* no config.h */ | ||
| 106 | # if defined (__STDC__) && (__STDC__ || defined (__SUNPRO_C)) | ||
| 107 | # define PTR void * /* for generic pointers */ | ||
| 108 | # else /* not standard C */ | ||
| 109 | # define const /* remove const for old compilers' sake */ | ||
| 110 | # define PTR long * /* don't use void* */ | ||
| 111 | # endif | ||
| 112 | #endif /* !HAVE_CONFIG_H */ | 96 | #endif /* !HAVE_CONFIG_H */ |
| 113 | 97 | ||
| 114 | #ifndef _GNU_SOURCE | 98 | #ifndef _GNU_SOURCE |
| @@ -415,8 +399,8 @@ static bool filename_is_absolute (char *f); | |||
| 415 | static void canonicalize_filename (char *); | 399 | static void canonicalize_filename (char *); |
| 416 | static void linebuffer_init (linebuffer *); | 400 | static void linebuffer_init (linebuffer *); |
| 417 | static void linebuffer_setlen (linebuffer *, int); | 401 | static void linebuffer_setlen (linebuffer *, int); |
| 418 | static PTR xmalloc (size_t); | 402 | static void *xmalloc (size_t); |
| 419 | static PTR xrealloc (char *, size_t); | 403 | static void *xrealloc (char *, size_t); |
| 420 | 404 | ||
| 421 | 405 | ||
| 422 | static char searchar = '/'; /* use /.../ searches */ | 406 | static char searchar = '/'; /* use /.../ searches */ |
| @@ -6686,19 +6670,19 @@ linebuffer_setlen (linebuffer *lbp, int toksize) | |||
| 6686 | } | 6670 | } |
| 6687 | 6671 | ||
| 6688 | /* Like malloc but get fatal error if memory is exhausted. */ | 6672 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 6689 | static PTR | 6673 | static void * |
| 6690 | xmalloc (size_t size) | 6674 | xmalloc (size_t size) |
| 6691 | { | 6675 | { |
| 6692 | PTR result = (PTR) malloc (size); | 6676 | void *result = malloc (size); |
| 6693 | if (result == NULL) | 6677 | if (result == NULL) |
| 6694 | fatal ("virtual memory exhausted", (char *)NULL); | 6678 | fatal ("virtual memory exhausted", (char *)NULL); |
| 6695 | return result; | 6679 | return result; |
| 6696 | } | 6680 | } |
| 6697 | 6681 | ||
| 6698 | static PTR | 6682 | static void * |
| 6699 | xrealloc (char *ptr, size_t size) | 6683 | xrealloc (char *ptr, size_t size) |
| 6700 | { | 6684 | { |
| 6701 | PTR result = (PTR) realloc (ptr, size); | 6685 | void *result = realloc (ptr, size); |
| 6702 | if (result == NULL) | 6686 | if (result == NULL) |
| 6703 | fatal ("virtual memory exhausted", (char *)NULL); | 6687 | fatal ("virtual memory exhausted", (char *)NULL); |
| 6704 | return result; | 6688 | return result; |
diff --git a/src/ChangeLog b/src/ChangeLog index b9e91d308cc..3054f4a284f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-05-21 Ken Brown <kbrown@cornell.edu> | 16 | 2012-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 |
| 69 | extern POINTER_TYPE *sbrk (); | 69 | extern 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 | ||
| 309 | static POINTER_TYPE *lisp_malloc (size_t, enum mem_type); | 309 | static 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 | ||
| 390 | static struct Lisp_Vector *allocate_vectorlike (EMACS_INT); | 390 | static struct Lisp_Vector *allocate_vectorlike (EMACS_INT); |
| 391 | static void lisp_free (POINTER_TYPE *); | 391 | static void lisp_free (void *); |
| 392 | static void mark_stack (void); | 392 | static void mark_stack (void); |
| 393 | static int live_vector_p (struct mem_node *, void *); | 393 | static int live_vector_p (struct mem_node *, void *); |
| 394 | static int live_buffer_p (struct mem_node *, void *); | 394 | static int live_buffer_p (struct mem_node *, void *); |
| @@ -435,15 +435,15 @@ static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag}; | |||
| 435 | 435 | ||
| 436 | static int staticidx = 0; | 436 | static int staticidx = 0; |
| 437 | 437 | ||
| 438 | static POINTER_TYPE *pure_alloc (size_t, int); | 438 | static 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 | ||
| 607 | static POINTER_TYPE * | 607 | static void * |
| 608 | overrun_check_malloc (size_t size) | 608 | overrun_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 | ||
| 632 | static POINTER_TYPE * | 632 | static void * |
| 633 | overrun_check_realloc (POINTER_TYPE *block, size_t size) | 633 | overrun_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 | ||
| 671 | static void | 671 | static void |
| 672 | overrun_check_free (POINTER_TYPE *block) | 672 | overrun_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 | ||
| 721 | POINTER_TYPE * | 721 | void * |
| 722 | xmalloc (size_t size) | 722 | xmalloc (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 | ||
| 738 | POINTER_TYPE * | 738 | void * |
| 739 | xrealloc (POINTER_TYPE *block, size_t size) | 739 | xrealloc (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 | ||
| 760 | void | 760 | void |
| 761 | xfree (POINTER_TYPE *block) | 761 | xfree (void *block) |
| 762 | { | 762 | { |
| 763 | if (!block) | 763 | if (!block) |
| 764 | return; | 764 | return; |
| @@ -893,7 +893,7 @@ safe_alloca_unwind (Lisp_Object arg) | |||
| 893 | static void *lisp_malloc_loser; | 893 | static void *lisp_malloc_loser; |
| 894 | #endif | 894 | #endif |
| 895 | 895 | ||
| 896 | static POINTER_TYPE * | 896 | static void * |
| 897 | lisp_malloc (size_t nbytes, enum mem_type type) | 897 | lisp_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 | ||
| 940 | static void | 940 | static void |
| 941 | lisp_free (POINTER_TYPE *block) | 941 | lisp_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. */ |
| 1037 | static POINTER_TYPE * | 1037 | static void * |
| 1038 | lisp_align_malloc (size_t nbytes, enum mem_type type) | 1038 | lisp_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 | ||
| 1143 | static void | 1143 | static void |
| 1144 | lisp_align_free (POINTER_TYPE *block) | 1144 | lisp_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 | ||
| 4725 | static POINTER_TYPE * | 4725 | static void * |
| 4726 | pure_alloc (size_t size, int type) | 4726 | pure_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 == ¤t_buffer->own_text); | 2051 | eassert (current_buffer->text == ¤t_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 **) ¤t_buffer->own_text.beg, | 2054 | r_alloc_reset_variable ((void **) ¤t_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 **) ¤t_buffer->own_text.beg); | 2057 | (void **) ¤t_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 | ||
| 4481 | static struct mmap_region * | 4481 | static struct mmap_region * |
| 4482 | mmap_find (POINTER_TYPE *start, POINTER_TYPE *end) | 4482 | mmap_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 | ||
| 4630 | static POINTER_TYPE * | 4630 | static void * |
| 4631 | mmap_alloc (POINTER_TYPE **var, size_t nbytes) | 4631 | mmap_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 | ||
| 4671 | static void | 4671 | static void |
| 4672 | mmap_free (POINTER_TYPE **var) | 4672 | mmap_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 | ||
| 4689 | static POINTER_TYPE * | 4689 | static void * |
| 4690 | mmap_realloc (POINTER_TYPE **var, size_t nbytes) | 4690 | mmap_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) | |||
| 4770 | static void | 4770 | static void |
| 4771 | alloc_buffer_text (struct buffer *b, ptrdiff_t nbytes) | 4771 | alloc_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) | |||
| 4797 | void | 4797 | void |
| 4798 | enlarge_buffer_text (struct buffer *b, EMACS_INT delta) | 4798 | enlarge_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 |
| @@ -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 | |||
| 49 | Lisp_Object Qstring_lessp; | 45 | Lisp_Object Qstring_lessp; |
| 50 | static Lisp_Object Qprovide, Qrequire; | 46 | static Lisp_Object Qprovide, Qrequire; |
| 51 | static Lisp_Object Qyes_or_no_p_history; | 47 | static 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. */ | |||
| 1531 | extern void *__sbrk (ptrdiff_t increment); | 1531 | extern 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 | |||
| 38 | static void insert_from_string_1 (Lisp_Object string, | 34 | static 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 *, | |||
| 2780 | extern void syms_of_xsettings (void); | 2780 | extern void syms_of_xsettings (void); |
| 2781 | 2781 | ||
| 2782 | /* Defined in vm-limit.c. */ | 2782 | /* Defined in vm-limit.c. */ |
| 2783 | extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *)); | 2783 | extern void memory_warnings (void *, void (*warnfun) (const char *)); |
| 2784 | 2784 | ||
| 2785 | /* Defined in alloc.c */ | 2785 | /* Defined in alloc.c */ |
| 2786 | extern void check_pure_size (void); | 2786 | extern void check_pure_size (void); |
| @@ -3597,9 +3597,9 @@ extern int initialized; | |||
| 3597 | 3597 | ||
| 3598 | extern int immediate_quit; /* Nonzero means ^G can quit instantly */ | 3598 | extern int immediate_quit; /* Nonzero means ^G can quit instantly */ |
| 3599 | 3599 | ||
| 3600 | extern POINTER_TYPE *xmalloc (size_t); | 3600 | extern void *xmalloc (size_t); |
| 3601 | extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t); | 3601 | extern void *xrealloc (void *, size_t); |
| 3602 | extern void xfree (POINTER_TYPE *); | 3602 | extern void xfree (void *); |
| 3603 | extern void *xnmalloc (ptrdiff_t, ptrdiff_t); | 3603 | extern void *xnmalloc (ptrdiff_t, ptrdiff_t); |
| 3604 | extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t); | 3604 | extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t); |
| 3605 | extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t); | 3605 | extern 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 | ||
| 34 | typedef POINTER_TYPE *POINTER; | ||
| 35 | typedef 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 |
| 39 | extern int mallopt (int, int); | 36 | extern 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 | ||
| 50 | typedef size_t SIZE; | ||
| 51 | typedef 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 | ||
| 55 | typedef size_t SIZE; | ||
| 56 | typedef 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 | ||
| 556 | static regoff_t re_match_2_internal _RE_ARGS ((struct re_pattern_buffer *bufp, | 546 | static 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 |
| 738 | static void extract_number _RE_ARGS ((int *dest, re_char *source)); | ||
| 739 | static void | 728 | static void |
| 740 | extract_number (dest, source) | 729 | extract_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 |
| 766 | static void extract_number_and_incr _RE_ARGS ((int *destination, | ||
| 767 | re_char **source)); | ||
| 768 | static void | 753 | static void |
| 769 | extract_number_and_incr (destination, source) | 754 | extract_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 | ||
| 1675 | static reg_errcode_t regex_compile _RE_ARGS ((re_char *pattern, size_t size, | 1658 | static 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); |
| 1678 | static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg)); | 1661 | static void store_op1 (re_opcode_t op, unsigned char *loc, int arg); |
| 1679 | static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, | 1662 | static void store_op2 (re_opcode_t op, unsigned char *loc, int arg1, int arg2); |
| 1680 | int arg1, int arg2)); | 1663 | static void insert_op1 (re_opcode_t op, unsigned char *loc, |
| 1681 | static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, | 1664 | int arg, unsigned char *end); |
| 1682 | int arg, unsigned char *end)); | 1665 | static void insert_op2 (re_opcode_t op, unsigned char *loc, |
| 1683 | static 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)); | 1667 | static boolean at_begline_loc_p (re_char *pattern, re_char *p, |
| 1685 | static boolean at_begline_loc_p _RE_ARGS ((re_char *pattern, | 1668 | reg_syntax_t syntax); |
| 1686 | re_char *p, | 1669 | static boolean at_endline_loc_p (re_char *p, re_char *pend, |
| 1687 | reg_syntax_t syntax)); | 1670 | reg_syntax_t syntax); |
| 1688 | static boolean at_endline_loc_p _RE_ARGS ((re_char *p, | 1671 | static re_char *skip_one_char (re_char *p); |
| 1689 | re_char *pend, | 1672 | static int analyse_first (re_char *p, re_char *pend, |
| 1690 | reg_syntax_t syntax)); | 1673 | char *fastmap, const int multibyte); |
| 1691 | static re_char *skip_one_char _RE_ARGS ((re_char *p)); | ||
| 1692 | static 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 | ||
| 2445 | static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type | 2425 | static 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 | ||
| 4557 | static int bcmp_translate _RE_ARGS ((re_char *s1, re_char *s2, | 4536 | static 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. */ |
| 472 | extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); | 456 | extern 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. */ |
| 477 | extern const char *re_compile_pattern | 461 | extern 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. */ |
| 485 | extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); | 468 | extern 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). */ |
| 493 | extern regoff_t re_search | 476 | extern 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. */ |
| 501 | extern regoff_t re_search_2 | 484 | extern 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. */ |
| 510 | extern regoff_t re_match | 494 | extern 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'. */ |
| 516 | extern regoff_t re_match_2 | 500 | extern 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. */ |
| 534 | extern void re_set_registers | 519 | extern 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. */ |
| 541 | extern char *re_comp _RE_ARGS ((const char *)); | 527 | extern char *re_comp (const char *); |
| 542 | extern int re_exec _RE_ARGS ((const char *)); | 528 | extern 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. */ |
| 565 | extern reg_errcode_t regcomp _RE_ARGS ((regex_t *__restrict __preg, | 551 | extern 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 | ||
| 569 | extern reg_errcode_t regexec _RE_ARGS ((const regex_t *__restrict __preg, | 555 | extern 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 | ||
| 575 | extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg, | 560 | extern 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 | ||
| 578 | extern void regfree _RE_ARGS ((regex_t *__preg)); | 563 | extern 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 | ||
| 670 | static void | 662 | static 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/>. */ | |||
| 31 | enum warnlevel { not_warned, warned_75, warned_85, warned_95 }; | 31 | enum warnlevel { not_warned, warned_75, warned_85, warned_95 }; |
| 32 | static enum warnlevel warnlevel; | 32 | static enum warnlevel warnlevel; |
| 33 | 33 | ||
| 34 | typedef POINTER_TYPE *POINTER; | 34 | typedef 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__ | ||
| 260 | static int volatile input_signal_count; | 259 | static int volatile input_signal_count; |
| 261 | #else | ||
| 262 | static int input_signal_count; | ||
| 263 | #endif | ||
| 264 | 260 | ||
| 265 | /* Used locally within XTread_socket. */ | 261 | /* Used locally within XTread_socket. */ |
| 266 | 262 | ||