OSDN Git Service

* lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Sep 1999 22:33:10 +0000 (22:33 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Sep 1999 22:33:10 +0000 (22:33 +0000)
* xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29464 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/lex.c
gcc/cp/xref.c

index b88a629..7603401 100644 (file)
@@ -1,3 +1,9 @@
+1999-09-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero.
+
+       * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy.
+
 1999-09-16  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl2.c (finish_file): Also call check_global_declarations for
index 77b5e3c..e1a0c09 100644 (file)
@@ -508,11 +508,9 @@ init_cpp_parse ()
 {
 #ifdef GATHER_STATISTICS
 #ifdef REDUCE_LENGTH
-  reduce_count = (int *)malloc (sizeof (int) * (REDUCE_LENGTH + 1));
-  bzero (reduce_count, sizeof (int) * (REDUCE_LENGTH + 1));
+  reduce_count = (int *) xcalloc (sizeof (int), (REDUCE_LENGTH + 1));
   reduce_count += 1;
-  token_count = (int *)malloc (sizeof (int) * (TOKEN_LENGTH + 1));
-  bzero (token_count, sizeof (int) * (TOKEN_LENGTH + 1));
+  token_count = (int *) xcalloc (sizeof (int), (TOKEN_LENGTH + 1));
   token_count += 1;
 #endif
 #endif
index cd6cb85..5c6e7b7 100644 (file)
@@ -60,9 +60,7 @@ int flag_gnu_xref;
 
 
 /* Return a malloc'd copy of STR.  */
-#define SALLOC(str) \
- ((char *) ((str) == NULL ? NULL       \
-           : (char *) strcpy ((char *) xmalloc (strlen ((str)) + 1), (str))))
+#define SALLOC(str) ((char *) ((str) == NULL ? NULL : xstrdup (str)))
 #define SFREE(str) (str != NULL && (free(str),0))
 
 #define STREQL(s1,s2) (strcmp((s1),(s2)) == 0)