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/StatusPlugins | |
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/StatusPlugins')
7 files changed, 22 insertions, 22 deletions
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index c96098bc38..08a79a64d9 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -141,13 +141,13 @@ void LoadOptions(TAAAProtoSettingList &loadSettings, BOOL override) int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName)
{
char setting[128];
- mir_snprintf(setting, SIZEOF(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, "%s_OptionFlags", protoName);
autoAwaySetting.optionFlags = db_get_w(NULL, MODULENAME, setting, FLAG_LV2ONINACTIVE | FLAG_RESET);
- mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, "%s_AwayTime", protoName);
autoAwaySetting.awayTime = db_get_w(NULL, MODULENAME, setting, SETTING_AWAYTIME_DEFAULT);
- mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, "%s_NATime", protoName);
autoAwaySetting.naTime = db_get_w(NULL, MODULENAME, setting, SETTING_NATIME_DEFAULT);
- mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, "%s_StatusFlags", protoName);
autoAwaySetting.statusFlags = db_get_w(NULL, MODULENAME, setting, StatusModeToProtoFlag(ID_STATUS_ONLINE) | StatusModeToProtoFlag(ID_STATUS_FREECHAT));
int flags;
@@ -155,9 +155,9 @@ int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName) flags = 0xFFFFFF;
else
flags = CallProtoService(protoName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, "%s_Lv1Status", protoName);
autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY)) ? ID_STATUS_AWAY : ID_STATUS_OFFLINE);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, "%s_Lv2Status", protoName);
autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA)) ? ID_STATUS_NA : ID_STATUS_OFFLINE);
return 0;
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp index cdc9c8e603..04be013089 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -34,17 +34,17 @@ static BOOL bSettingSame = FALSE; static int WriteAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName)
{
char setting[128];
- mir_snprintf(setting, SIZEOF(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, "%s_OptionFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.optionFlags);
- mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, "%s_AwayTime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.awayTime);
- mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, "%s_NATime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.naTime);
- mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, "%s_StatusFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.statusFlags);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, "%s_Lv1Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv1Status);
- mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, "%s_Lv2Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv2Status);
return 0;
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 06de929df4..64d1a63444 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -812,7 +812,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP char setting[128];
int i, oldCount = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0);
for (i=0; i < oldCount; i++) {
- mir_snprintf(setting, SIZEOF(setting), "%d_", i);
+ mir_snprintf(setting, "%d_", i);
ClearDatabase(setting);
}
for (i=0; i < arProfiles.getCount(); i++) {
@@ -828,7 +828,7 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP TSettingsList& ar = *po.ps;
for (int j=0; j < ar.getCount(); j++) {
if ( ar[j].szMsg != NULL ) {
- mir_snprintf(setting, SIZEOF(setting), "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
+ mir_snprintf(setting, "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG);
db_set_ts(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg);
}
db_set_w(NULL, MODULENAME, OptName(i, ar[j].szName), ar[j].status);
@@ -955,6 +955,6 @@ static int DeleteSetting(const char *szSetting,LPARAM lParam) char* OptName(int i, const char* setting)
{
static char buf[100];
- mir_snprintf(buf, SIZEOF(buf), "%d_%s", i, setting);
+ mir_snprintf(buf, "%d_%s", i, setting);
return buf;
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 3a7421957f..25c0e0bffd 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -161,7 +161,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; char setting[80]; - mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, SETTING_PROFILENAME); + mir_snprintf(setting, "%d_%s", profile, SETTING_PROFILENAME); if ( db_get_ts(NULL, MODULENAME, setting, &dbv)) return -1; @@ -264,7 +264,7 @@ INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam) profile = (profile >= 0)?profile:db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); char setting[64]; - mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG); + mir_snprintf(setting, "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG); if (!db_get_b(NULL, MODULENAME, setting, 0)) CallService(MS_CS_SETSTATUSEX,(WPARAM)&profileSettings, 0); else diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index aa2bba706e..b126018a9a 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -47,14 +47,14 @@ TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa) // load status
char setting[80];
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", profile, pa->szModuleName);
+ mir_snprintf(setting, "%d_%s", profile, pa->szModuleName);
int iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
status = iStatus;
// load last status
- mir_snprintf(setting, SIZEOF(setting), "%s%s", PREFIX_LAST, szName);
+ mir_snprintf(setting, "%s%s", PREFIX_LAST, szName);
iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index 70d702f215..6fc5b99823 100644 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp @@ -55,12 +55,12 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam) ttb.pszService = MS_SS_LOADANDSETPROFILE;
for (int i=0; i < profileCount; i++) {
char setting[80];
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
+ mir_snprintf(setting, "%d_%s", i, SETTING_CREATETTBBUTTON);
if (!db_get_b(NULL, MODULENAME, setting, FALSE))
continue;
DBVARIANT dbv;
- mir_snprintf(setting, SIZEOF(setting), "%d_%s", i, SETTING_PROFILENAME);
+ mir_snprintf(setting, "%d_%s", i, SETTING_PROFILENAME);
if (db_get(NULL, MODULENAME, setting, &dbv))
continue;
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 3feff7a963..543bbc0f20 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -69,7 +69,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
TCHAR desc[512];
- mir_sntprintf(desc, SIZEOF(desc), TranslateT("Set %s message for %s."),
+ mir_sntprintf(desc, TranslateT("Set %s message for %s."),
pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName);
SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc);
}
|