From 3994a8b43a94b7e2b22199700cea54b20bd6ed15 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Tue, 15 Nov 2016 15:35:00 +0000 Subject: [PATCH] Fix various SVACE errors Change-Id: Iae0e1b6b7707e1060060de112f7831119bb86641 --- .../combined-update-render-controller.cpp | 3 +- .../performance-logging/performance-server.cpp | 4 +- .../statistics/stat-context-manager.h | 5 +- .../base/separate-update-render/vsync-notifier.cpp | 5 +- .../adaptor-framework/application-extensions.cpp | 3 +- adaptors/ecore/common/ecore-indicator-impl.cpp | 58 ++-------------------- adaptors/ecore/common/ecore-server-connection.h | 6 ++- .../wayland/window-render-surface-ecore-wl.cpp | 3 +- adaptors/x11/native-image-source-impl-x.cpp | 4 +- adaptors/x11/window-render-surface-x.cpp | 3 +- .../test-gl-sync-abstraction.h | 6 ++- .../tizen/image-loaders/loader-astc.cpp | 2 +- .../tizen/image-loaders/loader-bmp.cpp | 24 ++++----- .../tizen/resource-loader/resource-loader.cpp | 7 ++- .../tizen/tizen-platform-abstraction.h | 6 ++- 15 files changed, 58 insertions(+), 81 deletions(-) diff --git a/adaptors/base/combined-update-render/combined-update-render-controller.cpp b/adaptors/base/combined-update-render/combined-update-render-controller.cpp index a1496db..26af651 100644 --- a/adaptors/base/combined-update-render/combined-update-render-controller.cpp +++ b/adaptors/base/combined-update-render/combined-update-render-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,6 +105,7 @@ CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalS mDestroyUpdateRenderThread( FALSE ), mUpdateRenderThreadCanSleep( FALSE ), mPendingRequestUpdate( FALSE ), + mUseElapsedTimeAfterWait( FALSE ), mNewSurface( NULL ), mPostRendering( FALSE ) { diff --git a/adaptors/base/performance-logging/performance-server.cpp b/adaptors/base/performance-logging/performance-server.cpp index 2c3512c..d6e68fe 100644 --- a/adaptors/base/performance-logging/performance-server.cpp +++ b/adaptors/base/performance-logging/performance-server.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,12 +45,14 @@ PerformanceServer::PerformanceServer( AdaptorInternalServices& adaptorServices, : mEnvironmentOptions( environmentOptions ), mKernelTrace( adaptorServices.GetKernelTraceInterface() ), mSystemTrace( adaptorServices.GetSystemTraceInterface() ), + mLogMutex(), #if defined(NETWORK_LOGGING_ENABLED) mNetworkServer( adaptorServices, environmentOptions ), mNetworkControlEnabled( mEnvironmentOptions.GetNetworkControlMode()), #endif mStatContextManager( *this ), mStatisticsLogBitmask( 0 ), + mPerformanceOutputBitmask( 0 ), mLoggingEnabled( false ), mLogFunctionInstalled( false ) { diff --git a/adaptors/base/performance-logging/statistics/stat-context-manager.h b/adaptors/base/performance-logging/statistics/stat-context-manager.h index 35308d2..9e9abe1 100644 --- a/adaptors/base/performance-logging/statistics/stat-context-manager.h +++ b/adaptors/base/performance-logging/statistics/stat-context-manager.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_ADAPTOR_STAT_CONTEXT_MANAGER_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -132,6 +132,9 @@ public: private: + StatContextManager( const StatContextManager& ); ///< Undefined + StatContextManager& operator=( const StatContextManager& ); ///< Undefined + typedef Dali::Vector< StatContext* > StatContexts; /** diff --git a/adaptors/base/separate-update-render/vsync-notifier.cpp b/adaptors/base/separate-update-render/vsync-notifier.cpp index dc407f8..7ea74b4 100644 --- a/adaptors/base/separate-update-render/vsync-notifier.cpp +++ b/adaptors/base/separate-update-render/vsync-notifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -170,7 +170,8 @@ void VSyncNotifier::Run() timespec sleepTime; sleepTime.tv_sec = 0; - sleepTime.tv_nsec = sleepTimeInMicroseconds * 1000; + sleepTime.tv_nsec = sleepTimeInMicroseconds; + sleepTime.tv_nsec *= NANOSECONDS_PER_MICROSECOND; nanosleep( &sleepTime, NULL ); } mThreadSynchronization.AddPerformanceMarker( PerformanceInterface::VSYNC ); diff --git a/adaptors/devel-api/adaptor-framework/application-extensions.cpp b/adaptors/devel-api/adaptor-framework/application-extensions.cpp index 582e659..e03b298 100755 --- a/adaptors/devel-api/adaptor-framework/application-extensions.cpp +++ b/adaptors/devel-api/adaptor-framework/application-extensions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ namespace Dali { ApplicationExtensions::ApplicationExtensions() +: mApplication( NULL ) { } diff --git a/adaptors/ecore/common/ecore-indicator-impl.cpp b/adaptors/ecore/common/ecore-indicator-impl.cpp index 2e61d8f..f344e25 100644 --- a/adaptors/ecore/common/ecore-indicator-impl.cpp +++ b/adaptors/ecore/common/ecore-indicator-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -541,6 +541,7 @@ bool Indicator::ScopedLock::IsLocked() Indicator::Indicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer ) : mPixmap( 0 ), + mGestureDeltaY( 0.0f ), mGestureDetected( false ), mConnection( this ), mOpacityMode( Dali::Window::OPAQUE ), @@ -1140,7 +1141,7 @@ bool Indicator::CopyToBuffer( int bufferNumber ) else if( scopedLock.IsLocked() ) { unsigned char *src = mSharedFileInfo[bufferNumber].mSharedFile->GetAddress(); - size_t size = mSharedFileInfo[bufferNumber].mImageWidth * mSharedFileInfo[bufferNumber].mImageHeight * 4; + size_t size = static_cast< size_t >( mSharedFileInfo[bufferNumber].mImageWidth ) * mSharedFileInfo[bufferNumber].mImageHeight * 4; if( mIndicatorBuffer->UpdatePixels( src, size ) ) { @@ -1621,58 +1622,7 @@ void Indicator::OnAnimationFinished(Dali::Animation& animation) void Indicator::OnPan( Dali::Actor actor, const Dali::PanGesture& gesture ) { - return ; - - if( mServerConnection ) - { - switch( gesture.state ) - { - case Gesture::Started: - { - mGestureDetected = false; - - // The gesture position is the current position after it has moved by the displacement. - // We want to reference the original position. - mGestureDeltaY = gesture.position.y - gesture.displacement.y; - } - - // No break, Fall through - case Gesture::Continuing: - { - if( mVisible == Dali::Window::AUTO && !mIsShowing ) - { - // Only take one touch point - if( gesture.numberOfTouches == 1 && mGestureDetected == false ) - { - mGestureDeltaY += gesture.displacement.y; - - if( mGestureDeltaY >= mImageHeight * SHOWING_DISTANCE_HEIGHT_RATE ) - { - ShowIndicator( AUTO_INDICATOR_STAY_DURATION ); - mGestureDetected = true; - } - } - } - - break; - } - - case Gesture::Finished: - case Gesture::Cancelled: - { - // if indicator is showing, hide again when touching is finished (Since touch leave is activated, checking it in gesture::finish instead of touch::up) - if( mVisible == Dali::Window::AUTO && mIsShowing ) - { - ShowIndicator( AUTO_INDICATOR_STAY_DURATION ); - } - break; - } - - - default: - break; - } - } + // Nothing to do, but we still want to consume pan } void Indicator::OnStageTouched(const Dali::TouchEvent& touchEvent) diff --git a/adaptors/ecore/common/ecore-server-connection.h b/adaptors/ecore/common/ecore-server-connection.h index 72941b9..d81cdfe 100644 --- a/adaptors/ecore/common/ecore-server-connection.h +++ b/adaptors/ecore/common/ecore-server-connection.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_ADAPTOR_ECORE_SERVER_CONNECTION_H_ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,6 +118,10 @@ private: // Class callbacks static Eina_Bool IpcServerData(void *data, int type, void *event); private: + + ServerConnection( const ServerConnection& ); ///< Undefined + ServerConnection& operator=( const ServerConnection& ); ///< Undefined + void CloseConnection(); private: diff --git a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp index da42e93..0d0609a 100644 --- a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, const std::string& name, bool isTransparent) : EcoreWlRenderSurface( positionSize, surface, name, isTransparent ), + mWlWindow( NULL ), mEglWindow( NULL ), mNeedToApproveDeiconify( false ) { diff --git a/adaptors/x11/native-image-source-impl-x.cpp b/adaptors/x11/native-image-source-impl-x.cpp index ef0007e..779b03a 100755 --- a/adaptors/x11/native-image-source-impl-x.cpp +++ b/adaptors/x11/native-image-source-impl-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -211,7 +211,7 @@ bool NativeImageSource::GetPixels(std::vector& pixbuf, unsigned& pixbuf.resize(width*height*4); unsigned * bufPtr = reinterpret_cast(&pixbuf[0]); const unsigned xDataLineSkip = pXImage->bytes_per_line; - const size_t copy_count = width * 4; + const size_t copy_count = static_cast< size_t >( width ) * 4; pixelFormat = Pixel::BGRA8888; for(unsigned y = height-1; y < height; --y, bufPtr += width) diff --git a/adaptors/x11/window-render-surface-x.cpp b/adaptors/x11/window-render-surface-x.cpp index 0580f54..d85c9c8 100644 --- a/adaptors/x11/window-render-surface-x.cpp +++ b/adaptors/x11/window-render-surface-x.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,6 +59,7 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, const std::string& className, bool isTransparent) : EcoreXRenderSurface( positionSize, surface, name, isTransparent ), + mX11Window( 0 ), mNeedToApproveDeiconify(false), mClassName(className) { diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.h index 278bcd7..8ce96a4 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.h +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-sync-abstraction.h @@ -2,7 +2,7 @@ #define __TEST_GL_SYNC_ABSTRACTION_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,6 +108,10 @@ public: // TEST FUNCTIONS int GetNumberOfSyncObjects(); private: + + TestGlSyncAbstraction( const TestGlSyncAbstraction& ); ///< Undefined + TestGlSyncAbstraction& operator=( const TestGlSyncAbstraction& ); ///< Undefined + typedef std::vector SyncContainer; typedef SyncContainer::iterator SyncIter; SyncContainer mSyncObjects; ///< The sync objects diff --git a/platform-abstractions/tizen/image-loaders/loader-astc.cpp b/platform-abstractions/tizen/image-loaders/loader-astc.cpp index 5d3e758..67b1ff5 100755 --- a/platform-abstractions/tizen/image-loaders/loader-astc.cpp +++ b/platform-abstractions/tizen/image-loaders/loader-astc.cpp @@ -215,7 +215,7 @@ bool LoadBitmapFromAstc( const ResourceLoadingClient& client, const ImageLoader: size_t imageByteCount = fileSize - sizeof( AstcFileHeader ); // Sanity-check the image data is not too large and that it is at less than 2 bytes per texel: - if( ( imageByteCount > MAX_IMAGE_DATA_SIZE ) || ( imageByteCount > ( ( width * height ) << 1 ) ) ) + if( ( imageByteCount > MAX_IMAGE_DATA_SIZE ) || ( imageByteCount > ( ( static_cast< size_t >( width ) * height ) << 1 ) ) ) { DALI_LOG_ERROR( "ASTC file has too large image-data field.\n" ); return false; diff --git a/platform-abstractions/tizen/image-loaders/loader-bmp.cpp b/platform-abstractions/tizen/image-loaders/loader-bmp.cpp index 2219b31..f1ddcbf 100644 --- a/platform-abstractions/tizen/image-loaders/loader-bmp.cpp +++ b/platform-abstractions/tizen/image-loaders/loader-bmp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -578,7 +578,7 @@ bool DecodeRGB1(FILE *fp, } for(unsigned int j = 0; j < fillw; j ++) { - int ctIndex = 0; + unsigned int ctIndex = 0; if((fillw * index + j ) < (fillw * height)) { ctIndex = colorIndex[ fillw * index + j ]; @@ -648,7 +648,7 @@ bool DecodeRGB4(FILE *fp, colorIndex[i] = cmd >> 4; colorIndex[i + 1] = cmd & (0x0F); } - int ctIndex = 0; + unsigned int ctIndex = 0; for(unsigned int index = 0; index < height; index = index + 1) { @@ -722,7 +722,7 @@ bool DecodeRGB8(FILE *fp, colorIndex[i] = cmd; } - int ctIndex = 0; + unsigned int ctIndex = 0; for(unsigned int index = 0; index < height; index = index + 1) { PixelBuffer *pixelsPtr = NULL; @@ -776,10 +776,10 @@ bool DecodeRLE4(FILE *fp, char colorTable[64]; std::vector colorIndex(width * height >> 1); std::vector run; - int x = 0; - int y = 0; - int dx = 0; - int dy = 0; + unsigned int x = 0; + unsigned int y = 0; + unsigned int dx = 0; + unsigned int dy = 0; width += (width & 1); width = width >> 1; @@ -938,8 +938,8 @@ bool DecodeRLE8(FILE *fp, return false; } PixelBuffer *pixelsPtr = pixels; - int x = 0; - int y = 0; + unsigned int x = 0; + unsigned int y = 0; unsigned int cmdStride = 2; width = ((width & 3) != 0) ? width + 4 - (width & 3) : width; @@ -958,8 +958,8 @@ bool DecodeRLE8(FILE *fp, return false; } - int dx = 0; - int dy = 0; + unsigned int dx = 0; + unsigned int dy = 0; bool finish = false; unsigned int length = 0; unsigned int copylength = 0; diff --git a/platform-abstractions/tizen/resource-loader/resource-loader.cpp b/platform-abstractions/tizen/resource-loader/resource-loader.cpp index a0e3fcf..967d2d9 100755 --- a/platform-abstractions/tizen/resource-loader/resource-loader.cpp +++ b/platform-abstractions/tizen/resource-loader/resource-loader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -242,6 +242,11 @@ struct ResourceLoader::ResourceLoaderImpl mStoredRequests.erase( iter ); } } + +private: + + ResourceLoaderImpl( const ResourceLoaderImpl& ); ///< Undefined + ResourceLoaderImpl& operator=( const ResourceLoaderImpl& ); ///< Undefined }; /********************************************************************************/ diff --git a/platform-abstractions/tizen/tizen-platform-abstraction.h b/platform-abstractions/tizen/tizen-platform-abstraction.h index fdad62e..949c77f 100644 --- a/platform-abstractions/tizen/tizen-platform-abstraction.h +++ b/platform-abstractions/tizen/tizen-platform-abstraction.h @@ -2,7 +2,7 @@ #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -147,6 +147,10 @@ public: // PlatformAbstraction overrides void SetDataStoragePath( const std::string& path ); private: + + TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined + TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined + ResourceLoader* mResourceLoader; std::string mDataStoragePath; }; -- 2.7.4