Remove floating point as bool warning.

This commit is contained in:
Jief L 2020-04-05 18:23:51 +03:00
parent 7b173d7f08
commit 83cd92cb9f
3 changed files with 15 additions and 7 deletions

View File

@ -2561,6 +2561,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_FLOAT_CONVERSION = YES;
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -2576,6 +2579,8 @@
NO_MSABI_VA_FUNCS,
DISABLE_PRINTLIB,
);
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_SHADOW = YES;
HEADER_SEARCH_PATHS = (
$PROJECT_DIR/../../Build/Clover/DEBUG_XCODE8/X64/rEFIt_UEFI/refit/DEBUG,
$PROJECT_DIR/../../rEFIt_UEFI/Platform/Posix,
@ -2620,9 +2625,14 @@
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_FLOAT_CONVERSION = YES;
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES;
GCC_WARN_SHADOW = YES;
HEADER_SEARCH_PATHS = (
$PROJECT_DIR/../../Build/Clover/DEBUG_XCODE8/X64/rEFIt_UEFI/refit/DEBUG,
$PROJECT_DIR/../../rEFIt_UEFI/Platform/Posix,
@ -3014,7 +3024,6 @@
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_ENABLE_OBJC_WEAK = NO;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@ -3075,7 +3084,6 @@
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_ENABLE_OBJC_WEAK = NO;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;

View File

@ -278,7 +278,7 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc
//there is bounds after nsvgParse()
IconImage->width = shape->bounds[2] - shape->bounds[0];
IconImage->height = shape->bounds[3] - shape->bounds[1];
if (!IconImage->height) {
if ( IconImage->height == 0 ) { // doing "if (!IconImage->height)" generates a warning
IconImage->height = 200;
}
// if (Id == BUILTIN_ICON_BACKGROUND || Id == BUILTIN_ICON_BANNER) {
@ -903,14 +903,14 @@ INTN renderSVGtext(EG_IMAGE* TextBufferXY, INTN posX, INTN posY, INTN textType,
// Height = 180; //for test
// DBG("textBuffer: [%d,%d], fontUnits=%d\n", Width, TextBufferXY->Height, (int)fontSVG->unitsPerEm);
if (!fontSVG->unitsPerEm) {
if ( fontSVG->unitsPerEm == 0 ) { // doing "if (!fontSVG->unitsPerEm)" generates a warning
fontSVG->unitsPerEm = 1000.f;
}
float fH = fontSVG->bbox[3] - fontSVG->bbox[1]; //1250
if (fH == 0.f) {
DBG("wrong font: %f\n", fontSVG->unitsPerEm);
DumpFloat2("Font bbox", fontSVG->bbox, 4);
fH = fontSVG->unitsPerEm?fontSVG->unitsPerEm:1000.0f; //1000
fH = fontSVG->unitsPerEm != 0 ? fontSVG->unitsPerEm : 1000.0f; //1000 // using "fontSVG->unitsPerEm != 0" instead of just is to avoid a warning
}
sy = (float)Height / fH; //(float)fontSVG->unitsPerEm; // 260./1250.
//in font units

View File

@ -4050,7 +4050,7 @@ float addLetter(NSVGparser* p, CHAR16 letter, float x, float y, float scale, UIN
DBG("font absent\n");
return x;
}
if (!scale) {
if ( scale == 0 ) { // doing "if (!scale)" generates a warning
return x;
}