aboutsummaryrefslogtreecommitdiffstats
path: root/lib-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 /lib-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 'lib-src')
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/etags.c28
2 files changed, 12 insertions, 22 deletions
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 @@
12012-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
12012-05-21 Glenn Morris <rgm@gnu.org> 72012-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);
415static void canonicalize_filename (char *); 399static void canonicalize_filename (char *);
416static void linebuffer_init (linebuffer *); 400static void linebuffer_init (linebuffer *);
417static void linebuffer_setlen (linebuffer *, int); 401static void linebuffer_setlen (linebuffer *, int);
418static PTR xmalloc (size_t); 402static void *xmalloc (size_t);
419static PTR xrealloc (char *, size_t); 403static void *xrealloc (char *, size_t);
420 404
421 405
422static char searchar = '/'; /* use /.../ searches */ 406static 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. */
6689static PTR 6673static void *
6690xmalloc (size_t size) 6674xmalloc (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
6698static PTR 6682static void *
6699xrealloc (char *ptr, size_t size) 6683xrealloc (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;