Fix SVACE issue 71/284171/1
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 11 Nov 2022 02:46:18 +0000 (11:46 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 11 Nov 2022 02:46:18 +0000 (11:46 +0900)
DO_NOT_ASSIGN_SIZE_OF_INT
DO_NOT_CAST_LONG_TO_DOUBLE
INVALID_ASSIGNMENT_WITH_UNSIGNED_VALUES

Change-Id: Ic0bca81c31b7e181879a9d13276f2dc00c3ee806

dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/graphics/gles-impl/gles-graphics-command-buffer.cpp
dali/internal/imaging/common/file-download.cpp
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp
dali/internal/network/common/socket-impl.cpp

index ed56e9f..49d02f3 100644 (file)
@@ -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<uint32_t>(currentFrameStartTime / NANOSECONDS_PER_MILLISECOND);
+    const uint32_t nextFrameTime = currentTime + static_cast<uint32_t>(mDefaultFrameDurationMilliseconds);
 
     uint64_t noOfFramesSinceLastUpdate = 1;
     float    frameDelta                = 0.0f;
index 177b6b9..d619842 100644 (file)
@@ -239,7 +239,7 @@ void CommandBuffer::BindVertexBuffers(uint32_t
                                       const std::vector<uint32_t>&                offsets)
 {
   auto command                                         = mCommandPool->AllocateCommand(CommandType::BIND_VERTEX_BUFFERS);
-  command->bindVertexBuffers.vertexBufferBindingsCount = firstBinding + buffers.size();
+  command->bindVertexBuffers.vertexBufferBindingsCount = firstBinding + static_cast<uint32_t>(buffers.size());
   auto pBindings                                       = mCommandPool->Allocate<GLES::VertexBufferBindingDescriptor>(firstBinding + buffers.size());
 
   command->bindVertexBuffers.vertexBufferBindings = pBindings;
index 6b50a47..4e203a9 100644 (file)
@@ -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_t>(size) >= maximumAllowedSizeBytes)
   {
     DALI_LOG_ERROR("File content length %f > max allowed %zu \"%s\" \n", size, maximumAllowedSizeBytes, url.c_str());
     return false;
index 6945b15..8595933 100644 (file)
@@ -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<uint32_t>(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<uint32_t>(integKeyEvent.time);
     ecoreKeyUpEvent.modifiers    = EcoreInputModifierToEcoreIMFModifier(integKeyEvent.keyModifier);
     ecoreKeyUpEvent.locks        = EcoreInputModifierToEcoreIMFLock(integKeyEvent.keyModifier);
     ecoreKeyUpEvent.dev_name     = deviceName.c_str();
index a6d1bfa..e34ed4a 100644 (file)
@@ -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<socklen_t>(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<unsigned int>(read(mSocketFileDescriptor, buffer, bufferSizeInBytes));
 
   return true;
 }