From 1951c86395652e8d9190eba8a17fb7ea4a5897b0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Feb 2013 18:47:54 +0100 Subject: [PATCH] Reduce padding in often-used structs Reduce the padding in some often-used structs for 64bit machines. 32bit machines should also profit from most changes, but to a lesser degree. Change-Id: Ic4c67b94e962731de4f31164c52a372d78944ccc Reviewed-by: Tobias Hunger Reviewed-by: Oswald Buddenhagen --- src/libs/cplusplus/CppDocument.h | 4 ++-- src/libs/cplusplus/Macro.h | 3 +-- src/libs/cplusplus/pp-engine.h | 4 ++-- src/libs/qmldebug/qmltoolsclient.h | 2 +- src/libs/qmleditorwidgets/gradientline.cpp | 2 +- src/libs/qmljs/qmljsinterpreter.h | 2 +- src/libs/qtcomponents/styleitem/qstyleitem.cpp | 2 +- src/plugins/classview/classviewsymbolinformation.h | 2 +- src/plugins/coreplugin/dialogs/ioptionspage.h | 2 +- src/plugins/coreplugin/dialogs/settingsdialog.cpp | 2 +- src/plugins/coreplugin/progressmanager/progressbar.h | 2 +- src/plugins/cpptools/cppcompletionassist.cpp | 2 +- src/plugins/cpptools/cpptoolseditorsupport.h | 2 +- src/plugins/find/searchresulttreeitems.cpp | 4 ++-- src/plugins/find/searchresulttreeitems.h | 2 +- .../genericprojectmanager/selectablefilesmodel.h | 2 +- src/plugins/qmlprofiler/qmlprofilerdatamodel.h | 4 ++-- src/plugins/qt4projectmanager/qt4nodes.cpp | 6 +++--- src/plugins/qt4projectmanager/qt4nodes.h | 9 +++++---- src/plugins/qtsupport/exampleslistmodel.h | 4 ++-- src/plugins/texteditor/fontsettingspage.cpp | 2 +- src/plugins/texteditor/fontsettingspage.h | 2 +- .../generichighlighter/highlightdefinition.cpp | 2 +- .../generichighlighter/highlightdefinition.h | 2 +- src/plugins/texteditor/itextmark.h | 8 ++++---- src/plugins/texteditor/texteditoroverlay.cpp | 2 +- src/plugins/texteditor/texteditoroverlay.h | 2 +- src/plugins/valgrind/callgrind/callgrindparsedata.cpp | 10 +++++----- 28 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index 11ae2e6a365..6e770145a50 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -146,8 +146,8 @@ public: const QString &text, unsigned length = 0) : _level(level), - _fileName(fileName), _line(line), + _fileName(fileName), _column(column), _length(length), _text(text) @@ -185,8 +185,8 @@ public: private: int _level; - QString _fileName; unsigned _line; + QString _fileName; unsigned _column; unsigned _length; QString _text; diff --git a/src/libs/cplusplus/Macro.h b/src/libs/cplusplus/Macro.h index e45c9ff0310..aad4f9209c6 100644 --- a/src/libs/cplusplus/Macro.h +++ b/src/libs/cplusplus/Macro.h @@ -143,9 +143,7 @@ public: private: friend class Environment; Macro *_next; - unsigned _hashcode; -private: QString decoratedName() const; struct Flags @@ -160,6 +158,7 @@ private: QVector _definitionTokens; QVector _formals; QString _fileName; + unsigned _hashcode; unsigned _fileRevision; unsigned _line; unsigned _offset; diff --git a/src/libs/cplusplus/pp-engine.h b/src/libs/cplusplus/pp-engine.h index 2bad2a5f6d6..1b318c74c8b 100644 --- a/src/libs/cplusplus/pp-engine.h +++ b/src/libs/cplusplus/pp-engine.h @@ -118,17 +118,17 @@ private: QBitArray m_skipping; QBitArray m_trueTest; int m_ifLevel; - Internal::TokenBuffer *m_tokenBuffer; unsigned m_tokenBufferDepth; + Internal::TokenBuffer *m_tokenBuffer; bool m_inPreprocessorDirective; - QByteArray *m_result; bool m_markExpandedTokens; bool m_noLines; bool m_inCondition; unsigned m_offsetRef; + QByteArray *m_result; unsigned m_lineRef; ExpansionStatus m_expansionStatus; diff --git a/src/libs/qmldebug/qmltoolsclient.h b/src/libs/qmldebug/qmltoolsclient.h index 76911c68e68..b153842da1e 100644 --- a/src/libs/qmldebug/qmltoolsclient.h +++ b/src/libs/qmldebug/qmltoolsclient.h @@ -79,8 +79,8 @@ private: QList m_currentDebugIds; QmlDebugConnection *m_connection; int m_requestId; - qreal m_slowDownFactor; int m_reloadQueryId; + qreal m_slowDownFactor; int m_destroyObjectQueryId; }; diff --git a/src/libs/qmleditorwidgets/gradientline.cpp b/src/libs/qmleditorwidgets/gradientline.cpp index c1f1cdf9e0d..7de37c087b7 100644 --- a/src/libs/qmleditorwidgets/gradientline.cpp +++ b/src/libs/qmleditorwidgets/gradientline.cpp @@ -64,8 +64,8 @@ GradientLine::GradientLine(QWidget *parent) : m_activeColor(Qt::black), m_gradientName(QLatin1String("gradient")), m_colorIndex(0), - m_dragActive(false), m_yOffset(0), + m_dragActive(false), m_create(false), m_active(false), m_dragOff(false), diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h index 9c6df29c8de..cff537800a9 100644 --- a/src/libs/qmljs/qmljsinterpreter.h +++ b/src/libs/qmljs/qmljsinterpreter.h @@ -908,9 +908,9 @@ public: private: Type _type; + LanguageUtils::ComponentVersion _version; QString _name; QString _path; - LanguageUtils::ComponentVersion _version; QString _as; AST::UiImport *_ast; }; diff --git a/src/libs/qtcomponents/styleitem/qstyleitem.cpp b/src/libs/qtcomponents/styleitem/qstyleitem.cpp index 21076342f8f..c0ce9521937 100644 --- a/src/libs/qtcomponents/styleitem/qstyleitem.cpp +++ b/src/libs/qtcomponents/styleitem/qstyleitem.cpp @@ -54,7 +54,6 @@ QStyleItem::QStyleItem(QDeclarativeItem *parent) : QDeclarativeItem(parent), m_dummywidget(0), m_styleoption(0), - m_type(Undefined), m_sunken(false), m_raised(false), m_active(true), @@ -63,6 +62,7 @@ QStyleItem::QStyleItem(QDeclarativeItem *parent) m_on(false), m_horizontal(true), m_sharedWidget(false), + m_type(Undefined), m_minimum(0), m_maximum(100), m_value(0), diff --git a/src/plugins/classview/classviewsymbolinformation.h b/src/plugins/classview/classviewsymbolinformation.h index 77b316320fd..d7331347a62 100644 --- a/src/plugins/classview/classviewsymbolinformation.h +++ b/src/plugins/classview/classviewsymbolinformation.h @@ -70,10 +70,10 @@ public: private: int m_iconType; //!< icon type + uint m_hash; //!< precalculated hash value - to speed up qHash QString m_name; //!< symbol name (e.g. SymbolInformation) QString m_type; //!< symbol type (e.g. (int char)) - uint m_hash; //!< precalculated hash value - to speed up qHash }; //! qHash overload for QHash/QSet diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.h b/src/plugins/coreplugin/dialogs/ioptionspage.h index 178ca4e66c6..1fa1e514479 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.h +++ b/src/plugins/coreplugin/dialogs/ioptionspage.h @@ -63,8 +63,8 @@ protected: void setCategoryIcon(const QString &categoryIcon) { m_categoryIcon = categoryIcon; } Id m_id; - QString m_displayName; Id m_category; + QString m_displayName; QString m_displayCategory; QString m_categoryIcon; }; diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp index 52a1f1aee9f..f123489035f 100644 --- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -73,11 +73,11 @@ class Category { public: Id id; + int index; QString displayName; QIcon icon; QList pages; QList providers; - int index; QTabWidget *tabWidget; }; diff --git a/src/plugins/coreplugin/progressmanager/progressbar.h b/src/plugins/coreplugin/progressmanager/progressbar.h index c4d71044288..e23fa6f0c30 100644 --- a/src/plugins/coreplugin/progressmanager/progressbar.h +++ b/src/plugins/coreplugin/progressmanager/progressbar.h @@ -75,13 +75,13 @@ private: QImage bar; QString m_text; QString m_title; - bool m_error; int m_progressHeight; int m_minimum; int m_maximum; int m_value; float m_cancelButtonFader; bool m_finished; + bool m_error; }; } // namespace Internal diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp index 10708feedd2..72be9a4bf04 100644 --- a/src/plugins/cpptools/cppcompletionassist.cpp +++ b/src/plugins/cpptools/cppcompletionassist.cpp @@ -111,8 +111,8 @@ public: private: bool m_isOverloaded; - unsigned m_completionOperator; mutable QChar m_typedChar; + unsigned m_completionOperator; QSharedPointer m_typeOfExpression; }; diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h index 0836254026d..26b28297983 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.h +++ b/src/plugins/cpptools/cpptoolseditorsupport.h @@ -89,9 +89,9 @@ private: QPointer _textEditor; QTimer *_updateDocumentTimer; int _updateDocumentInterval; + unsigned _revision; QFuture _documentParser; QString _cachedContents; - unsigned _revision; }; } // namespace Internal diff --git a/src/plugins/find/searchresulttreeitems.cpp b/src/plugins/find/searchresulttreeitems.cpp index 1503fa71e7b..b5e9ac8b5a2 100644 --- a/src/plugins/find/searchresulttreeitems.cpp +++ b/src/plugins/find/searchresulttreeitems.cpp @@ -36,8 +36,8 @@ SearchResultTreeItem::SearchResultTreeItem(const Find::SearchResultItem &item, : item(item), m_parent(parent), m_isUserCheckable(false), - m_checkState(Qt::Unchecked), - m_isGenerated(false) + m_isGenerated(false), + m_checkState(Qt::Unchecked) { } diff --git a/src/plugins/find/searchresulttreeitems.h b/src/plugins/find/searchresulttreeitems.h index d7e9f1726e1..dce537be0a2 100644 --- a/src/plugins/find/searchresulttreeitems.h +++ b/src/plugins/find/searchresulttreeitems.h @@ -74,8 +74,8 @@ private: SearchResultTreeItem *m_parent; QList m_children; bool m_isUserCheckable; - Qt::CheckState m_checkState; bool m_isGenerated; + Qt::CheckState m_checkState; }; } // namespace Internal diff --git a/src/plugins/genericprojectmanager/selectablefilesmodel.h b/src/plugins/genericprojectmanager/selectablefilesmodel.h index fccf9d8d736..7d1fafb126b 100644 --- a/src/plugins/genericprojectmanager/selectablefilesmodel.h +++ b/src/plugins/genericprojectmanager/selectablefilesmodel.h @@ -46,12 +46,12 @@ struct Tree { QString name; Qt::CheckState checked; + bool isDir; QList childDirectories; QList files; QList visibleFiles; QIcon icon; QString fullPath; - bool isDir; Tree *parent; }; diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.h b/src/plugins/qmlprofiler/qmlprofilerdatamodel.h index bbd2c279dfb..0eb31b43f26 100644 --- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.h +++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.h @@ -56,6 +56,8 @@ struct QmlRangeEventData QmlDebug::QmlEventLocation location; QmlDebug::QmlEventType eventType; + bool isBindingLoop; + QHash parentHash; QHash childrenHash; @@ -67,8 +69,6 @@ struct QmlRangeEventData double percentOfTime; qint64 medianTime; - bool isBindingLoop; - QmlRangeEventData &operator=(const QmlRangeEventData &ref); }; diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 1dd62e072e9..1ba540c22c7 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -287,9 +287,9 @@ struct InternalNode QMap subnodes; QStringList files; ProjectExplorer::FileType type; + int priority; QString displayName; QString typeName; - int priority; QString fullPath; QIcon icon; @@ -305,7 +305,7 @@ struct InternalNode qDeleteAll(subnodes); } - // Creates a tree structure from a list of absolute file paths. + // Creates: a tree structure from a list of absolute file paths. // Empty directories are compressed into a single entry with a longer path. // * project // * /absolute/path @@ -1435,9 +1435,9 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project, const QString &filePath, QObject *parent) : Qt4PriFileNode(project, this, filePath), - m_projectType(InvalidProject), m_validParse(false), m_parseInProgress(true), + m_projectType(InvalidProject), m_readerExact(0), m_readerCumulative(0) { diff --git a/src/plugins/qt4projectmanager/qt4nodes.h b/src/plugins/qt4projectmanager/qt4nodes.h index 67d8b962460..7b31371b875 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.h +++ b/src/plugins/qt4projectmanager/qt4nodes.h @@ -433,9 +433,13 @@ private: TargetInformation targetInformation(QtSupport::ProFileReader *reader) const; void setupInstallsList(const QtSupport::ProFileReader *reader); + bool m_isDeployable; + + bool m_validParse; + bool m_parseInProgress; + Qt4ProjectType m_projectType; Qt4VariablesHash m_varValues; - bool m_isDeployable; QMap m_uitimestamps; TargetInformation m_qt4targetInformation; @@ -444,9 +448,6 @@ private: InstallsList m_installsList; friend class Qt4NodeHierarchy; - bool m_validParse; - bool m_parseInProgress; - QStringList m_uiHeaderFiles; // Async stuff diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index 1a32c5b4930..d23a0a5deb5 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -56,7 +56,6 @@ enum InstructionalType struct ExampleItem { ExampleItem(): difficulty(0), isVideo(false), isHighlighted(false) {} - InstructionalType type; QString name; QString projectPath; QString description; @@ -65,13 +64,14 @@ struct ExampleItem QStringList filesToOpen; QStringList tags; QStringList dependencies; + InstructionalType type; int difficulty; bool hasSourceCode; bool isVideo; + bool isHighlighted; QString videoUrl; QString videoLength; QStringList platforms; - bool isHighlighted; }; class ExamplesListModel : public QAbstractListModel diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index c36d39bd25c..090d6f72baa 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -238,8 +238,8 @@ FormatDescription::FormatDescription(TextStyle id, const QString &displayName, c FormatDescription::FormatDescription(TextStyle id, const QString &displayName, const QString &tooltipText, const Format &format) : m_id(id), - m_displayName(displayName), m_format(format), + m_displayName(displayName), m_tooltipText(tooltipText) { } diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h index 5cbf09d1441..3870904cd27 100644 --- a/src/plugins/texteditor/fontsettingspage.h +++ b/src/plugins/texteditor/fontsettingspage.h @@ -76,8 +76,8 @@ public: private: TextStyle m_id; // Name of the category - QString m_displayName; // Displayed name of the category Format m_format; // Default format + QString m_displayName; // Displayed name of the category QString m_tooltipText; // Description text for category }; diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinition.cpp b/src/plugins/texteditor/generichighlighter/highlightdefinition.cpp index 1807a42979f..69d143786ad 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinition.cpp +++ b/src/plugins/texteditor/generichighlighter/highlightdefinition.cpp @@ -40,8 +40,8 @@ using namespace TextEditor; using namespace Internal; HighlightDefinition::HighlightDefinition() : - m_singleLineCommentAfterWhiteSpaces(false), m_keywordCaseSensitivity(Qt::CaseSensitive), + m_singleLineCommentAfterWhiteSpaces(false), m_indentationBasedFolding(false) { QString s(QLatin1String(".():!+,-<=>%&/;?[]^{|}~\\*, \t")); diff --git a/src/plugins/texteditor/generichighlighter/highlightdefinition.h b/src/plugins/texteditor/generichighlighter/highlightdefinition.h index e294ee03162..2d45de7006b 100644 --- a/src/plugins/texteditor/generichighlighter/highlightdefinition.h +++ b/src/plugins/texteditor/generichighlighter/highlightdefinition.h @@ -106,7 +106,6 @@ private: QString m_initialContext; QString m_singleLineComment; - bool m_singleLineCommentAfterWhiteSpaces; QString m_multiLineCommentStart; QString m_multiLineCommentEnd; @@ -114,6 +113,7 @@ private: Qt::CaseSensitivity m_keywordCaseSensitivity; + bool m_singleLineCommentAfterWhiteSpaces; bool m_indentationBasedFolding; QSet m_delimiters; diff --git a/src/plugins/texteditor/itextmark.h b/src/plugins/texteditor/itextmark.h index 3f5693bb4f7..eb5a8b81c09 100644 --- a/src/plugins/texteditor/itextmark.h +++ b/src/plugins/texteditor/itextmark.h @@ -56,8 +56,8 @@ public: : m_markableInterface(0), m_lineNumber(line), m_priority(NormalPriority), - m_widthFactor(1.0), - m_visible(true) + m_visible(true), + m_widthFactor(1.0) {} virtual ~ITextMark(); @@ -95,10 +95,10 @@ private: Q_DISABLE_COPY(ITextMark) ITextMarkable *m_markableInterface; int m_lineNumber; - QIcon m_icon; Priority m_priority; - double m_widthFactor; bool m_visible; + QIcon m_icon; + double m_widthFactor; }; typedef QList TextMarks; diff --git a/src/plugins/texteditor/texteditoroverlay.cpp b/src/plugins/texteditor/texteditoroverlay.cpp index 354cb8c852d..a20376364aa 100644 --- a/src/plugins/texteditor/texteditoroverlay.cpp +++ b/src/plugins/texteditor/texteditoroverlay.cpp @@ -41,9 +41,9 @@ using namespace TextEditor::Internal; TextEditorOverlay::TextEditorOverlay(BaseTextEditorWidget *editor) : QObject(editor), m_visible(false), + m_alpha(true), m_borderWidth(1), m_dropShadowWidth(2), - m_alpha(true), m_firstSelectionOriginalBegin(-1), m_editor(editor), m_viewport(editor->viewport()) diff --git a/src/plugins/texteditor/texteditoroverlay.h b/src/plugins/texteditor/texteditoroverlay.h index 4d65a23893b..05a8163038c 100644 --- a/src/plugins/texteditor/texteditoroverlay.h +++ b/src/plugins/texteditor/texteditoroverlay.h @@ -112,9 +112,9 @@ private: QTextCursor assembleCursorForSelection(int selectionIndex) const; bool m_visible; + bool m_alpha; int m_borderWidth; int m_dropShadowWidth; - bool m_alpha; int m_firstSelectionOriginalBegin; BaseTextEditorWidget *m_editor; QWidget *m_viewport; diff --git a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp index fb3a3129437..f7c69dcf647 100644 --- a/src/plugins/valgrind/callgrind/callgrindparsedata.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparsedata.cpp @@ -49,8 +49,8 @@ class ParseData::Private { Q_DECLARE_TR_FUNCTIONS(Valgrind::Callgrind::ParseData) public: Private(ParseData *q) - : m_lineNumberPositionIndex(-1) - , m_pid(0) + : m_pid(0) + , m_lineNumberPositionIndex(-1) , m_part(0) , m_version(0) , m_cycleCacheValid(false) @@ -62,14 +62,15 @@ public: QStringList m_events; QStringList m_positions; - int m_lineNumberPositionIndex; QVector m_totalCosts; QVector m_functions; QString m_command; quint64 m_pid; + int m_lineNumberPositionIndex; uint m_part; - QStringList m_descriptions; int m_version; + bool m_cycleCacheValid; + QStringList m_descriptions; QString m_creator; QHash > > functionLookup; @@ -84,7 +85,6 @@ public: void cycleDetection(); void cleanupFunctionCycles(); - bool m_cycleCacheValid; QVector m_cycleCache; ParseData *m_q;