+2015-03-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port etags to -DDEBUG
+ * etags.c (xnew, xrnew) [DEBUG]: Don't include chkmalloc.h, which
+ is not part of Emacs and is typically not installed.
+ Instead, just invoke xmalloc and xrealloc as usual.
+ Problem reported by Nicolas Richard in:
+ http://bugs.gnu.org/20191#20
+ (xrnew): Avoid no-longer-needed cast to 'char *'.
+ (xrealloc): First arg is now void *, not char *.
+
2015-03-06 Paul Eggert <eggert@cs.ucla.edu>
Random minor fixes for movemail
* SYNOPSIS: Type *xnew (int n, Type);
* void xrnew (OldPointer, int n, Type);
*/
-#if DEBUG
-# include "chkmalloc.h"
-# define xnew(n,Type) ((Type *) trace_malloc (__FILE__, __LINE__, \
- (n) * sizeof (Type)))
-# define xrnew(op,n,Type) ((op) = (Type *) trace_realloc (__FILE__, __LINE__, \
- (char *) (op), (n) * sizeof (Type)))
-#else
-# define xnew(n,Type) ((Type *) xmalloc ((n) * sizeof (Type)))
-# define xrnew(op,n,Type) ((op) = (Type *) xrealloc ( \
- (char *) (op), (n) * sizeof (Type)))
-#endif
+#define xnew(n, Type) ((Type *) xmalloc ((n) * sizeof (Type)))
+#define xrnew(op, n, Type) ((op) = (Type *) xrealloc (op, (n) * sizeof (Type)))
typedef void Lang_function (FILE *);
static void linebuffer_init (linebuffer *);
static void linebuffer_setlen (linebuffer *, int);
static void *xmalloc (size_t);
-static void *xrealloc (char *, size_t);
+static void *xrealloc (void *, size_t);
\f
static char searchar = '/'; /* use /.../ searches */
}
static void *
-xrealloc (char *ptr, size_t size)
+xrealloc (void *ptr, size_t size)
{
void *result = realloc (ptr, size);
if (result == NULL)