From 8f09ec4921fbb6c6d60577805a5fe6879e864d68 Mon Sep 17 00:00:00 2001 From: "Eunki, Hong" Date: Tue, 7 Feb 2023 11:05:12 +0900 Subject: [PATCH] Fix svace issue (uint32_t to long) To convert unsigned value into signed value safely, we should convert as unsigned type with same size as signed type, and after done, convert into signed type. Change-Id: I1ee541cff8851adf0e5512ccf0d7a6e00a865690 Signed-off-by: Eunki, Hong --- .../src/dali/dali-test-suite-utils/test-graphics-buffer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp index 27f0dce..42b53b1 100644 --- a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp +++ b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -61,11 +61,11 @@ void TestGraphicsBuffer::Upload(uint32_t offset, uint32_t size) if(size <= memory.size() && mCreated) { // Use subData to avoid re-allocation - mGl.BufferSubData(GetTarget(), offset, size, &memory[offset]); + mGl.BufferSubData(GetTarget(), static_cast(static_cast(offset)), static_cast(static_cast(size)), &memory[offset]); } else { - mGl.BufferData(GetTarget(), GLsizeiptr(size), &memory[0], GL_STATIC_DRAW); //@todo Query - do we need other usages? + mGl.BufferData(GetTarget(), static_cast(static_cast(size)), &memory[0], GL_STATIC_DRAW); //@todo Query - do we need other usages? mCreated = true; } } -- 2.7.4