Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faecb78a authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Fix google-explicit-constructor warnings in frameworks/base

* Add explicit keyword to conversion constructors.
* Add NOLINT to implicit conversion constructors.

Bug: 28341362
Test: build with clang-tidy
Change-Id: Ie4d37072ab57d1662d18db4de1c8577247f43337
parent ed6625d9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public:

private:
    friend class AnimationContext;
    AnimationHandle(AnimationContext& context);
    explicit AnimationHandle(AnimationContext& context);
    AnimationHandle(RenderNode& animatingNode, AnimationContext& context);
    ~AnimationHandle();

@@ -75,7 +75,7 @@ private:
class AnimationContext {
    PREVENT_COPY_AND_ASSIGN(AnimationContext);
public:
    ANDROID_API AnimationContext(renderthread::TimeLord& clock);
    ANDROID_API explicit AnimationContext(renderthread::TimeLord& clock);
    ANDROID_API virtual ~AnimationContext();

    nsecs_t frameTimeMs() { return mFrameTimeMs; }
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ class TreeInfo;
class AnimatorManager {
    PREVENT_COPY_AND_ASSIGN(AnimatorManager);
public:
    AnimatorManager(RenderNode& parent);
    explicit AnimatorManager(RenderNode& parent);
    ~AnimatorManager();

    void addAnimator(const sp<BaseRenderNodeAnimator>& animator);
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public:
        return sInstance != nullptr;
    }
private:
    Caches(RenderState& renderState);
    explicit Caches(RenderState& renderState);
    static Caches* sInstance;

public:
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ namespace uirenderer {
class CanvasPropertyPrimitive : public VirtualLightRefBase {
    PREVENT_COPY_AND_ASSIGN(CanvasPropertyPrimitive);
public:
    CanvasPropertyPrimitive(float initialValue) : value(initialValue) {}
    explicit CanvasPropertyPrimitive(float initialValue) : value(initialValue) {}

    float value;
};
@@ -36,7 +36,7 @@ public:
class CanvasPropertyPaint : public VirtualLightRefBase {
    PREVENT_COPY_AND_ASSIGN(CanvasPropertyPaint);
public:
    CanvasPropertyPaint(const SkPaint& initialValue) : value(initialValue) {}
    explicit CanvasPropertyPaint(const SkPaint& initialValue) : value(initialValue) {}

    SkPaint value;
};
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public:

class ANDROID_API CanvasState {
public:
    CanvasState(CanvasStateClient& renderer);
    explicit CanvasState(CanvasStateClient& renderer);
    ~CanvasState();

    /**
Loading