Skip to content

Commit

Permalink
More traditional placement of const specifier, matching casts
Browse files Browse the repository at this point in the history
As suggested in the code review:

 - More traditional placment of the const specifier, e.g. const unsigned char * instead of unsigned char const *
 - Matching casts to also cast to const unsigned char * instead of of unsigned char *

Co-Authored-By: Frank Dana <[email protected]>
  • Loading branch information
musteresel and ferdnyc authored Nov 27, 2019
1 parent 4b76c1e commit 7e28460
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ void Frame::Thumbnail(std::string path, int new_width, int new_height, std::stri

// Get pixels
unsigned char *pixels = (unsigned char *) thumbnail->bits();
unsigned char const *mask_pixels = (unsigned char *) mask->constBits();
const unsigned char *mask_pixels = (const unsigned char *) mask->constBits();

// Convert the mask image to grayscale
// Loop through pixels
Expand Down Expand Up @@ -922,7 +922,7 @@ std::shared_ptr<Magick::Image> Frame::GetMagickImage()
AddColor(width, height, "#000000");

// Get the pixels from the frame image
QRgb const *tmpBits = (const QRgb*)image->constBits();
const QRgb *tmpBits = (const QRgb*)image->constBits();

// Create new image object, and fill with pixel data
std::shared_ptr<Magick::Image> magick_image = std::shared_ptr<Magick::Image>(new Magick::Image(image->width(), image->height(),"RGBA", Magick::CharPixel, tmpBits));
Expand Down

0 comments on commit 7e28460

Please sign in to comment.