drm_hwcomposer: enable code analysis using clang-tidy
Drm hwcomposer project has some code-style inconsistencies.
This is the initial step to unify code-style of the code.
Clang-tidy is a great tool which can not only suggest correct styling,
but also allow predicting the errors in the code and suggest correct
coding approaches to avoid potential weaknesses.
CI was tuned to check clang-tidy recommendation for some part of the
code which is ready ATM (can be built outside AOSP tree).
For this part a limited set of clang-tidy checks has applied (coarse check).
Header files aren't checked at all.
Starting from now new code files must be included into the list that is
checked by almost all clang-tidy checks (fine checklist). New header files
should be also included into this list.
See '.gitlab-ci-clang-tidy-fine.sh'.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/drm/DrmDevice.h b/drm/DrmDevice.h
index be68aa6..d8f347f 100644
--- a/drm/DrmDevice.h
+++ b/drm/DrmDevice.h
@@ -71,13 +71,13 @@
int GetConnectorProperty(const DrmConnector &connector, const char *prop_name,
DrmProperty *property);
- const std::string GetName() const;
+ std::string GetName() const;
const std::vector<std::unique_ptr<DrmCrtc>> &crtcs() const;
uint32_t next_mode_id();
- int CreatePropertyBlob(void *data, size_t length, uint32_t *blob_id);
- int DestroyPropertyBlob(uint32_t blob_id);
+ int CreatePropertyBlob(void *data, size_t length, uint32_t *blob_id) const;
+ int DestroyPropertyBlob(uint32_t blob_id) const;
bool HandlesDisplay(int display) const;
void RegisterHotplugHandler(DrmEventHandler *handler) {
event_listener_.RegisterHotplugHandler(handler);
@@ -86,7 +86,7 @@
private:
int TryEncoderForDisplay(int display, DrmEncoder *enc);
int GetProperty(uint32_t obj_id, uint32_t obj_type, const char *prop_name,
- DrmProperty *property);
+ DrmProperty *property) const;
int CreateDisplayPipe(DrmConnector *connector);
int AttachWriteback(DrmConnector *display_conn);