clean-ups, remove warnings, fix includes.
Test: built and run
Bug: none
Change-Id: I505df89e2263952d90fae432c5eaa7d00056c6f0
diff --git a/libs/gui/GraphicBufferAlloc.cpp b/libs/gui/GraphicBufferAlloc.cpp
index f2d3677..cc7d403 100644
--- a/libs/gui/GraphicBufferAlloc.cpp
+++ b/libs/gui/GraphicBufferAlloc.cpp
@@ -15,21 +15,15 @@
** limitations under the License.
*/
-#include <log/log.h>
-
-#include <ui/GraphicBuffer.h>
-
#include <gui/GraphicBufferAlloc.h>
-// ----------------------------------------------------------------------------
+#include <log/log.h>
+
+
namespace android {
-// ----------------------------------------------------------------------------
-GraphicBufferAlloc::GraphicBufferAlloc() {
-}
-
-GraphicBufferAlloc::~GraphicBufferAlloc() {
-}
+GraphicBufferAlloc::GraphicBufferAlloc() = default;
+GraphicBufferAlloc::~GraphicBufferAlloc() = default;
sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t width,
uint32_t height, PixelFormat format, uint32_t layerCount,
@@ -44,15 +38,12 @@
if (err == NO_MEMORY) {
GraphicBuffer::dumpAllocationsToSystemLog();
}
- ALOGE("GraphicBufferAlloc::createGraphicBuffer(w=%u, h=%u, lc=%u) "
- "failed (%s), handle=%p",
+ ALOGE("GraphicBufferAlloc::createGraphicBuffer(w=%u, h=%u, lc=%u) failed (%s), handle=%p",
width, height, layerCount, strerror(-err),
graphicBuffer->handle);
- return 0;
+ graphicBuffer.clear();
}
return graphicBuffer;
}
-// ----------------------------------------------------------------------------
-}; // namespace android
-// ----------------------------------------------------------------------------
+} // namespace android