microui icon indicating copy to clipboard operation
microui copied to clipboard

Fix msvc warnings

Open rdck opened this issue 2 years ago • 1 comments

The Microsoft C compiler at warning level 3 (/W3) complains about various integer casts. I assume microui doesn't intend to handle the cases where these casts would overflow. I think it's worth making the casts explicit, to express that this is the intended behavior.

rdck avatar Sep 12 '22 20:09 rdck

MSVC showing the integer casting warning message because microui uses the wrong type-casting for strlen. strlen on both 32-bit and 64-bit in x86 and amd64 returns an unsigned long but microui has unsigned as the type. See here.

There are other points I saw where microui uses that same wrong type for a specific purpose. MSVC explicitly sees microui as a C++ file thus it leads to explicit casting since C++ requires you to do so.

rilysh avatar Jul 10 '23 07:07 rilysh