From 54b217154db91fd5f0d95ec8efd393a1003a1c2f Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Wed, 4 Aug 2021 08:51:13 +0100 Subject: [PATCH] Fix SVACE errors in ImageViewEncodedBufferImage example Change-Id: Iea7b538631cb4a6d190cd7ce424339f7e7ba2fcf --- .../image-view-encoded-image-buffer-example.cpp | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/image-view-encoded-image-buffer/image-view-encoded-image-buffer-example.cpp b/examples/image-view-encoded-image-buffer/image-view-encoded-image-buffer-example.cpp index aca1819..8aea44a 100644 --- a/examples/image-view-encoded-image-buffer/image-view-encoded-image-buffer-example.cpp +++ b/examples/image-view-encoded-image-buffer/image-view-encoded-image-buffer-example.cpp @@ -16,11 +16,11 @@ */ #include -#include -#include -#include #include +#include +#include #include +#include #include #include "shared/view.h" @@ -52,12 +52,12 @@ const unsigned int TIMER_INTERVAL = 1000; // ms EncodedImageBuffer ConvertFileToEncodedImageBuffer(const char* url) { EncodedImageBuffer buffer; - FILE *fp; + FILE* fp; fp = fopen(url, "rb"); if(fp != NULL) { fseek(fp, 0, SEEK_END); - size_t size = ftell(fp); + size_t size = ftell(fp); Dali::Vector data; data.Resize(size); fseek(fp, 0, SEEK_SET); @@ -103,7 +103,7 @@ public: APPLICATION_TITLE); // Initialize - mState = 0; + mState = 0; mImageIndex = 0; UpdateImageUrl(); UpdateImageViews(); @@ -119,7 +119,6 @@ public: } private: - void UpdateImageUrl() { mImageBuffer = ConvertFileToEncodedImageBuffer(IMAGE_PATH[mImageIndex]); @@ -142,7 +141,7 @@ private: bool needToCreate = true; // If current state don't wanna create current view, just skip - unsigned int currentViewState = 1u << ((i + j) & 1); + unsigned int currentViewState = 1u << ((i + j) & 1); if(mState & currentViewState) { needToCreate = false; @@ -215,19 +214,19 @@ private: private: Application& mApplication; - Toolkit::Control mView; ///< The View instance. - Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - Layer mContentLayer; ///< Content layer + Toolkit::Control mView; ///< The View instance. + Toolkit::ToolBar mToolBar; ///< The View's Toolbar. + Layer mContentLayer; ///< Content layer Toolkit::ImageView mImageViews[NUMBER_OF_IMAGES]; - unsigned int mImageIndex; + unsigned int mImageIndex{0u}; EncodedImageBuffer mImageBuffer; ImageUrl mImageUrl; // Automatic unparent and create ticker. - Timer mTimer; - unsigned int mState; ///< 0 : draw all images, 1 : draw half, 2 : draw another half, 3 : don't draw images. + Timer mTimer; + unsigned int mState{0u}; ///< 0 : draw all images, 1 : draw half, 2 : draw another half, 3 : don't draw images. }; int DALI_EXPORT_API main(int argc, char** argv) -- 2.7.4