changeset 2312:ed6535aefb7e

[xemacs-hg @ 2004-09-27 18:51:20 by james] Fix gcc 3.3 'log' shadow warning by changing to 'log2'.
author james
date Mon, 27 Sep 2004 18:51:22 +0000
parents 2200ebac5409
children 0aade2222409
files src/ChangeLog src/gmalloc.c
diffstat 2 files changed, 18 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 27 18:39:23 2004 +0000
+++ b/src/ChangeLog	Mon Sep 27 18:51:22 2004 +0000
@@ -1,3 +1,7 @@
+2004-09-27  Jerry James  <james@xemacs.org>
+
+	* gmalloc.c (malloc): Change log to log2 to quiet gcc 3.3.
+
 2004-09-27  Jerry James  <james@xemacs.org>
 
 	* sysdep.c: Mark more unused parameters with the UNUSED macro.
--- a/src/gmalloc.c	Mon Sep 27 18:39:23 2004 +0000
+++ b/src/gmalloc.c	Mon Sep 27 18:51:22 2004 +0000
@@ -574,14 +574,14 @@
     {
       /* Small allocation to receive a fragment of a block.
 	 Determine the logarithm to base two of the fragment size. */
-      __malloc_size_t log = 1;
+      __malloc_size_t log2 = 1;
       --size;
       while ((size /= 2) != 0)
-	++log;
+	++log2;
 
       /* Look in the fragment lists for a
 	 free fragment of the desired size. */
-      next = _fraghead[log].next;
+      next = _fraghead[log2].next;
       if (next != NULL)
 	{
 	  /* There are free fragments of this size.
@@ -595,13 +595,13 @@
 	  if (--_heapinfo[block].busy.info.frag.nfree != 0)
 	    _heapinfo[block].busy.info.frag.first = (unsigned long int)
 	      ((unsigned long int) ((char *) next->next - (char *) NULL)
-	       % BLOCKSIZE) >> log;
+	       % BLOCKSIZE) >> log2;
 
 	  /* Update the statistics.  */
 	  ++_chunks_used;
-	  _bytes_used += 1 << log;
+	  _bytes_used += 1 << log2;
 	  --_chunks_free;
-	  _bytes_free -= 1 << log;
+	  _bytes_free -= 1 << log2;
 	}
       else
 	{
@@ -612,11 +612,11 @@
 	    return NULL;
 
 	  /* Link all fragments but the first into the free list.  */
-	  for (i = 1; i < (__malloc_size_t) (BLOCKSIZE >> log); ++i)
+	  for (i = 1; i < (__malloc_size_t) (BLOCKSIZE >> log2); ++i)
 	    {
-	      next = (struct list *) ((char *) result + (i << log));
-	      next->next = _fraghead[log].next;
-	      next->prev = &_fraghead[log];
+	      next = (struct list *) ((char *) result + (i << log2));
+	      next->next = _fraghead[log2].next;
+	      next->prev = &_fraghead[log2];
 	      next->prev->next = next;
 	      if (next->next != NULL)
 		next->next->prev = next;
@@ -624,13 +624,13 @@
 
 	  /* Initialize the nfree and first counters for this block.  */
 	  block = BLOCK (result);
-	  _heapinfo[block].busy.type = log;
+	  _heapinfo[block].busy.type = log2;
 	  _heapinfo[block].busy.info.frag.nfree = i - 1;
 	  _heapinfo[block].busy.info.frag.first = i - 1;
 
-	  _chunks_free += (BLOCKSIZE >> log) - 1;
-	  _bytes_free += BLOCKSIZE - (1 << log);
-	  _bytes_used -= BLOCKSIZE - (1 << log);
+	  _chunks_free += (BLOCKSIZE >> log2) - 1;
+	  _bytes_free += BLOCKSIZE - (1 << log2);
+	  _bytes_used -= BLOCKSIZE - (1 << log2);
 	}
     }
   else