emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 84c7c6f: Port etags to -DDEBUG


From: Paul Eggert
Subject: [Emacs-diffs] master 84c7c6f: Port etags to -DDEBUG
Date: Fri, 27 Mar 2015 18:15:10 +0000

branch: master
commit 84c7c6fd2b9604fa28e0b834caa46423114b9c5b
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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 *.
---
 lib-src/ChangeLog |   11 +++++++++++
 lib-src/etags.c   |   17 ++++-------------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 9786809..0bb24c3 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,14 @@
+2015-03-27  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        Random minor fixes for movemail
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 7f18755..b1361db 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -176,17 +176,8 @@ char pot_etags_version[] = "@(#) pot revision number is 
17.38.1.4";
  * 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 *);
 
@@ -348,7 +339,7 @@ static void canonicalize_filename (char *);
 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);
 
 
 static char searchar = '/';    /* use /.../ searches */
@@ -6533,7 +6524,7 @@ xmalloc (size_t size)
 }
 
 static void *
-xrealloc (char *ptr, size_t size)
+xrealloc (void *ptr, size_t size)
 {
   void *result = realloc (ptr, size);
   if (result == NULL)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]