OSDN Git Service

Fix rule of three warnings
authorColin Cross <ccross@android.com>
Tue, 27 Sep 2016 01:11:41 +0000 (18:11 -0700)
committerColin Cross <ccross@android.com>
Thu, 29 Sep 2016 23:35:15 +0000 (23:35 +0000)
Sensor and BufferItem have destructors, the copy constructor and
assignment operators should not be implicit. The warnings were being
hidden by the use of -isystem to include frameworks/native/include.

Bug: 31752268
Test: m -j
Change-Id: If375d85cd3d6ded4ee6b27b841bf10f563254682

include/gui/BufferItem.h
include/gui/Sensor.h

index f45d852..3ab63d0 100644 (file)
@@ -46,6 +46,8 @@ class BufferItem : public Flattenable<BufferItem> {
     enum { INVALID_BUFFER_SLOT = -1 };
     BufferItem();
     ~BufferItem();
+    BufferItem(const BufferItem&) = default;
+    BufferItem& operator=(const BufferItem&) = default;
 
     static const char* scalingModeName(uint32_t scalingMode);
 
index 094fd16..7506835 100644 (file)
@@ -61,6 +61,9 @@ public:
         uuid_t() : b{0} {}
     };
 
+    Sensor(const Sensor&) = default;
+    Sensor& operator=(const Sensor&) = default;
+
     Sensor(const char * name = "");
     Sensor(struct sensor_t const* hwSensor, int halVersion = 0);
     Sensor(struct sensor_t const& hwSensor, const uuid_t& uuid, int halVersion = 0);