From: Colin Clark Date: Tue, 6 Feb 2024 12:18:24 +0000 (+0000) Subject: clang=tidy: readability-uppercase-literal-suffix X-Git-Tag: v2.3~43 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=eb51901a4813f5f295e7c266168377db2ed3fca5 clang=tidy: readability-uppercase-literal-suffix - Fix warnings identified by this flag - Remove the exclude from .clang-tidy file --- diff --git a/.clang-tidy b/.clang-tidy index 8a71f20e..8d77bb38 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -54,7 +54,6 @@ Checks: > -readability-named-parameter, -readability-qualified-auto, -readability-simplify-boolean-expr, - -readability-uppercase-literal-suffix ExtraArgs: [-Wno-unknown-warning-option, -Wno-unused-lambda-capture, -Wno-unused-but-set-variable] diff --git a/src/color-man.cc b/src/color-man.cc index 63dacd45..4efd9841 100644 --- a/src/color-man.cc +++ b/src/color-man.cc @@ -511,7 +511,7 @@ static cmsToneCurve* colorspaces_create_transfer(int32_t size, double (*fct)(dou for(int32_t i = 0; i < size; ++i) { const double x = static_cast(i) / (size - 1); - const double y = MIN(fct(x), 1.0f); + const double y = MIN(fct(x), 1.0F); values.push_back(static_cast(y)); } @@ -605,19 +605,19 @@ static guchar *nclx_to_lcms_profile(const struct heif_color_profile_nclx *nclx, whitepoint.x = nclx->color_primary_white_x; whitepoint.y = nclx->color_primary_white_y; - whitepoint.Y = 1.0f; + whitepoint.Y = 1.0F; primaries.Red.x = nclx->color_primary_red_x; primaries.Red.y = nclx->color_primary_red_y; - primaries.Red.Y = 1.0f; + primaries.Red.Y = 1.0F; primaries.Green.x = nclx->color_primary_green_x; primaries.Green.y = nclx->color_primary_green_y; - primaries.Green.Y = 1.0f; + primaries.Green.Y = 1.0F; primaries.Blue.x = nclx->color_primary_blue_x; primaries.Blue.y = nclx->color_primary_blue_y; - primaries.Blue.Y = 1.0f; + primaries.Blue.Y = 1.0F; switch (nclx->color_primaries) { @@ -671,19 +671,19 @@ static guchar *nclx_to_lcms_profile(const struct heif_color_profile_nclx *nclx, trc_name = "Rec709 RGB"; break; case heif_transfer_characteristic_ITU_R_BT_470_6_System_M: - curve[0] = curve[1] = curve[2] = cmsBuildGamma (nullptr, 2.2f); + curve[0] = curve[1] = curve[2] = cmsBuildGamma (nullptr, 2.2F); profile = static_cast(cmsCreateRGBProfile(&whitepoint, &primaries, curve)); cmsFreeToneCurve(curve[0]); trc_name = "Gamma2.2 RGB"; break; case heif_transfer_characteristic_ITU_R_BT_470_6_System_B_G: - curve[0] = curve[1] = curve[2] = cmsBuildGamma (nullptr, 2.8f); + curve[0] = curve[1] = curve[2] = cmsBuildGamma (nullptr, 2.8F); profile = static_cast(cmsCreateRGBProfile(&whitepoint, &primaries, curve)); cmsFreeToneCurve(curve[0]); trc_name = "Gamma2.8 RGB"; break; case heif_transfer_characteristic_linear: - curve[0] = curve[1] = curve[2] = cmsBuildGamma (nullptr, 1.0f); + curve[0] = curve[1] = curve[2] = cmsBuildGamma (nullptr, 1.0F); profile = static_cast(cmsCreateRGBProfile(&whitepoint, &primaries, curve)); cmsFreeToneCurve(curve[0]); trc_name = "linear RGB"; diff --git a/src/zonedetect.cc b/src/zonedetect.cc index fae1cf61..ba64b80a 100644 --- a/src/zonedetect.cc +++ b/src/zonedetect.cc @@ -122,7 +122,7 @@ static unsigned int ZDDecodeVariableLengthUnsigned(const ZoneDetect *library, ui unsigned int shift = 0; while(true) { value |= (((static_cast(buffer[i])) & UINT8_C(0x7F)) << shift); - shift += 7u; + shift += 7U; if(!(buffer[i] & UINT8_C(0x80))) { break; @@ -341,12 +341,12 @@ static int ZDPointInBox(int32_t xl, int32_t x, int32_t xr, int32_t yl, int32_t y static uint32_t ZDUnshuffle(uint64_t w) { - w &= 0x5555555555555555llu; - w = (w | (w >> 1)) & 0x3333333333333333llu; - w = (w | (w >> 2)) & 0x0F0F0F0F0F0F0F0Fllu; - w = (w | (w >> 4)) & 0x00FF00FF00FF00FFllu; - w = (w | (w >> 8)) & 0x0000FFFF0000FFFFllu; - w = (w | (w >> 16)) & 0x00000000FFFFFFFFllu; + w &= 0x5555555555555555LLU; + w = (w | (w >> 1)) & 0x3333333333333333LLU; + w = (w | (w >> 2)) & 0x0F0F0F0F0F0F0F0FLLU; + w = (w | (w >> 4)) & 0x00FF00FF00FF00FFLLU; + w = (w | (w >> 8)) & 0x0000FFFF0000FFFFLLU; + w = (w | (w >> 16)) & 0x00000000FFFFFFFFLLU; return static_cast(w); }