summaryrefslogtreecommitdiff
path: root/poppler/CairoOutputDev.cc
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-02-06 18:31:55 +0100
committerAlbert Astals Cid <aacid@kde.org>2019-02-06 18:31:55 +0100
commit5a72f3cd65d4c9481b0b5b2535e51057c7b9b291 (patch)
treec1c2bdfb419c6adb3643eedc8499aaf90518e39b /poppler/CairoOutputDev.cc
parentff1ab1b0c9b265df1fd07380cd78ca0daa63d642 (diff)
Use reinterpret_cast to silence cast-align warnings
In ImageOutputDev it comes directly from malloc, and malloc guarantees alignment for basic types, so we're good In ArthurOutputDev it comes from QImage::bits that uses malloc internally, so we're good In cairo* it comes from cairo_image_surface_get_data that comes from pixman_image_get_data that returns a uint32_t * so we're only going to the original type alignment
Diffstat (limited to 'poppler/CairoOutputDev.cc')
-rw-r--r--poppler/CairoOutputDev.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 02a6f262..30c9f57a 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -1826,7 +1826,7 @@ void CairoOutputDev::setSoftMask(GfxState * state, const double * bbox, bool alp
cairo_destroy(maskCtx);
/* convert to a luminocity map */
- uint32_t *source_data = (uint32_t*)cairo_image_surface_get_data(source);
+ uint32_t *source_data = reinterpret_cast<uint32_t *>(cairo_image_surface_get_data(source));
/* get stride in units of 32 bits */
ptrdiff_t stride = cairo_image_surface_get_stride(source)/4;
for (int y=0; y<height; y++) {
@@ -2594,7 +2594,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
buffer = cairo_image_surface_get_data (image);
row_stride = cairo_image_surface_get_stride (image);
for (y = 0; y < height; y++) {
- dest = (unsigned int *) (buffer + y * row_stride);
+ dest = reinterpret_cast<unsigned int *>(buffer + y * row_stride);
pix = imgStr->getLine();
colorMap->getRGBLine (pix, dest, width);
}
@@ -2746,7 +2746,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s
buffer = cairo_image_surface_get_data (image);
row_stride = cairo_image_surface_get_stride (image);
for (y = 0; y < height; y++) {
- dest = (unsigned int *) (buffer + y * row_stride);
+ dest = reinterpret_cast<unsigned int *>(buffer + y * row_stride);
pix = imgStr->getLine();
colorMap->getRGBLine (pix, dest, width);
}
@@ -3154,7 +3154,7 @@ public:
buffer = cairo_image_surface_get_data (image);
stride = cairo_image_surface_get_stride (image);
for (int y = 0; y < height; y++) {
- uint32_t *dest = (uint32_t *) (buffer + y * stride);
+ uint32_t *dest = reinterpret_cast<uint32_t *>(buffer + y * stride);
getRow(y, dest);
}
} else {