public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* memalloc fix compiler warnings
@ 2009-02-03  8:44 Simon Kallweit
  2009-02-17  0:40 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Kallweit @ 2009-02-03  8:44 UTC (permalink / raw)
  To: eCos Patches List

[-- Attachment #1: Type: text/plain, Size: 43 bytes --]

just a little patch to fix a few warnings.

[-- Attachment #2: memalloc_fix_warnings.patch --]
[-- Type: text/x-diff, Size: 3327 bytes --]

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" );

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: memalloc fix compiler warnings
  2009-02-03  8:44 memalloc fix compiler warnings Simon Kallweit
@ 2009-02-17  0:40 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2009-02-17  0:40 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: eCos Patches List

Simon Kallweit wrote:
> 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.


Applied, thanks!

Jifl
-- 
*See us at Embedded World 2009, Nürnberg, Germany, 3-5 Mar, Stand 11-300*
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-17  0:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-03  8:44 memalloc fix compiler warnings Simon Kallweit
2009-02-17  0:40 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).