freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2-demos] master 97585a2 01/13: [ftinspect] Remove `const_cast'.


From: Werner LEMBERG
Subject: [freetype2-demos] master 97585a2 01/13: [ftinspect] Remove `const_cast'.
Date: Thu, 11 May 2017 15:26:22 -0400 (EDT)

branch: master
commit 97585a2421d7b71f71c5cf64fffc86f81184ca5a
Author: Philipp Kerling <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [ftinspect] Remove `const_cast'.
    
    * src/ftinspect.cpp (GlyphBitmap::paint): `const_cast' is
    potentially dangerous and should only be used as a last resort.
    Here, the mutable data can just be accessed with `.bits()' instead.
---
 ChangeLog         | 8 ++++++++
 src/ftinspect.cpp | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 57224be..ce47ebc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-05-11  Philipp Kerling  <address@hidden>
+
+       [ftinspect] Remove `const_cast'.
+
+       * src/ftinspect.cpp (GlyphBitmap::paint): `const_cast' is
+       potentially dangerous and should only be used as a last resort.
+       Here, the mutable data can just be accessed with `.bits()' instead.
+
 2017-05-11  Werner Lemberg  <address@hidden>
 
        Fix clang warnings.
diff --git a/src/ftinspect.cpp b/src/ftinspect.cpp
index 69986bd..3ec36e9 100644
--- a/src/ftinspect.cpp
+++ b/src/ftinspect.cpp
@@ -1206,7 +1206,7 @@ GlyphBitmap::paint(QPainter* painter,
 
   bitmap.rows = height;
   bitmap.width = width;
-  bitmap.buffer = const_cast<uchar*>(image.constBits());
+  bitmap.buffer = image.bits();
   bitmap.pitch = image.bytesPerLine();
   bitmap.pixel_mode = pixelMode;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]