[SCM] GNU M4 source repository branch, branch-1_4, updated. v1.4.10b-10-gfb8ad0c

"Eric Blake" <[email protected]>
Newsgroups gmane.comp.gnu.m4.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU M4 source repository".

http://git.sv.gnu.org/gitweb/?p=m4.git;a=commitdiff;h=fb8ad0c1e45abc64d8588dc812023a7ecfd8d269

The branch, branch-1_4 has been updated
       via  fb8ad0c1e45abc64d8588dc812023a7ecfd8d269 (commit)
      from  c702fdb4cb9ed26f3d75dc46240bfecdb9d6c1bd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fb8ad0c1e45abc64d8588dc812023a7ecfd8d269
Author: Eric Blake <[email protected]>
Date:   Thu Mar 13 12:14:45 2008 -0600

    Consistently cast malloc results, for C++ compilation.
    
    * src/builtin.c (compile_pattern): Add cast.
    * src/macro.c (expand_macro): Likewise.
    * src/output.c (m4_tmpname): Likewise.
    * src/stackovf.c (setup_stackovf_trap): Use correct type.
    
    Signed-off-by: Eric Blake <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog      |    8 ++++++++
 src/builtin.c  |    2 +-
 src/macro.c    |    6 ++++--
 src/output.c   |    7 ++++---
 src/stackovf.c |    5 +++--
 5 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0888256..9f25499 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-03-13  Eric Blake  <[email protected]>
+
+	Consistently cast malloc results, for C++ compilation.
+	* src/builtin.c (compile_pattern): Add cast.
+	* src/macro.c (expand_macro): Likewise.
+	* src/output.c (m4_tmpname): Likewise.
+	* src/stackovf.c (setup_stackovf_trap): Use correct type.
+
 2008-03-10  Eric Blake  <[email protected]>
 
 	Allow 'make installcheck' with './configure --program-prefix'.
diff --git a/src/builtin.c b/src/builtin.c
index 09322ea..a1d4d01 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -308,7 +308,7 @@ compile_pattern (const char *str, size_t len, struct re_pattern_buffer **buf,
       }
 
   /* Next, check if STR can be compiled.  */
-  new_buf = xzalloc (sizeof *new_buf);
+  new_buf = (struct re_pattern_buffer *) xzalloc (sizeof *new_buf);
   msg = re_compile_pattern (str, len, new_buf);
 #ifdef DEBUG_REGEX
   if (trace_file)
diff --git a/src/macro.c b/src/macro.c
index 4558e9c..6123f05 100644
--- a/src/macro.c
+++ b/src/macro.c
@@ -661,8 +661,10 @@ expand_macro (symbol *sym)
   if (!stacks[level].args)
     {
       assert (!stacks[level].refcount);
-      stacks[level].args = xmalloc (sizeof (struct obstack));
-      stacks[level].argv = xmalloc (sizeof (struct obstack));
+      stacks[level].args =
+	(struct obstack *) xmalloc (sizeof *stacks[level].args);
+      stacks[level].argv =
+	(struct obstack *) xmalloc (sizeof *stacks[level].args);
       obstack_init (stacks[level].args);
       obstack_init (stacks[level].argv);
       stacks[level].args_base = obstack_finish (stacks[level].args);
diff --git a/src/output.c b/src/output.c
index 7b2d6de..24b6fa8 100644
--- a/src/output.c
+++ b/src/output.c
@@ -198,7 +198,8 @@ m4_tmpname (int divnum)
       obstack_1grow (&diversion_storage, '4');
       obstack_1grow (&diversion_storage, '-');
       offset = obstack_object_size (&diversion_storage);
-      buffer = obstack_alloc (&diversion_storage, INT_BUFSIZE_BOUND (divnum));
+      buffer = (char *) obstack_alloc (&diversion_storage,
+                                       INT_BUFSIZE_BOUND (divnum));
     }
   if (snprintf (&buffer[offset], INT_BUFSIZE_BOUND (divnum), "%d", divnum) < 0)
     m4_error (EXIT_FAILURE, errno, NULL,
@@ -385,8 +386,8 @@ make_room_for (int length)
 	}
 
       /* The current buffer may be safely reallocated.  */
-      output_diversion->u.buffer
-	= xrealloc (output_diversion->u.buffer, (size_t) wanted_size);
+      output_diversion->u.buffer = xrealloc (output_diversion->u.buffer,
+                                             (size_t) wanted_size);
 
       total_buffer_size += wanted_size - output_diversion->size;
       output_diversion->size = wanted_size;
diff --git a/src/stackovf.c b/src/stackovf.c
index 3877cd9..514e806 100644
--- a/src/stackovf.c
+++ b/src/stackovf.c
@@ -1,6 +1,7 @@
 /* Detect stack overflow (when getrlimit and sigaction or sigvec are available)
 
-   Copyright (C) 1993, 1994, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 2006, 2007, 2008 Free Software
+   Foundation, Inc.
    Jim Avera <[email protected]>, October 1993.
 
    This file is part of GNU M4.
@@ -370,7 +371,7 @@ Error - Do not know how to set up stack-ovf trap handler...
 
   {
     struct sigstack ss;
-    char *stackbuf = xmalloc (2 * SIGSTKSZ);
+    void *stackbuf = xmalloc (2 * SIGSTKSZ);
 
     ss.ss_sp = stackbuf + SIGSTKSZ;
     ss.ss_onstack = 0;


hooks/post-receive
--
GNU M4 source repository
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.