ArmPkg: Fix Ecc error 3002 in CompilerIntrinsicsLib

This patch fixes the following Ecc reported error:
Non-Boolean comparisons should use a compare operator
(==, !=, >, < >=, <=)

Brackets are also added to comply to with the coding
standard.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
This commit is contained in:
Pierre Gondois
2020-12-10 10:11:59 +00:00
committed by mergify[bot]
parent e3fe63ddeb
commit 53aabb978e
6 changed files with 19 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
//------------------------------------------------------------------------------
//
// Copyright (c) 2019, Pete Batard. All rights reserved.
// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
@@ -20,7 +21,7 @@ int memcmp(const void *s1, const void *s2, size_t n)
unsigned char const *t1 = s1;
unsigned char const *t2 = s2;
while (n--) {
while (n-- != 0) {
if (*t1 != *t2)
return (int)*t1 - (int)*t2;
t1++;