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/Popup | |
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/Popup')
-rw-r--r-- | plugins/Popup/src/font.cpp | 4 | ||||
-rw-r--r-- | plugins/Popup/src/notifications.cpp | 28 | ||||
-rw-r--r-- | plugins/Popup/src/opt_class.cpp | 20 | ||||
-rw-r--r-- | plugins/Popup/src/services.cpp | 4 | ||||
-rw-r--r-- | plugins/Popup/src/skin.cpp | 6 |
5 files changed, 31 insertions, 31 deletions
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 1b3ff5583f..264f45d188 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -131,10 +131,10 @@ void ReloadFonts() char setting[256];
for (int i = 0; i < gTreeData.getCount(); i++) {
if (gTreeData[i]->typ == 2) {
- mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", gTreeData[i]->pupClass.pszName);
+ mir_snprintf(setting, "%s/TextCol", gTreeData[i]->pupClass.pszName);
gTreeData[i]->colorText = gTreeData[i]->pupClass.colorText =
(COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clText);
- mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", gTreeData[i]->pupClass.pszName);
+ mir_snprintf(setting, "%s/BgCol", gTreeData[i]->pupClass.pszName);
gTreeData[i]->colorBack = gTreeData[i]->pupClass.colorBack =
(COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
}
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index b5a9740f46..3652582256 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -92,32 +92,32 @@ void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul) if (ptd->typ == 1) {
char setting[2 * MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}Timeout",
+ mir_snprintf(setting, "{%s/%s}Timeout",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_w(NULL, szModul, setting, ptd->notification.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}enabled",
+ mir_snprintf(setting, "{%s/%s}enabled",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_b(NULL, szModul, setting, ptd->enabled);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}TimeoutVal",
+ mir_snprintf(setting, "{%s/%s}TimeoutVal",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}disableWhen",
+ mir_snprintf(setting, "{%s/%s}disableWhen",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_b(NULL, szModul, setting, ptd->disableWhen);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}leftAction",
+ mir_snprintf(setting, "{%s/%s}leftAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}rightAction",
+ mir_snprintf(setting, "{%s/%s}rightAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
@@ -139,29 +139,29 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) char setting[2 * MAXMODULELABELLENGTH];
char *szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->notification.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, ptd->notification.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
ptd->notification.iSeconds ? ptd->notification.iSeconds : 0);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->disableWhen =
db_get_b(NULL, szModul, setting, 0);
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzRAction);
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -209,7 +209,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) char section[MAXMODULELABELLENGTH], setting[MAXMODULELABELLENGTH];
mir_snprintf(section, SIZEOF(section), "Popups/%s", notification->lpzGroup);
- mir_snprintf(setting, SIZEOF(setting), MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(setting, MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = section;
@@ -259,7 +259,7 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen) ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), MODULNAME"_%s_%s", ptd->notification.lpzGroup, ptd->notification.lpzName);
+ mir_snprintf(setting, MODULNAME"_%s_%s", ptd->notification.lpzGroup, ptd->notification.lpzName);
ppd->lchIcon = Skin_GetIcon(setting);
}
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index cb5e2c48f6..35bd585ed0 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -490,25 +490,25 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul) char setting[2 * MAXMODULELABELLENGTH];
char *szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName);
ptd->enabled =
(signed char)db_get_b(NULL, szModul, setting, TRUE);
- mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/Timeout", ptd->pupClass.pszName);
ptd->pupClass.iSeconds =
(signed char)db_get_w(NULL, szModul, setting, 0);
- mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/TimeoutVal", ptd->pupClass.pszName);
ptd->timeoutValue =
(signed char)db_get_w(NULL, szModul, setting,
ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds);
- mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ??
mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
- mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName);
szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); // standart ??
mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -518,18 +518,18 @@ void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul) {
char setting[2 * MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s/enabled", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName);
db_set_b(NULL, szModul, setting, ptd->enabled);
- mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/Timeout", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->pupClass.iSeconds);
- mir_snprintf(setting, SIZEOF(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/TimeoutVal", ptd->pupClass.pszName);
db_set_w(NULL, szModul, setting, ptd->timeoutValue);
- mir_snprintf(setting, SIZEOF(setting), "%s/leftAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->leftAction);
- mir_snprintf(setting, SIZEOF(setting), "%s/rightAction", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName);
db_set_s(NULL, szModul, setting, ptd->rightAction);
}
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 69b06749d8..b77c87a75a 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -377,7 +377,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) LoadClassSettings(ptd, PU_MODULCLASS);
// we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
- mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/TextCol", ptd->pupClass.pszName);
ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
@@ -395,7 +395,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) FontRegisterT(&fid);
// we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
- mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", ptd->pupClass.pszName);
+ mir_snprintf(setting, "%s/BgCol", ptd->pupClass.pszName);
ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index c83a430b6b..1a6a14bdf7 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -210,7 +210,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options for (int i = 0; i < 32; ++i) {
char buf[10];
- mir_snprintf(buf, SIZEOF(buf), "opt%d", i);
+ mir_snprintf(buf, "opt%d", i);
wnd->getArgs()->add(buf, (m_flags&(1L << i)) ? 1 : 0);
}
@@ -1042,14 +1042,14 @@ void PopupSkin::freeSkin(SKINELEMENT *head) void PopupSkin::saveOpts() const
{
char buf[128];
- mir_snprintf(buf, SIZEOF(buf), "skin.%.120S", m_name);
+ mir_snprintf(buf, "skin.%.120S", m_name);
db_set_dw(NULL, MODULNAME, buf, m_flags);
}
void PopupSkin::loadOpts() const
{
char buf[128];
- mir_snprintf(buf, SIZEOF(buf), "skin.%.120S", m_name);
+ mir_snprintf(buf, "skin.%.120S", m_name);
m_flags = db_get_dw(NULL, MODULNAME, buf, m_flags);
}
|