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/NewXstatusNotify/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/NewXstatusNotify/src')
-rw-r--r-- | plugins/NewXstatusNotify/src/main.cpp | 6 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/options.cpp | 16 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/xstatus.cpp | 8 |
3 files changed, 15 insertions, 15 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 90acfb1646..f8f56fe5fc 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -405,7 +405,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) if (!opt.FromOffline || oldStatus != ID_STATUS_OFFLINE) { // Either it wasn't a change from Offline or we didn't enable that.
char buff[8];
- mir_snprintf(buff, SIZEOF(buff), "%d", newStatus);
+ mir_snprintf(buff, "%d", newStatus);
if (db_get_b(0, MODULE, buff, 1) == 0)
return 0; // "Notify when a contact changes to one of..." is unchecked
}
@@ -803,7 +803,7 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam) if (opt.AutoDisable && (!opt.OnlyGlobalChanges || szProto == NULL)) {
if (opt.DisablePopupGlobally && ServiceExists(MS_POPUP_QUERY)) {
char szSetting[12];
- mir_snprintf(szSetting, SIZEOF(szSetting), "p%d", wParam);
+ mir_snprintf(szSetting, "p%d", wParam);
BYTE hlpDisablePopup = db_get_b(0, MODULE, szSetting, 0);
if (hlpDisablePopup != opt.PopupAutoDisabled) {
@@ -827,7 +827,7 @@ int StatusModeChanged(WPARAM wParam, LPARAM lParam) if (opt.DisableSoundGlobally) {
char szSetting[12];
- mir_snprintf(szSetting, SIZEOF(szSetting), "s%d", wParam);
+ mir_snprintf(szSetting, "s%d", wParam);
BYTE hlpDisableSound = db_get_b(0, MODULE, szSetting, 0);
if (hlpDisableSound != opt.SoundAutoDisabled) {
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 1952dd4e2f..fdd9a14aa3 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -135,9 +135,9 @@ void SaveTemplates() for (int i = 0; i < ProtoTemplates.getCount(); i++) {
PROTOTEMPLATE *prototemplate = ProtoTemplates[i];
char str[MAX_PATH];
- mir_snprintf(str, SIZEOF(str), "%s_TPopupSMsgChanged", prototemplate->ProtoName);
+ mir_snprintf(str, "%s_TPopupSMsgChanged", prototemplate->ProtoName);
db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateMsg);
- mir_snprintf(str, SIZEOF(str), "%s_TPopupSMsgRemoved", prototemplate->ProtoName);
+ mir_snprintf(str, "%s_TPopupSMsgRemoved", prototemplate->ProtoName);
db_set_ts(0, MODULE, str, prototemplate->ProtoTemplateRemoved);
}
}
@@ -428,12 +428,12 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
ctlColour = SendDlgItemMessage(hwndDlg, (i + 2000), CPM_GETCOLOUR, 0, 0);
StatusList[Index(i)].colorBack = SendDlgItemMessage(hwndDlg, (i + 2000), CPM_GETCOLOUR, 0, 0);
- mir_snprintf(str, SIZEOF(str), "%ibg", i);
+ mir_snprintf(str, "%ibg", i);
db_set_dw(0, MODULE, str, ctlColour);
ctlColour = SendDlgItemMessage(hwndDlg, (i + 1000), CPM_GETCOLOUR, 0, 0);
StatusList[Index(i)].colorText = ctlColour;
- mir_snprintf(str, SIZEOF(str), "%itx", i);
+ mir_snprintf(str, "%itx", i);
db_set_dw(0, MODULE, str, ctlColour);
}
@@ -480,13 +480,13 @@ INT_PTR CALLBACK DlgProcAutoDisableOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "p%d", i);
+ mir_snprintf(str, "p%d", i);
CheckDlgButton(hwndDlg, i, db_get_b(0, MODULE, str, 0) ? BST_CHECKED : BST_UNCHECKED);
}
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "s%d", i);
+ mir_snprintf(str, "s%d", i);
CheckDlgButton(hwndDlg, (i + 2000), db_get_b(NULL, MODULE, str, 0) ? BST_CHECKED : BST_UNCHECKED);
}
@@ -500,13 +500,13 @@ INT_PTR CALLBACK DlgProcAutoDisableOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "p%d", i);
+ mir_snprintf(str, "p%d", i);
db_set_b(NULL, MODULE, str, IsDlgButtonChecked(hwndDlg, i));
}
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++) {
char str[8];
- mir_snprintf(str, SIZEOF(str), "s%d", i);
+ mir_snprintf(str, "s%d", i);
db_set_b(NULL, MODULE, str, IsDlgButtonChecked(hwndDlg, i + 2000));
}
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index e39af13d61..88bb66a8e7 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -172,7 +172,7 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc) case TYPE_JABBER_ACTIVITY:
DBVARIANT dbv;
char szSetting[64];
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
+ mir_snprintf(szSetting, "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
if (!db_get_s(xsc->hContact, "AdvStatus", szSetting, &dbv)) {
hIcon = Skin_GetIcon(dbv.pszVal);
db_free(&dbv);
@@ -235,7 +235,7 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc) switch (xsc->type) {
case TYPE_JABBER_MOOD:
case TYPE_JABBER_ACTIVITY:
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
+ mir_snprintf(szSetting, "%s/%s/icon", xsc->szProto, (xsc->type == TYPE_JABBER_MOOD) ? "mood" : "activity");
if (!db_get_s(xsc->hContact, "AdvStatus", szSetting, &dbv)) {
hIcon = Skin_GetIcon(dbv.pszVal);
db_free(&dbv);
@@ -351,7 +351,7 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) BOOL bEnablePopup = true, bEnableSound = true, bEnableLog = opt.XLogToDB;
char buff[12] = { 0 };
- mir_snprintf(buff, SIZEOF(buff), "%d", ID_STATUS_EXTRASTATUS);
+ mir_snprintf(buff, "%d", ID_STATUS_EXTRASTATUS);
if ((db_get_b(0, MODULE, buff, 1) == 0)
|| (db_get_w(xsc->hContact, xsc->szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
|| (!opt.HiddenContactsToo && (db_get_b(xsc->hContact, "CList", "Hidden", 0) == 1))
@@ -452,7 +452,7 @@ TCHAR* GetJabberAdvStatusText(MCONTACT hContact, char *szProto, char *szSlot, ch char szSetting[128];
buff[0] = 0;
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
+ mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ts(hContact, "AdvStatus", szSetting, &dbv)) {
_tcsncpy(buff, dbv.ptszVal, bufflen);
buff[bufflen - 1] = 0;
|