Improve some structure layouts

This commit is contained in:
Martchus 2018-03-11 16:14:42 +01:00
parent 0215b89057
commit b35fc2ff0d
7 changed files with 31 additions and 31 deletions

View File

@ -133,8 +133,8 @@ protected:
IdentifierType m_id;
uint64 m_startOffset;
uint64 m_maxSize;
uint32 m_idLength;
DataSizeType m_dataSize;
uint32 m_idLength;
uint32 m_sizeLength;
ImplementationType *m_parent;
std::unique_ptr<ImplementationType> m_nextSibling;
@ -159,8 +159,8 @@ template <class ImplementationType>
GenericFileElement<ImplementationType>::GenericFileElement(GenericFileElement<ImplementationType>::ContainerType &container, uint64 startOffset)
: m_id(IdentifierType())
, m_startOffset(startOffset)
, m_idLength(0)
, m_dataSize(0)
, m_idLength(0)
, m_sizeLength(0)
, m_parent(nullptr)
, m_container(&container)
@ -184,8 +184,8 @@ GenericFileElement<ImplementationType>::GenericFileElement(ImplementationType &p
: m_id(IdentifierType())
, m_startOffset(startOffset)
, m_maxSize(parent.startOffset() + parent.totalSize() - startOffset)
, m_idLength(0)
, m_dataSize(0)
, m_idLength(0)
, m_sizeLength(0)
, m_parent(&parent)
, m_container(&parent.container())
@ -203,8 +203,8 @@ GenericFileElement<ImplementationType>::GenericFileElement(
: m_id(IdentifierType())
, m_startOffset(startOffset)
, m_maxSize(maxSize)
, m_idLength(0)
, m_dataSize(0)
, m_idLength(0)
, m_sizeLength(0)
, m_parent(nullptr)
, m_container(&container)

View File

@ -34,11 +34,11 @@ enum Id3v2TextEncodingByte : byte { Ascii, Utf16WithBom, Utf16BigEndianWithoutBo
* \brief Constructs a new Id3v2Frame.
*/
Id3v2Frame::Id3v2Frame()
: m_flag(0)
, m_group(0)
, m_parsedVersion(0)
: m_parsedVersion(0)
, m_dataSize(0)
, m_totalSize(0)
, m_flag(0)
, m_group(0)
, m_padding(false)
{
}
@ -48,11 +48,11 @@ Id3v2Frame::Id3v2Frame()
*/
Id3v2Frame::Id3v2Frame(const IdentifierType &id, const TagValue &value, byte group, uint16 flag)
: TagField<Id3v2Frame>(id, value)
, m_flag(flag)
, m_group(group)
, m_parsedVersion(0)
, m_dataSize(0)
, m_totalSize(0)
, m_flag(flag)
, m_group(group)
, m_padding(false)
{
}

View File

@ -142,11 +142,11 @@ protected:
void clear();
private:
uint16 m_flag;
byte m_group;
uint32 m_parsedVersion;
uint32 m_dataSize;
uint32 m_totalSize;
uint16 m_flag;
byte m_group;
bool m_padding;
};

View File

@ -87,14 +87,14 @@ MediaFileInfo::MediaFileInfo()
, m_tagsParsingStatus(ParsingStatus::NotParsedYet)
, m_chaptersParsingStatus(ParsingStatus::NotParsedYet)
, m_attachmentsParsingStatus(ParsingStatus::NotParsedYet)
, m_forceFullParse(MEDIAINFO_CPP_FORCE_FULL_PARSE)
, m_forceRewrite(true)
, m_minPadding(0)
, m_maxPadding(0)
, m_preferredPadding(0)
, m_tagPosition(ElementPosition::BeforeData)
, m_forceTagPosition(true)
, m_indexPosition(ElementPosition::BeforeData)
, m_forceFullParse(MEDIAINFO_CPP_FORCE_FULL_PARSE)
, m_forceRewrite(true)
, m_forceTagPosition(true)
, m_forceIndexPosition(true)
{
}
@ -114,14 +114,14 @@ MediaFileInfo::MediaFileInfo(const string &path)
, m_tagsParsingStatus(ParsingStatus::NotParsedYet)
, m_chaptersParsingStatus(ParsingStatus::NotParsedYet)
, m_attachmentsParsingStatus(ParsingStatus::NotParsedYet)
, m_forceFullParse(MEDIAINFO_CPP_FORCE_FULL_PARSE)
, m_forceRewrite(true)
, m_minPadding(0)
, m_maxPadding(0)
, m_preferredPadding(0)
, m_tagPosition(ElementPosition::BeforeData)
, m_forceTagPosition(true)
, m_indexPosition(ElementPosition::BeforeData)
, m_forceFullParse(MEDIAINFO_CPP_FORCE_FULL_PARSE)
, m_forceRewrite(true)
, m_forceTagPosition(true)
, m_forceIndexPosition(true)
{
}

View File

@ -185,14 +185,14 @@ private:
// fields specifying object behaviour
std::string m_saveFilePath;
bool m_forceFullParse;
bool m_forceRewrite;
size_t m_minPadding;
size_t m_maxPadding;
size_t m_preferredPadding;
ElementPosition m_tagPosition;
bool m_forceTagPosition;
ElementPosition m_indexPosition;
bool m_forceFullParse;
bool m_forceRewrite;
bool m_forceTagPosition;
bool m_forceIndexPosition;
};

View File

@ -30,13 +30,13 @@ namespace TagParser {
*/
TagValue::TagValue(const TagValue &other)
: m_size(other.m_size)
, m_type(other.m_type)
, m_desc(other.m_desc)
, m_mimeType(other.m_mimeType)
, m_language(other.m_language)
, m_labeledAsReadonly(other.m_labeledAsReadonly)
, m_type(other.m_type)
, m_encoding(other.m_encoding)
, m_descEncoding(other.m_descEncoding)
, m_labeledAsReadonly(other.m_labeledAsReadonly)
{
if (!other.isEmpty()) {
m_ptr = make_unique<char[]>(m_size);

View File

@ -135,13 +135,13 @@ private:
std::unique_ptr<char[]> m_ptr;
std::size_t m_size;
TagDataType m_type;
std::string m_desc;
std::string m_mimeType;
std::string m_language;
bool m_labeledAsReadonly;
TagDataType m_type;
TagTextEncoding m_encoding;
TagTextEncoding m_descEncoding;
bool m_labeledAsReadonly;
};
/*!
@ -150,9 +150,9 @@ private:
inline TagValue::TagValue()
: m_size(0)
, m_type(TagDataType::Undefined)
, m_labeledAsReadonly(false)
, m_encoding(TagTextEncoding::Latin1)
, m_descEncoding(TagTextEncoding::Latin1)
, m_labeledAsReadonly(false)
{
}
@ -174,8 +174,8 @@ inline TagValue::~TagValue()
* \remarks Strips the BOM of the specified \a text.
*/
inline TagValue::TagValue(const char *text, std::size_t textSize, TagTextEncoding textEncoding, TagTextEncoding convertTo)
: m_labeledAsReadonly(false)
, m_descEncoding(TagTextEncoding::Latin1)
: m_descEncoding(TagTextEncoding::Latin1)
, m_labeledAsReadonly(false)
{
assignText(text, textSize, textEncoding, convertTo);
}
@ -190,8 +190,8 @@ inline TagValue::TagValue(const char *text, std::size_t textSize, TagTextEncodin
* \remarks Strips the BOM of the specified \a text.
*/
inline TagValue::TagValue(const std::string &text, TagTextEncoding textEncoding, TagTextEncoding convertTo)
: m_labeledAsReadonly(false)
, m_descEncoding(TagTextEncoding::Latin1)
: m_descEncoding(TagTextEncoding::Latin1)
, m_labeledAsReadonly(false)
{
assignText(text, textEncoding, convertTo);
}
@ -217,9 +217,9 @@ inline TagValue::TagValue(int value)
inline TagValue::TagValue(const char *data, std::size_t length, TagDataType type, TagTextEncoding encoding)
: m_size(length)
, m_type(type)
, m_labeledAsReadonly(false)
, m_encoding(encoding)
, m_descEncoding(TagTextEncoding::Latin1)
, m_labeledAsReadonly(false)
{
if (length) {
if (type == TagDataType::Text) {
@ -245,9 +245,9 @@ inline TagValue::TagValue(const char *data, std::size_t length, TagDataType type
inline TagValue::TagValue(std::unique_ptr<char[]> &&data, std::size_t length, TagDataType type, TagTextEncoding encoding)
: m_size(length)
, m_type(type)
, m_labeledAsReadonly(false)
, m_encoding(encoding)
, m_descEncoding(TagTextEncoding::Latin1)
, m_labeledAsReadonly(false)
{
if (length) {
m_ptr = move(data);