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 <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15813 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Laszlo Ersek 2014-08-16 16:18:59 +00:00 committed by jljusten
parent 75955444cb
commit 6a650d1fd1
1 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@ OrderedCollectionIsEmpty (
IN CONST RED_BLACK_TREE *Tree IN CONST RED_BLACK_TREE *Tree
) )
{ {
return Tree->Root == NULL; return (BOOLEAN)(Tree->Root == NULL);
} }
@ -838,7 +838,7 @@ NodeIsNullOrBlack (
IN CONST RED_BLACK_TREE_NODE *Node IN CONST RED_BLACK_TREE_NODE *Node
) )
{ {
return Node == NULL || Node->Color == RedBlackTreeBlack; return (BOOLEAN)(Node == NULL || Node->Color == RedBlackTreeBlack);
} }