steinbergmedia / vstgui

A user interface toolkit mainly for audio plug-ins
Other
869 stars 124 forks source link

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

Open GeorgeAAbraham1 opened 2 years ago

GeorgeAAbraham1 commented 2 years ago

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

scheffle commented 2 years ago

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

GeorgeAAbraham1 commented 2 years ago

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