Inspection: Variable can be made constexpr

This commit is contained in:
Urs Fleisch
2024-01-20 17:22:53 +01:00
parent 710522e6e1
commit 5d921c6325
18 changed files with 26 additions and 26 deletions

View File

@@ -98,7 +98,7 @@ void PrivateFrame::parseFields(const ByteVector &data)
// Owner identifier is assumed to be Latin1
const int byteAlign = 1;
constexpr int byteAlign = 1;
const int endOfOwner = data.find(textDelimiter(String::Latin1), 0, byteAlign);
d->owner = String(data.mid(0, endOfOwner));

View File

@@ -54,8 +54,8 @@ namespace
const ID3v2::Latin1StringHandler defaultStringHandler;
const ID3v2::Latin1StringHandler *stringHandler = &defaultStringHandler;
const long MinPaddingSize = 1024;
const long MaxPaddingSize = 1024 * 1024;
constexpr long MinPaddingSize = 1024;
constexpr long MaxPaddingSize = 1024 * 1024;
} // namespace
class ID3v2::Tag::TagPrivate

View File

@@ -349,7 +349,7 @@ void MPEG::Header::parse(File *file, offset_t offset, bool checkLength)
if(nextData.size() < 4)
return;
const unsigned int HeaderMask = 0xfffe0c00;
constexpr unsigned int HeaderMask = 0xfffe0c00;
const unsigned int header = data.toUInt(0, true) & HeaderMask;
const unsigned int nextHeader = nextData.toUInt(0, true) & HeaderMask;