From 5a19f89d6c8eb148e6bb7b450f702b666f685ed1 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sat, 13 Dec 2014 10:52:12 +0000 Subject: MoveMemory -> memmove git-svn-id: http://svn.miranda-ng.org/main/trunk@11365 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AssocMgr/src/assoclist.cpp | 2 +- plugins/AssocMgr/src/reg.cpp | 6 +++--- plugins/AssocMgr/src/test.cpp | 2 +- plugins/AutoShutdown/src/utils.cpp | 2 +- plugins/AutoShutdown/src/watcher.cpp | 2 +- plugins/CountryFlags/src/utils.cpp | 2 +- plugins/CryptoPP/src/GPGw/gpg_main.cpp | 4 ++-- plugins/Db3x_mmap/src/dbcache.cpp | 4 ++-- plugins/Db3x_mmap/src/dbevents.cpp | 2 +- plugins/Db3x_mmap/src/dbsettings.cpp | 16 ++++++++-------- plugins/Db3x_mmap/src/dbtool/eventchain.cpp | 4 ++-- plugins/DbEditorPP/src/exportimport.cpp | 2 +- plugins/NewAwaySysMod/src/SetAwayMsg.cpp | 2 +- plugins/QuickReplies/src/options.cpp | 2 +- plugins/Scriver/src/chat/message.cpp | 4 ++-- plugins/Scriver/src/input.cpp | 2 +- plugins/SimpleStatusMsg/src/main.cpp | 16 ++++++++-------- plugins/SimpleStatusMsg/src/msgbox.cpp | 2 +- plugins/SimpleStatusMsg/src/options.cpp | 2 +- plugins/StatusPlugins/commonstatus.cpp | 2 +- plugins/TabSRMM/src/chat/message.cpp | 4 ++-- plugins/TabSRMM/src/contactcache.cpp | 2 +- plugins/TabSRMM/src/msgdialog.cpp | 6 +++--- plugins/TabSRMM/src/msgdlgutils.cpp | 4 ++-- plugins/TabSRMM/src/msglog.cpp | 14 +++++++------- plugins/TabSRMM/src/utils.cpp | 2 +- plugins/UserInfoEx/src/ctrl_edit.cpp | 2 +- plugins/Variables/src/contact.cpp | 2 +- plugins/Variables/src/parse_alias.cpp | 2 +- plugins/Variables/src/parse_inet.cpp | 4 ++-- plugins/Variables/src/parse_str.cpp | 8 ++++---- plugins/Variables/src/variables.cpp | 14 +++++++------- plugins/WebView/src/webview_datawnd.cpp | 2 +- 33 files changed, 73 insertions(+), 73 deletions(-) (limited to 'plugins') diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index a0692e1d38..c9cb806f7c 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -471,7 +471,7 @@ static BOOL RemoveAssocItem_Worker(const char *pszClassName) /* resize storage array */ if ((index+1)hProcess) { /* remove from list */ if (i<(nTransfersCount-1)) - MoveMemory(&transfers[i],&transfers[i+1],(nTransfersCount-i-1)*sizeof(HANDLE)); + memmove(&transfers[i],&transfers[i+1],(nTransfersCount-i-1)*sizeof(HANDLE)); --nTransfersCount; HANDLE *buf = (HANDLE*)mir_realloc(transfers,nTransfersCount*sizeof(HANDLE)); if (buf != NULL) transfers=buf; diff --git a/plugins/CountryFlags/src/utils.cpp b/plugins/CountryFlags/src/utils.cpp index e9786cad1d..26bb000014 100644 --- a/plugins/CountryFlags/src/utils.cpp +++ b/plugins/CountryFlags/src/utils.cpp @@ -59,7 +59,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT msg,UINT_PTR idTimer,DWORD #endif /* resize storage array */ if ((i+1) 0) memset((m_pDbCache + ofsDest + bytes - x), 0, x); if (ofsSource < m_dwFileSize) - MoveMemory(m_pDbCache + ofsDest, m_pDbCache + ofsSource, bytes - x); + memmove(m_pDbCache + ofsDest, m_pDbCache + ofsSource, bytes - x); logg(); } @@ -108,7 +108,7 @@ void CDb3Mmap::DBWrite(DWORD ofs, PVOID pData, int bytes) //log2("write %d@%08x",bytes,ofs); if (ofs+bytes > m_dwFileSize) ReMap(ofs+bytes-m_dwFileSize); - MoveMemory(m_pDbCache+ofs,pData,bytes); + memmove(m_pDbCache+ofs,pData,bytes); logg(); } diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 397d1aaf3e..ad94419aec 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -298,7 +298,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei) memset(dbei->pBlob + len, 0, bytesToCopy - len); mir_free(pBlob); } - else MoveMemory(dbei->pBlob, pSrc, bytesToCopy); + else memmove(dbei->pBlob, pSrc, bytesToCopy); } return 0; } diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 1aff61284b..362aaa82e0 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -147,8 +147,8 @@ LBL_Seek: return 2; case DBVT_BYTE: dbv->bVal = pBlob[1]; break; - case DBVT_WORD: MoveMemory(&(dbv->wVal), (PWORD)(pBlob + 1), 2); break; - case DBVT_DWORD: MoveMemory(&(dbv->dVal), (PDWORD)(pBlob + 1), 4); break; + case DBVT_WORD: memmove(&(dbv->wVal), (PWORD)(pBlob + 1), 2); break; + case DBVT_DWORD: memmove(&(dbv->dVal), (PDWORD)(pBlob + 1), 4); break; case DBVT_UTF8: case DBVT_ASCIIZ: @@ -158,13 +158,13 @@ LBL_Seek: dbv->cchVal--; if (varLen < dbv->cchVal) dbv->cchVal = varLen; - MoveMemory(dbv->pszVal, pBlob + 3, dbv->cchVal); // decode + memmove(dbv->pszVal, pBlob + 3, dbv->cchVal); // decode dbv->pszVal[dbv->cchVal] = 0; dbv->cchVal = varLen; } else { dbv->pszVal = (char*)mir_alloc(1 + varLen); - MoveMemory(dbv->pszVal, pBlob + 3, varLen); + memmove(dbv->pszVal, pBlob + 3, varLen); dbv->pszVal[varLen] = 0; } break; @@ -175,11 +175,11 @@ LBL_Seek: if (isStatic) { if (varLen < dbv->cpbVal) dbv->cpbVal = varLen; - MoveMemory(dbv->pbVal, pBlob + 3, dbv->cpbVal); + memmove(dbv->pbVal, pBlob + 3, dbv->cpbVal); } else { dbv->pbVal = (BYTE *)mir_alloc(varLen); - MoveMemory(dbv->pbVal, pBlob + 3, varLen); + memmove(dbv->pbVal, pBlob + 3, varLen); } dbv->cpbVal = varLen; break; @@ -201,13 +201,13 @@ LBL_Seek: dbv->cchVal--; if (varLen < dbv->cchVal) dbv->cchVal = varLen; - MoveMemory(dbv->pszVal, decoded, dbv->cchVal); + memmove(dbv->pszVal, decoded, dbv->cchVal); dbv->pszVal[dbv->cchVal] = 0; dbv->cchVal = varLen; } else { dbv->pszVal = (char*)mir_alloc(1 + varLen); - MoveMemory(dbv->pszVal, decoded, varLen); + memmove(dbv->pszVal, decoded, varLen); dbv->pszVal[varLen] = 0; } } diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp index 15fc96b0ec..d4fd3467af 100644 --- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp @@ -269,12 +269,12 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime) DWORD oldSize = dbeNew->cbBlob; BYTE* pOldMemo = (BYTE*)_alloca(dbeNew->cbBlob); memcpy(pOldMemo, dbeNew->blob, dbeNew->cbBlob); - MoveMemory(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // decode + memmove(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // decode ConvertOldEvent(dbeNew); if (dbeNew->cbBlob > oldSize) pOldMemo = (BYTE*)_alloca(dbeNew->cbBlob); memcpy(pOldMemo, dbeNew->blob, dbeNew->cbBlob); - MoveMemory(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // encode + memmove(dbeNew->blob, pOldMemo, dbeNew->cbBlob); // encode } if (dbePrev) { diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index b115f8689d..4c751a76c0 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -493,7 +493,7 @@ void importSettings(MCONTACT hContact, char *importstring ) case 'r': *pstr='\r'; break; default: *pstr=pstr[1]; break; } - MoveMemory(pstr+1,pstr+2,mir_strlen(pstr+2)+1); + memmove(pstr+1,pstr+2,mir_strlen(pstr+2)+1); } } } diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 3e4b9c0c1f..c944d2fc2c 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -80,7 +80,7 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, int nLen = GetWindowTextLength(hWnd); TCHAR *text = (TCHAR*)malloc((nLen + 1) * sizeof(TCHAR)); GetWindowText(hWnd, text, nLen + 1); - MoveMemory(text + start, text + end, sizeof(TCHAR)* (_tcslen(text) + 1 - end)); + memmove(text + start, text + end, sizeof(TCHAR)* (_tcslen(text) + 1 - end)); SetWindowText(hWnd, text); free(text); SendMessage(hWnd, EM_SETSEL, start, start); diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index 862247e955..ec4fcac1ad 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -44,7 +44,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam SendMessage(hwnd, WM_KEYDOWN, VK_LEFT, 0); SendMessage(hwnd, EM_GETSEL, (WPARAM) & start, (LPARAM) (PDWORD) NULL); GetWindowText(hwnd, text, SIZEOF(text)); - MoveMemory(text + start, text + end, sizeof(WCHAR) * (wcslen(text) + 1 - end)); + memmove(text + start, text + end, sizeof(WCHAR) * (wcslen(text) + 1 - end)); SetWindowText(hwnd, text); SendMessage(hwnd, EM_SETSEL, start, start); SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd); diff --git a/plugins/Scriver/src/chat/message.cpp b/plugins/Scriver/src/chat/message.cpp index c01cb1f2ee..a417f3a51f 100644 --- a/plugins/Scriver/src/chat/message.cpp +++ b/plugins/Scriver/src/chat/message.cpp @@ -95,7 +95,7 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si) p1 += 5; - MoveMemory(pszText, p1, mir_strlen(p1) + 1); + memmove(pszText, p1, mir_strlen(p1) + 1); p1 = pszText; // iterate through all characters, if rtf control character found then take action @@ -287,7 +287,7 @@ TCHAR* DoRtfToTags(char *pszText, SESSION_INFO *si) // move the memory and paste in new commands instead of the old RTF if (InsertThis[0] || iRemoveChars) { - MoveMemory(p1 + mir_strlen(InsertThis), p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1); + memmove(p1 + mir_strlen(InsertThis), p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1); memcpy(p1, InsertThis, mir_strlen(InsertThis)); p1 += mir_strlen(InsertThis); } diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 04cfeacc0d..a0c3ba5d3b 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -384,7 +384,7 @@ BOOL HandleLinkClick(HINSTANCE hInstance, HWND hwndDlg, HWND hwndFocus, ENLINK * tr.lpstrText = (LPWSTR)mir_alloc(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8)); SendMessage(lParam->nmhdr.hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (_tcschr(tr.lpstrText, _T('@')) != NULL && _tcschr(tr.lpstrText, _T(':')) == NULL && _tcschr(tr.lpstrText, _T('/')) == NULL) { - MoveMemory(tr.lpstrText + 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1)); + memmove(tr.lpstrText + 7, tr.lpstrText, sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 1)); memcpy(tr.lpstrText, _T("mailto:"), sizeof(TCHAR) * 7); } diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 5d0bf4b922..6925b4f189 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -122,7 +122,7 @@ static TCHAR *GetWinampSong(void) if (pstr < szTitle + (iTitleLen / 2)) { - MoveMemory(szTitle, pstr + 9, _tcslen(pstr + 9) * sizeof(TCHAR)); + memmove(szTitle, pstr + 9, _tcslen(pstr + 9) * sizeof(TCHAR)); pstr = _tcsstr(pstr + 1, _T(" - Winamp")); if (pstr == NULL) { @@ -163,7 +163,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (i + 2 <= 1024 && msg[i + 2]) { count++; - MoveMemory(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(TCHAR)); + memmove(p, p + 1, (mir_tstrlen(p) - 1) * sizeof(TCHAR)); } else { @@ -197,7 +197,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (mir_tstrlen(ptszWinampTitle) > 12) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(ptszWinampTitle) - 12) * sizeof(TCHAR)); - MoveMemory(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR)); + memmove(msg + i + mir_tstrlen(ptszWinampTitle), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR)); memcpy(msg + i, ptszWinampTitle, mir_tstrlen(ptszWinampTitle) * sizeof(TCHAR)); mir_free(ptszWinampTitle); @@ -232,7 +232,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (mir_tstrlen(substituteStr) > 6) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR)); - MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR)); + memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR)); memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR)); } else if (!_tcsnicmp(msg + i, _T("%date%"), 6)) @@ -242,7 +242,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (mir_tstrlen(substituteStr) > 6) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR)); - MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR)); + memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 6, (mir_tstrlen(msg) - i - 5) * sizeof(TCHAR)); memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR)); } else if (!_tcsnicmp(msg+i, _T("%rand("), 6)) @@ -264,7 +264,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (mir_tstrlen(substituteStr) > k - i) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - (k - i)) * sizeof(TCHAR)); - MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR)); + memmove(msg + i + mir_tstrlen(substituteStr), msg + i + (k - i), (mir_tstrlen(msg) - i - (k - i - 1)) * sizeof(TCHAR)); memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR)); } mir_free(temp); @@ -314,7 +314,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (mir_tstrlen(substituteStr) > 9) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg) + 1 + mir_tstrlen(substituteStr) - 9) * sizeof(TCHAR)); - MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(TCHAR)); + memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 9, (mir_tstrlen(msg) - i - 8) * sizeof(TCHAR)); memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR)); } else if (!_tcsnicmp(msg+i, _T("%randdefmsg%"), 12)) @@ -362,7 +362,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (mir_tstrlen(substituteStr) > 12) msg = (TCHAR *)mir_realloc(msg, (mir_tstrlen(msg)+1+mir_tstrlen(substituteStr)-12) * sizeof(TCHAR)); - MoveMemory(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR)); + memmove(msg + i + mir_tstrlen(substituteStr), msg + i + 12, (mir_tstrlen(msg) - i - 11) * sizeof(TCHAR)); memcpy(msg + i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR)); } } diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 7777fdfc71..aa5fcc7480 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -544,7 +544,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L textLen = GetWindowTextLength(hwndDlg); text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1)); GetWindowText(hwndDlg, text, textLen + 1); - MoveMemory(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end)); + memmove(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end)); SetWindowText(hwndDlg, text); mir_free(text); SendMessage(hwndDlg, EM_SETSEL, start, start); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index e6b48a54a3..5b750e136a 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -69,7 +69,7 @@ static LRESULT CALLBACK OptEditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam textLen = GetWindowTextLength(hwndDlg); text = (TCHAR *)mir_alloc(sizeof(TCHAR) * (textLen + 1)); GetWindowText(hwndDlg, text, textLen + 1); - MoveMemory(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end)); + memmove(text + start, text + end, sizeof(TCHAR) * (textLen + 1 - end)); SetWindowText(hwndDlg, text); mir_free(text); SendMessage(hwndDlg, EM_SETSEL, start, start); diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index de543e17e4..c82053e3c9 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -185,7 +185,7 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) if (mir_tstrlen(substituteStr) > 6) tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(mir_tstrlen(tszMsg) + 1 + mir_tstrlen(substituteStr) - 6)); - MoveMemory(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5)); + memmove(tszMsg + j + mir_tstrlen(substituteStr), tszMsg + j + 6, sizeof(TCHAR)*(mir_tstrlen(tszMsg) - j - 5)); memcpy(tszMsg + j, substituteStr, sizeof(TCHAR)*mir_tstrlen(substituteStr)); } diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index c108f97281..afc1503f53 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -110,7 +110,7 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si) } else p1 += 7; - MoveMemory(pszText, p1, mir_strlen(p1) + 1); + memmove(pszText, p1, mir_strlen(p1) + 1); p1 = pszText; // iterate through all characters, if rtf control character found then take action @@ -298,7 +298,7 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si) // move the memory and paste in new commands instead of the old RTF if (InsertThis[0] || iRemoveChars) { - MoveMemory(p1 + mir_strlen(InsertThis) , p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1); + memmove(p1 + mir_strlen(InsertThis) , p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1); memcpy(p1, InsertThis, mir_strlen(InsertThis)); p1 += mir_strlen(InsertThis); } diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 6e06dd7f50..54d1a93446 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -296,7 +296,7 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM lParam) if ((m_iHistoryTop == m_iHistorySize) && oldTop == 0) { // shift the stack down... TInputHistory ihTemp = m_history[0]; m_iHistoryTop--; - ::MoveMemory((void*)&m_history[0], (void*)&m_history[1], (m_iHistorySize - 1) * sizeof(TInputHistory)); + ::memmove((void*)&m_history[0], (void*)&m_history[1], (m_iHistorySize - 1) * sizeof(TInputHistory)); m_history[m_iHistoryTop] = ihTemp; } if (iLength > m_history[m_iHistoryTop].lLen) { diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 913f0a1f2a..2dfbe714ec 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2081,7 +2081,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP tr.lpstrText = (TCHAR*)_alloca(sizeof(TCHAR)*(tr.chrg.cpMax - tr.chrg.cpMin + 8)); SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) { - MoveMemory(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1); + memmove(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1); memcpy(tr.lpstrText, _T("mailto:"), 7); } if (!IsStringValidLink(tr.lpstrText)) @@ -2898,8 +2898,8 @@ quote_from_last: } if (dbei.eventType == EVENTTYPE_FILE) { size_t iDescr = mir_strlen((char *)(szText + sizeof(DWORD))); - MoveMemory(szText, szText + sizeof(DWORD), iDescr); - MoveMemory(szText + iDescr + 2, szText + sizeof(DWORD)+iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1); + memmove(szText, szText + sizeof(DWORD), iDescr); + memmove(szText + iDescr + 2, szText + sizeof(DWORD)+iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1); szText[iDescr] = '\r'; szText[iDescr + 1] = '\n'; szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + mir_strlen((char *)szText))); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 1b3f647bb4..e35708465f 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -883,7 +883,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) TCHAR InsertThis[50]; p1 += 5; - MoveMemory(pszText, p1, (mir_tstrlen(p1) + 1) * sizeof(TCHAR)); + memmove(pszText, p1, (mir_tstrlen(p1) + 1) * sizeof(TCHAR)); p1 = pszText; // iterate through all characters, if rtf control character found then take action while (*p1 != '\0') { @@ -1075,7 +1075,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) // move the memory and paste in new commands instead of the old RTF if (InsertThis[0] || iRemoveChars) { size_t cbLen = _tcslen(InsertThis); - MoveMemory(p1 + cbLen, p1 + iRemoveChars, (mir_tstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR)); + memmove(p1 + cbLen, p1 + iRemoveChars, (mir_tstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR)); memcpy(p1, InsertThis, cbLen * sizeof(TCHAR)); p1 += cbLen; } diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index ea502d8c7e..1e89d91879 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -347,14 +347,14 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int memcpy(*buffer + i, begin ? "\\i1 " : "\\i0 ", 4); continue; case 'u': - MoveMemory(*buffer + i + 2, *buffer + i + 1, *cbBufferEnd - i); + memmove(*buffer + i + 2, *buffer + i + 1, *cbBufferEnd - i); memcpy(*buffer + i, begin ? "\\ul1 " : "\\ul0 ", 5); *cbBufferEnd += 1; continue; case 's': *cbBufferAlloced += 20; *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced); - MoveMemory(*buffer + i + 6, *buffer + i + 1, (*cbBufferEnd - i) + 1); + memmove(*buffer + i + 6, *buffer + i + 1, (*cbBufferEnd - i) + 1); memcpy(*buffer + i, begin ? "\\strike1 " : "\\strike0 ", begin ? 9 : 9); *cbBufferEnd += 5; continue; @@ -379,7 +379,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced += 1024; *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced); } - MoveMemory(*buffer + i + 6, *buffer + i + 2, *cbBufferEnd - i - 1); + memmove(*buffer + i + 6, *buffer + i + 2, *cbBufferEnd - i - 1); memcpy(*buffer + i, "\\line ", 6); *cbBufferEnd += 4; } @@ -388,7 +388,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced += 1024; *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced); } - MoveMemory(*buffer + i + 6, *buffer + i + 1, *cbBufferEnd - i); + memmove(*buffer + i + 6, *buffer + i + 1, *cbBufferEnd - i); memcpy(*buffer + i, "\\line ", 6); *cbBufferEnd += 5; } @@ -397,7 +397,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced += 1024; *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced); } - MoveMemory(*buffer + i + 5, *buffer + i + 1, *cbBufferEnd - i); + memmove(*buffer + i + 5, *buffer + i + 1, *cbBufferEnd - i); memcpy(*buffer + i, "\\tab ", 5); *cbBufferEnd += 4; } @@ -406,7 +406,7 @@ static int AppendToBufferWithRTF(int mode, char **buffer, int *cbBufferEnd, int *cbBufferAlloced += 1024; *buffer = (char *)mir_realloc(*buffer, *cbBufferAlloced); } - MoveMemory(*buffer + i + 1, *buffer + i, *cbBufferEnd - i + 1); + memmove(*buffer + i + 1, *buffer + i, *cbBufferEnd - i + 1); (*buffer)[i] = '\\'; ++*cbBufferEnd; i++; @@ -683,7 +683,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (dat->hHistoryEvents) { if (dat->curHistory == dat->maxHistory) { - MoveMemory(dat->hHistoryEvents, &dat->hHistoryEvents[1], sizeof(HANDLE)* (dat->maxHistory - 1)); + memmove(dat->hHistoryEvents, &dat->hHistoryEvents[1], sizeof(HANDLE)* (dat->maxHistory - 1)); dat->curHistory--; } dat->hHistoryEvents[dat->curHistory++] = hDbEvent; diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index f7a3739098..87e95357e9 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -976,7 +976,7 @@ const wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRi tr.lpstrText = (wchar_t *)mir_alloc(2 * (tr.chrg.cpMax - tr.chrg.cpMin + 8)); ::SendMessageW(hwndRich, EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (wcschr(tr.lpstrText, '@') != NULL && wcschr(tr.lpstrText, ':') == NULL && wcschr(tr.lpstrText, '/') == NULL) { - ::MoveMemory(tr.lpstrText + 7, tr.lpstrText, sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 1)); + ::memmove(tr.lpstrText + 7, tr.lpstrText, sizeof(wchar_t) * (tr.chrg.cpMax - tr.chrg.cpMin + 1)); ::memcpy(tr.lpstrText, L"mailto:", 7 * sizeof(wchar_t)); } return(tr.lpstrText); diff --git a/plugins/UserInfoEx/src/ctrl_edit.cpp b/plugins/UserInfoEx/src/ctrl_edit.cpp index 84c1402103..3ccc3d6fbf 100644 --- a/plugins/UserInfoEx/src/ctrl_edit.cpp +++ b/plugins/UserInfoEx/src/ctrl_edit.cpp @@ -349,7 +349,7 @@ LRESULT CEditCtrl::LinkNotificationHandler(ENLINK* lnk) { if (_tcschr(tr.lpstrText, '@') != NULL && _tcschr(tr.lpstrText, ':') == NULL && _tcschr(tr.lpstrText, '/') == NULL) { - MoveMemory(tr.lpstrText + (7*sizeof(TCHAR)), tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(TCHAR)); + memmove(tr.lpstrText + (7*sizeof(TCHAR)), tr.lpstrText, (tr.chrg.cpMax - tr.chrg.cpMin + 1)*sizeof(TCHAR)); memcpy(tr.lpstrText, _T("mailto:"), (7*sizeof(TCHAR))); } diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 64d4dfb308..65a92523e4 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -379,7 +379,7 @@ static int contactSettingChanged(WPARAM hContact, LPARAM lParam) /* remove from cache */ mir_free(cce[i].tszContact); if (cacheSize > 1) { - MoveMemory(&cce[i], &cce[cacheSize-1], sizeof(CONTACTCE)); + memmove(&cce[i], &cce[cacheSize-1], sizeof(CONTACTCE)); cce = ( CONTACTCE* )mir_realloc(cce, (cacheSize-1)*sizeof(CONTACTCE)); cacheSize -= 1; } diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp index 01440e862e..d9b31ace06 100644 --- a/plugins/Variables/src/parse_alias.cpp +++ b/plugins/Variables/src/parse_alias.cpp @@ -61,7 +61,7 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg) if (res == NULL) return NULL; } - MoveMemory(res + ecur + (_tcslen(rArg) - _tcslen(tArg)), res + ecur, (_tcslen(res + ecur) + 1)*sizeof(TCHAR)); + memmove(res + ecur + (_tcslen(rArg) - _tcslen(tArg)), res + ecur, (_tcslen(res + ecur) + 1)*sizeof(TCHAR)); _tcsncpy(res + cur, rArg, _tcslen(rArg)); } } diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index 6504463eee..4843b6557f 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -39,7 +39,7 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) return NULL; char hex[8]; - MoveMemory(res + cur + 3, res + cur + 1, strlen(res + cur + 1) + 1); + memmove(res + cur + 3, res + cur + 1, strlen(res + cur + 1) + 1); mir_snprintf(hex, SIZEOF(hex), "%%%x", *(res + cur)); strncpy(res + cur, hex, strlen(hex)); cur += strlen(hex); @@ -66,7 +66,7 @@ static TCHAR *parseUrlDec(ARGUMENTSINFO *ai) memset(hex, '\0', sizeof(hex)); strncpy(hex, res + cur + 1, 2); *(res + cur) = (char)strtol(hex, NULL, 16); - MoveMemory(res + cur + 1, res + cur + 3, strlen(res + cur + 3) + 1); + memmove(res + cur + 1, res + cur + 3, strlen(res + cur + 3) + 1); } cur++; } diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp index 36e2fab4f6..28df138d44 100644 --- a/plugins/Variables/src/parse_str.cpp +++ b/plugins/Variables/src/parse_str.cpp @@ -86,7 +86,7 @@ static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai) int loc = cur - res; res = (TCHAR*)mir_realloc(res, (_tcslen(res) + 2)*sizeof(TCHAR)); cur = res + loc; - MoveMemory(cur + 2, cur + 1, (_tcslen(cur + 1) + 1)*sizeof(TCHAR)); + memmove(cur + 2, cur + 1, (_tcslen(cur + 1) + 1)*sizeof(TCHAR)); memcpy(cur, _T("\r\n"), 2 * sizeof(TCHAR)); cur += 2; } @@ -147,7 +147,7 @@ static TCHAR *parseFixeol2(ARGUMENTSINFO *ai) res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(szReplacement) - _tcslen(szEol) + 1)*sizeof(TCHAR)); cur = res + pos; } - MoveMemory(cur + _tcslen(szReplacement), cur + _tcslen(szEol), (_tcslen(cur + _tcslen(szEol)) + 1)*sizeof(TCHAR)); + memmove(cur + _tcslen(szReplacement), cur + _tcslen(szEol), (_tcslen(cur + _tcslen(szEol)) + 1)*sizeof(TCHAR)); memcpy(cur, szReplacement, _tcslen(szReplacement)*sizeof(TCHAR)); pos += _tcslen(szReplacement) - 1; } @@ -408,7 +408,7 @@ static TCHAR *parseReplace(ARGUMENTSINFO *ai) res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(ai->targv[i + 1]) - _tcslen(ai->targv[i]) + 1)*sizeof(TCHAR)); cur = res + pos; } - MoveMemory(cur + _tcslen(ai->targv[i + 1]), cur + _tcslen(ai->targv[i]), (_tcslen(cur + _tcslen(ai->targv[i])) + 1)*sizeof(TCHAR)); + memmove(cur + _tcslen(ai->targv[i + 1]), cur + _tcslen(ai->targv[i]), (_tcslen(cur + _tcslen(ai->targv[i])) + 1)*sizeof(TCHAR)); memcpy(cur, ai->targv[i + 1], _tcslen(ai->targv[i + 1])*sizeof(TCHAR)); pos += _tcslen(ai->targv[i + 1]) - 1; } @@ -461,7 +461,7 @@ static TCHAR *parseScroll(ARGUMENTSINFO *ai) memset(res, 0, ((2 * _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR))); _tcscpy(res, ai->targv[1]); _tcscat(res, ai->targv[1]); - MoveMemory(res, res + move, (_tcslen(res + move) + 1)*sizeof(TCHAR)); + memmove(res, res + move, (_tcslen(res + move) + 1)*sizeof(TCHAR)); *(res + display) = 0; res = (TCHAR*)mir_realloc(res, (_tcslen(res) + 1)*sizeof(TCHAR)); diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp index a378a87904..af95b31dd5 100644 --- a/plugins/Variables/src/variables.cpp +++ b/plugins/Variables/src/variables.cpp @@ -173,25 +173,25 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) pargv = argv = NULL; // new round if (*cur == DONTPARSE_CHAR) { - MoveMemory(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); + memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); if (*cur == DONTPARSE_CHAR) continue; while ( (*cur != DONTPARSE_CHAR) && (*cur != 0)) cur++; - MoveMemory(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); + memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); pos = cur-string-1; continue; } // remove end of lines else if ((!_tcsncmp(cur, _T("\r\n"), 2)) && (gParseOpts.bStripEOL)) { - MoveMemory(cur, cur+2, (_tcslen(cur+2)+1)*sizeof(TCHAR)); + memmove(cur, cur+2, (_tcslen(cur+2)+1)*sizeof(TCHAR)); pos = cur-string-1; continue; } else if ((*cur == '\n' && gParseOpts.bStripEOL) || (*cur == ' ' && gParseOpts.bStripWS)) { - MoveMemory(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); + memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); pos = cur - string - 1; continue; } @@ -206,13 +206,13 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) string = (TCHAR*)mir_realloc(string, (_tcslen(string)+1)*sizeof(TCHAR)); continue; } - MoveMemory(scur, cur, (_tcslen(cur)+1)*sizeof(TCHAR)); + memmove(scur, cur, (_tcslen(cur)+1)*sizeof(TCHAR)); pos = scur-string-1; continue; } else if ((*cur != FIELD_CHAR) && (*cur != FUNC_CHAR) && (*cur != FUNC_ONCE_CHAR)) { if (gParseOpts.bStripAll) { - MoveMemory(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); + memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR)); pos = cur - string - 1; } continue; @@ -352,7 +352,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi) } scur = string+scurPos; cur = string+curPos; - MoveMemory(scur + parsedTokenLen, cur, (_tcslen(cur)+1)*sizeof(TCHAR)); + memmove(scur + parsedTokenLen, cur, (_tcslen(cur)+1)*sizeof(TCHAR)); memcpy(scur, parsedToken, parsedTokenLen*sizeof(TCHAR)); { size_t len = _tcslen(string); diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 40e986fb0b..5e37235911 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -321,7 +321,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_DATA, EM_GETTEXTRANGE, 0, (LPARAM) & tr); if (strchr(tr.lpstrText, '@') != NULL && strchr(tr.lpstrText, ':') == NULL && strchr(tr.lpstrText, '/') == NULL) { - MoveMemory(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1); + memmove(tr.lpstrText + 7, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin + 1); memcpy(tr.lpstrText, "mailto:", 7); } -- cgit v1.2.3