vstgui icon indicating copy to clipboard operation
vstgui copied to clipboard

Some modern casting issues.. CBitmapPixelAccess::setPosition and itmapPixelAccess::operator++

Open GeorgeAAbraham1 opened this issue 2 years ago • 2 comments

cbitmap.h CBitmapPixelAccess::setPosition and itmapPixelAccess::operator++ Gives compiler error : currentPos = address + y * bytesPerRow; Expectation, something like.. : currentPos = address + static_cast<__int64>(y) * bytesPerRow;

GeorgeAAbraham1 avatar Aug 01 '22 06:08 GeorgeAAbraham1

Can you please add the complete compiler output and the compiler version when doing such a bug report. That would help enormously.

scheffle avatar Aug 10 '22 12:08 scheffle

Hi

Sure..

Microsoft Visual Studio Community 2022 Version 17.2.6 VisualStudio.17.Release/17.2.6+32630.192 Microsoft .NET Framework Version 4.8.03752

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA939 Microsoft Visual C++ 2022

This is covered in the C++ 17 book.. as a standard change.. it's not a bug.

exact compiler warnings: Severity Code Description Project File Line Suppression State Warning C26451 Arithmetic overflow: Using operator '' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '' to avoid overflow (io.2). SineSyn C:\Users\GeorgeAB.FSG\VST_SDK\vst3sdk\vstgui4\vstgui\lib\cbitmap.h 233 Warning C26451 Arithmetic overflow: Using operator '' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '' to avoid overflow (io.2). SineSyn C:\Users\GeorgeAB.FSG\VST_SDK\vst3sdk\vstgui4\vstgui\lib\cbitmap.h 246 Warning C26451 Arithmetic overflow: Using operator '' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '' to avoid overflow (io.2). SineSyn C:\Users\GeorgeAB.FSG\VST_SDK\vst3sdk\vstgui4\vstgui\lib\cbitmap.h 246

GeorgeAAbraham1 avatar Aug 10 '22 12:08 GeorgeAAbraham1