diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/etags.c | 28 |
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 @@ | |||
| 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; |