From 6c03cc5f2db5e005ed0990b53ffc6e03433d666c Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Fri, 11 Nov 2022 11:46:18 +0900 Subject: [PATCH] Fix SVACE issue DO_NOT_ASSIGN_SIZE_OF_INT DO_NOT_CAST_LONG_TO_DOUBLE INVALID_ASSIGNMENT_WITH_UNSIGNED_VALUES Change-Id: Ic0bca81c31b7e181879a9d13276f2dc00c3ee806 --- .../internal/adaptor/common/combined-update-render-controller.cpp | 4 ++-- dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp | 2 +- dali/internal/imaging/common/file-download.cpp | 2 +- .../input/tizen-wayland/input-method-context-impl-ecore-wl.cpp | 8 ++++---- dali/internal/network/common/socket-impl.cpp | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index ed56e9f..49d02f3 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -593,8 +593,8 @@ void CombinedUpdateRenderController::UpdateRenderThread() // UPDATE ////////////////////////////// - const unsigned int currentTime = currentFrameStartTime / NANOSECONDS_PER_MILLISECOND; - const unsigned int nextFrameTime = currentTime + mDefaultFrameDurationMilliseconds; + const uint32_t currentTime = static_cast(currentFrameStartTime / NANOSECONDS_PER_MILLISECOND); + const uint32_t nextFrameTime = currentTime + static_cast(mDefaultFrameDurationMilliseconds); uint64_t noOfFramesSinceLastUpdate = 1; float frameDelta = 0.0f; diff --git a/dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp b/dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp index 177b6b9..d619842 100644 --- a/dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp +++ b/dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp @@ -239,7 +239,7 @@ void CommandBuffer::BindVertexBuffers(uint32_t const std::vector& offsets) { auto command = mCommandPool->AllocateCommand(CommandType::BIND_VERTEX_BUFFERS); - command->bindVertexBuffers.vertexBufferBindingsCount = firstBinding + buffers.size(); + command->bindVertexBuffers.vertexBufferBindingsCount = firstBinding + static_cast(buffers.size()); auto pBindings = mCommandPool->Allocate(firstBinding + buffers.size()); command->bindVertexBuffers.vertexBufferBindings = pBindings; diff --git a/dali/internal/imaging/common/file-download.cpp b/dali/internal/imaging/common/file-download.cpp index 6b50a47..4e203a9 100644 --- a/dali/internal/imaging/common/file-download.cpp +++ b/dali/internal/imaging/common/file-download.cpp @@ -196,7 +196,7 @@ bool DownloadFile(CURL* curlHandle, // get the content length, -1 == size is not known curl_easy_getinfo(curlHandle, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &size); - if(size >= maximumAllowedSizeBytes) + if(static_cast(size) >= maximumAllowedSizeBytes) { DALI_LOG_ERROR("File content length %f > max allowed %zu \"%s\" \n", size, maximumAllowedSizeBytes, url.c_str()); return false; diff --git a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp index 6945b15..8595933 100644 --- a/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp +++ b/dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp @@ -532,8 +532,8 @@ void InputMethodContextEcoreWl::PreEditChanged(void*, ImfContext* imfContext, vo data.startIndex = 0; data.endIndex = 0; - size_t visualCharacterIndex = 0; - size_t byteIndex = 0; + uint32_t visualCharacterIndex = 0; + size_t byteIndex = 0; // iterate through null terminated string checking each character's position against the given byte position ( attr->end_index ). char leadByte = preEditString[byteIndex]; @@ -1203,7 +1203,7 @@ bool InputMethodContextEcoreWl::ProcessEventKeyDown(const Dali::KeyEvent& keyEve ecoreKeyDownEvent.key = key.c_str(); ecoreKeyDownEvent.string = integKeyEvent.keyString.c_str(); ecoreKeyDownEvent.compose = compose.c_str(); - ecoreKeyDownEvent.timestamp = integKeyEvent.time; + ecoreKeyDownEvent.timestamp = static_cast(integKeyEvent.time); ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier(integKeyEvent.keyModifier); ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock(integKeyEvent.keyModifier); ecoreKeyDownEvent.dev_name = deviceName.c_str(); @@ -1259,7 +1259,7 @@ bool InputMethodContextEcoreWl::ProcessEventKeyUp(const Dali::KeyEvent& keyEvent ecoreKeyUpEvent.key = key.c_str(); ecoreKeyUpEvent.string = integKeyEvent.keyString.c_str(); ecoreKeyUpEvent.compose = compose.c_str(); - ecoreKeyUpEvent.timestamp = integKeyEvent.time; + ecoreKeyUpEvent.timestamp = static_cast(integKeyEvent.time); ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier(integKeyEvent.keyModifier); ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock(integKeyEvent.keyModifier); ecoreKeyUpEvent.dev_name = deviceName.c_str(); diff --git a/dali/internal/network/common/socket-impl.cpp b/dali/internal/network/common/socket-impl.cpp index a6d1bfa..e34ed4a 100644 --- a/dali/internal/network/common/socket-impl.cpp +++ b/dali/internal/network/common/socket-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -167,7 +167,7 @@ SocketInterface* Socket::Accept() const struct sockaddr clientAddress; - socklen_t addressLength(sizeof(sockaddr_in)); + socklen_t addressLength(static_cast(sizeof(sockaddr_in))); int clientFileDescriptor = accept(mSocketFileDescriptor, &clientAddress, &addressLength); if(clientFileDescriptor == -1) @@ -316,7 +316,7 @@ bool Socket::Read(void* buffer, unsigned int bufferSizeInBytes, unsigned int& by return false; } - bytesRead = read(mSocketFileDescriptor, buffer, bufferSizeInBytes); + bytesRead = static_cast(read(mSocketFileDescriptor, buffer, bufferSizeInBytes)); return true; } -- 2.7.4