From 8b81d60137c929cc50f50a53c3905e8ff313628b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Feb 2013 13:45:06 +0000 Subject: memory allocation fix git-svn-id: http://svn.miranda-ng.org/main/trunk@3782 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FloatingContacts/src/bitmap_funcs.cpp | 18 +++++++++--------- plugins/Popup/src/bitmap_funcs.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp index 422fc13c33..6a9f31ee45 100644 --- a/plugins/FloatingContacts/src/bitmap_funcs.cpp +++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp @@ -379,7 +379,7 @@ void MyBitmap::BlendColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 PU_DIV255(koef2g * cl * alpha), PU_DIV255(koef2b * cl * alpha), alpha); -#pragma warning(pop) +#pragma warning(pop) // COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]); // COLOR32 src = (cl > 128) ? // rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, alpha): @@ -446,7 +446,7 @@ void MyBitmap::DrawColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 PU_DIV255(koef2g * cl * alpha), PU_DIV255(koef2b * cl * alpha), alpha); -#pragma warning(pop) +#pragma warning(pop) // bits[(i+y)*width + (j+x)] = (cl > 128) ? // rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])): // rgba(koef2r * cl, koef2g * cl, koef2b * cl, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])); @@ -548,7 +548,7 @@ void MyBitmap::BlendPartColorized(MyBitmap *bmp, int xin, int yin, int win, int PU_DIV255(koef2g * cl * alpha), PU_DIV255(koef2b * cl * alpha), alpha); -#pragma warning(pop) +#pragma warning(pop) // COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]); // COLOR32 src = (cl > 128) ? // rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, alpha): @@ -789,7 +789,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) //Base on code by Artem Shpynov //from clist_modern plugin -//slightly modified and integrated to MyBitmap class +//slightly modified and integrated to MyBitmap class void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength) { SIZE sz; GetTextExtentPoint32(this->getDC(), str, lstrlen(str), &sz); @@ -877,7 +877,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength) mx = (BYTE)(max(max(bx,rx),gx)); - if (1) + if (1) { bx = (bx>3):bx; rx = (rx>3):rx; @@ -885,7 +885,7 @@ void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength) // reduce boldeness at white fonts } COLOR32 cl = row_dst[j]; - if (mx) + if (mx) { COLOR32 rrx,grx,brx; COLOR32 rlx,glx,blx; @@ -981,7 +981,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) } HRGN hRgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData); - delete pRgnData; + delete[] pRgnData; return hRgn; } @@ -1166,7 +1166,7 @@ bool MyBitmap::loadFromFile(const char *fn, const char *fnAlpha) } else { char ext[5]; - memcpy(ext,fn+(strlen(fn)-4),5); + memcpy(ext,fn+(strlen(fn)-4),5); if (!lstrcmpiA(ext,".png")) { return loadFromFile_png(fn, fnAlpha); @@ -1182,7 +1182,7 @@ bool MyBitmap::loadFromFile(const char *fn, const char *fnAlpha) void MyBitmap::allocate(int w, int h) { if (dcBmp && (width == w) && (height == h)) return; - + width = w; height = h; diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 8854c8178e..8e37e796ad 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -352,7 +352,7 @@ void MyBitmap::BlendColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 PU_DIV255(koef2g * cl * alpha), PU_DIV255(koef2b * cl * alpha), alpha); -#pragma warning(pop) +#pragma warning(pop) // COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]); // COLOR32 src = (cl > 128) ? // rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, alpha): @@ -419,7 +419,7 @@ void MyBitmap::DrawColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 PU_DIV255(koef2g * cl * alpha), PU_DIV255(koef2b * cl * alpha), alpha); -#pragma warning(pop) +#pragma warning(pop) // bits[(i+y)*width + (j+x)] = (cl > 128) ? // rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])): // rgba(koef2r * cl, koef2g * cl, koef2b * cl, geta(bmp->bits[int(i*ky)*bmp->width + int(j*kx)])); @@ -521,7 +521,7 @@ void MyBitmap::BlendPartColorized(MyBitmap *bmp, int xin, int yin, int win, int PU_DIV255(koef2g * cl * alpha), PU_DIV255(koef2b * cl * alpha), alpha); -#pragma warning(pop) +#pragma warning(pop) // COLOR32 cl = getr(bmp->bits[int(i*ky)*bmp->width + int(j*kx)]); // COLOR32 src = (cl > 128) ? // rgba(koef1r * cl + br, koef1g * cl + bg, koef1b * cl + bb, alpha): @@ -753,7 +753,7 @@ HRGN MyBitmap::buildOpaqueRgn(int level, bool opaque) } HRGN hRgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData); - delete pRgnData; + delete[] pRgnData; return hRgn; } @@ -938,7 +938,7 @@ bool MyBitmap::loadFromFile(const char *fn, const char *fnAlpha) } else { char ext[5]; - memcpy(ext,fn+(strlen(fn)-4),5); + memcpy(ext,fn+(strlen(fn)-4),5); if (!lstrcmpiA(ext,".png")) { return loadFromFile_png(fn, fnAlpha); -- cgit v1.2.3