diff --git a/CMakeLists.txt b/CMakeLists.txt index ba5c218..265f8b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,7 @@ add_compile_options( -Wpedantic -Wno-unused-parameter -Wno-unused-value - -Wno-missing-field-initializers - -Wno-narrowing) + -Wno-missing-field-initializers) set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG) diff --git a/include/hyprgraphics/color/Color.hpp b/include/hyprgraphics/color/Color.hpp index 315fa71..442bc4e 100644 --- a/include/hyprgraphics/color/Color.hpp +++ b/include/hyprgraphics/color/Color.hpp @@ -18,7 +18,7 @@ namespace Hyprgraphics { double l = 0, a = 0, b = 0; }; - CColor(); // black + CColor() = default; // black CColor(const SSRGB& rgb); CColor(const SHSL& hsl); CColor(const SOkLab& lab); diff --git a/src/color/Color.cpp b/src/color/Color.cpp index d809def..da869a6 100644 --- a/src/color/Color.cpp +++ b/src/color/Color.cpp @@ -26,10 +26,6 @@ static double hueToRgb(double p, double q, double t) { return p; } -Hyprgraphics::CColor::CColor() { - ; -} - Hyprgraphics::CColor::CColor(const SSRGB& rgb) : r(rgb.r), g(rgb.g), b(rgb.b) { ; } diff --git a/src/image/formats/Bmp.cpp b/src/image/formats/Bmp.cpp index df01579..c302cef 100644 --- a/src/image/formats/Bmp.cpp +++ b/src/image/formats/Bmp.cpp @@ -110,7 +110,7 @@ std::expected BMP::createSurfaceFromBMP(const std cairo_format_t format = CAIRO_FORMAT_ARGB32; int stride = cairo_format_stride_for_width(format, bitmapHeader.width); - // SHIT! + // Good cast! unsigned char* imageData = (unsigned char*)malloc(static_cast(bitmapHeader.height * stride)); if (bitmapHeader.numberOfBitPerPixel == 24) diff --git a/src/image/formats/Png.cpp b/src/image/formats/Png.cpp index 3708111..e9c7ede 100644 --- a/src/image/formats/Png.cpp +++ b/src/image/formats/Png.cpp @@ -56,7 +56,7 @@ std::expected PNG::createSurfaceFromPNG(const std if (!succeededDecode && ret == SPNG_EBUFSIZ) { // hack, but I don't know why decoded_image_size is sometimes wrong - // Because of the cast from unsigned int to unsigned long? and because of the realloc? + // Good cast! At least now it's explicit imageLength = static_cast(ihdr.height * ihdr.width * 4) /* FIXME: this is wrong if we doing >32bpp!!!! */; imageData = (uint8_t*)realloc(imageData, imageLength); diff --git a/src/image/formats/Webp.cpp b/src/image/formats/Webp.cpp index f308e85..dd85f2c 100644 --- a/src/image/formats/Webp.cpp +++ b/src/image/formats/Webp.cpp @@ -47,7 +47,7 @@ std::expected WEBP::createSurfaceFromWEBP(const s config.options.no_fancy_upsampling = 1; config.output.u.RGBA.rgba = CAIRODATA; config.output.u.RGBA.stride = CAIROSTRIDE; - // SHIT! + // Really good cast! config.output.u.RGBA.size = static_cast(CAIROSTRIDE * HEIGHT); config.output.is_external_memory = 1; config.output.width = WIDTH; diff --git a/tests/image.cpp b/tests/image.cpp index 95e3660..90fc54e 100644 --- a/tests/image.cpp +++ b/tests/image.cpp @@ -25,7 +25,6 @@ static bool tryLoadImage(const std::string& path) { std::string name = image.getMime(); std::ranges::replace(name, '/', '_'); - // No lint? return cairo_surface_write_to_png(image.cairoSurface()->cairo(), (TEST_DIR + "/" + name + ".png").c_str()) == CAIRO_STATUS_SUCCESS; }