diff --git a/src/image/formats/Bmp.cpp b/src/image/formats/Bmp.cpp index c302cef..f22cf95 100644 --- a/src/image/formats/Bmp.cpp +++ b/src/image/formats/Bmp.cpp @@ -110,7 +110,6 @@ std::expected BMP::createSurfaceFromBMP(const std cairo_format_t format = CAIRO_FORMAT_ARGB32; int stride = cairo_format_stride_for_width(format, bitmapHeader.width); - // 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 e9c7ede..ee2d18b 100644 --- a/src/image/formats/Png.cpp +++ b/src/image/formats/Png.cpp @@ -31,7 +31,7 @@ std::expected PNG::createSurfaceFromPNG(const std spng_set_png_buffer(ctx, PNGCONTENT.data(), PNGCONTENT.size()); - spng_ihdr ihdr{.width=0}; + spng_ihdr ihdr{.width = 0}; if (int ret = spng_get_ihdr(ctx, &ihdr); ret) return std::unexpected(std::string{"loading png: spng_get_ihdr failed: "} + spng_strerror(ret)); @@ -56,7 +56,6 @@ std::expected PNG::createSurfaceFromPNG(const std if (!succeededDecode && ret == SPNG_EBUFSIZ) { // hack, but I don't know why decoded_image_size is sometimes wrong - // 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 dd85f2c..b18df75 100644 --- a/src/image/formats/Webp.cpp +++ b/src/image/formats/Webp.cpp @@ -47,7 +47,6 @@ std::expected WEBP::createSurfaceFromWEBP(const s config.options.no_fancy_upsampling = 1; config.output.u.RGBA.rgba = CAIRODATA; config.output.u.RGBA.stride = CAIROSTRIDE; - // Really good cast! config.output.u.RGBA.size = static_cast(CAIROSTRIDE * HEIGHT); config.output.is_external_memory = 1; config.output.width = WIDTH;