From patchwork Wed Aug 13 09:49:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 35341 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03FBB203C5 for ; Wed, 13 Aug 2014 09:50:00 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf79531882pab.1 for ; Wed, 13 Aug 2014 02:50:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=0pfNcY4r1BaZ+TMLGcRybOSXVvx3IdfhAsjrFsAUmL0=; b=nODzYe/whaZrioRmGegBuWRFRN/H4Q7Lk4a10RjR+c9Xq7MhAAZxQM1bbS/NBjbDKK 8MytDRACWt0ECEcsCeG92O34K6mQ/Al0+6qtf68YjCXfnw3vrZh5njIWUY/seVsWbmBU rg1jly+oMJJ6WxxTYEdvHwHUCXbzOSiqqiI53BRJUO+iUVJDYWCNXSQv8EvdtRmjNYA6 y3Lo8ivJCKeK/0Z9B3tT/P284uv1wrYzcR56741J20fJs9nZUJlamqP7lnzZEsT3Cq+z vMo0R9ZVe33pRva5JJTmojKadVWPGCaPkAiwmgWHDc26mG2WSK3VMQun3+GNzR9+45vP OXGQ== X-Gm-Message-State: ALoCoQlYPFbhW3eD5/oQ6+U039H+NBAXsjTy3QFjYzTEbI/5KbLn2nhKb47MLOuiITMSLvN9250W X-Received: by 10.70.37.41 with SMTP id v9mr1978241pdj.0.1407923400311; Wed, 13 Aug 2014 02:50:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.134 with SMTP id m6ls550002qge.8.gmail; Wed, 13 Aug 2014 02:50:00 -0700 (PDT) X-Received: by 10.220.110.77 with SMTP id m13mr2608370vcp.35.1407923400168; Wed, 13 Aug 2014 02:50:00 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id r6si786783vcu.14.2014.08.13.02.50.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 02:50:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so14459238vcb.5 for ; Wed, 13 Aug 2014 02:50:00 -0700 (PDT) X-Received: by 10.221.9.72 with SMTP id ov8mr2622290vcb.27.1407923400066; Wed, 13 Aug 2014 02:50:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp316688vcb; Wed, 13 Aug 2014 02:49:59 -0700 (PDT) X-Received: by 10.42.63.129 with SMTP id c1mr4915876ici.82.1407923399423; Wed, 13 Aug 2014 02:49:59 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id k4si2947355ige.53.2014.08.13.02.49.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 13 Aug 2014 02:49:59 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XHVBm-0006GN-Ro; Wed, 13 Aug 2014 09:49:50 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XHVBl-0006GG-5I for edk2-devel@lists.sourceforge.net; Wed, 13 Aug 2014 09:49:49 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XHVBg-0006ZI-SS for edk2-devel@lists.sourceforge.net; Wed, 13 Aug 2014 09:49:49 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7D9nbsG015956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Aug 2014 05:49:37 -0400 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7D9nV8l004349; Wed, 13 Aug 2014 05:49:36 -0400 From: Laszlo Ersek To: liming.gao@intel.com, edk2-devel@lists.sourceforge.net, jordan.l.justen@intel.com, michael.d.kinney@intel.com Date: Wed, 13 Aug 2014 11:49:29 +0200 Message-Id: <1407923369-30959-3-git-send-email-lersek@redhat.com> In-Reply-To: <1407923369-30959-1-git-send-email-lersek@redhat.com> References: <1407923369-30959-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -2.2 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1XHVBg-0006ZI-SS Subject: [edk2] [PATCH 2/2] MdePkg: BaseOrderedCollectionRedBlackTreeLib: silence invalid VS2005 warnings X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- .../BaseOrderedCollectionRedBlackTreeLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c index 9f40b70..b37caf2 100644 --- a/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c +++ b/MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.c @@ -148,7 +148,7 @@ OrderedCollectionIsEmpty ( 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 ) { - return Node == NULL || Node->Color == RedBlackTreeBlack; + return (BOOLEAN)(Node == NULL || Node->Color == RedBlackTreeBlack); }