diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-30 21:20:14 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-30 21:20:14 +0000 |
commit | d9c98bcdfca6da51a1a82dc6c0dc5996b3b6cd6d (patch) | |
tree | a6f925c63bc31e4b4dba301183cc3b429d52d816 /src/modules | |
parent | ce2d4f19e3f810b282eb7d47d470d426ff459e1f (diff) |
new sorting functions applied
git-svn-id: http://svn.miranda-ng.org/main/trunk@11180 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
42 files changed, 232 insertions, 240 deletions
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp index ff1fe17e42..75a82d6eab 100644 --- a/src/modules/chat/chat_svc.cpp +++ b/src/modules/chat/chat_svc.cpp @@ -498,7 +498,7 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam) } else if (gcd->iType == GC_EVENT_NOTICE || gcd->iType == GC_EVENT_INFORMATION) { si = ci.GetActiveSession(); - if (si && !lstrcmpA(si->pszModule, gcd->pszModule)) { + if (si && !mir_strcmp(si->pszModule, gcd->pszModule)) { pWnd = si->ptszID; pMod = si->pszModule; } diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp index d4de18e515..2499b79f2d 100644 --- a/src/modules/chat/clist.cpp +++ b/src/modules/chat/clist.cpp @@ -46,7 +46,7 @@ MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi if (hContact) { //contact exist, make sure it is in the right group
if (pszGroup[0]) {
ptrT grpName(db_get_tsa(hContact, "CList", "Group"));
- if (!lstrcmp(pszGroup, grpName))
+ if (!mir_tstrcmp(pszGroup, grpName))
db_set_ts(hContact, "CList", "Group", pszGroup);
}
@@ -236,7 +236,7 @@ MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom) continue;
ptrT roomid(db_get_tsa(hContact, pszModule, "ChatRoomID"));
- if (roomid != NULL && !lstrcmpi(roomid, pszRoom))
+ if (roomid != NULL && !mir_tstrcmpi(roomid, pszRoom))
return hContact;
}
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp index e77d2013d8..e628a7c447 100644 --- a/src/modules/chat/log.cpp +++ b/src/modules/chat/log.cpp @@ -386,7 +386,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) mir_tstrncpy(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
mir_tstrncpy(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30);
- if (!g_Settings->bShowTimeIfChanged || streamData->si->LastTime == 0 || lstrcmp(szTimeStamp, szOldTimeStamp)) {
+ if (!g_Settings->bShowTimeIfChanged || streamData->si->LastTime == 0 || mir_tstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, &buffer, &bufferEnd, &bufferAlloced, _T("%s"), szTimeStamp);
}
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp index 4f6666b99e..85899ca1b8 100644 --- a/src/modules/chat/manager.cpp +++ b/src/modules/chat/manager.cpp @@ -125,7 +125,7 @@ static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL remo SESSION_INFO *pTemp = ci.wndList, *pLast = NULL;
while (pTemp != NULL) {
// match
- if ((!pszID && pTemp->iType != GCW_SERVER || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID && pTemp->iType != GCW_SERVER || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
DWORD dw = pTemp->dwItemData;
if (ci.OnRemoveSession)
@@ -166,7 +166,7 @@ static SESSION_INFO* SM_FindSession(const TCHAR *pszID, const char *pszModule) SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule))
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule))
return pTemp;
pTemp = pTemp->next;
@@ -181,7 +181,7 @@ static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule) SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
ci.UM_RemoveAll(&pTemp->pUsers);
pTemp->nUsersInNicklist = 0;
if (pTemp->iType != GCW_SERVER)
@@ -204,7 +204,7 @@ static BOOL SM_SetStatusEx(const TCHAR *pszID, const char *pszModule, const TCHA return FALSE;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
ci.UM_SetStatusEx(pTemp->pUsers, pszText, flags);
if (pTemp->hWnd)
RedrawWindow(GetDlgItem(pTemp->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
@@ -237,7 +237,7 @@ static BOOL SM_AddEventToAllMatchingUID(GCEVENT *gce) SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpiA(pTemp->pszModule, gce->pDest->pszModule)) {
+ if (!mir_strcmpi(pTemp->pszModule, gce->pDest->pszModule)) {
if (ci.UM_FindUser(pTemp->pUsers, gce->ptszUID)) {
if (pTemp->bInitDone) {
if (ci.OnEventBroadcast)
@@ -266,7 +266,7 @@ static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce, SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
LOGINFO *li = ci.LM_AddEvent(&pTemp->pLog, &pTemp->pLogEnd);
pTemp->iEventCount += 1;
@@ -300,7 +300,7 @@ static USERINFO* SM_AddUser(const TCHAR *pszID, const char *pszModule, const TCH SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
USERINFO *p = ci.UM_AddUser(pTemp->pStatuses, &pTemp->pUsers, pszUID, pszNick, wStatus);
pTemp->nUsersInNicklist++;
if (ci.OnAddUser)
@@ -320,7 +320,7 @@ static BOOL SM_MoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR * SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
ci.UM_SortUser(&pTemp->pUsers, pszUID);
return TRUE;
}
@@ -337,7 +337,7 @@ static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
DWORD dw;
USERINFO *ui = ci.UM_FindUser(pTemp->pUsers, pszUID);
if (ui) {
@@ -368,7 +368,7 @@ static USERINFO* SM_GetUserFromIndex(const TCHAR *pszID, const char *pszModule, SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule))
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule))
return ci.UM_FindUserFromIndex(pTemp->pUsers, index);
pTemp = pTemp->next;
}
@@ -383,7 +383,7 @@ STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
STATUSINFO *ti = ci.TM_AddStatus(&pTemp->pStatuses, pszStatus, &pTemp->iStatusCount);
if (ti)
pTemp->iStatusCount++;
@@ -404,7 +404,7 @@ static BOOL SM_GiveStatus(const TCHAR *pszID, const char *pszModule, const TCHAR SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
USERINFO *ui = ci.UM_GiveStatus(pTemp->pUsers, pszUID, ci.TM_StringToWord(pTemp->pStatuses, pszStatus));
if (ui) {
SM_MoveUser(pTemp->ptszID, pTemp->pszModule, ui->pszUID);
@@ -426,7 +426,7 @@ static BOOL SM_SetContactStatus(const TCHAR *pszID, const char *pszModule, const SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
USERINFO *ui = ci.UM_SetContactStatus(pTemp->pUsers, pszUID, wStatus);
if (ui) {
SM_MoveUser(pTemp->ptszID, pTemp->pszModule, ui->pszUID);
@@ -448,7 +448,7 @@ static BOOL SM_TakeStatus(const TCHAR *pszID, const char *pszModule, const TCHAR SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
USERINFO* ui = ci.UM_TakeStatus(pTemp->pUsers, pszUID, ci.TM_StringToWord(pTemp->pStatuses, pszStatus));
if (ui) {
SM_MoveUser(pTemp->ptszID, pTemp->pszModule, ui->pszUID);
@@ -468,7 +468,7 @@ static LRESULT SM_SendMessage(const TCHAR *pszID, const char *pszModule, UINT ms SESSION_INFO *pTemp = ci.wndList;
while (pTemp && pszModule) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
if (pTemp->hWnd) {
LRESULT i = SendMessage(pTemp->hWnd, msg, wParam, lParam);
if (pszID)
@@ -489,7 +489,7 @@ static BOOL SM_PostMessage(const TCHAR *pszID, const char *pszModule, UINT msg, SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->ptszID, pszID) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!mir_tstrcmpi(pTemp->ptszID, pszID) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
if (pTemp->hWnd)
return PostMessage(pTemp->hWnd, msg, wParam, lParam);
@@ -504,7 +504,7 @@ static BOOL SM_BroadcastMessage(const char *pszModule, UINT msg, WPARAM wParam, {
SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (!pszModule || !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if (!pszModule || !mir_strcmpi(pTemp->pszModule, pszModule)) {
if (pTemp->hWnd) {
if (bAsync)
PostMessage(pTemp->hWnd, msg, wParam, lParam);
@@ -524,7 +524,7 @@ static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus) SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
pTemp->wStatus = wStatus;
if (pTemp->hContact) {
if (pTemp->iType != GCW_SERVER && wStatus != ID_STATUS_OFFLINE)
@@ -551,7 +551,7 @@ static BOOL SM_SendUserMessage(const TCHAR *pszID, const char *pszModule, const SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
if (pTemp->iType == GCW_CHATROOM || pTemp->iType == GCW_PRIVMESS)
DoEventHook(pTemp->ptszID, pTemp->pszModule, GC_USER_MESSAGE, NULL, pszText, 0);
if (pszID)
@@ -569,7 +569,7 @@ static BOOL SM_ChangeUID(const TCHAR *pszID, const char *pszModule, const TCHAR SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
USERINFO* ui = ci.UM_FindUser(pTemp->pUsers, pszUID);
if (ui)
replaceStrT(ui->pszUID, pszNewUID);
@@ -589,7 +589,7 @@ static BOOL SM_ChangeNick(const TCHAR *pszID, const char *pszModule, GCEVENT *gc SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
+ if ((!pszID || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
USERINFO* ui = ci.UM_FindUser(pTemp->pUsers, gce->ptszUID);
if (ui) {
replaceStrT(ui->pszNick, gce->ptszText);
@@ -641,7 +641,7 @@ static void SM_AddCommand(const TCHAR *pszID, const char *pszModule, const char* {
SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (lstrcmpi(pTemp->ptszID, pszID) == 0 && lstrcmpiA(pTemp->pszModule, pszModule) == 0) { // match
+ if (mir_tstrcmpi(pTemp->ptszID, pszID) == 0 && mir_strcmpi(pTemp->pszModule, pszModule) == 0) { // match
COMMANDINFO *node = (COMMANDINFO *)mir_alloc(sizeof(COMMANDINFO));
node->lpCommand = mir_strdup(lpNewCommand);
node->last = NULL; // always added at beginning!
@@ -678,7 +678,7 @@ static char* SM_GetPrevCommand(const TCHAR *pszID, const char *pszModule) // get {
SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (lstrcmpi(pTemp->ptszID, pszID) == 0 && lstrcmpiA(pTemp->pszModule, pszModule) == 0) { // match
+ if (mir_tstrcmpi(pTemp->ptszID, pszID) == 0 && mir_strcmpi(pTemp->pszModule, pszModule) == 0) { // match
COMMANDINFO *pPrevCmd = NULL;
if (pTemp->lpCurrentCommand != NULL) {
if (pTemp->lpCurrentCommand->next != NULL) // not NULL
@@ -700,7 +700,7 @@ static char* SM_GetNextCommand(const TCHAR *pszID, const char *pszModule) // get {
SESSION_INFO *pTemp = ci.wndList;
while (pTemp != NULL) {
- if (lstrcmpi(pTemp->ptszID, pszID) == 0 && lstrcmpiA(pTemp->pszModule, pszModule) == 0) { // match
+ if (mir_tstrcmpi(pTemp->ptszID, pszID) == 0 && mir_strcmpi(pTemp->pszModule, pszModule) == 0) { // match
COMMANDINFO *pNextCmd = NULL;
if (pTemp->lpCurrentCommand != NULL)
pNextCmd = pTemp->lpCurrentCommand->last; // last command (newest at beginning)
@@ -719,7 +719,7 @@ static int SM_GetCount(const char *pszModule) int count = 0;
while (pTemp != NULL) {
- if (!lstrcmpiA(pszModule, pTemp->pszModule))
+ if (!mir_strcmpi(pszModule, pTemp->pszModule))
count++;
pTemp = pTemp->next;
@@ -732,7 +732,7 @@ static SESSION_INFO* SM_FindSessionByIndex(const char *pszModule, int iItem) SESSION_INFO *pTemp = ci.wndList;
int count = 0;
while (pTemp != NULL) {
- if (!lstrcmpiA(pszModule, pTemp->pszModule)) {
+ if (!mir_strcmpi(pszModule, pTemp->pszModule)) {
if (iItem == count)
return pTemp;
else
@@ -855,7 +855,7 @@ static MODULEINFO* MM_FindModule(const char *pszModule) MODULEINFO *pTemp = m_ModList;
while (pTemp != NULL) {
- if (lstrcmpiA(pTemp->pszModule, pszModule) == 0)
+ if (mir_strcmpi(pTemp->pszModule, pszModule) == 0)
return pTemp;
pTemp = pTemp->next;
@@ -938,7 +938,7 @@ static STATUSINFO* TM_FindStatus(STATUSINFO* pStatusList, const TCHAR *pszStatus STATUSINFO *pTemp = pStatusList;
while (pTemp != NULL) {
- if (lstrcmpi(pTemp->pszGroup, pszStatus) == 0)
+ if (mir_tstrcmpi(pTemp->pszGroup, pszStatus) == 0)
return pTemp;
pTemp = pTemp->next;
@@ -953,7 +953,7 @@ static WORD TM_StringToWord(STATUSINFO* pStatusList, const TCHAR *pszStatus) STATUSINFO *pTemp = pStatusList;
while (pTemp != NULL) {
- if (lstrcmpi(pTemp->pszGroup, pszStatus) == 0)
+ if (mir_tstrcmpi(pTemp->pszGroup, pszStatus) == 0)
return pTemp->Status;
if (pTemp->next == NULL)
@@ -1016,12 +1016,12 @@ static int UM_CompareItem(USERINFO * u1, const TCHAR *pszNick, WORD wStatus) if ((dw2 & 1) && !(dw1 & 1))
return 1;
if ((dw1 & 1) && (dw2 & 1))
- return lstrcmp(u1->pszNick, pszNick);
+ return mir_tstrcmp(u1->pszNick, pszNick);
dw1 = dw1 >> 1;
dw2 = dw2 >> 1;
}
- return lstrcmp(u1->pszNick, pszNick);
+ return mir_tstrcmp(u1->pszNick, pszNick);
}
static USERINFO* UM_SortUser(USERINFO** ppUserList, const TCHAR *pszUID)
@@ -1032,7 +1032,7 @@ static USERINFO* UM_SortUser(USERINFO** ppUserList, const TCHAR *pszUID) if (!pTemp || !pszUID)
return NULL;
- while (pTemp && lstrcmpi(pTemp->pszUID, pszUID)) {
+ while (pTemp && mir_tstrcmpi(pTemp->pszUID, pszUID)) {
pLast = pTemp;
pTemp = pTemp->next;
}
@@ -1112,7 +1112,7 @@ static USERINFO* UM_FindUser(USERINFO* pUserList, const TCHAR *pszUID) USERINFO *pTemp = pUserList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->pszUID, pszUID))
+ if (!mir_tstrcmpi(pTemp->pszUID, pszUID))
return pTemp;
pTemp = pTemp->next;
@@ -1144,7 +1144,7 @@ static USERINFO* UM_GiveStatus(USERINFO* pUserList, const TCHAR *pszUID, WORD st USERINFO *pTemp = pUserList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->pszUID, pszUID)) {
+ if (!mir_tstrcmpi(pTemp->pszUID, pszUID)) {
pTemp->Status |= status;
return pTemp;
}
@@ -1160,7 +1160,7 @@ static USERINFO* UM_SetContactStatus(USERINFO* pUserList, const TCHAR *pszUID, W USERINFO *pTemp = pUserList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->pszUID, pszUID)) {
+ if (!mir_tstrcmpi(pTemp->pszUID, pszUID)) {
pTemp->ContactStatus = status;
return pTemp;
}
@@ -1203,7 +1203,7 @@ static USERINFO* UM_TakeStatus(USERINFO* pUserList, const TCHAR *pszUID, WORD st USERINFO *pTemp = pUserList;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->pszUID, pszUID)) {
+ if (!mir_tstrcmpi(pTemp->pszUID, pszUID)) {
pTemp->Status &= ~status;
return pTemp;
}
@@ -1221,7 +1221,7 @@ static TCHAR* UM_FindUserAutoComplete(USERINFO* pUserList, const TCHAR* pszOrigi USERINFO *pTemp = pUserList;
while (pTemp != NULL) {
if (pTemp->pszNick && my_strstri(pTemp->pszNick, pszOriginal) == pTemp->pszNick)
- if (lstrcmpi(pTemp->pszNick, pszCurrent) > 0 && (!pszName || lstrcmpi(pTemp->pszNick, pszName) < 0))
+ if (mir_tstrcmpi(pTemp->pszNick, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(pTemp->pszNick, pszName) < 0))
pszName = pTemp->pszNick;
pTemp = pTemp->next;
@@ -1236,7 +1236,7 @@ static BOOL UM_RemoveUser(USERINFO** ppUserList, const TCHAR *pszUID) USERINFO *pTemp = *ppUserList, *pLast = NULL;
while (pTemp != NULL) {
- if (!lstrcmpi(pTemp->pszUID, pszUID)) {
+ if (!mir_tstrcmpi(pTemp->pszUID, pszUID)) {
if (pLast == NULL)
*ppUserList = pTemp->next;
else
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index eba07e1068..788ae8604b 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -162,7 +162,7 @@ static int ClcProtoAck(WPARAM, LPARAM lParam) WindowList_BroadcastAsync(hClcWindowList, INTM_INVALIDATE, 0, 0);
if (ack->result == ACKRESULT_SUCCESS) {
for (int i=0; i < cli.hClcProtoCount; i++) {
- if (!lstrcmpA(cli.clcProto[i].szProto, ack->szModule)) {
+ if (!mir_strcmp(cli.clcProto[i].szProto, ack->szModule)) {
cli.clcProto[i].dwStatus = (WORD) ack->lParam;
break;
}
@@ -432,14 +432,14 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (dbcws->value.type == DBVT_ASCIIZ) {
WCHAR* wszGrpName = mir_a2u(dbcws->value.pszVal+1);
- eq = !lstrcmp(szFullName, wszGrpName);
+ eq = !mir_tstrcmp(szFullName, wszGrpName);
mir_free(wszGrpName);
}
else {
char* szGrpName = NEWSTR_ALLOCA(dbcws->value.pszVal+1);
WCHAR* wszGrpName;
Utf8Decode(szGrpName, &wszGrpName);
- eq = !lstrcmp(szFullName, wszGrpName);
+ eq = !mir_tstrcmp(szFullName, wszGrpName);
mir_free(wszGrpName);
}
if (eq && (contact->group->hideOffline != 0) == ((dbcws->value.pszVal[0] & GROUPF_HIDEOFFLINE) != 0))
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index c3ee8a0980..c575b81672 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.cpp @@ -148,7 +148,7 @@ HRESULT CDropTarget::DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL shortPt.y = pt.y;
hwnd = WindowFromPoint(shortPt);
GetClassName(hwnd, szWindowClass, SIZEOF(szWindowClass));
- if (!lstrcmp(szWindowClass, _T(CLISTCONTROL_CLASS))) {
+ if (!mir_tstrcmp(szWindowClass, _T(CLISTCONTROL_CLASS))) {
struct ClcData *dat;
hwndCurrentDrag = hwnd;
dat = (struct ClcData *) GetWindowLongPtr(hwndCurrentDrag, 0);
@@ -188,7 +188,7 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR *szFil mir_tstrcat(szPath, _T("\\*"));
if (hFind = FindFirstFile(szPath, &fd)) {
do {
- if (!lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T("..")))
+ if (!mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T("..")))
continue;
mir_tstrcpy(szPath, szFilename);
mir_tstrcat(szPath, _T("\\"));
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index ca54079ade..36650d19be 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -66,7 +66,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD break; if (group->cl.items[i]->type != CLCIT_GROUP) continue; - compareResult = lstrcmp(szThisField, group->cl.items[i]->szText); + compareResult = mir_tstrcmp(szThisField, group->cl.items[i]->szText); if (compareResult == 0) { if (pNextField == NULL && flags != (DWORD) - 1) { group->cl.items[i]->groupId = (WORD) groupId; @@ -110,7 +110,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact); - if (!lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden)) + if (!mir_tstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden)) group->totalMembers++; } } @@ -248,7 +248,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int u mir_free(dbv.ptszVal); return; } - if (!lstrcmp(szGroupName, dbv.ptszVal)) + if (!mir_tstrcmp(szGroupName, dbv.ptszVal)) break; } if (groupFlags & GROUPF_HIDEOFFLINE) { @@ -262,7 +262,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int u mir_free(dbv.ptszVal); return; } - if (!lstrcmp(szGroupName, dbv.ptszVal)) + if (!mir_tstrcmp(szGroupName, dbv.ptszVal)) break; len = mir_tstrlen(szGroupName); if (!_tcsncmp(szGroupName, dbv.ptszVal, len) && dbv.ptszVal[len] == '\\') @@ -455,7 +455,7 @@ static int __cdecl GroupSortProc(const void* p1, const void* p2) { ClcContact **contact1 = (ClcContact**)p1, **contact2 = (ClcContact**)p2; - return lstrcmpi(contact1[0]->szText, contact2[0]->szText); + return mir_tstrcmpi(contact1[0]->szText, contact2[0]->szText); } static int __cdecl ContactSortProc(const void* p1, const void* p2) diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 3e7b82b370..1f6b07e04c 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -372,7 +372,7 @@ int fnFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefi TCHAR *lowered_text = CharLowerW(NEWTSTR_ALLOCA(text));
show = _tcsstr(lowered_szText, lowered_text) != NULL;
}
- else show = ((prefixOk && !_tcsnicmp(text, group->cl.items[group->scanIndex]->szText, testlen)) || (!prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
+ else show = ((prefixOk && !_tcsnicmp(text, group->cl.items[group->scanIndex]->szText, testlen)) || (!prefixOk && !mir_tstrcmpi(text, group->cl.items[group->scanIndex]->szText)));
if (show) {
ClcGroup *contactGroup = group;
@@ -407,7 +407,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) ClcContact *contact;
if (cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL) != -1) {
- if (lstrcmp(contact->szText, text) && !_tcsstr(text, _T("\\"))) {
+ if (mir_tstrcmp(contact->szText, text) && !_tcsstr(text, _T("\\"))) {
if (contact->type == CLCIT_GROUP) {
if (contact->group->parent && contact->group->parent->parent) {
TCHAR szFullName[256];
@@ -421,7 +421,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) else if (contact->type == CLCIT_CONTACT) {
cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
TCHAR* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
- if (!text[0] || !lstrcmp(otherName, text))
+ if (!text[0] || !mir_tstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
db_set_ts(contact->hContact, "CList", "MyHandle", text);
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index f8bf6d9143..92397503c9 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -102,7 +102,7 @@ static void ShowEventsInTray() int j;
for (j = 0; j < nTrayProtoCnt; j++)
- if (iEventProto && pTrayProtos[j] && !lstrcmpA(pTrayProtos[j], iEventProto))
+ if (iEventProto && pTrayProtos[j] && !mir_strcmp(pTrayProtos[j], iEventProto))
break;
if (j >= nTrayProtoCnt) // event was not found so assume first icon
j = 0;
@@ -218,7 +218,7 @@ int fnRemoveEvent(MCONTACT hContact, HANDLE dbEvent) szEventProto = (char *)cli.events.items[i]->cle.lpszProtocol;
else
szEventProto = NULL;
- if (szEventProto && szProto && !lstrcmpA(szEventProto, szProto))
+ if (szEventProto && szProto && !mir_strcmp(szEventProto, szProto))
nSameProto++;
}
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 0a522dc9d2..0313c030bb 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -242,7 +242,7 @@ INT_PTR MainMenuExecService(WPARAM wParam, LPARAM lParam) lpMainMenuExecParam mmep = (lpMainMenuExecParam)wParam;
if (mmep != NULL) {
// bug in help.c, it used wparam as parent window handle without reason.
- if (!lstrcmpA(mmep->szServiceName, "Help/AboutCommand"))
+ if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand"))
mmep->Param1 = 0;
CallService(mmep->szServiceName, mmep->Param1, lParam);
@@ -796,7 +796,7 @@ int fnGetProtoIndexByPos(PROTOCOLDESCRIPTOR **proto, int protoCnt, int Pos) DBVARIANT dbv;
if (!db_get_s(NULL, "Protocols", buf, &dbv)) {
for (int p=0; p < protoCnt; p++) {
- if (lstrcmpA(proto[p]->szName, dbv.pszVal) == 0) {
+ if (mir_strcmp(proto[p]->szName, dbv.pszVal) == 0) {
db_free(&dbv);
return p;
}
@@ -1078,7 +1078,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) }
for (int i=0; i < accounts.getCount(); i++) {
- if (!lstrcmpA(accounts[i]->szModuleName, ack->szModule)) {
+ if (!mir_strcmp(accounts[i]->szModuleName, ack->szModule)) {
if (((int)ack->hProcess >= ID_STATUS_OFFLINE || (int)ack->hProcess == 0) && (int)ack->hProcess < ID_STATUS_OFFLINE + SIZEOF(statusModeList)) {
int pos = statustopos((int)ack->hProcess);
if (pos == -1)
@@ -1131,11 +1131,11 @@ int fnConvertMenu(CLISTMENUITEM* mi, TMO_MenuItem* pmi) static MenuProto* FindProtocolMenu(const char* proto)
{
for (int i=0; i < cli.menuProtoCount; i++)
- if (cli.menuProtos[i].pMenu && !lstrcmpiA(cli.menuProtos[i].szProto, proto))
+ if (cli.menuProtos[i].pMenu && !mir_strcmpi(cli.menuProtos[i].szProto, proto))
return &cli.menuProtos[i];
if (cli.menuProtoCount == 1)
- if (!lstrcmpiA(cli.menuProtos[0].szProto, proto))
+ if (!mir_strcmpi(cli.menuProtos[0].szProto, proto))
return &cli.menuProtos[0];
return NULL;
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 4edff9c697..2bfbb8906d 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -200,7 +200,7 @@ void fnTrayIconRemove(HWND hwnd, const char *szProto) mir_cslock lck(trayLockCS);
for (int i = 0; i < cli.trayIconCount; i++) {
struct trayIconInfo_t* pii = &cli.trayIcon[i];
- if (pii->id != 0 && !lstrcmpA(szProto, pii->szProto)) {
+ if (pii->id != 0 && !mir_strcmp(szProto, pii->szProto)) {
NOTIFYICONDATA nid = { SIZEOFNID };
nid.hWnd = hwnd;
nid.uID = pii->id;
@@ -334,7 +334,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer for (i = 0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
- if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
continue;
nid.uID = cli.trayIcon[i].id;
@@ -402,7 +402,7 @@ LBL_Error: for (int i = 0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
- if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
continue;
DestroyIcon(cli.trayIcon[i].hBaseIcon);
@@ -473,7 +473,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) }
for (int i = 0; i < accounts.getCount(); i++)
- if (!lstrcmpA(szChangedProto, accounts[i]->szModuleName))
+ if (!mir_strcmp(szChangedProto, accounts[i]->szModuleName))
cli.cycleStep = i;
int changed = cli.pfnTrayCalcChanged(szChangedProto, averageMode, netProtoCount);
@@ -540,7 +540,7 @@ void fnTrayIconSetToBase(char *szPreferredProto) for (i = 0; i < cli.trayIconCount; i++) {
if (cli.trayIcon[i].id == 0)
continue;
- if (lstrcmpA(cli.trayIcon[i].szProto, szPreferredProto))
+ if (mir_strcmp(cli.trayIcon[i].szProto, szPreferredProto))
continue;
cli.pfnTrayIconUpdate(cli.trayIcon[i].hBaseIcon, NULL, szPreferredProto, 1);
return;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index b3be884dbc..eacb1ec87b 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -90,7 +90,7 @@ static int MenuItem_PreBuild(WPARAM, LPARAM) TCHAR cls[128];
HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, SIZEOF(cls));
- hwndClist = (!lstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_tstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
Menu_ShowItem(hRenameMenuItem, hItem != 0);
return 0;
@@ -102,7 +102,7 @@ static INT_PTR MenuItem_RenameContact(WPARAM, LPARAM) HWND hwndClist = GetFocus();
GetClassName(hwndClist, cls, SIZEOF(cls));
// worst case scenario, the rename is sent to the main contact list
- hwndClist = (!lstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
+ hwndClist = (!mir_tstrcmp( _T(CLISTCONTROL_CLASS), cls)) ? hwndClist : cli.hwndContactList;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
if (hItem) {
SetFocus(hwndClist);
@@ -413,7 +413,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int rc;
// wParam = (ATOM)hProfileAtom, lParam = 0
if (GlobalGetAtomName((ATOM) wParam, profile, SIZEOF(profile))) {
- rc = lstrcmpi(profile, VARST(_T("%miranda_userdata%\\%miranda_profilename%.dat"))) == 0;
+ rc = mir_tstrcmpi(profile, VARST(_T("%miranda_userdata%\\%miranda_profilename%.dat"))) == 0;
ReplyMessage(rc);
if (rc) {
ShowWindow(hwnd, SW_RESTORE);
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index 2579de60bc..8695adcb42 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -44,7 +44,7 @@ static INT_PTR GroupAdded(WPARAM wParam, LPARAM lParam) HWND hwndFocus = GetFocus();
GetClassName(hwndFocus, szFocusClass, SIZEOF(szFocusClass));
- if (!lstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) {
+ if (!mir_tstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) {
hItem = (HANDLE) SendMessage(hwndFocus, CLM_FINDGROUP, wParam, 0);
if (hItem)
SendMessage(hwndFocus, CLM_EDITLABEL, (WPARAM) hItem, 0);
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index c25e997f4a..59426dbbb9 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -105,7 +105,7 @@ int fnCompareContacts(const ClcContact* c1, const ClcContact* c2) } /* both are online, now check protocols */ if (c1->proto != NULL && c2->proto != NULL) { - rc = lstrcmpA(c1->proto, c2->proto); + rc = mir_strcmp(c1->proto, c2->proto); if (rc != 0) return rc; } diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index bb5e533ff4..f3ac197a5c 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -51,7 +51,7 @@ static void DumpMenuItem(TMO_IntMenuItem* pParent, int level = 0) static int CompareMenus(const TIntMenuObject* p1, const TIntMenuObject* p2)
{
- return lstrcmpA(p1->pszName, p2->pszName);
+ return mir_strcmp(p1->pszName, p2->pszName);
}
LIST<TIntMenuObject> g_menus(10, CompareMenus);
@@ -249,7 +249,7 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam) TIntMenuObject* pmo = g_menus[objidx];
for (PMO_IntMenuItem p = pmo->m_items.first; p != NULL; p = p->next)
- if (!lstrcmpA(p->UniqName, szProto))
+ if (!mir_strcmp(p->UniqName, szProto))
return (INT_PTR)p;
return NULL;
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 79e461b6c4..723bc73878 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -108,7 +108,7 @@ static int SaveTree(HWND hwndDlg) mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName); if (iod->name != NULL && iod->defname != NULL && - lstrcmp(iod->name, iod->defname) != 0) + mir_tstrcmp(iod->name, iod->defname) != 0) db_set_ts(NULL, MenuNameItems, DBString, iod->name); else db_unset(NULL, MenuNameItems, DBString); @@ -718,7 +718,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (iod->pimi->submenu.first == NULL && iod->uniqname) SetDlgItemTextA(hwndDlg, IDC_GENMENU_SERVICE, iod->uniqname); - EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), lstrcmp(iod->name, iod->defname) != 0); + EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_DEFAULT), mir_tstrcmp(iod->name, iod->defname) != 0); EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_SET), TRUE); EnableWindow( GetDlgItem(hwndDlg, IDC_GENMENU_CUSTOMNAME), TRUE); break; diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index e27699662a..716f9418ac 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -294,7 +294,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) //must rename setting in all child contacts too
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
- if (!lstrcmp(cache->tszGroup, oldName)) {
+ if (!mir_tstrcmp(cache->tszGroup, oldName)) {
db_set_ts(hContact, "CList", "Group", szName);
mir_free(cache->tszGroup);
cache->tszGroup = 0;
@@ -335,7 +335,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) _itoa(i, idstr, 10);
if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
- if (!lstrcmp(dbv.ptszVal + 1, str)) {
+ if (!mir_tstrcmp(dbv.ptszVal + 1, str)) {
if (i < groupId)
break; //is OK
MoveGroupBefore(groupId + 1, i + 2);
@@ -502,7 +502,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) mii.cch = SIZEOF(szThisMenuItem);
mii.dwTypeData = szThisMenuItem;
GetMenuItemInfo(hThisMenu, menuId, TRUE, &mii);
- compareResult = lstrcmp(szThisField, szThisMenuItem);
+ compareResult = mir_tstrcmp(szThisField, szThisMenuItem);
if (compareResult == 0) {
if (pNextField == NULL) {
mii.fMask = MIIM_DATA;
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index 41b2b105ae..f4f29460d0 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -56,7 +56,7 @@ static void fillProfileName(const TCHAR* ptszFileName) _tcsncpy_s(g_shortProfileName, p, _TRUNCATE);
TCHAR *pos = _tcsrchr(g_shortProfileName, '.');
- if (lstrcmpi(pos, _T(".dat")) == 0)
+ if (mir_tstrcmpi(pos, _T(".dat")) == 0)
*pos = 0;
}
@@ -456,7 +456,7 @@ static BOOL CALLBACK EnumMirandaWindows(HWND hwnd, LPARAM lParam) TCHAR classname[256];
ENUMMIRANDAWINDOW *x = (ENUMMIRANDAWINDOW *)lParam;
DWORD_PTR res = 0;
- if (GetClassName(hwnd, classname, SIZEOF(classname)) && lstrcmp(_T("Miranda"), classname) == 0) {
+ if (GetClassName(hwnd, classname, SIZEOF(classname)) && mir_tstrcmp(_T("Miranda"), classname) == 0) {
if (SendMessageTimeout(hwnd, x->msg, (WPARAM)x->aPath, 0, SMTO_ABORTIFHUNG, 100, &res) && res) {
x->found++;
return FALSE;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index 76bab7ef88..7f5e59f454 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -39,11 +39,11 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa const TCHAR *pszSecurityInfo;
GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, SIZEOF(szSecurity), mirandabootini);
- if (!lstrcmpi(szSecurity, _T("all")))
+ if (!mir_tstrcmpi(szSecurity, _T("all")))
pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before every change that is made.");
- else if (!lstrcmpi(szSecurity, _T("onlyunsafe")))
+ else if (!mir_tstrcmpi(szSecurity, _T("onlyunsafe")))
pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before changes that are known to be unsafe.");
- else if (!lstrcmpi(szSecurity, _T("none")))
+ else if (!mir_tstrcmpi(szSecurity, _T("none")))
pszSecurityInfo = LPGENT("Security systems to prevent malicious changes have been disabled. You will receive no further warnings.");
else pszSecurityInfo = NULL;
if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
@@ -79,7 +79,7 @@ static bool IsInSpaceSeparatedList(const char *szWord, const char *szList) for (szItem = szList;;) {
szEnd = strchr(szItem, ' ');
if (szEnd == NULL)
- return !lstrcmpA(szItem, szWord);
+ return !mir_strcmp(szItem, szWord);
if (szEnd - szItem == wordLen)
if (!strncmp(szItem, szWord, wordLen))
@@ -410,15 +410,15 @@ static void DoAutoExec(void) int secur;
GetPrivateProfileString(_T("AutoExec"), _T("Use"), _T("prompt"), szUse, SIZEOF(szUse), mirandabootini);
- if (!lstrcmpi(szUse, _T("no"))) return;
+ if (!mir_tstrcmpi(szUse, _T("no"))) return;
GetPrivateProfileString(_T("AutoExec"), _T("Safe"), _T("CLC Icons CLUI CList SkinSounds"), buf, SIZEOF(buf), mirandabootini);
ptrA szSafeSections(mir_t2a(buf));
GetPrivateProfileString(_T("AutoExec"), _T("Unsafe"), _T("AIM Facebook GG ICQ IRC JABBER MRA MSN SKYPE Tlen TWITTER VKontakte XFire"), buf, SIZEOF(buf), mirandabootini);
ptrA szUnsafeSections(mir_t2a(buf));
GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, SIZEOF(szSecurity), mirandabootini);
- if (!lstrcmpi(szSecurity, _T("none"))) secur = 0;
- else if (!lstrcmpi(szSecurity, _T("notsafe"))) secur = 1;
- else if (!lstrcmpi(szSecurity, _T("onlyunsafe"))) secur = 2;
+ if (!mir_tstrcmpi(szSecurity, _T("none"))) secur = 0;
+ else if (!mir_tstrcmpi(szSecurity, _T("notsafe"))) secur = 1;
+ else if (!mir_tstrcmpi(szSecurity, _T("onlyunsafe"))) secur = 2;
GetPrivateProfileString(_T("AutoExec"), _T("OverrideSecurityFilename"), _T(""), szOverrideSecurityFilename, SIZEOF(szOverrideSecurityFilename), mirandabootini);
GetPrivateProfileString(_T("AutoExec"), _T("OnCreateFilename"), _T(""), szOnCreateFilename, SIZEOF(szOnCreateFilename), mirandabootini);
@@ -443,10 +443,10 @@ static void DoAutoExec(void) str2[1] = 0;
do {
- bool secFN = lstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0;
+ bool secFN = mir_tstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0;
mir_sntprintf(szIniPath, SIZEOF(szIniPath), _T("%s%s"), szFindPath, fd.cFileName);
- if (!lstrcmpi(szUse, _T("prompt")) && !secFN) {
+ if (!mir_tstrcmpi(szUse, _T("prompt")) && !secFN) {
int result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
if (result == IDC_NOTOALL) break;
if (result == IDCANCEL) continue;
@@ -459,9 +459,9 @@ static void DoAutoExec(void) else {
TCHAR szOnCompletion[8];
GetPrivateProfileString(_T("AutoExec"), _T("OnCompletion"), _T("recycle"), szOnCompletion, SIZEOF(szOnCompletion), mirandabootini);
- if (!lstrcmpi(szOnCompletion, _T("delete")))
+ if (!mir_tstrcmpi(szOnCompletion, _T("delete")))
DeleteFile(szIniPath);
- else if (!lstrcmpi(szOnCompletion, _T("recycle"))) {
+ else if (!mir_tstrcmpi(szOnCompletion, _T("recycle"))) {
SHFILEOPSTRUCT shfo = { 0 };
shfo.wFunc = FO_DELETE;
shfo.pFrom = szIniPath;
@@ -469,7 +469,7 @@ static void DoAutoExec(void) shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO;
SHFileOperation(&shfo);
}
- else if (!lstrcmpi(szOnCompletion, _T("rename"))) {
+ else if (!mir_tstrcmpi(szOnCompletion, _T("rename"))) {
TCHAR szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH];
GetPrivateProfileString(_T("AutoExec"), _T("RenamePrefix"), _T("done_"), szRenamePrefix, SIZEOF(szRenamePrefix), mirandabootini);
mir_tstrcpy(szNewPath, szFindPath);
@@ -477,7 +477,7 @@ static void DoAutoExec(void) mir_tstrcat(szNewPath, fd.cFileName);
MoveFile(szIniPath, szNewPath);
}
- else if (!lstrcmpi(szOnCompletion, _T("ask")))
+ else if (!mir_tstrcmpi(szOnCompletion, _T("ask")))
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INIIMPORTDONE), NULL, IniImportDoneDlgProc, (LPARAM)szIniPath);
}
}
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index 82b44a090c..c7bd537245 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -309,7 +309,7 @@ BOOL EnumProfilesForList(TCHAR *tszFullPath, TCHAR *profile, LPARAM lParam) } int iItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item); - if (lstrcmpi(ped->szProfile, tszFullPath) == 0) + if (mir_tstrcmpi(ped->szProfile, tszFullPath) == 0) ListView_SetItemState(hwndList, iItem, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); item.iItem = iItem; diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index f68c502ea2..44a0748da1 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -408,7 +408,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP DestroyIcon(hIcon); cbei.lParam = (LPARAM)pa->szModuleName; SendDlgItemMessageA(hwndDlg, IDC_PROTOLIST, CBEM_INSERTITEM, 0, (LPARAM)&cbei); - if (szProto && cbei.pszText && !lstrcmp(szProto, pa->tszAccountName)) + if (szProto && cbei.pszText && !mir_tstrcmp(szProto, pa->tszAccountName)) index = cbei.iItem; cbei.iItem++; } @@ -827,7 +827,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP int i; for (i = 0; i < dat->searchCount; i++) - if (dat->search[i].hProcess == ack->hProcess && dat->search[i].hProcess != NULL && !lstrcmpA(dat->search[i].szProto, ack->szModule)) break; + if (dat->search[i].hProcess == ack->hProcess && dat->search[i].hProcess != NULL && !mir_strcmp(dat->search[i].szProto, ack->szModule)) break; if (i == dat->searchCount) break; @@ -893,7 +893,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (int i = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCOUNT, 0, 0); i--;) { char *szComboProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0); if (szComboProto == NULL) continue; - if (!lstrcmpA(szComboProto, ack->szModule)) { + if (!mir_strcmp(szComboProto, ack->szModule)) { COMBOBOXEXITEM cbei = { 0 }; cbei.mask = CBEIF_IMAGE; cbei.iItem = i; @@ -933,7 +933,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (int i = SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCOUNT, 0, 0); i--;) { char *szComboProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, i, 0); if (szComboProto == NULL) continue; - if (!lstrcmpA(szComboProto, ack->szModule)) { + if (!mir_strcmp(szComboProto, ack->szModule)) { COMBOBOXEXITEM cbei = { 0 }; cbei.mask = CBEIF_IMAGE; cbei.iItem = i; diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index 4386af1143..9af4b9e8b5 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -147,17 +147,17 @@ int CALLBACK SearchResultsCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lPa switch(sortCol)
{
case COLUMNID_PROTO:
- return lstrcmpA(lsr1->szProto, lsr2->szProto)*sortMultiplier;
+ return mir_strcmp(lsr1->szProto, lsr2->szProto)*sortMultiplier;
case COLUMNID_HANDLE:
- return lstrcmpi(lsr1->psr.id, lsr2->psr.id)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.id, lsr2->psr.id)*sortMultiplier;
case COLUMNID_NICK:
- return lstrcmpi(lsr1->psr.nick, lsr2->psr.nick)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.nick, lsr2->psr.nick)*sortMultiplier;
case COLUMNID_FIRST:
- return lstrcmpi(lsr1->psr.firstName, lsr2->psr.firstName)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.firstName, lsr2->psr.firstName)*sortMultiplier;
case COLUMNID_LAST:
- return lstrcmpi(lsr1->psr.lastName, lsr2->psr.lastName)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.lastName, lsr2->psr.lastName)*sortMultiplier;
case COLUMNID_EMAIL:
- return lstrcmpi(lsr1->psr.email, lsr2->psr.email)*sortMultiplier;
+ return mir_tstrcmpi(lsr1->psr.email, lsr2->psr.email)*sortMultiplier;
}
}
else
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index aad063d484..ba90edb38a 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -332,7 +332,7 @@ static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TC {
TreeView_GetItem(hwndTree, &tvi);
- if (!lstrcmp(tvi.pszText, name))
+ if (!mir_tstrcmp(tvi.pszText, name))
return tvi.hItem;
tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
@@ -1265,7 +1265,7 @@ static FontInternal *sttFindFont(OBJLIST<FontInternal> &fonts, char *module, cha for (int i=0; i < fonts.getCount(); i++)
{
FontInternal& F = fonts[i];
- if (!lstrcmpA(F.dbSettingsGroup, module) && !lstrcmpA(F.prefix, prefix))
+ if (!mir_strcmp(F.dbSettingsGroup, module) && !mir_strcmp(F.prefix, prefix))
return &F;
}
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index 9a46c10e37..1c7b0783dd 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -290,7 +290,7 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack) for (int i=0; i < font_id_list.getCount(); i++) {
FontInternal& F = font_id_list[i];
- if (!lstrcmp(F.group, font_id->group) && !lstrcmp(F.name, font_id->name) && !(F.flags & FIDF_ALLOWREREGISTER))
+ if (!mir_tstrcmp(F.group, font_id->group) && !mir_tstrcmp(F.name, font_id->name) && !(F.flags & FIDF_ALLOWREREGISTER))
return 1;
}
@@ -303,7 +303,7 @@ static int sttRegisterFontWorker(FontIDW* font_id, int hLangpack) memcpy(newItem, font_id, font_id->cbSize);
newItem->hLangpack = hLangpack;
- if (!lstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) {
+ if (!mir_tstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) {
LOGFONT lf;
SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, FALSE);
mir_tstrncpy(newItem->deffontsettings.szFace, lf.lfFaceName, SIZEOF(newItem->deffontsettings.szFace));
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp index f3b538f6b3..e8c5ac9f34 100644 --- a/src/modules/icolib/skin2opts.cpp +++ b/src/modules/icolib/skin2opts.cpp @@ -354,7 +354,7 @@ static HTREEITEM FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR {
TreeView_GetItem(hwndTree, &tvi);
- if (!lstrcmp(tvi.pszText, name))
+ if (!mir_tstrcmp(tvi.pszText, name))
return tvi.hItem;
tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
@@ -611,7 +611,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM static int CALLBACK DoSortIconsFunc(LPARAM lParam1, LPARAM lParam2, LPARAM)
{
- return lstrcmpi(iconList[lParam1]->getDescr(), iconList[lParam2]->getDescr());
+ return mir_tstrcmpi(iconList[lParam1]->getDescr(), iconList[lParam2]->getDescr());
}
static int CALLBACK DoSortIconsFuncByOrder(LPARAM lParam1, LPARAM lParam2, LPARAM)
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp index f6110cbbdf..25c1f09577 100644 --- a/src/modules/langpack/langpack.cpp +++ b/src/modules/langpack/langpack.cpp @@ -53,7 +53,7 @@ BOOL EnumLangpacks(ENUM_PACKS_CALLBACK callback, WPARAM wParam, LPARAM lParam) if (!LoadLangPackDescr(tszFullPath, &pack)) {
pack.ftFileDate = wfd.ftLastWriteTime;
/* enabled? */
- if (langpack && !lstrcmpi(langpack, wfd.cFileName)) {
+ if (langpack && !mir_tstrcmpi(langpack, wfd.cFileName)) {
if (!fPackFound) pack.flags |= LPF_ENABLED;
fPackFound = TRUE;
}
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index 9580b13859..5f9b813782 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -586,7 +586,7 @@ static INT_PTR Meta_SrmmCurrentSub(WPARAM hMeta, LPARAM lParam) static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData*)lParam;
- if (lstrcmpA(sicd->szModule, META_PROTO))
+ if (mir_strcmp(sicd->szModule, META_PROTO))
return 0;
DBCachedContact *cc = CheckMeta(hMeta);
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index b7a529853b..a42e9ea700 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -53,7 +53,7 @@ struct ProxyAuth mir_free(szMethod);
}
static int Compare(const ProxyAuth* p1, const ProxyAuth* p2)
- { return lstrcmpiA(p1->szServer, p2->szServer); }
+ { return mir_strcmpi(p1->szServer, p2->szServer); }
};
struct ProxyAuthList : OBJLIST<ProxyAuth>
@@ -202,7 +202,7 @@ static NetlibConnection* NetlibHttpProcessUrl(NETLIBHTTPREQUEST *nlhr, NetlibUse if (nlc != NULL) {
bool httpProxy = !(nloc.flags & NLOCF_SSL) && nlc->proxyType == PROXYTYPE_HTTP;
- bool sameHost = lstrcmpA(nlc->nloc.szHost, nloc.szHost) == 0 && nlc->nloc.wPort == nloc.wPort;
+ bool sameHost = mir_strcmp(nlc->nloc.szHost, nloc.szHost) == 0 && nlc->nloc.wPort == nloc.wPort;
if (!httpProxy && !sameHost) {
NetlibDoClose(nlc);
@@ -503,11 +503,11 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) doneHostHeader = doneContentLengthHeader = doneProxyAuthHeader = doneAuthHeader = 0;
for (i=0; i < nlhr->headersCount; i++) {
NETLIBHTTPHEADER &p = nlhr->headers[i];
- if (!lstrcmpiA(p.szName, "Host")) doneHostHeader = 1;
- else if (!lstrcmpiA(p.szName, "Content-Length")) doneContentLengthHeader = 1;
- else if (!lstrcmpiA(p.szName, "Proxy-Authorization")) doneProxyAuthHeader = 1;
- else if (!lstrcmpiA(p.szName, "Authorization")) doneAuthHeader = 1;
- else if (!lstrcmpiA(p.szName, "Connection")) continue;
+ if (!mir_strcmpi(p.szName, "Host")) doneHostHeader = 1;
+ else if (!mir_strcmpi(p.szName, "Content-Length")) doneContentLengthHeader = 1;
+ else if (!mir_strcmpi(p.szName, "Proxy-Authorization")) doneProxyAuthHeader = 1;
+ else if (!mir_strcmpi(p.szName, "Authorization")) doneAuthHeader = 1;
+ else if (!mir_strcmpi(p.szName, "Connection")) continue;
if (p.szValue == NULL) continue;
AppendToCharBuffer(&httpRequest, "%s: %s\r\n", p.szName, p.szValue);
}
@@ -1029,10 +1029,10 @@ next: for (i=0; i<nlhrReply->headersCount; i++) {
NETLIBHTTPHEADER &p = nlhrReply->headers[i];
- if (!lstrcmpiA(p.szName, "Content-Length"))
+ if (!mir_strcmpi(p.szName, "Content-Length"))
dataLen = atoi(p.szValue);
- if (!lstrcmpiA(p.szName, "Content-Encoding")) {
+ if (!mir_strcmpi(p.szName, "Content-Encoding")) {
cenc = i;
if (strstr(p.szValue, "gzip"))
cenctype = 1;
@@ -1040,11 +1040,11 @@ next: cenctype = 2;
}
- if (!lstrcmpiA(p.szName, "Connection"))
- close = !lstrcmpiA(p.szValue, "close");
+ if (!mir_strcmpi(p.szName, "Connection"))
+ close = !mir_strcmpi(p.szValue, "close");
- if (!lstrcmpiA(p.szName, "Transfer-Encoding") &&
- !lstrcmpiA(p.szValue, "chunked"))
+ if (!mir_strcmpi(p.szName, "Transfer-Encoding") &&
+ !mir_strcmpi(p.szValue, "chunked"))
{
chunked = true;
chunkhdr = i;
diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp index 5980a1f5b1..47149e1174 100644 --- a/src/modules/netlib/netlibhttpproxy.cpp +++ b/src/modules/netlib/netlibhttpproxy.cpp @@ -119,7 +119,7 @@ static bool NetlibHttpGatewaySend(NetlibConnection *nlc, RequestType reqType, co NETLIBOPENCONNECTION nloc;
NetlibConnFromUrl(nlhrSend.szUrl, false, nloc);
- bool sameHost = lstrcmpA(nlc->nloc.szHost, nloc.szHost) == 0 && nlc->nloc.wPort == nloc.wPort;
+ bool sameHost = mir_strcmp(nlc->nloc.szHost, nloc.szHost) == 0 && nlc->nloc.wPort == nloc.wPort;
if (!sameHost)
{
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 332e0f723a..92102b044e 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -105,7 +105,7 @@ static void CopySettingsStruct(NETLIBUSERSETTINGS *dest, NETLIBUSERSETTINGS *sou static void CombineSettingsStrings(char **dest, char **source)
{
- if (*dest != NULL && (*source == NULL || lstrcmpiA(*dest, *source))) { mir_free(*dest); *dest = NULL; }
+ if (*dest != NULL && (*source == NULL || mir_strcmpi(*dest, *source))) { mir_free(*dest); *dest = NULL; }
}
static void CombineSettingsStructs(NETLIBUSERSETTINGS *dest, DWORD *destFlags, NETLIBUSERSETTINGS *source, DWORD sourceFlags)
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index d9e9f29c33..61f7461e62 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.cpp @@ -85,13 +85,13 @@ void AddDialogString(HWND hWndDlg, const PageHash key) TCHAR szClass[64];
GetClassName(hWndDlg, szClass, SIZEOF(szClass));
- if (lstrcmpi(szClass, _T("SysTreeView32")) == 0) {
+ if (mir_tstrcmpi(szClass, _T("SysTreeView32")) == 0) {
HTREEITEM hItem = TreeView_GetRoot(hWndDlg);
AddTreeViewNodes(hWndDlg, key, hItem);
return;
}
- if (lstrcmpi(szClass, _T("listbox")) == 0) {
+ if (mir_tstrcmpi(szClass, _T("listbox")) == 0) {
if (GetWindowStyle(hWndDlg) & LBS_HASSTRINGS) {
int count = ListBox_GetCount(hWndDlg);
for (int i=0; i < count; i++) {
@@ -107,7 +107,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) return;
}
- if (lstrcmpi(szClass, _T("SysListView32")) == 0) {
+ if (mir_tstrcmpi(szClass, _T("SysListView32")) == 0) {
int count = ListView_GetItemCount(hWndDlg);
for (int i=0; i < count; i++) {
title[0] = 0; //safety
@@ -119,7 +119,7 @@ void AddDialogString(HWND hWndDlg, const PageHash key) return;
}
- if (lstrcmpi(szClass, _T("combobox")) == 0) {
+ if (mir_tstrcmpi(szClass, _T("combobox")) == 0) {
if (GetWindowStyle(hWndDlg) & CBS_HASSTRINGS) {
int count = ComboBox_GetCount(hWndDlg);
for (int i=0; i < count; i++) {
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 74464fd333..21818343e7 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -154,7 +154,7 @@ static BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hwnd, LPARAM lParam) TCHAR szClass[64];
GetClassName(hwnd, szClass, SIZEOF(szClass));
- if (!lstrcmp(szClass, _T("Button")) && (GetWindowLongPtr(hwnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
+ if (!mir_tstrcmp(szClass, _T("Button")) && (GetWindowLongPtr(hwnd, GWL_STYLE) & 0x0F) == BS_GROUPBOX)
SendMessage(hwnd, WM_SETFONT, lParam, 0);
return TRUE;
}
@@ -198,7 +198,7 @@ static int lstrcmpnull(TCHAR *str1, TCHAR *str2) if (str1 == NULL && str2 != NULL)
return -1;
- return lstrcmp(str1, str2);
+ return mir_tstrcmp(str1, str2);
}
static TCHAR* GetPluginName(HINSTANCE hInstance, TCHAR *buffer, int size)
@@ -688,7 +688,7 @@ static BOOL IsInsideTab(HWND hdlg, OptionsDlgData *dat, int i) for (int j = 0; j < dat->arOpd.getCount() && pages < 2; j++) {
OptionsPageData* opd2 = dat->arOpd[j];
if (!CheckPageShow(hdlg, dat, j)) continue;
- if (lstrcmp(opd2->ptszTitle, opd->ptszTitle) || lstrcmpnull(opd2->ptszGroup, opd->ptszGroup))
+ if (mir_tstrcmp(opd2->ptszTitle, opd->ptszTitle) || lstrcmpnull(opd2->ptszGroup, opd->ptszGroup))
continue;
pages++;
}
@@ -873,7 +873,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L }
dat->arOpd.insert(opd);
- if (!lstrcmp(lastPage, odp->ptszTitle) && !lstrcmpnull(lastGroup, odp->ptszGroup))
+ if (!mir_tstrcmp(lastPage, odp->ptszTitle) && !lstrcmpnull(lastGroup, odp->ptszGroup))
if ((ood->pszTab == NULL && dat->currentPage == -1) || !lstrcmpnull(lastTab, odp->ptszTab))
dat->currentPage = (int)i;
}
@@ -1029,13 +1029,13 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L continue;
OptionsPageData *p = dat->arOpd[i];
- if (lstrcmp(opd->ptszTitle, p->ptszTitle) || lstrcmpnull(opd->ptszGroup, p->ptszGroup))
+ if (mir_tstrcmp(opd->ptszTitle, p->ptszTitle) || lstrcmpnull(opd->ptszGroup, p->ptszGroup))
continue;
tie.pszText = TranslateTH(p->hLangpack, p->ptszTab);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
- if (!lstrcmp(opd->ptszTab, p->ptszTab))
+ if (!mir_tstrcmp(opd->ptszTab, p->ptszTab))
sel = pages;
pages++;
}
diff --git a/src/modules/plugins/dll_sniffer.cpp b/src/modules/plugins/dll_sniffer.cpp index 2b5f2822fd..2e63cfba16 100644 --- a/src/modules/plugins/dll_sniffer.cpp +++ b/src/modules/plugins/dll_sniffer.cpp @@ -115,18 +115,18 @@ MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin) bool bHasLoad = false, bHasUnload = false, bHasInfo = false, bHasMuuids = false;
for (size_t i=0; i < pED->NumberOfNames; i++, ptrRVA++, ptrOrdRVA++) {
char *szName = (char*)&pSecStart[*ptrRVA];
- if (!lstrcmpA(szName, "Load"))
+ if (!mir_strcmp(szName, "Load"))
bHasLoad = true;
- if (!lstrcmpA(szName, "MirandaPluginInfoEx"))
+ if (!mir_strcmp(szName, "MirandaPluginInfoEx"))
bHasInfo = true;
- else if (!lstrcmpA(szName, "Unload"))
+ else if (!mir_strcmp(szName, "Unload"))
bHasUnload = true;
- else if (!lstrcmpA(szName, "MirandaInterfaces")) {
+ else if (!mir_strcmp(szName, "MirandaInterfaces")) {
bHasMuuids = true;
pIds = (MUUID*)&pSecStart[ ptrFuncList[*ptrOrdRVA]];
}
// old plugin, skip it
- else if (!lstrcmpA(szName, "MirandaPluginInterfaces"))
+ else if (!mir_strcmp(szName, "MirandaPluginInterfaces"))
__leave;
}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index 07270ffb84..a9264bcca9 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -34,7 +34,7 @@ extern bool bModulesLoadedFired; static int sttComparePluginsByName(const pluginEntry* p1, const pluginEntry* p2)
{
- return lstrcmp(p1->pluginname, p2->pluginname);
+ return mir_tstrcmp(p1->pluginname, p2->pluginname);
}
LIST<pluginEntry>
@@ -63,7 +63,7 @@ static pluginEntry *pluginList_freeimg, *pluginList_crshdmp, *serviceModePlugin int equalUUID(const MUUID& u1, const MUUID& u2)
{
- return memcmp(&u1, &u2, sizeof(MUUID))?0:1;
+ return memcmp(&u1, &u2, sizeof(MUUID)) ? 0 : 1;
}
bool hasMuuid(const MUUID* p, const MUUID& uuid)
@@ -71,8 +71,8 @@ bool hasMuuid(const MUUID* p, const MUUID& uuid) if (p == NULL)
return false;
- for (int i=0; !equalUUID(miid_last, p[i]); i++)
- if ( equalUUID(uuid, p[i]))
+ for (int i = 0; !equalUUID(miid_last, p[i]); i++)
+ if (equalUUID(uuid, p[i]))
return true;
return false;
@@ -91,22 +91,22 @@ bool hasMuuid(const BASIC_PLUGIN_INFO& bpi, const MUUID& uuid) static const MUUID pluginBannedList[] =
{
- {0x9d6c3213, 0x02b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe2, 0x4f, 0x8d, 0x65 }}, // old chat
- {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 }}, // old clist
- {0x657fe89b, 0xd121, 0x40c2, { 0x8a, 0xc9, 0xb9, 0xfa, 0x57, 0x55, 0xb3, 0x0c }}, // old srmm
- {0x112f7d30, 0xcd19, 0x4c74, { 0xa0, 0x3b, 0xbf, 0xbb, 0x76, 0xb7, 0x5b, 0xc4 }}, // extraicons
- {0x72765a6f, 0xb017, 0x42f1, { 0xb3, 0x0f, 0x5e, 0x09, 0x41, 0x27, 0x3a, 0x3f }}, // flashavatars
- {0x1394a3ab, 0x2585, 0x4196, { 0x8f, 0x72, 0x0e, 0xae, 0xc2, 0x45, 0x0e, 0x11 }}, // db3x
- {0x28ff9b91, 0x3e4d, 0x4f1c, { 0xb4, 0x7c, 0xc6, 0x41, 0xb0, 0x37, 0xff, 0x40 }}, // dbx_mmap_sa
- {0x28f45248, 0x8c9c, 0x4bee, { 0x93, 0x07, 0x7b, 0xcf, 0x3e, 0x12, 0xbf, 0x99 }}, // dbx_tree
- {0x4c4a27cf, 0x5e64, 0x4242, { 0xa3, 0x32, 0xb9, 0x8b, 0x08, 0x24, 0x3e, 0x89 }}, // metacontacts
- {0x9c448c61, 0xfc3f, 0x42f9, { 0xb9, 0xf0, 0x4a, 0x30, 0xe1, 0xcf, 0x86, 0x71 }}, // skypekit based skype
- {0x49c2cf54, 0x7898, 0x44de, { 0xbe, 0x3a, 0x6d, 0x2e, 0x4e, 0xf9, 0x00, 0x79 }} // firstrun
+ { 0x9d6c3213, 0x02b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe2, 0x4f, 0x8d, 0x65 } }, // old chat
+ { 0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 } }, // old clist
+ { 0x657fe89b, 0xd121, 0x40c2, { 0x8a, 0xc9, 0xb9, 0xfa, 0x57, 0x55, 0xb3, 0x0c } }, // old srmm
+ { 0x112f7d30, 0xcd19, 0x4c74, { 0xa0, 0x3b, 0xbf, 0xbb, 0x76, 0xb7, 0x5b, 0xc4 } }, // extraicons
+ { 0x72765a6f, 0xb017, 0x42f1, { 0xb3, 0x0f, 0x5e, 0x09, 0x41, 0x27, 0x3a, 0x3f } }, // flashavatars
+ { 0x1394a3ab, 0x2585, 0x4196, { 0x8f, 0x72, 0x0e, 0xae, 0xc2, 0x45, 0x0e, 0x11 } }, // db3x
+ { 0x28ff9b91, 0x3e4d, 0x4f1c, { 0xb4, 0x7c, 0xc6, 0x41, 0xb0, 0x37, 0xff, 0x40 } }, // dbx_mmap_sa
+ { 0x28f45248, 0x8c9c, 0x4bee, { 0x93, 0x07, 0x7b, 0xcf, 0x3e, 0x12, 0xbf, 0x99 } }, // dbx_tree
+ { 0x4c4a27cf, 0x5e64, 0x4242, { 0xa3, 0x32, 0xb9, 0x8b, 0x08, 0x24, 0x3e, 0x89 } }, // metacontacts
+ { 0x9c448c61, 0xfc3f, 0x42f9, { 0xb9, 0xf0, 0x4a, 0x30, 0xe1, 0xcf, 0x86, 0x71 } }, // skypekit based skype
+ { 0x49c2cf54, 0x7898, 0x44de, { 0xbe, 0x3a, 0x6d, 0x2e, 0x4e, 0xf9, 0x00, 0x79 } } // firstrun
};
static bool isPluginBanned(const MUUID& u1)
{
- for (int i=0; i < SIZEOF(pluginBannedList); i++)
+ for (int i = 0; i < SIZEOF(pluginBannedList); i++)
if (equalUUID(pluginBannedList[i], u1))
return true;
@@ -118,25 +118,25 @@ static bool isPluginBanned(const MUUID& u1) static MuuidReplacement pluginDefault[] =
{
- { MIID_UIUSERINFO, _T("stduserinfo"), NULL }, // 0
- { MIID_SRURL, _T("stdurl"), NULL }, // 1
- { MIID_SREMAIL, _T("stdemail"), NULL }, // 2
- { MIID_SRAUTH, _T("stdauth"), NULL }, // 3
- { MIID_SRFILE, _T("stdfile"), NULL }, // 4
- { MIID_UIHELP, _T("stdhelp"), NULL }, // 5
- { MIID_UIHISTORY, _T("stduihist"), NULL }, // 6
- { MIID_IDLE, _T("stdidle"), NULL }, // 7
- { MIID_AUTOAWAY, _T("stdautoaway"), NULL }, // 8
- { MIID_USERONLINE, _T("stduseronline"), NULL }, // 9
- { MIID_SRAWAY, _T("stdaway"), NULL }, // 10
- { MIID_CLIST, _T("stdclist"), NULL }, // 11
- { MIID_CHAT, _T("stdchat"), NULL }, // 12
- { MIID_SRMM, _T("stdmsg"), NULL } // 13
+ { MIID_UIUSERINFO, _T("stduserinfo"), NULL }, // 0
+ { MIID_SRURL, _T("stdurl"), NULL }, // 1
+ { MIID_SREMAIL, _T("stdemail"), NULL }, // 2
+ { MIID_SRAUTH, _T("stdauth"), NULL }, // 3
+ { MIID_SRFILE, _T("stdfile"), NULL }, // 4
+ { MIID_UIHELP, _T("stdhelp"), NULL }, // 5
+ { MIID_UIHISTORY, _T("stduihist"), NULL }, // 6
+ { MIID_IDLE, _T("stdidle"), NULL }, // 7
+ { MIID_AUTOAWAY, _T("stdautoaway"), NULL }, // 8
+ { MIID_USERONLINE, _T("stduseronline"), NULL }, // 9
+ { MIID_SRAWAY, _T("stdaway"), NULL }, // 10
+ { MIID_CLIST, _T("stdclist"), NULL }, // 11
+ { MIID_CHAT, _T("stdchat"), NULL }, // 12
+ { MIID_SRMM, _T("stdmsg"), NULL } // 13
};
int getDefaultPluginIdx(const MUUID& muuid)
{
- for (int i=0; i < SIZEOF(pluginDefault); i++)
+ for (int i = 0; i < SIZEOF(pluginDefault); i++)
if (equalUUID(muuid, pluginDefault[i].uuid))
return i;
@@ -171,7 +171,7 @@ char* GetPluginNameByInstance(HINSTANCE hInstance) if (pluginList.getCount() == 0)
return NULL;
- for (int i=0; i < pluginList.getCount(); i++) {
+ for (int i = 0; i < pluginList.getCount(); i++) {
pluginEntry *p = pluginList[i];
if (p->bpi.pluginInfo && p->bpi.hInst == hInstance)
return p->bpi.pluginInfo->shortName;
@@ -184,7 +184,7 @@ int GetPluginLangByInstance(HINSTANCE hInstance) if (pluginList.getCount() == 0)
return NULL;
- for (int i=0; i < pluginList.getCount(); i++) {
+ for (int i = 0; i < pluginList.getCount(); i++) {
pluginEntry *p = pluginList[i];
if (p->bpi.pluginInfo && p->bpi.hInst == hInstance)
return p->hLangpack;
@@ -194,12 +194,12 @@ int GetPluginLangByInstance(HINSTANCE hInstance) int GetPluginFakeId(const MUUID &uuid, int hLangpack)
{
- for (int i=0; i < pluginList.getCount(); i++) {
+ for (int i = 0; i < pluginList.getCount(); i++) {
pluginEntry *p = pluginList[i];
if (!p->bpi.hInst)
continue;
- if ( equalUUID(p->bpi.pluginInfo->uuid, uuid))
+ if (equalUUID(p->bpi.pluginInfo->uuid, uuid))
return p->hLangpack = (hLangpack) ? hLangpack : --sttFakeID;
}
@@ -238,7 +238,7 @@ static int checkPI(BASIC_PLUGIN_INFO* bpi, PLUGININFOEX* pi) return FALSE;
if (pi->shortName == NULL || pi->description == NULL || pi->author == NULL ||
- pi->authorEmail == NULL || pi->copyright == NULL || pi->homepage == NULL)
+ pi->authorEmail == NULL || pi->copyright == NULL || pi->homepage == NULL)
return FALSE;
return TRUE;
@@ -253,9 +253,9 @@ int checkAPI(TCHAR* plugin, BASIC_PLUGIN_INFO* bpi, DWORD mirandaVersion, int ch return 0;
// loaded, check for exports
- bpi->Load = (Miranda_Plugin_Load) GetProcAddress(h, "Load");
- bpi->Unload = (Miranda_Plugin_Unload) GetProcAddress(h, "Unload");
- bpi->InfoEx = (Miranda_Plugin_InfoEx) GetProcAddress(h, "MirandaPluginInfoEx");
+ bpi->Load = (Miranda_Plugin_Load)GetProcAddress(h, "Load");
+ bpi->Unload = (Miranda_Plugin_Unload)GetProcAddress(h, "Unload");
+ bpi->InfoEx = (Miranda_Plugin_InfoEx)GetProcAddress(h, "MirandaPluginInfoEx");
// if they were present
if (!bpi->Load || !bpi->Unload || !bpi->InfoEx) {
@@ -264,7 +264,7 @@ LBL_Error: return 0;
}
- bpi->Interfaces = (MUUID*) GetProcAddress(h, "MirandaInterfaces");
+ bpi->Interfaces = (MUUID*)GetProcAddress(h, "MirandaInterfaces");
if (bpi->Interfaces == NULL) {
typedef MUUID * (__cdecl * Miranda_Plugin_Interfaces) (void);
Miranda_Plugin_Interfaces pFunc = (Miranda_Plugin_Interfaces)GetProcAddress(h, "MirandaPluginInterfaces");
@@ -286,10 +286,10 @@ LBL_Ok: // check clist ?
if (checkTypeAPI == CHECKAPI_CLIST) {
- bpi->clistlink = (CList_Initialise) GetProcAddress(h, "CListInitialise");
+ bpi->clistlink = (CList_Initialise)GetProcAddress(h, "CListInitialise");
if (pi->flags & UNICODE_AWARE)
- if (bpi->clistlink)
- goto LBL_Ok;
+ if (bpi->clistlink)
+ goto LBL_Ok;
}
goto LBL_Error;
@@ -323,7 +323,7 @@ void Plugin_Uninit(pluginEntry *p) int Plugin_UnloadDyn(pluginEntry *p)
{
if (p->bpi.hInst) {
- if ( CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
+ if (CallPluginEventHook(p->bpi.hInst, hOkToExitEvent, 0, 0) != 0)
return FALSE;
KillModuleSubclassing(p->bpi.hInst);
@@ -354,7 +354,7 @@ int Plugin_UnloadDyn(pluginEntry *p) // mark default plugins to be loaded
if (!(p->pclass & PCLASS_CORE))
- for (int i=0; i < SIZEOF(pluginDefault); i++)
+ for (int i = 0; i < SIZEOF(pluginDefault); i++)
if (pluginDefault[i].pImpl == p)
pluginDefault[i].pImpl = NULL;
@@ -365,7 +365,7 @@ int Plugin_UnloadDyn(pluginEntry *p) static int valid_library_name(TCHAR *name)
{
TCHAR *dot = _tcsrchr(name, '.');
- if (dot != NULL && lstrcmpi(dot + 1, _T("dll")) == 0)
+ if (dot != NULL && mir_tstrcmpi(dot + 1, _T("dll")) == 0)
if (dot[4] == 0)
return 1;
@@ -390,8 +390,7 @@ void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam) do {
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && valid_library_name(ffd.cFileName))
cb(&ffd, exe, wParam, lParam);
- }
- while (FindNextFile(hFind, &ffd));
+ } while (FindNextFile(hFind, &ffd));
FindClose(hFind);
} //if
}
@@ -410,7 +409,7 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) // map dll into the memory and check its exports
bool bIsPlugin = false;
- mir_ptr<MUUID> pIds( GetPluginInterfaces(tszFullPath, bIsPlugin));
+ mir_ptr<MUUID> pIds(GetPluginInterfaces(tszFullPath, bIsPlugin));
if (!bIsPlugin) {
p->pclass |= PCLASS_FAILED; // piece of shit
return p;
@@ -420,7 +419,7 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) bool bIsDb = hasMuuid(pIds, miid_database);
if (bIsDb || hasMuuid(pIds, miid_crypto)) {
BASIC_PLUGIN_INFO bpi;
- if ( checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) {
+ if (checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) {
// plugin is valid
p->pclass |= ((bIsDb ? PCLASS_DB : PCLASS_CRYPT) | PCLASS_BASICAPI);
// copy the dblink stuff
@@ -435,19 +434,19 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) else p->pclass |= PCLASS_FAILED;
}
// plugin declared that it's a contact list. mark it for the future load
- else if ( hasMuuid(pIds, miid_clist)) {
+ else if (hasMuuid(pIds, miid_clist)) {
// keep a note of this plugin for later
clistPlugins.insert(p);
p->pclass |= PCLASS_CLIST;
}
// plugin declared that it's a service mode plugin.
// load it for a profile manager's window
- else if ( hasMuuid(pIds, miid_servicemode)) {
+ else if (hasMuuid(pIds, miid_servicemode)) {
BASIC_PLUGIN_INFO bpi;
if (checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) {
p->pclass |= (PCLASS_OK | PCLASS_BASICAPI);
p->bpi = bpi;
- if ( hasMuuid(bpi, miid_servicemode)) {
+ if (hasMuuid(bpi, miid_servicemode)) {
p->pclass |= (PCLASS_SERVICE);
servicePlugins.insert(p);
}
@@ -461,18 +460,13 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) void SetPluginOnWhiteList(const TCHAR* pluginname, int allow)
{
- char plugName[MAX_PATH];
- strncpy(plugName, StrConvA(pluginname), SIZEOF(plugName));
- strlwr(plugName);
- db_set_b(NULL, PLUGINDISABLELIST, plugName, allow == 0);
+ db_set_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), allow == 0);
}
// returns 1 if the plugin should be enabled within this profile, filename is always lower case
int isPluginOnWhiteList(const TCHAR* pluginname)
{
- char* pluginnameA = _strlwr(mir_t2a(pluginname));
- int rc = db_get_b(NULL, PLUGINDISABLELIST, pluginnameA, 0);
- mir_free(pluginnameA);
+ int rc = db_get_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), 0);
if (rc != 0 && askAboutIgnoredPlugins) {
TCHAR buf[256];
mir_sntprintf(buf, SIZEOF(buf), TranslateT("'%s' is disabled, re-enable?"), pluginname);
@@ -493,7 +487,6 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) if (slice)
*slice = 0;
- CharLower(p->pluginname);
if (!(p->pclass & (PCLASS_LOADED | PCLASS_DB | PCLASS_CLIST))) {
if (!bDynamic && !isPluginOnWhiteList(p->pluginname))
return false;
@@ -512,8 +505,8 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) if (p->bpi.Interfaces) {
MUUID *piface = p->bpi.Interfaces;
- for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
- int idx = getDefaultPluginIdx( piface[i] );
+ for (int i = 0; !equalUUID(miid_last, piface[i]); i++) {
+ int idx = getDefaultPluginIdx(piface[i]);
if (idx != -1 && pluginDefault[idx].pImpl) {
if (!bDynamic) { // this place is already occupied, skip & disable
SetPluginOnWhiteList(p->pluginname, 0);
@@ -534,7 +527,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) p->pclass |= PCLASS_LOADED;
if (p->bpi.Interfaces) {
MUUID *piface = p->bpi.Interfaces;
- for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
+ for (int i = 0; !equalUUID(miid_last, piface[i]); i++) {
int idx = getDefaultPluginIdx(piface[i]);
if (idx != -1)
pluginDefault[idx].pImpl = p;
@@ -603,21 +596,20 @@ static bool loadClistModule(TCHAR* exe, pluginEntry *p) static pluginEntry* getCListModule(TCHAR *exe, TCHAR *slice)
{
- for (int i=0; i < clistPlugins.getCount(); i++) {
+ for (int i = 0; i < clistPlugins.getCount(); i++) {
pluginEntry *p = clistPlugins[i];
mir_sntprintf(slice, &exe[MAX_PATH] - slice, _T("\\Plugins\\%s"), p->pluginname);
- CharLower(p->pluginname);
if (!isPluginOnWhiteList(p->pluginname))
continue;
- if ( loadClistModule(exe, p))
+ if (loadClistModule(exe, p))
return p;
}
MuuidReplacement& stdClist = pluginDefault[11];
- if ( LoadCorePlugin(stdClist)) {
+ if (LoadCorePlugin(stdClist)) {
mir_sntprintf(slice, &exe[MAX_PATH] - slice, _T("\\Core\\%s.dll"), stdClist.stdplugname);
- if ( loadClistModule(exe, stdClist.pImpl))
+ if (loadClistModule(exe, stdClist.pImpl))
return stdClist.pImpl;
}
@@ -626,7 +618,7 @@ static pluginEntry* getCListModule(TCHAR *exe, TCHAR *slice) int UnloadPlugin(TCHAR* buf, int bufLen)
{
- for (int i = pluginList.getCount()-1; i >= 0; i--) {
+ for (int i = pluginList.getCount() - 1; i >= 0; i--) {
pluginEntry *p = pluginList[i];
if (!_tcsicmp(p->pluginname, buf)) {
GetModuleFileName(p->bpi.hInst, buf, bufLen);
@@ -668,12 +660,12 @@ static int LaunchServicePlugin(pluginEntry *p) int LoadDefaultServiceModePlugin()
{
- LPCTSTR param = CmdLine_GetOption( _T("svc"));
+ LPCTSTR param = CmdLine_GetOption(_T("svc"));
if (param == NULL || *param == 0)
return SERVICE_CONTINUE;
size_t cbLen = _tcslen(param);
- for (int i=0; i < servicePlugins.getCount(); i++) {
+ for (int i = 0; i < servicePlugins.getCount(); i++) {
pluginEntry *p = servicePlugins[i];
if (!_tcsnicmp(p->pluginname, param, cbLen)) {
int res = LaunchServicePlugin(p);
@@ -771,7 +763,7 @@ int LoadNewPluginsModule(void) if (clistPlugins.getCount())
MessageBox(NULL, TranslateT("Unable to start any of the installed contact list plugins, I even ignored your preferences for which contact list couldn't load any."), _T("Miranda NG"), MB_OK | MB_ICONERROR);
else
- MessageBox(NULL, TranslateT("Can't find a contact list plugin! You need StdClist or any other contact list plugin.") , _T("Miranda NG"), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, TranslateT("Can't find a contact list plugin! You need StdClist or any other contact list plugin."), _T("Miranda NG"), MB_OK | MB_ICONERROR);
return 1;
}
@@ -800,10 +792,10 @@ static BOOL scanPluginsDir(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM) {
pluginEntry *p = OpenPlugin(fd->cFileName, _T("Plugins"), path);
if (!(p->pclass & PCLASS_FAILED)) {
- if (pluginList_freeimg == NULL && lstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0)
+ if (pluginList_freeimg == NULL && mir_tstrcmpi(fd->cFileName, _T("advaimg.dll")) == 0)
pluginList_freeimg = p;
- if (pluginList_crshdmp == NULL && lstrcmpi(fd->cFileName, _T("crashdumper.dll")) == 0) {
+ if (pluginList_crshdmp == NULL && mir_tstrcmpi(fd->cFileName, _T("crashdumper.dll")) == 0) {
pluginList_crshdmp = p;
p->pclass |= PCLASS_LAST;
}
@@ -855,7 +847,7 @@ void UnloadNewPluginsModule(void) UnloadPluginOptions();
// unload everything but the DB
- for (int i = pluginList.getCount()-1; i >= 0; i--) {
+ for (int i = pluginList.getCount() - 1; i >= 0; i--) {
pluginEntry *p = pluginList[i];
if (!(p->pclass & (PCLASS_DB | PCLASS_CRYPT)) && p != pluginList_crshdmp)
Plugin_Uninit(p);
@@ -866,7 +858,7 @@ void UnloadNewPluginsModule(void) UnloadDatabase();
- for (int k = pluginList.getCount()-1; k >= 0; k--) {
+ for (int k = pluginList.getCount() - 1; k >= 0; k--) {
pluginEntry *p = pluginList[k];
Plugin_Uninit(p);
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 7ffec4f215..30fd40f6da 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -36,7 +36,7 @@ static HANDLE hHooks[4]; static int CompareAccounts(const PROTOACCOUNT* p1, const PROTOACCOUNT* p2)
{
- return lstrcmpA(p1->szModuleName, p2->szModuleName);
+ return mir_strcmp(p1->szModuleName, p2->szModuleName);
}
LIST<PROTOACCOUNT> accounts(10, CompareAccounts);
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp index 2b5f8ac7f3..909f02b885 100644 --- a/src/modules/skin/hotkey_opts.cpp +++ b/src/modules/skin/hotkey_opts.cpp @@ -246,23 +246,23 @@ static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lP item2 = (THotkeyItem *)lvi.lParam; if (!item1 && !item2) - return lstrcmp(title1, title2); + return mir_tstrcmp(title1, title2); if (!item1 && item2) { - if (res = lstrcmp(title1, item2->getSection())) + if (res = mir_tstrcmp(title1, item2->getSection())) return res; return -1; } if (!item2 && item1) { - if (res = lstrcmp(item1->getSection(), title2)) + if (res = mir_tstrcmp(item1->getSection(), title2)) return res; return 1; } /* item1 != NULL && item2 != NULL */ - if (res = lstrcmp(item1->getSection(), item2->getSection())) return res; - if (res = lstrcmp(item1->getDescr(), item2->getDescr())) return res; + if (res = mir_tstrcmp(item1->getSection(), item2->getSection())) return res; + if (res = mir_tstrcmp(item1->getDescr(), item2->getDescr())) return res; if (!item1->rootHotkey && item2->rootHotkey) return -1; if (item1->rootHotkey && !item2->rootHotkey) return 1; return 0; @@ -357,7 +357,7 @@ static void sttBuildHotkeyList(HWND hwndList) if (item->OptDeleted) continue; - if (!i || lstrcmp(item->ptszSection, hotkeys[i-1]->ptszSection)) { + if (!i || mir_tstrcmp(item->ptszSection, hotkeys[i-1]->ptszSection)) { lvi.mask = LVIF_TEXT|LVIF_PARAM; lvi.iItem = nItems++; lvi.iSubItem = 0; @@ -872,7 +872,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, ListView_GetItem(lpnmhdr->hwndFrom, &lvi); item = (THotkeyItem *)lvi.lParam; if (!item) continue; - if (!lstrcmp( item->getSection(), buf)) { + if (!mir_tstrcmp( item->getSection(), buf)) { ListView_DeleteItem(lpnmhdr->hwndFrom, lvi.iItem); --lvi.iItem; --count; @@ -887,7 +887,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (item->OptDeleted) continue; - if ( lstrcmp(buf, item->getSection())) + if ( mir_tstrcmp(buf, item->getSection())) continue; lvi.mask = LVIF_PARAM|LVIF_INDENT; diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index adab1fda71..95f78a708c 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -29,9 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int sttCompareHotkeys(const THotkeyItem *p1, const THotkeyItem *p2)
{
int res;
- if (res = lstrcmp(p1->ptszSection, p2->ptszSection))
+ if (res = mir_tstrcmp(p1->ptszSection, p2->ptszSection))
return res;
- if (res = lstrcmp(p1->ptszDescription, p2->ptszDescription))
+ if (res = mir_tstrcmp(p1->ptszDescription, p2->ptszDescription))
return res;
if (!p1->rootHotkey && p2->rootHotkey)
return -1;
@@ -228,7 +228,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam) if (!pszCurrentName) continue;
hotkeys[i]->UnregisterHotkey =
- !lstrcmpA(pszCurrentName, pszName) ||
+ !mir_strcmp(pszCurrentName, pszName) ||
!strncmp(pszCurrentName, pszNamePrefix, cbNamePrefix);
}
@@ -263,7 +263,7 @@ static INT_PTR svcHotkeyCheck(WPARAM wParam, LPARAM lParam) for (i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
BYTE hkMod, hkVk;
- if ((item->type != HKT_MANUAL) || lstrcmp(pszSection, item->ptszSection)) continue;
+ if ((item->type != HKT_MANUAL) || mir_tstrcmp(pszSection, item->ptszSection)) continue;
sttWordToModAndVk(item->Hotkey, &hkMod, &hkVk);
if (!hkVk) continue;
if (!item->Enabled) continue;
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index e70f0ad2d6..02b09d1127 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -45,7 +45,7 @@ struct SoundItem static int CompareSounds(const SoundItem* p1, const SoundItem* p2)
{
- return lstrcmpA(p1->name, p2->name);
+ return mir_strcmp(p1->name, p2->name);
}
static OBJLIST<SoundItem> arSounds(10, CompareSounds);
diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp index 47ef5b7178..f26a708049 100644 --- a/src/modules/utils/bmpfilter.cpp +++ b/src/modules/utils/bmpfilter.cpp @@ -48,12 +48,12 @@ static INT_PTR sttBitmapLoader(const TCHAR* ptszFileName) if (ServiceExists(MS_IMG_LOAD))
return CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_TCHAR);
- if (!lstrcmpi(pszExt, _T(".bmp")) || !lstrcmpi(pszExt, _T(".rle"))) {
+ if (!mir_tstrcmpi(pszExt, _T(".bmp")) || !mir_tstrcmpi(pszExt, _T(".rle"))) {
//LoadImage can do this much faster
return (INT_PTR)LoadImage(hInst, szFilename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
}
- if (!lstrcmpi(pszExt, _T(".png"))) {
+ if (!mir_tstrcmpi(pszExt, _T(".png"))) {
HANDLE hFile, hMap = NULL;
BYTE* ppMap = NULL;
INT_PTR cbFileSize = 0;
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index bd37f53ef5..08ec0faa1f 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -108,7 +108,7 @@ static LPCTSTR timeapiGetTzDescription(LPCTSTR TZname) for (int i = 0; i < g_timezonesBias.getCount(); i++) {
MIM_TIMEZONE *tz = g_timezonesBias[i];
- if (!lstrcmp(tz->tszName, TZname))
+ if (!mir_tstrcmp(tz->tszName, TZname))
return tz->szDisplay;
}
return _T("");
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index deb41b3e90..cffb5f6ce1 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -312,7 +312,7 @@ static INT_PTR GetCountryByNumber(WPARAM wParam, LPARAM) static INT_PTR GetCountryByISOCode(WPARAM wParam, LPARAM)
{
for (int i = 0; i < SIZEOF(countries); i++)
- if ( lstrcmpiA((char*)wParam, countries[i].ISOcode) == 0)
+ if ( mir_strcmpi((char*)wParam, countries[i].ISOcode) == 0)
return (INT_PTR)countries[i].szName;
return NULL;
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp index 9da791bfdf..04c82c59d3 100644 --- a/src/modules/xml/xmlParser.cpp +++ b/src/modules/xml/xmlParser.cpp @@ -1199,7 +1199,7 @@ XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease, XMLSTR lpszName, XM TCHAR* p = _tcschr(lpszName, ':'); if (p) - if (!lstrcmp(p+1, d->lpszNS) || (d->pParent && !lstrcmp(p+1, d->pParent->lpszNS))) + if (!mir_tstrcmp(p+1, d->lpszNS) || (d->pParent && !mir_tstrcmp(p+1, d->pParent->lpszNS))) *p = 0; return pAttr; |