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/StatusPlugins | |
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/StatusPlugins')
-rw-r--r-- | plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp | 12 | ||||
-rw-r--r-- | plugins/StatusPlugins/AdvancedAutoAway/options.cpp | 12 | ||||
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 8 | ||||
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/options.cpp | 4 | ||||
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/options.cpp | 6 | ||||
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/profiles.cpp | 12 | ||||
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/startupstatus.cpp | 10 | ||||
-rw-r--r-- | plugins/StatusPlugins/StartupStatus/toolbars.cpp | 4 |
8 files changed, 34 insertions, 34 deletions
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index 33b130e1e7..5e08e14a20 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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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, SIZEOF(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 c4d58d1747..97c5bf9675 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, SIZEOF(setting), "%s_OptionFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.optionFlags);
- mir_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_AwayTime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.awayTime);
- mir_snprintf(setting, sizeof(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_NATime", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.naTime);
- mir_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_StatusFlags", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.statusFlags);
- mir_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_Lv1Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv1Status);
- mir_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, SIZEOF(setting), "%s_Lv2Status", protoName);
db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv2Status);
return 0;
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 163e48f237..f21f169ae5 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -215,7 +215,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH EnterCriticalSection(&GenStatusCS); char dbSetting[128]; - mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", cs->szName); + mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", cs->szName); cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus; if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) cs->status = ID_STATUS_DISABLED; @@ -526,7 +526,7 @@ static int ProcessProtoAck(WPARAM,LPARAM lParam) return 0; char dbSetting[128]; - mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", ack->szModule); + mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", ack->szModule); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return 0; @@ -1060,7 +1060,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) return -1; char dbSetting[128]; - mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled return -1; @@ -1087,7 +1087,7 @@ INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam) char *szProto = (char *)lParam; char dbSetting[128]; - mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return FALSE; diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index a4611dd7bf..eb02862138 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -71,7 +71,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L ListView_InsertItem(hList,&lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE));
lvItem.iItem++;
}
@@ -152,7 +152,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L ListView_GetItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", (char *)lvItem.lParam);
db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 21f84acbc3..8661aa7d02 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -816,7 +816,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, SIZEOF(setting), "%d_", i);
ClearDatabase(setting);
}
for (i=0; i < arProfiles.getCount(); i++) {
@@ -832,7 +832,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, SIZEOF(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);
@@ -959,6 +959,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, SIZEOF(buf), "%d_%s", i, setting);
return buf;
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 33ffb03994..c8a909bacf 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -107,7 +107,7 @@ static int CreateMainMenuItems(WPARAM wParam, LPARAM lParam) mi.ptszName = profilename; mi.position = 2000100000 + mcount; - mir_snprintf(servicename, sizeof(servicename), "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); + mir_snprintf(servicename, SIZEOF(servicename), "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); switch(mcount) { case 0: hProfileServices[mcount] = CreateServiceFunction(servicename, profileService0); @@ -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, SIZEOF(setting), "%d_%s", profile, SETTING_PROFILENAME); if ( db_get_ts(NULL, MODULENAME, setting, &dbv)) return -1; @@ -190,7 +190,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) for ( int i=0; i < pceCount; i++ ) { if ( (pce[i].profile == profile) && (!strcmp(pce[i].szProto, szProto))) { - mir_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + mir_snprintf(dbSetting, SIZEOF(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(_tcslen(dbv.ptszVal)+1)); if (pce[i].msg != NULL) { @@ -214,7 +214,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) pce[pceCount].profile = profile; pce[pceCount].szProto = _strdup(szProto); pce[pceCount].msg = NULL; - mir_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + mir_snprintf(dbSetting, SIZEOF(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { pce[pceCount].msg = _tcsdup(dbv.ptszVal); db_free(&dbv); @@ -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, SIZEOF(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG); if (!db_get_b(NULL, MODULENAME, setting, 0)) CallService(MS_CS_SETSTATUSEX,(WPARAM)&profileSettings, 0); else @@ -339,7 +339,7 @@ static int RegisterHotKeys() return -1; char atomname[255]; - mir_snprintf(atomname, sizeof(atomname), "StatusProfile_%d", i); + mir_snprintf(atomname, SIZEOF(atomname), "StatusProfile_%d", i); hkInfo[hkiCount].id = GlobalAddAtomA(atomname); if (hkInfo[hkiCount].id == 0) continue; diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index 9065e97b43..95308ac959 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, SIZEOF(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, SIZEOF(setting), "%s%s", PREFIX_LAST, szName);
iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if (iStatus < MIN_STATUS || iStatus > MAX_STATUS)
iStatus = DEFAULT_STATUS;
@@ -168,7 +168,7 @@ static void SetLastStatusMessages(TSettingsList &ps) continue;
char dbSetting[128];
- mir_snprintf(dbSetting, sizeof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
+ mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
@@ -301,9 +301,9 @@ static int OnOkToExit(WPARAM, LPARAM) continue;
char lastName[128], lastMsg[128];
- mir_snprintf(lastName, sizeof(lastName), "%s%s", PREFIX_LAST, pa->szModuleName);
+ mir_snprintf(lastName, SIZEOF(lastName), "%s%s", PREFIX_LAST, pa->szModuleName);
db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
- mir_snprintf(lastMsg, sizeof(lastMsg), "%s%s", PREFIX_LASTMSG, pa->szModuleName);
+ mir_snprintf(lastMsg, SIZEOF(lastMsg), "%s%s", PREFIX_LASTMSG, pa->szModuleName);
db_unset(NULL, MODULENAME, lastMsg);
if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG))
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index c88ba01b8c..70d702f215 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, SIZEOF(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, SIZEOF(setting), "%d_%s", i, SETTING_PROFILENAME);
if (db_get(NULL, MODULENAME, setting, &dbv))
continue;
|