summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2016-04-27 11:29:23 -0700
committerChih-Hung Hsieh <chh@google.com>2016-04-27 11:38:12 -0700
commitc6baf563ba6aa207a48317c177b29f1d2b70cf3d (patch)
tree38cb5ab3e8ce0ebe0bcdace644378ad037adb37f
parentcd4f7e12037acd16f500dc9a4be98e51fe58a11b (diff)
Fix google-explicit-constructor warnings.
Bug: 28341362 Change-Id: Ibdd6a210bb7ff228e3624cc319169f77aca3b51e
-rwxr-xr-xcore/jni/android/graphics/Bitmap.cpp2
-rw-r--r--core/jni/android/graphics/HarfBuzzNGFaceSkia.cpp2
-rw-r--r--core/jni/android/graphics/Region.cpp2
-rw-r--r--core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp2
-rw-r--r--core/jni/android_util_AssetManager.cpp2
-rw-r--r--core/jni/android_view_GraphicBuffer.cpp2
-rw-r--r--core/jni/android_view_InputChannel.cpp2
-rw-r--r--core/jni/android_view_ThreadedRenderer.cpp6
-rw-r--r--core/jni/android_view_VelocityTracker.cpp2
-rw-r--r--libs/androidfw/ResourceTypes.cpp2
-rw-r--r--libs/androidfw/ZipUtils.cpp4
-rw-r--r--libs/hwui/AnimatorManager.cpp2
-rw-r--r--libs/hwui/DeferredDisplayList.cpp2
-rw-r--r--libs/hwui/SkiaCanvas.cpp2
-rw-r--r--libs/hwui/TessellationCache.cpp6
-rw-r--r--libs/hwui/renderstate/RenderState.cpp2
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp2
-rw-r--r--libs/hwui/unit_tests/LinearAllocatorTests.cpp2
-rw-r--r--libs/storage/IMountService.cpp2
-rw-r--r--libs/storage/IObbActionListener.cpp2
-rw-r--r--media/mca/filterfw/jni/jni_gl_environment.cpp2
-rw-r--r--native/android/asset_manager.cpp4
-rw-r--r--native/android/choreographer.cpp2
-rw-r--r--native/android/storage_manager.cpp2
-rw-r--r--services/core/jni/com_android_server_AlarmManagerService.cpp2
-rw-r--r--services/core/jni/com_android_server_hdmi_HdmiCecController.cpp2
-rw-r--r--tools/aapt2/ResourceTable_test.cpp2
27 files changed, 33 insertions, 33 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index a805b6d1d151..167294e94083 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -380,7 +380,7 @@ using namespace android;
// on the caller already having a local JNI ref
class LocalScopedBitmap {
public:
- LocalScopedBitmap(jlong bitmapHandle)
+ explicit LocalScopedBitmap(jlong bitmapHandle)
: mBitmap(reinterpret_cast<Bitmap*>(bitmapHandle)) {}
Bitmap* operator->() {
diff --git a/core/jni/android/graphics/HarfBuzzNGFaceSkia.cpp b/core/jni/android/graphics/HarfBuzzNGFaceSkia.cpp
index e53794243198..939249a48b19 100644
--- a/core/jni/android/graphics/HarfBuzzNGFaceSkia.cpp
+++ b/core/jni/android/graphics/HarfBuzzNGFaceSkia.cpp
@@ -50,7 +50,7 @@ static const bool kDebugGlyphs = false;
// calls. See the Harfbuzz source for references about what these callbacks do.
struct HarfBuzzFontData {
- HarfBuzzFontData(SkPaint* paint) : m_paint(paint) { }
+ explicit HarfBuzzFontData(SkPaint* paint) : m_paint(paint) { }
SkPaint* m_paint;
};
diff --git a/core/jni/android/graphics/Region.cpp b/core/jni/android/graphics/Region.cpp
index bcd0b60308bb..b7d652485749 100644
--- a/core/jni/android/graphics/Region.cpp
+++ b/core/jni/android/graphics/Region.cpp
@@ -268,7 +268,7 @@ struct RgnIterPair {
SkRegion fRgn; // a copy of the caller's region
SkRegion::Iterator fIter; // an iterator acting upon the copy (fRgn)
- RgnIterPair(const SkRegion& rgn) : fRgn(rgn) {
+ explicit RgnIterPair(const SkRegion& rgn) : fRgn(rgn) {
// have our iterator reference our copy (fRgn), so we know it will be
// unchanged for the lifetime of the iterator
fIter.reset(fRgn);
diff --git a/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp b/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp
index f0420585bfa4..a08166568c9f 100644
--- a/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp
+++ b/core/jni/android_hardware_camera2_legacy_PerfMeasurement.cpp
@@ -114,7 +114,7 @@ class PerfMeasurementContext {
* will be active at once, which is a function of the GPU's level of
* pipelining and the frequency of queries.
*/
- PerfMeasurementContext(size_t maxQueryCount):
+ explicit PerfMeasurementContext(size_t maxQueryCount):
mTimingStartIndex(0),
mTimingEndIndex(0),
mTimingQueryIndex(0) {
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 8385f75e4a66..5bbc4a43c6e8 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -1059,7 +1059,7 @@ static void android_content_AssetManager_dumpTheme(JNIEnv* env, jobject clazz,
class XmlAttributeFinder : public BackTrackingAttributeFinder<XmlAttributeFinder, jsize> {
public:
- XmlAttributeFinder(const ResXMLParser* parser)
+ explicit XmlAttributeFinder(const ResXMLParser* parser)
: BackTrackingAttributeFinder(0, parser != NULL ? parser->getAttributeCount() : 0)
, mParser(parser) {}
diff --git a/core/jni/android_view_GraphicBuffer.cpp b/core/jni/android_view_GraphicBuffer.cpp
index a4ab9fd7e298..af975fbf7c9c 100644
--- a/core/jni/android_view_GraphicBuffer.cpp
+++ b/core/jni/android_view_GraphicBuffer.cpp
@@ -88,7 +88,7 @@ static struct {
class GraphicBufferWrapper {
public:
- GraphicBufferWrapper(const sp<GraphicBuffer>& buffer): buffer(buffer) {
+ explicit GraphicBufferWrapper(const sp<GraphicBuffer>& buffer): buffer(buffer) {
}
sp<GraphicBuffer> buffer;
diff --git a/core/jni/android_view_InputChannel.cpp b/core/jni/android_view_InputChannel.cpp
index 092ac27176cc..c7998a169225 100644
--- a/core/jni/android_view_InputChannel.cpp
+++ b/core/jni/android_view_InputChannel.cpp
@@ -43,7 +43,7 @@ static struct {
class NativeInputChannel {
public:
- NativeInputChannel(const sp<InputChannel>& inputChannel);
+ explicit NativeInputChannel(const sp<InputChannel>& inputChannel);
~NativeInputChannel();
inline sp<InputChannel> getInputChannel() { return mInputChannel; }
diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp
index 7b2a40b36c48..629070686707 100644
--- a/core/jni/android_view_ThreadedRenderer.cpp
+++ b/core/jni/android_view_ThreadedRenderer.cpp
@@ -68,7 +68,7 @@ public:
class InvokeAnimationListeners : public MessageHandler {
public:
- InvokeAnimationListeners(std::vector<OnFinishedEvent>& events) {
+ explicit InvokeAnimationListeners(std::vector<OnFinishedEvent>& events) {
mOnFinishedEvents.swap(events);
}
@@ -108,7 +108,7 @@ private:
class RootRenderNode : public RenderNode, ErrorHandler {
public:
- RootRenderNode(JNIEnv* env) : RenderNode() {
+ explicit RootRenderNode(JNIEnv* env) : RenderNode() {
mLooper = Looper::getForThread();
LOG_ALWAYS_FATAL_IF(!mLooper.get(),
"Must create RootRenderNode on a thread with a looper!");
@@ -197,7 +197,7 @@ private:
class ContextFactoryImpl : public IContextFactory {
public:
- ContextFactoryImpl(RootRenderNode* rootNode) : mRootNode(rootNode) {}
+ explicit ContextFactoryImpl(RootRenderNode* rootNode) : mRootNode(rootNode) {}
virtual AnimationContext* createAnimationContext(renderthread::TimeLord& clock) {
return new AnimationContextBridge(clock, mRootNode);
diff --git a/core/jni/android_view_VelocityTracker.cpp b/core/jni/android_view_VelocityTracker.cpp
index 04ec7059365e..e1f2241bfd47 100644
--- a/core/jni/android_view_VelocityTracker.cpp
+++ b/core/jni/android_view_VelocityTracker.cpp
@@ -45,7 +45,7 @@ static struct {
class VelocityTrackerState {
public:
- VelocityTrackerState(const char* strategy);
+ explicit VelocityTrackerState(const char* strategy);
void clear();
void addMovement(const MotionEvent* event);
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 806eeda3555a..d6dd983717c7 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -3008,7 +3008,7 @@ String8 ResTable_config::toString() const {
struct ResTable::Header
{
- Header(ResTable* _owner) : owner(_owner), ownedData(NULL), header(NULL),
+ explicit Header(ResTable* _owner) : owner(_owner), ownedData(NULL), header(NULL),
resourceIDMap(NULL), resourceIDMapSize(0) { }
~Header()
diff --git a/libs/androidfw/ZipUtils.cpp b/libs/androidfw/ZipUtils.cpp
index 6fa0f14ecb8e..5abfc8ee917e 100644
--- a/libs/androidfw/ZipUtils.cpp
+++ b/libs/androidfw/ZipUtils.cpp
@@ -150,7 +150,7 @@ bail:
class FileReader {
public:
- FileReader(FILE* fp) :
+ explicit FileReader(FILE* fp) :
mFp(fp), mReadBuf(new unsigned char[kReadBufSize])
{
}
@@ -170,7 +170,7 @@ public:
class FdReader {
public:
- FdReader(int fd) :
+ explicit FdReader(int fd) :
mFd(fd), mReadBuf(new unsigned char[kReadBufSize])
{
}
diff --git a/libs/hwui/AnimatorManager.cpp b/libs/hwui/AnimatorManager.cpp
index cd30b1859384..22947b066aca 100644
--- a/libs/hwui/AnimatorManager.cpp
+++ b/libs/hwui/AnimatorManager.cpp
@@ -155,7 +155,7 @@ void AnimatorManager::endAllStagingAnimators() {
class EndActiveAnimatorsFunctor {
public:
- EndActiveAnimatorsFunctor(AnimationContext& context) : mContext(context) {}
+ explicit EndActiveAnimatorsFunctor(AnimationContext& context) : mContext(context) {}
void operator() (BaseRenderNodeAnimator* animator) {
animator->forceEndNow(mContext);
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index 03aecd42d16a..610398c8aa76 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -61,7 +61,7 @@ public:
class DrawBatch : public Batch {
public:
- DrawBatch(const DeferInfo& deferInfo) : mAllOpsOpaque(true),
+ explicit DrawBatch(const DeferInfo& deferInfo) : mAllOpsOpaque(true),
mBatchId(deferInfo.batchId), mMergeId(deferInfo.mergeId) {
mOps.clear();
}
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index 644a4f305a2e..a8e1a4b16bb0 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -164,7 +164,7 @@ SkiaCanvas::SkiaCanvas(const SkBitmap& bitmap) {
class ClipCopier : public SkCanvas::ClipVisitor {
public:
- ClipCopier(SkCanvas* dstCanvas) : m_dstCanvas(dstCanvas) {}
+ explicit ClipCopier(SkCanvas* dstCanvas) : m_dstCanvas(dstCanvas) {}
virtual void clipRect(const SkRect& rect, SkRegion::Op op, bool antialias) {
m_dstCanvas->clipRect(rect, op, antialias);
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp
index 17cb3a7fd6fd..84c2a409e4fb 100644
--- a/libs/hwui/TessellationCache.cpp
+++ b/libs/hwui/TessellationCache.cpp
@@ -110,7 +110,7 @@ public:
class TessellationCache::TessellationProcessor : public TaskProcessor<VertexBuffer*> {
public:
- TessellationProcessor(Caches& caches)
+ explicit TessellationProcessor(Caches& caches)
: TaskProcessor<VertexBuffer*>(&caches.tasks) {}
~TessellationProcessor() {}
@@ -124,7 +124,7 @@ public:
class TessellationCache::Buffer {
public:
- Buffer(const sp<Task<VertexBuffer*> >& task)
+ explicit Buffer(const sp<Task<VertexBuffer*> >& task)
: mTask(task)
, mBuffer(nullptr) {
}
@@ -283,7 +283,7 @@ static void tessellateShadows(
class ShadowProcessor : public TaskProcessor<TessellationCache::vertexBuffer_pair_t*> {
public:
- ShadowProcessor(Caches& caches)
+ explicit ShadowProcessor(Caches& caches)
: TaskProcessor<TessellationCache::vertexBuffer_pair_t*>(&caches.tasks) {}
~ShadowProcessor() {}
diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp
index 84b696596d40..229aa46f7f79 100644
--- a/libs/hwui/renderstate/RenderState.cpp
+++ b/libs/hwui/renderstate/RenderState.cpp
@@ -186,7 +186,7 @@ void RenderState::assertOnGLThread() {
class DecStrongTask : public renderthread::RenderTask {
public:
- DecStrongTask(VirtualLightRefBase* object) : mObject(object) {}
+ explicit DecStrongTask(VirtualLightRefBase* object) : mObject(object) {}
virtual void run() override {
mObject->decStrong(nullptr);
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 64075f1c346a..8301107eb8d1 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -129,7 +129,7 @@ class DispatchFrameCallbacks : public RenderTask {
private:
RenderThread* mRenderThread;
public:
- DispatchFrameCallbacks(RenderThread* rt) : mRenderThread(rt) {}
+ explicit DispatchFrameCallbacks(RenderThread* rt) : mRenderThread(rt) {}
virtual void run() override {
mRenderThread->dispatchFrameCallbacks();
diff --git a/libs/hwui/unit_tests/LinearAllocatorTests.cpp b/libs/hwui/unit_tests/LinearAllocatorTests.cpp
index b3959d169e1d..18dc8f9cc275 100644
--- a/libs/hwui/unit_tests/LinearAllocatorTests.cpp
+++ b/libs/hwui/unit_tests/LinearAllocatorTests.cpp
@@ -30,7 +30,7 @@ public:
SignalingDtor() {
mDestroyed = nullptr;
}
- SignalingDtor(bool* destroyedSignal) {
+ explicit SignalingDtor(bool* destroyedSignal) {
mDestroyed = destroyedSignal;
*mDestroyed = false;
}
diff --git a/libs/storage/IMountService.cpp b/libs/storage/IMountService.cpp
index c643ed008a3b..74638e7eccc3 100644
--- a/libs/storage/IMountService.cpp
+++ b/libs/storage/IMountService.cpp
@@ -55,7 +55,7 @@ enum {
class BpMountService: public BpInterface<IMountService>
{
public:
- BpMountService(const sp<IBinder>& impl)
+ explicit BpMountService(const sp<IBinder>& impl)
: BpInterface<IMountService>(impl)
{
}
diff --git a/libs/storage/IObbActionListener.cpp b/libs/storage/IObbActionListener.cpp
index 9656e655e22c..a71341bc1364 100644
--- a/libs/storage/IObbActionListener.cpp
+++ b/libs/storage/IObbActionListener.cpp
@@ -26,7 +26,7 @@ enum {
// This is a stub that real consumers should override.
class BpObbActionListener: public BpInterface<IObbActionListener> {
public:
- BpObbActionListener(const sp<IBinder>& impl)
+ explicit BpObbActionListener(const sp<IBinder>& impl)
: BpInterface<IObbActionListener>(impl)
{ }
diff --git a/media/mca/filterfw/jni/jni_gl_environment.cpp b/media/mca/filterfw/jni/jni_gl_environment.cpp
index 5f007396f287..096120e5a26d 100644
--- a/media/mca/filterfw/jni/jni_gl_environment.cpp
+++ b/media/mca/filterfw/jni/jni_gl_environment.cpp
@@ -39,7 +39,7 @@ using android::Surface;
class NativeWindowHandle : public WindowHandle {
public:
- NativeWindowHandle(ANativeWindow* window) : window_(window) {
+ explicit NativeWindowHandle(ANativeWindow* window) : window_(window) {
}
virtual ~NativeWindowHandle() {
diff --git a/native/android/asset_manager.cpp b/native/android/asset_manager.cpp
index dee3f8c700ed..0e5e5c60d506 100644
--- a/native/android/asset_manager.cpp
+++ b/native/android/asset_manager.cpp
@@ -39,7 +39,7 @@ struct AAssetDir {
size_t mCurFileIndex;
String8 mCachedFileName;
- AAssetDir(AssetDir* dir) : mAssetDir(dir), mCurFileIndex(0) { }
+ explicit AAssetDir(AssetDir* dir) : mAssetDir(dir), mCurFileIndex(0) { }
~AAssetDir() { delete mAssetDir; }
};
@@ -48,7 +48,7 @@ struct AAssetDir {
struct AAsset {
Asset* mAsset;
- AAsset(Asset* asset) : mAsset(asset) { }
+ explicit AAsset(Asset* asset) : mAsset(asset) { }
~AAsset() { delete mAsset; }
};
diff --git a/native/android/choreographer.cpp b/native/android/choreographer.cpp
index e35c85b883e8..c3629da1cb12 100644
--- a/native/android/choreographer.cpp
+++ b/native/android/choreographer.cpp
@@ -64,7 +64,7 @@ protected:
virtual ~Choreographer() = default;
private:
- Choreographer(const sp<Looper>& looper);
+ explicit Choreographer(const sp<Looper>& looper);
Choreographer(const Choreographer&) = delete;
virtual void dispatchVsync(nsecs_t timestamp, int32_t id, uint32_t count);
diff --git a/native/android/storage_manager.cpp b/native/android/storage_manager.cpp
index 399f1ffcb594..137b72cf14e3 100644
--- a/native/android/storage_manager.cpp
+++ b/native/android/storage_manager.cpp
@@ -37,7 +37,7 @@ private:
sp<AStorageManager> mStorageManager;
public:
- ObbActionListener(AStorageManager* mgr) :
+ explicit ObbActionListener(AStorageManager* mgr) :
mStorageManager(mgr)
{}
diff --git a/services/core/jni/com_android_server_AlarmManagerService.cpp b/services/core/jni/com_android_server_AlarmManagerService.cpp
index 246ab0d259f4..407c0726e521 100644
--- a/services/core/jni/com_android_server_AlarmManagerService.cpp
+++ b/services/core/jni/com_android_server_AlarmManagerService.cpp
@@ -74,7 +74,7 @@ protected:
class AlarmImplAlarmDriver : public AlarmImpl
{
public:
- AlarmImplAlarmDriver(int fd) : AlarmImpl(&fd, 1) { }
+ explicit AlarmImplAlarmDriver(int fd) : AlarmImpl(&fd, 1) { }
int set(int type, struct timespec *ts);
int setTime(struct timeval *tv);
diff --git a/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp b/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
index b72cf4dc94d0..5f73d425ca0a 100644
--- a/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
+++ b/services/core/jni/com_android_server_hdmi_HdmiCecController.cpp
@@ -84,7 +84,7 @@ private:
// it to service thread.
class CecEventWrapper : public LightRefBase<CecEventWrapper> {
public:
- CecEventWrapper(const hdmi_event_t& event) {
+ explicit CecEventWrapper(const hdmi_event_t& event) {
// Copy message.
switch (event.type) {
case HDMI_EVENT_CEC_MESSAGE:
diff --git a/tools/aapt2/ResourceTable_test.cpp b/tools/aapt2/ResourceTable_test.cpp
index 06d8699730de..d3b9af32c945 100644
--- a/tools/aapt2/ResourceTable_test.cpp
+++ b/tools/aapt2/ResourceTable_test.cpp
@@ -28,7 +28,7 @@ namespace aapt {
struct TestValue : public Value {
std::u16string value;
- TestValue(StringPiece16 str) : value(str.toString()) {
+ explicit TestValue(StringPiece16 str) : value(str.toString()) {
}
TestValue* clone(StringPool* /*newPool*/) const override {