more fixes, will merge fixes for w4245 and w4389

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-13 12:29:24 -07:00
parent 3522f622f3
commit e9b4f48f71
31 changed files with 21 additions and 133 deletions
-2
View File
@@ -9,8 +9,6 @@
#include "EditorDefs.h"
#pragma warning ( disable : 4244 ) // conversion from 'double' to 'float', possible loss of data.
/**** Decompose.h - Basic declarations ****/
typedef struct
{
+4 -8
View File
@@ -61,15 +61,11 @@ QColor ScaleColor(const QColor& c, float aScale)
aColor = QColor(1, 1, 1);
}
int r = aColor.red();
int g = aColor.green();
int b = aColor.blue();
const float r = static_cast<float>(aColor.red()) * aScale;
const float g = static_cast<float>(aColor.green()) * aScale;
const float b = static_cast<float>(aColor.blue()) * aScale;
r *= aScale;
g *= aScale;
b *= aScale;
return QColor(CLAMP(r, 0, 255), CLAMP(g, 0, 255), CLAMP(b, 0, 255));
return QColor(CLAMP(static_cast<int>(r), 0, 255), CLAMP(static_cast<int>(g), 0, 255), CLAMP(static_cast<int>(b), 0, 255));
}
CAlphaBitmap::CAlphaBitmap()
+2 -2
View File
@@ -60,7 +60,7 @@ libtiffDummyReadProc (thandle_t fd, tdata_t buf, tsize_t size)
memcpy(buf, &memImage->buffer[memImage->offset], size);
memImage->offset += size;
memImage->offset += static_cast<uint32>(size);
// Return the amount of data read
return size;
@@ -83,7 +83,7 @@ libtiffDummySeekProc (thandle_t fd, toff_t off, int i)
break;
case SEEK_CUR:
memImage->offset += off;
memImage->offset += static_cast<uint32>(off);
break;
case SEEK_END:
-3
View File
@@ -137,8 +137,6 @@ namespace Util
{
x = x - 1;
#pragma warning(push)
#pragma warning(disable : 4293)
if (sizeof(TInteger) > 0)
{
x |= x >> 1;
@@ -163,7 +161,6 @@ namespace Util
{
x |= x >> 32;
}
#pragma warning(pop)
return x + 1;
}