Remove use of C-style casts
This commit is contained in:
committed by
Jonas Kvinge
parent
637772f8f0
commit
b38ad81928
@@ -98,7 +98,7 @@ void Analyzer::Base::paintEvent(QPaintEvent *e) {
|
||||
|
||||
// convert to mono here - our built in analyzers need mono, but the engines provide interleaved pcm
|
||||
for (uint x = 0; static_cast<int>(x) < fht_->size(); ++x) {
|
||||
lastscope_[x] = double(thescope[i] + thescope[i + 1]) / (2 * (1 << 15));
|
||||
lastscope_[x] = static_cast<float>(thescope[i] + thescope[i + 1]) / (2 * (1U << 15U));
|
||||
i += 2;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ void Analyzer::Base::demo(QPainter &p) {
|
||||
if (t < 201) {
|
||||
Scope s(32);
|
||||
|
||||
const double dt = double(t) / 200;
|
||||
const double dt = static_cast<double>(t) / 200;
|
||||
for (uint i = 0; i < s.size(); ++i) {
|
||||
s[i] = dt * (sin(M_PI + (i * M_PI) / s.size()) + 1.0);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ void BlockAnalyzer::determineStep() {
|
||||
// the fall time of 30 is too slow on framerates above 50fps
|
||||
const double fallTime = static_cast<double>(timeout() < 20 ? 20 * rows_ : 30 * rows_);
|
||||
|
||||
step_ = double(rows_ * timeout()) / fallTime;
|
||||
step_ = static_cast<double>(rows_ * timeout()) / fallTime;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void BoomAnalyzer::resizeEvent(QResizeEvent *e) {
|
||||
bands_ = qMin(static_cast<int>(static_cast<double>(width() + 1) / (kColumnWidth + 1)) + 1, kMaxBandCount);
|
||||
scope_.resize(bands_);
|
||||
|
||||
F_ = double(HEIGHT) / (log10(256) * double(1.1) /*<- max. amplitude*/);
|
||||
F_ = static_cast<double>(HEIGHT) / (log10(256) * static_cast<double>(1.1) /*<- max. amplitude*/);
|
||||
|
||||
barPixmap_ = QPixmap(kColumnWidth - 2, HEIGHT);
|
||||
canvas_ = QPixmap(size());
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <QVector>
|
||||
#include <QtMath>
|
||||
|
||||
FHT::FHT(uint n) : num_((n < 3) ? 0 : 1 << n), exp2_((n < 3) ? int(-1) : int(n)) {
|
||||
FHT::FHT(uint n) : num_((n < 3) ? 0 : 1 << n), exp2_((n < 3) ? static_cast<int>(-1) : static_cast<int>(n)) {
|
||||
|
||||
if (n > 3) {
|
||||
buf_vector_.resize(num_);
|
||||
|
||||
Reference in New Issue
Block a user