Replace use of C style casts

This commit is contained in:
Jonas Kvinge
2020-06-15 17:59:02 +02:00
parent a68c249d4e
commit 72ede666d4
35 changed files with 105 additions and 111 deletions

View File

@@ -265,7 +265,7 @@ static void input_data_mixed_float(const guint8* _in, double* out, guint len, do
Q_UNUSED(max_value);
guint j, ip = 0;
gfloat *in = (gfloat *) _in;
const gfloat *in = reinterpret_cast<const gfloat*>(_in);
for (j = 0; j < len; j++) {
out[op] = in[ip++];
@@ -279,7 +279,7 @@ static void input_data_mixed_double (const guint8 * _in, double* out, guint len,
Q_UNUSED(max_value);
guint j, ip = 0;
gdouble *in = (gdouble *) _in;
const gdouble *in = reinterpret_cast<const gdouble*>(_in);
for (j = 0; j < len; j++) {
out[op] = in[ip++];
@@ -291,7 +291,7 @@ static void input_data_mixed_double (const guint8 * _in, double* out, guint len,
static void input_data_mixed_int32_max (const guint8 * _in, double* out, guint len, double max_value, guint op, guint nfft) {
guint j, ip = 0;
gint32 *in = (gint32 *) _in;
const gint32 *in = reinterpret_cast<const gint32*>(_in);
for (j = 0; j < len; j++) {
out[op] = in[ip++] / max_value;
@@ -323,7 +323,7 @@ static void input_data_mixed_int24_max (const guint8 * _in, double* out, guint l
static void input_data_mixed_int16_max (const guint8 * _in, double * out, guint len, double max_value, guint op, guint nfft) {
guint j, ip = 0;
gint16 *in = (gint16 *) _in;
const gint16 *in = reinterpret_cast<const gint16*>(_in);
for (j = 0; j < len; j++) {
out[op] = in[ip++] / max_value;

View File

@@ -196,10 +196,10 @@ void SetLevels(const QString &levels) {
}
if (class_name.isEmpty() || class_name == "*") {
sDefaultLevel = (Level) level;
sDefaultLevel = static_cast<Level>(level);
}
else {
sClassLevels->insert(class_name, (Level) level);
sClassLevels->insert(class_name, static_cast<Level>(level));
}
}

View File

@@ -803,7 +803,7 @@ QByteArray TagReader::LoadEmbeddedArt(const QString &filename) const {
TagLib::ID3v2::AttachedPictureFrame *pic = static_cast<TagLib::ID3v2::AttachedPictureFrame*>(apic_frames.front());
return QByteArray((const char*) pic->picture().data(), pic->picture().size());
return QByteArray(reinterpret_cast<const char*>(pic->picture().data()), pic->picture().size());
}
// MP4/AAC
@@ -834,7 +834,7 @@ QByteArray TagReader::LoadEmbeddedAPEArt(const TagLib::APE::ItemListMap &map) co
TagLib::ByteVector data = it->second.binaryData();
int pos = data.find('\0') + 1;
if ((pos > 0) && ((uint)pos < data.size())) {
if ((pos > 0) && (static_cast<uint>(pos) < data.size())) {
ret = QByteArray(data.data() + pos, data.size() - pos);
}
}