diff options
author | OBATA Akio <[email protected]> | 2019-02-11 17:54:14 +0900 |
---|---|---|
committer | OBATA Akio <[email protected]> | 2019-02-11 17:54:14 +0900 |
commit | 28d80743c0fcd9c9ca9bdccd78d3c052dc9b43de (patch) | |
tree | e5ede2debaabaa8d4e343653041fd05a28bb9352 /kcontrol | |
parent | 02cb998b9cb2cd5ef36fe0b86781fc452a0d150e (diff) | |
download | tdebase-28d80743c0fcd9c9ca9bdccd78d3c052dc9b43de.tar.gz tdebase-28d80743c0fcd9c9ca9bdccd78d3c052dc9b43de.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 <[email protected]>
Diffstat (limited to 'kcontrol')
-rw-r--r-- | kcontrol/access/kcmaccess.cpp | 14 |
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)); } |