[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [digikam] libs/dimg/filters/sharp: fix clang compiler warnings under OSX
From:       Gilles Caulier <caulier.gilles () gmail ! com>
Date:       2014-05-31 13:21:21
Message-ID: E1WqjDt-0005Qn-Qw () scm ! kde ! org
[Download RAW message or body]

Git commit fb54cc361309d0b12b79873c620e49fddf8503e3 by Gilles Caulier.
Committed on 31/05/2014 at 13:20.
Pushed by cgilles into branch 'master'.

fix clang compiler  warnings under OSX

M  +7    -7    libs/dimg/filters/sharp/refocusfilter.cpp

http://commits.kde.org/digikam/fb54cc361309d0b12b79873c620e49fddf8503e3

diff --git a/libs/dimg/filters/sharp/refocusfilter.cpp b/libs/dimg/filters/sharp/refocusfilter.cpp
index 8f275bf..560c08f 100644
--- a/libs/dimg/filters/sharp/refocusfilter.cpp
+++ b/libs/dimg/filters/sharp/refocusfilter.cpp
@@ -212,8 +212,8 @@ void RefocusFilter::refocusImage(uchar* const data, int width, int height, bool
 
 void RefocusFilter::convolveImageMultithreaded(uint start, uint stop, uint y1, const Args& prm)
 {
-    unsigned short* orgData16  = (unsigned short*)prm.orgData;
-    unsigned short* destData16 = (unsigned short*)prm.destData;
+    ushort* orgData16  = reinterpret_cast<ushort*>(prm.orgData);
+    ushort* destData16 = reinterpret_cast<ushort*>(prm.destData);
 
     double valRed, valGreen, valBlue;
     uint   x1, x2, y2;
@@ -269,8 +269,8 @@ void RefocusFilter::convolveImageMultithreaded(uint start, uint stop, uint y1, c
         }
         else                 // 16 bits image.
         {
-            unsigned short red, green, blue;
-            unsigned short* ptr = 0;
+            ushort red, green, blue;
+            ushort* ptr = 0;
 
             for (y2 = 0; runningFlag() && (y2 < prm.mat_size); ++y2)
             {
@@ -303,9 +303,9 @@ void RefocusFilter::convolveImageMultithreaded(uint start, uint stop, uint y1, c
                 ptr = &destData16[index2 * 4];
 
                 // Overwrite RGB values to destination.
-                ptr[0] = (unsigned short) CLAMP(valBlue,  0.0, 65535.0);
-                ptr[1] = (unsigned short) CLAMP(valGreen, 0.0, 65535.0);
-                ptr[2] = (unsigned short) CLAMP(valRed,   0.0, 65535.0);
+                ptr[0] = (ushort) CLAMP(valBlue,  0.0, 65535.0);
+                ptr[1] = (ushort) CLAMP(valGreen, 0.0, 65535.0);
+                ptr[2] = (ushort) CLAMP(valRed,   0.0, 65535.0);
             }
         }
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic