summaryrefslogtreecommitdiffstats
path: root/src/kvilib/ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvilib/ext')
-rw-r--r--src/kvilib/ext/kvi_doublebuffer.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/kvilib/ext/kvi_doublebuffer.cpp b/src/kvilib/ext/kvi_doublebuffer.cpp
index 0f15dca..cea8268 100644
--- a/src/kvilib/ext/kvi_doublebuffer.cpp
+++ b/src/kvilib/ext/kvi_doublebuffer.cpp
@@ -32,12 +32,14 @@ static unsigned int g_uMaxRequestedHeight = 0;
KviDoubleBuffer::KviDoubleBuffer(unsigned int uWidth,unsigned int uHeight)
{
- if((g_pMemoryPixmap->width() < uWidth) || (g_pMemoryPixmap->height() < uHeight))
+ unsigned int uPixmapWidth = static_cast<unsigned int>(g_pMemoryPixmap->width());
+ unsigned int uPixmapHeight = static_cast<unsigned int>(g_pMemoryPixmap->height());
+ if(uPixmapWidth < uWidth || uPixmapHeight < uHeight)
{
// The memory buffer is too small
// There is either no such user requirement or it has grown by the meantime
- unsigned int uMaxW = uWidth > g_pMemoryPixmap->width() ? uWidth : g_pMemoryPixmap->width();
- unsigned int uMaxH = uHeight > g_pMemoryPixmap->height() ? uHeight : g_pMemoryPixmap->height();
+ unsigned int uMaxW = uWidth > uPixmapWidth ? uWidth : uPixmapWidth;
+ unsigned int uMaxH = uHeight > uPixmapHeight ? uHeight : uPixmapHeight;
g_pMemoryPixmap->resize(uMaxW,uMaxH);
}
@@ -70,7 +72,7 @@ void KviDoubleBuffer::done()
void KviDoubleBuffer::heartbeat()
{
- if(((g_uMaxRequestedHeight + 64) < g_pMemoryPixmap->height()) || ((g_uMaxRequestedWidth + 64) < g_pMemoryPixmap->width()))
+ if((g_uMaxRequestedHeight + 64) < static_cast<unsigned int>(g_pMemoryPixmap->height()) || (g_uMaxRequestedWidth + 64) < static_cast<unsigned int>(g_pMemoryPixmap->width()))
{
// do shrink :)
g_pMemoryPixmap->resize(g_uMaxRequestedWidth,g_uMaxRequestedHeight);