summaryrefslogtreecommitdiffstats
path: root/kcontrol
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2019-02-11 17:54:14 +0900
committerSlávek Banko <slavek.banko@axis.cz>2019-02-11 17:29:48 +0100
commit88664174b921ceb3a48aed70d4111d462d1c7acb (patch)
treea959f840f1db91a1644df33f477064288e5f39c1 /kcontrol
parent67fac6eb61fb55b98db7e67d5ead244272cc4b49 (diff)
downloadtdebase-88664174b921ceb3a48aed70d4111d462d1c7acb.tar.gz
tdebase-88664174b921ceb3a48aed70d4111d462d1c7acb.zip
resolve ambiguous log() overload
log() may accept `float` or `double` for C++, so passing `int` is ambiguous. Change to exactly pass valiables as `double` to log(), it is expected here. Signed-off-by: OBATA Akio <obache@wizdas.com> (cherry picked from commit 28d80743c0fcd9c9ca9bdccd78d3c052dc9b43de)
Diffstat (limited to 'kcontrol')
-rw-r--r--kcontrol/access/kcmaccess.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/kcontrol/access/kcmaccess.cpp b/kcontrol/access/kcmaccess.cpp
index 485c7b80a..ccdb74f81 100644
--- a/kcontrol/access/kcmaccess.cpp
+++ b/kcontrol/access/kcmaccess.cpp
@@ -63,13 +63,13 @@ void ExtendedIntNumInput::setRange(int min, int max, int step, bool slider) {
this->min = min;
this->max = max;
sliderMax = (int)floor (0.5
- + 2*(log(max)-log(min)) / (log(max)-log(max-1)));
+ + 2*(log((double)max)-log((double)min)) / (log((double)max)-log((double)max-1)));
m_slider->setRange(0, sliderMax);
m_slider->setSteps(step, sliderMax/10);
m_slider->setTickInterval(sliderMax/10);
- double alpha = sliderMax / (log(max) - log(min));
- double logVal = alpha * (log(value())-log(min));
+ double alpha = sliderMax / (log((double)max) - log((double)min));
+ double logVal = alpha * (log((double)value())-log((double)min));
m_slider->setValue ((int)floor (0.5 + logVal));
connect(m_slider, TQT_SIGNAL(valueChanged(int)),
@@ -86,8 +86,8 @@ void ExtendedIntNumInput::slotSpinValueChanged(int val)
{
if(m_slider) {
- double alpha = sliderMax / (log(max) - log(min));
- double logVal = alpha * (log(val)-log(min));
+ double alpha = sliderMax / (log((double)max) - log((double)min));
+ double logVal = alpha * (log((double)val)-log((double)min));
m_slider->setValue ((int)floor (0.5 + logVal));
}
@@ -96,8 +96,8 @@ void ExtendedIntNumInput::slotSpinValueChanged(int val)
void ExtendedIntNumInput::slotSliderValueChanged(int val)
{
- double alpha = sliderMax / (log(max) - log(min));
- double linearVal = exp (val/alpha + log(min));
+ double alpha = sliderMax / (log((double)max) - log((double)min));
+ double linearVal = exp (val/alpha + log((double)min));
m_spin->setValue ((int)floor(0.5 + linearVal));
}