diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:12:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:12:13 +0000 |
commit | b7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch) | |
tree | 468d9610a590685322ad2159a9bd2d9e2ba83f89 /plugins/TabSRMM/src | |
parent | 7de513f180c429859e246d1033d745b394e1fc28 (diff) |
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/chat/options.cpp | 18 | ||||
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/themeio.cpp | 30 |
5 files changed, 32 insertions, 32 deletions
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 4c28234aa7..c8754ccab7 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -187,17 +187,17 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM }
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = M.GetDword(szMod, str, fol[j].defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)M.GetByte(szMod, str, fol[j].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
+ mir_snprintf(str, "Font%dSty", i);
style = M.GetByte(szMod, str, fol[j].defStyle);
if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M.GetByte("inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
@@ -211,13 +211,13 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = style & FONTF_STRIKEOUT ? 1 : 0;
}
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = M.GetByte(szMod, str, fol[j].defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%d", i);
+ mir_snprintf(str, "Font%d", i);
if ((i == 17 && !mir_strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !mir_strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
_tcsncpy_s(lf->lfFaceName, _T("Webdings"), _TRUNCATE);
@@ -349,7 +349,7 @@ void Chat_AddIcons(void) HICON LoadIconEx(char *pszIcoLibName)
{
char szTemp[256];
- mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp);
}
@@ -499,7 +499,7 @@ void RegisterFontServiceFonts() for (int i = 0; i < SIZEOF(IM_fontOptionsList); i++) {
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
LoadMsgDlgFont(FONTSECTION_IM, i, &lf, &fontOptionsList[i].colour, FONTMODULE);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i);
+ mir_snprintf(szTemp, "Font%d", i);
strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
fid.order = i;
_tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
@@ -562,7 +562,7 @@ void RegisterFontServiceFonts() _tcsncpy(fid.backgroundName, LPGENT("Fields background"), SIZEOF(fid.backgroundName));
for (int i = 0; i < IPFONTCOUNT; i++) {
LoadMsgDlgFont(FONTSECTION_IP, i + 100, &lf, &fontOptionsList[i].colour, FONTMODULE);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i + 100);
+ mir_snprintf(szTemp, "Font%d", i + 100);
strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix));
fid.order = i + 100;
_tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name));
@@ -584,7 +584,7 @@ void RegisterFontServiceFonts() _tcsncpy(cid.group, LPGENT("Message Sessions")_T("/")LPGENT("Group chats"), SIZEOF(cid.group));
strncpy(cid.dbSettingsGroup, CHAT_MODULE, SIZEOF(cid.dbSettingsGroup));
for (int i = 0; i <= 7; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
+ mir_snprintf(szTemp, "NickColor%d", i);
_tcsncpy(cid.name, chatcolorsnames[i], SIZEOF(cid.name));
cid.order = i + 1;
strncpy(cid.setting, szTemp, SIZEOF(cid.setting));
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 61e9997c1c..87452fb702 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -2086,17 +2086,17 @@ void TSAPI DeleteContainer(int iIndex) }
char szSetting[CONTAINER_NAMELEN + 30];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%d_Flags", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%d_Flags", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%d_Trans", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%d_Trans", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dwidth", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dwidth", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dheight", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dheight", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dx", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dx", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s%dy", CONTAINER_PREFIX, iIndex);
+ mir_snprintf(szSetting, "%s%dy", CONTAINER_PREFIX, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 5846f432d1..96159f7743 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1622,7 +1622,7 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer) for (int i = 1; i <= 5; i++) {
char szTemp[40];
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i);
+ mir_snprintf(szTemp, "cc%d", i);
COLORREF colour = M.GetDword(szTemp, RGB(224, 224, 224));
if (colour == 0)
colour = RGB(1, 1, 1);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index abf43caaa6..cf6d077f18 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -236,7 +236,7 @@ static int AppendUnicodeToBuffer(CMStringA &str, const TCHAR *line, int mode) else {
char szTemp[10];
int colindex = GetColorIndex(GetRTFFont(LOWORD(mode) ? (MSGFONTID_MYMSG + (HIWORD(mode) ? 8 : 0)) : (MSGFONTID_YOURMSG + (HIWORD(mode) ? 8 : 0))));
- mir_snprintf(szTemp, SIZEOF(szTemp), "%02d", colindex);
+ mir_snprintf(szTemp, "%02d", colindex);
str.Append(szTemp);
}
str.AppendChar(' ');
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 6a1b1531f1..4a5776ee46 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -192,19 +192,19 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) char *szModule = fontBlocks[n].szModule;
WritePrivateProfileStringA(fontBlocks[n].szBLockname, "Valid", "1", szIniFilename);
for (i = 0; i < fontBlocks[n].iCount; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", firstIndex + i);
+ mir_snprintf(szTemp, "Font%d", firstIndex + i);
mir_snprintf(szAppname, SIZEOF(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
db_free(&dbv);
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dCol", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dCol", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Color", _itoa(M.GetDword(szModule, szTemp, 0), szBuf, 10), szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSty", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSty", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Style", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSize", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSize", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Size", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSet", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSet", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Set", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
}
n++;
@@ -232,7 +232,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) WritePrivateProfileStringA("RTLTemplates", TemplateNames[i], szRTL, szIniFilename);
}
for (i = 0; i < CUSTOM_COLORS; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i + 1);
+ mir_snprintf(szTemp, "cc%d", i + 1);
if (dat == 0)
WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(M.GetDword(szTemp, 0), szBuf, 10), szIniFilename);
else
@@ -275,7 +275,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in continue;
}
for (i = 0; i < fontBlocks[n].iCount; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", firstIndex + i);
+ mir_snprintf(szTemp, "Font%d", firstIndex + i);
mir_snprintf(szAppname, SIZEOF(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
if (GetPrivateProfileStringA(szAppname, "Face", "Verdana", szBuf, sizeof(szBuf), szIniFilename) != 0) {
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
@@ -283,19 +283,19 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in db_set_s(NULL, szModule, szTemp, szBuf);
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dCol", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dCol", firstIndex + i);
db_set_dw(0, szModule, szTemp, GetPrivateProfileIntA(szAppname, "Color", GetSysColor(COLOR_WINDOWTEXT), szIniFilename));
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSty", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSty", firstIndex + i);
db_set_b(0, szModule, szTemp, (BYTE)(GetPrivateProfileIntA(szAppname, "Style", 0, szIniFilename)));
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSize", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSize", firstIndex + i);
bSize = (char)GetPrivateProfileIntA(szAppname, "Size", -10, szIniFilename);
if (bSize > 0)
bSize = -MulDiv(bSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
db_set_b(0, szModule, szTemp, bSize);
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%dSet", firstIndex + i);
+ mir_snprintf(szTemp, "Font%dSet", firstIndex + i);
charset = GetPrivateProfileIntA(szAppname, "Set", 0, szIniFilename);
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
charset = 0;
@@ -325,7 +325,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in db_set_b(0, SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
for (i = 0; i < CUSTOM_COLORS; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i + 1);
+ mir_snprintf(szTemp, "cc%d", i + 1);
db_set_dw(0, SRMSGMOD_T, szTemp, GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename));
}
for (i = 0; i <= 7; i++) {
@@ -336,7 +336,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in else
defclr = g_Settings.UserListColors[CHAT_STATUS_NORMAL];
g_Settings.nickColors[i] = GetPrivateProfileIntA("Nick Colors", _itoa(i, szTemp, 10), defclr, szIniFilename);
- mir_snprintf(szTemp, SIZEOF(szTemp), "NickColor%d", i);
+ mir_snprintf(szTemp, "NickColor%d", i);
db_set_dw(0, CHAT_MODULE, szTemp, g_Settings.nickColors[i]);
}
}
@@ -347,7 +347,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in ReleaseDC(NULL, hdc);
if (!noAdvanced) {
for (i = 0; i < MSGDLGFONTCOUNT; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i);
+ mir_snprintf(szTemp, "Font%d", i);
LoadLogfontFromINI(i, szTemp, &dat->theme.logFonts[i], &dat->theme.fontColors[i], szIniFilename);
wsprintfA(dat->theme.rtfFonts + (i * RTFCACHELINESIZE), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, dat->theme.logFonts[i].lfWeight >= FW_BOLD ? 1 : 0, dat->theme.logFonts[i].lfItalic, dat->theme.logFonts[i].lfUnderline, 2 * abs(dat->theme.logFonts[i].lfHeight) * 74 / SY); //!!!!!!!!
}
@@ -371,7 +371,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in dat->theme.right_indent = GetPrivateProfileIntA("Message Log", "RightIndent", 0, szIniFilename);
for (i = 0; i < CUSTOM_COLORS; i++) {
- mir_snprintf(szTemp, SIZEOF(szTemp), "cc%d", i + 1);
+ mir_snprintf(szTemp, "cc%d", i + 1);
dat->theme.custom_colors[i] = GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename);
}
}
|