clang=tidy: readability-uppercase-literal-suffix
authorColin Clark <colin.clark@cclark.uk>
Tue, 6 Feb 2024 12:18:24 +0000 (12:18 +0000)
committerColin Clark <colin.clark@cclark.uk>
Tue, 6 Feb 2024 12:18:24 +0000 (12:18 +0000)
- Fix warnings identified by this flag
- Remove the exclude from .clang-tidy file

.clang-tidy
src/color-man.cc
src/zonedetect.cc

index 8a71f20..8d77bb3 100644 (file)
@@ -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]
index 63dacd4..4efd984 100644 (file)
@@ -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<float>(i) / (size - 1);
-               const double y = MIN(fct(x), 1.0f);
+               const double y = MIN(fct(x), 1.0F);
                values.push_back(static_cast<float>(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<cmsHPROFILE *>(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<cmsHPROFILE *>(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<cmsHPROFILE *>(cmsCreateRGBProfile(&whitepoint, &primaries, curve));
                        cmsFreeToneCurve(curve[0]);
                        trc_name = "linear RGB";
index fae1cf6..ba64b80 100644 (file)
@@ -122,7 +122,7 @@ static unsigned int ZDDecodeVariableLengthUnsigned(const ZoneDetect *library, ui
         unsigned int shift = 0;
         while(true) {
             value |= (((static_cast<uint64_t>(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<uint32_t>(w);
 }