Revision: 15813
          http://sourceforge.net/p/edk2/code/15813
Author:   jljusten
Date:     2014-08-16 16:18:59 +0000 (Sat, 16 Aug 2014)
Log Message:
-----------
MdePkg: BaseOrderedCollectionRedBlackTreeLib: silence invalid VS2005 warnings

VS2005 reports the following build failure:

  BaseOrderedCollectionRedBlackTreeLib.c(151) : warning C4244:
    'return' : conversion from 'int' to 'BOOLEAN', possible loss of data
  BaseOrderedCollectionRedBlackTreeLib.c(840) : warning C4244:
    'return' : conversion from 'int' to 'BOOLEAN', possible loss of data

This is incorrect. The ISO C standard guarantees that the expressions in
question can only return values 0 and 1, both of which can be represented
by BOOLEAN (== UINT8, == unsigned char).

Silence the incorrect warnings with explicit casts to BOOLEAN.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    
trunk/edk2/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c

Modified: 
trunk/edk2/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c
===================================================================
--- 
trunk/edk2/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c
       2014-08-16 16:18:53 UTC (rev 15812)
+++ 
trunk/edk2/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c
       2014-08-16 16:18:59 UTC (rev 15813)
@@ -148,7 +148,7 @@
   IN CONST RED_BLACK_TREE *Tree
   )
 {
-  return Tree->Root == NULL;
+  return (BOOLEAN)(Tree->Root == NULL);
 }
 
 
@@ -838,7 +838,7 @@
   IN CONST RED_BLACK_TREE_NODE *Node
   )
 {
-  return Node == NULL || Node->Color == RedBlackTreeBlack;
+  return (BOOLEAN)(Node == NULL || Node->Color == RedBlackTreeBlack);
 }
 
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to