This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

memalloc fix compiler warnings


just a little patch to fix a few warnings.
diff -r e07f59cf767f packages/services/memalloc/common/current/ChangeLog
--- a/packages/services/memalloc/common/current/ChangeLog	Tue Feb 03 09:31:10 2009 +0100
+++ b/packages/services/memalloc/common/current/ChangeLog	Tue Feb 03 09:43:06 2009 +0100
@@ -1,3 +1,9 @@
+2009-02-03  Simon Kallweit  <simon.kallweit@intefo.ch>
+
+	* include/mvarimpl.inl:
+	* include/sepmetaimpl.inl:
+	Fixed a few compiler warnings.
+
 2009-01-09  John Dallaway  <john@dallaway.org.uk>
 
 	* cdl/memalloc.cdl: Invoke tclsh explicitly to avoid the need for
diff -r e07f59cf767f packages/services/memalloc/common/current/include/mvarimpl.inl
--- a/packages/services/memalloc/common/current/include/mvarimpl.inl	Tue Feb 03 09:31:10 2009 +0100
+++ b/packages/services/memalloc/common/current/include/mvarimpl.inl	Tue Feb 03 09:43:06 2009 +0100
@@ -152,7 +152,7 @@
 
     CYG_ASSERT( align > 0, "Bad alignment" );
     CYG_ASSERT(0!=align ,"align is zero");
-    CYG_ASSERT(0==(align & align-1),"align not a power of 2");
+    CYG_ASSERT(0==(align & (align-1)),"align not a power of 2");
 
     if ((unsigned)size < sizeof(struct memdq)) {
         bottom = NULL;
@@ -165,7 +165,7 @@
     alignment = align;
     while (alignment < (cyg_int32)sizeof(struct memdq))
         alignment += alignment;
-    CYG_ASSERT(0==(alignment & alignment-1),"alignment not a power of 2");
+    CYG_ASSERT(0==(alignment & (alignment-1)),"alignment not a power of 2");
 
     // the memdq for each allocation is always positioned immediately before
     // an aligned address, so that the allocation (i.e. what eventually gets
@@ -182,12 +182,12 @@
     
     CYG_ASSERT( top > bottom , "heap too small" );
     CYG_ASSERT( top <= (base+size), "top too large" );
-    CYG_ASSERT( ((cyg_int32)(top+sizeof(struct memdq)) & alignment-1)==0,
+    CYG_ASSERT( ((cyg_int32)(top+sizeof(struct memdq)) & (alignment-1))==0,
                 "top badly aligned" );
 
     struct memdq *hdq = &head, *dq = (struct memdq *)bottom;
     
-    CYG_ASSERT( ((cyg_int32)memdq2alloc(dq) & alignment-1)==0,
+    CYG_ASSERT( ((cyg_int32)memdq2alloc(dq) & (alignment-1))==0,
                  "bottom badly aligned" );
 
     hdq->prev = hdq->next = dq;
diff -r e07f59cf767f packages/services/memalloc/common/current/include/sepmetaimpl.inl
--- a/packages/services/memalloc/common/current/include/sepmetaimpl.inl	Tue Feb 03 09:31:10 2009 +0100
+++ b/packages/services/memalloc/common/current/include/sepmetaimpl.inl	Tue Feb 03 09:43:06 2009 +0100
@@ -273,7 +273,7 @@
 
     CYG_ASSERT( alignment > 0, "Bad alignment" );
     CYG_ASSERT( 0!=alignment, "alignment is zero" );
-    CYG_ASSERT( 0==(alignment & alignment-1), "alignment not a power of 2" );
+    CYG_ASSERT( 0==(alignment & (alignment-1)), "alignment not a power of 2" );
 
     obase=base;
     osize=size;
@@ -293,9 +293,9 @@
     
     CYG_ASSERT( top > bottom , "heap too small" );
     CYG_ASSERT( top <= (base+size), "top too large" );
-    CYG_ASSERT( (((cyg_int32)(top)) & alignment-1)==0,
+    CYG_ASSERT( (((cyg_int32)(top)) & (alignment-1))==0,
                 "top badly aligned" );
-    CYG_ASSERT( (((cyg_int32)(bottom)) & alignment-1)==0,
+    CYG_ASSERT( (((cyg_int32)(bottom)) & (alignment-1))==0,
                 "bottom badly aligned" );
 
     CYG_ASSERT( metatop > metabottom , "meta space too small" );

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]