From b2fad485cd5b41744ef0cc4a02722c021afd926c Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 1 Dec 2014 00:07:01 +0000 Subject: ZeroMemory -> memset, few bugs fised git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirandaG15/src/CAppletManager.cpp | 2 +- plugins/MirandaG15/src/CConfig.cpp | 2 +- plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp | 6 +++--- plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp | 4 ++-- plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp | 4 ++-- plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp | 10 +++++----- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'plugins/MirandaG15/src') diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 9ca5594c6b..ef9746eb87 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -916,7 +916,7 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lPara // Create struct for dbevent DBEVENTINFO dbevent; - ZeroMemory(&dbevent, sizeof(dbevent)); + memset(&dbevent, 0, sizeof(dbevent)); //dbevent.flags |= PREF_UNICODE; dbevent.cbSize = sizeof(dbevent); dbevent.cbBlob = db_event_getBlobSize(hdbevent); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index e5809be5bf..473296553d 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -250,7 +250,7 @@ void CConfig::OnConnectionChanged() { int CConfig::InitOptionsDialog(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp; - ZeroMemory(&odp, sizeof(odp)); + memset(&odp, 0, sizeof(odp)); odp.cbSize = sizeof(odp); odp.position = 847000000; odp.hInstance = hInstance; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp index db850a54c2..466b9cfe59 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDConnectionLogitech.cpp @@ -137,7 +137,7 @@ bool CLCDConnectionLogitech::Initialize(tstring strAppletName,bool bAutostart, b if(lgLcdInit() != ERROR_SUCCESS) return false; - ZeroMemory(&m_connectContext, sizeof(m_connectContext)); + memset(&m_connectContext, 0, sizeof(m_connectContext)); m_connectContext.connection = LGLCD_INVALID_CONNECTION; m_connectContext.appFriendlyName = m_strAppletName.c_str(); @@ -257,7 +257,7 @@ bool CLCDConnectionLogitech::Connect(int iIndex) } // Now lets open the LCD. We must initialize the g_OpenContext structure. - ZeroMemory(&OpenContext, sizeof(OpenContext)); + memset(&OpenContext, 0, sizeof(OpenContext)); OpenContext.connection = m_hConnection; OpenContext.deviceType = m_pConnectedDevice->GetIndex();//LGLCD_DEVICE_QVGA; OpenContext.device = LGLCD_INVALID_DEVICE; @@ -283,7 +283,7 @@ bool CLCDConnectionLogitech::Connect(int iIndex) m_pPixels = OpenContext.deviceType==LGLCD_DEVICE_QVGA? m_lcdBitmap.bmp_qvga32.pixels:m_lcdBitmap.bmp_mono.pixels; m_iPixels = OpenContext.deviceType==LGLCD_DEVICE_QVGA? sizeof(m_lcdBitmap.bmp_qvga32.pixels):sizeof(m_lcdBitmap.bmp_mono.pixels); m_pDrawingBuffer = (PBYTE) malloc(m_iPixels); - ZeroMemory(m_pDrawingBuffer, m_iPixels); + memset(m_pDrawingBuffer, 0, m_iPixels); m_iPriority = LGLCD_PRIORITY_NORMAL; m_bConnected = true; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp index d1ed4dc48d..814410f9b8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDGfx.cpp @@ -74,7 +74,7 @@ bool CLCDGfx::Initialize(int nWidth, int nHeight, int nBPP, PBYTE pLcdBitmapBits return false; } - ZeroMemory(m_pBitmapInfo, nBMISize); + memset(m_pBitmapInfo, 0, nBMISize); m_pBitmapInfo->bmiHeader.biSize = sizeof(m_pBitmapInfo->bmiHeader); m_pBitmapInfo->bmiHeader.biWidth = m_nWidth; m_pBitmapInfo->bmiHeader.biHeight = -m_nHeight; @@ -298,7 +298,7 @@ void CLCDGfx::DrawText(int nX, int nY, LPCTSTR sText) int nOldBkMode = SetBkMode(m_hDC, TRANSPARENT); DRAWTEXTPARAMS dtp; - ZeroMemory(&dtp, sizeof(DRAWTEXTPARAMS)); + memset(&dtp, 0, sizeof(DRAWTEXTPARAMS)); dtp.cbSize = sizeof(DRAWTEXTPARAMS); RECT rBounds = {nX,nY,GetClipWidth(),GetClipHeight()}; diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp index f3a01450af..7d531cbea8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp @@ -9,7 +9,7 @@ CLCDInput::CLCDInput() { m_lInputTime = 0; m_iLinePosition = 0; - ZeroMemory(&m_Marker,2*sizeof(SMarker)); + memset(&m_Marker, 0, sizeof(m_Marker)); m_pScrollbar = NULL; m_bShowSymbols = true; @@ -573,7 +573,7 @@ void CLCDInput::Reset() m_lInputTime = 0; m_bInsert = true; - ZeroMemory(&m_Marker[0],sizeof(SMarker)); + memset(&m_Marker[0], 0, sizeof(SMarker)); m_strText = _T(""); m_vLineOffsets.clear(); diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp index 1e06d87774..9d49c40aa8 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDTextObject.cpp @@ -11,7 +11,7 @@ CLCDTextObject::CLCDTextObject() m_hFont = NULL; m_iFontHeight = 0; // Initialize DRAWTEXTPARAMS - ZeroMemory(&m_dtp, sizeof(DRAWTEXTPARAMS)); + memset(&m_dtp, 0, sizeof(DRAWTEXTPARAMS)); m_dtp.cbSize = sizeof(DRAWTEXTPARAMS); // Initialize alignment m_iTextFormat = m_iTextAlignment = (DT_LEFT | DT_NOPREFIX); @@ -107,7 +107,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) return; LOGFONT lf; - ZeroMemory(&lf, sizeof(lf)); + memset(&lf, 0, sizeof(lf)); GetObject(m_hFont, sizeof(LOGFONT), &lf); _tcsncpy(lf.lfFaceName, strFontName.c_str(), LF_FACESIZE); @@ -121,7 +121,7 @@ void CLCDTextObject::SetFontFaceName(tstring strFontName) void CLCDTextObject::SetFontPointSize(int nPointSize) { LOGFONT lf; - ZeroMemory(&lf, sizeof(lf)); + memset(&lf, 0, sizeof(lf)); GetObject(m_hFont, sizeof(LOGFONT), &lf); lf.lfHeight = -MulDiv(nPointSize, 96, 72); @@ -134,7 +134,7 @@ void CLCDTextObject::SetFontPointSize(int nPointSize) //************************************************************************ void CLCDTextObject::SetFontItalic(bool flag) { LOGFONT lf; - ZeroMemory(&lf, sizeof(lf)); + memset(&lf, 0, sizeof(lf)); GetObject(m_hFont, sizeof(LOGFONT), &lf); lf.lfItalic = flag; @@ -148,7 +148,7 @@ void CLCDTextObject::SetFontItalic(bool flag) { void CLCDTextObject::SetFontWeight(int nWeight) { LOGFONT lf; - ZeroMemory(&lf, sizeof(lf)); + memset(&lf, 0, sizeof(lf)); GetObject(m_hFont, sizeof(LOGFONT), &lf); lf.lfWeight = nWeight; -- cgit v1.2.3