diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 04:50:22 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 04:50:22 +0000 |
commit | 41a7300678e4bb3cd703e2c236e57af4a31962c7 (patch) | |
tree | 36318f807498cf15b405eda5c451fd37bfe1b675 /plugins/TabSRMM | |
parent | 97e0ada5c34d6e7eba1cf47a8d8ac029197be6de (diff) |
mir_snprintf(..., sizeof() -> SIZEOF(), ...)
small fixs cleanups
git-svn-id: http://svn.miranda-ng.org/main/trunk@11188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat/options.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 3 |
5 files changed, 12 insertions, 11 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index fa7186ed31..d384f9721d 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -730,12 +730,12 @@ void TSAPI BB_CustomButtonClick(TWindowData *dat, DWORD idFrom, HWND hwndFrom, B void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd) { DBVARIANT dbv = { 0 }; - char SettingName[1024] = { '\0' }; + char SettingName[1024]; char* token = NULL; //modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden - mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID); + mir_snprintf(SettingName, SIZEOF(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID); if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) { token = strtok(dbv.pszVal, "_"); @@ -757,13 +757,13 @@ void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd) void CB_WriteButtonSettings(MCONTACT hContact, CustomButtonData *cbd) { - char SettingName[1024] = { '\0' }; - char SettingParameter[1024] = { '\0' }; + char SettingName[1024]; + char SettingParameter[1024]; //modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden - mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID); - mir_snprintf(SettingParameter, sizeof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->dwPosition, cbd->bIMButton, cbd->bChatButton, cbd->bLSided, cbd->bRSided, cbd->bCanBeHidden); + mir_snprintf(SettingName, SIZEOF(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID); + mir_snprintf(SettingParameter, SIZEOF(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->dwPosition, cbd->bIMButton, cbd->bChatButton, cbd->bLSided, cbd->bRSided, cbd->bCanBeHidden); if (!(cbd->opFlags & BBSF_NTBDESTRUCT)) db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter); else diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 1103d33dd8..590589603b 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -405,7 +405,7 @@ void Chat_AddIcons(void) HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY)
{
char szTemp[256];
- mir_snprintf(szTemp, sizeof(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp);
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 8136cc9e72..65eec8bc58 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -687,7 +687,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, } else { char szCName[CONTAINER_NAMELEN + 20]; - mir_snprintf(szCName, sizeof(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex); + mir_snprintf(szCName, SIZEOF(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex); if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) { if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName)) if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split")) diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 752bee529d..ac82f2133d 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1201,9 +1201,9 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG static void SetupLogFormatting(TWindowData *dat)
{
if (dat->hHistoryEvents)
- mir_snprintf(dat->szMicroLf, sizeof(dat->szMicroLf), "%s", "\\v\\cf%d \\ ~-+%d+-~\\v0 ");
+ mir_snprintf(dat->szMicroLf, SIZEOF(dat->szMicroLf), "%s", "\\v\\cf%d \\ ~-+%d+-~\\v0 ");
else
- mir_snprintf(dat->szMicroLf, sizeof(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
+ mir_snprintf(dat->szMicroLf, SIZEOF(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
}
static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 18f441a628..48a3ec64df 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -1017,8 +1017,9 @@ LRESULT Utils::CmdDispatcher(UINT uType, HWND hwndDlg, UINT cmd, WPARAM wParam, void Utils::sanitizeFilename(wchar_t* tszFilename)
{
static wchar_t *forbiddenCharacters = L"%/\\':|\"<>?";
+ static size_t forbiddenCharactersLen = mir_wstrlen(forbiddenCharacters);
- for (int i=0; i < mir_wstrlen(forbiddenCharacters); i++) {
+ for (size_t i=0; i < forbiddenCharactersLen; i++) {
wchar_t* szFound = 0;
while ((szFound = wcschr(tszFilename, (int)forbiddenCharacters[i])) != NULL)
|