build fix for msvc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

build fix for msvc

Patrick Spendrin
Hi,

as I am unsure whether I should really commit this:
please take a look at this patch, it is needed to build digikam with
msvc 2008.

Thanks in advance,
Patrick

Index: ToneMappingBase.cpp
===================================================================
--- ToneMappingBase.cpp (revision 1023583)
+++ ToneMappingBase.cpp (working copy)
@@ -95,9 +95,9 @@
 
     switch (par.function_id){
         case 0://power function
-            p=pow(10.0,fabs((x2*2.0-1.0))*current_process_power_value*0.02);
+            p=pow((double)10.0,(double)fabs((x2*2.0-1.0))*current_process_power_value*0.02);
             if (x2>=0.5) result=pow(x1,p);
-            else result=1.0-pow(1.0-x1,p);
+            else result=1.0-pow((double)1.0-x1,(double)p);
             break;
         case 1://linear function
             p=1.0/(1+exp(-(x2*2.0-1.0)*current_process_power_value*0.04));
Index: ToneMappingFloat.cpp
===================================================================
--- ToneMappingFloat.cpp (revision 1023583)
+++ ToneMappingFloat.cpp (working copy)
@@ -231,7 +231,7 @@
 
 void ToneMappingFloat::stretch_contrast(REALTYPE *data, int datasize){
     //stretch the contrast
-    unsigned int histogram_size=256;
+    const unsigned int histogram_size=256;
     //first, we compute the histogram
     unsigned int histogram[histogram_size];
     for (unsigned int i=0;i<histogram_size;i++) histogram[i]=0;

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel

signature.asc (202 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: build fix for msvc

Gilles Caulier-4
This patch sound fine for me...

Gilles

2009/9/15 Patrick Spendrin <[hidden email]>:

> Hi,
>
> as I am unsure whether I should really commit this:
> please take a look at this patch, it is needed to build digikam with
> msvc 2008.
>
> Thanks in advance,
> Patrick
>
> _______________________________________________
> Digikam-devel mailing list
> [hidden email]
> https://mail.kde.org/mailman/listinfo/digikam-devel
>
>
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel