Merge "Fix google-explicit-constructor warnings in libhardware"

This commit is contained in:
Chih-hung Hsieh 2016-06-30 22:50:52 +00:00 committed by Gerrit Code Review
commit 99d2543a12
12 changed files with 12 additions and 12 deletions

View file

@ -34,7 +34,7 @@ class Camera {
public:
// id is used to distinguish cameras. 0 <= id < NUM_CAMERAS.
// module is a handle to the HAL module, used when the device is opened.
Camera(int id);
explicit Camera(int id);
virtual ~Camera();
// Common Camera Device Operations (see <hardware/camera_common.h>)

View file

@ -29,7 +29,7 @@ namespace default_camera_hal {
// camera device.
class CameraHAL {
public:
CameraHAL(int num_cameras);
explicit CameraHAL(int num_cameras);
~CameraHAL();
// Camera Module Interface (see <hardware/camera_common.h>)

View file

@ -27,7 +27,7 @@ namespace default_camera_hal {
// metadata and logic about that device.
class ExampleCamera : public Camera {
public:
ExampleCamera(int id);
explicit ExampleCamera(int id);
~ExampleCamera();
private:

View file

@ -48,7 +48,7 @@ public:
class Autolock {
Locker& locker;
public:
inline Autolock(Locker& locker) : locker(locker) { locker.lock(); }
inline explicit Autolock(Locker& locker) : locker(locker) { locker.lock(); }
inline ~Autolock() { locker.unlock(); }
};
inline Locker() { pthread_mutex_init(&mutex, 0); }

View file

@ -38,7 +38,7 @@ class SensorEventQueue {
pthread_cond_t mSpaceAvailableCondition;
public:
SensorEventQueue(int capacity);
explicit SensorEventQueue(int capacity);
~SensorEventQueue();
// Returns length of region, between zero and min(capacity, requestedLength). If there is any

View file

@ -38,7 +38,7 @@ class Camera {
public:
// id is used to distinguish cameras. 0 <= id < NUM_CAMERAS.
// module is a handle to the HAL module, used when the device is opened.
Camera(int id);
explicit Camera(int id);
virtual ~Camera();
// Common Camera Device Operations (see <hardware/camera_common.h>)

View file

@ -36,7 +36,7 @@ class CameraHAL;
class HotplugThread : public android::Thread {
public:
HotplugThread(CameraHAL *hal);
explicit HotplugThread(CameraHAL *hal);
~HotplugThread();
// Override below two methods for proper cleanup.

View file

@ -28,7 +28,7 @@ namespace usb_camera_hal {
*/
class UsbCamera : public Camera {
public:
UsbCamera(int id);
explicit UsbCamera(int id);
~UsbCamera();
private:

View file

@ -36,7 +36,7 @@ namespace tests {
template <bool InfoQuirk = false>
struct CameraModuleFixture {
CameraModuleFixture(int CameraID = -1) {
explicit CameraModuleFixture(int CameraID = -1) {
TEST_EXTENSION_FORKING_CONSTRUCTOR;
mCameraID = CameraID;

View file

@ -71,7 +71,7 @@ class CameraStreamFixture
: public CameraModuleFixture</*InfoQuirk*/true> {
public:
CameraStreamFixture(CameraStreamParams p)
explicit CameraStreamFixture(CameraStreamParams p)
: CameraModuleFixture(TestSettings::DeviceId()) {
TEST_EXTENSION_FORKING_CONSTRUCTOR;

View file

@ -166,7 +166,7 @@ class NotifierListener {
*/
class StreamAdapter: public camera2_stream_ops {
public:
StreamAdapter(sp<IGraphicBufferProducer> consumer);
explicit StreamAdapter(sp<IGraphicBufferProducer> consumer);
~StreamAdapter();

View file

@ -42,7 +42,7 @@ decltype(auto) delay_async(Duration&& delay, Function&& task)
*/
class TempFile {
public:
TempFile(const char* path);
explicit TempFile(const char* path);
~TempFile();
// No copy or assign