From b7c74cd5b22618d544a3f4ae124985d4837e3a22 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2015 22:12:13 +0000 Subject: new mir_snprintf templates without SIZEOF git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/src/alarm_win.cpp | 2 +- plugins/Alarms/src/alarmlist.cpp | 78 +++++------ plugins/AssocMgr/src/assoclist.cpp | 16 +-- plugins/AvatarHistory/src/utils.cpp | 2 +- plugins/BasicHistory/src/Options.cpp | 154 ++++++++++----------- plugins/CSList/src/cslist.cpp | 2 +- plugins/Clist_blind/src/cluiopts.cpp | 4 +- plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp | 4 +- plugins/Clist_modern/src/modern_clcitems.cpp | 2 +- plugins/Clist_modern/src/modern_clcopts.cpp | 18 +-- plugins/Clist_modern/src/modern_clcutils.cpp | 2 +- plugins/Clist_modern/src/modern_clistopts.cpp | 4 +- plugins/Clist_modern/src/modern_clui.cpp | 6 +- plugins/Clist_modern/src/modern_log.cpp | 2 +- plugins/Clist_modern/src/modern_newrowopts.cpp | 4 +- plugins/Clist_modern/src/modern_skinengine.cpp | 46 +++--- plugins/Clist_modern/src/modern_statusbar.cpp | 20 +-- .../Clist_modern/src/modern_statusbar_options.cpp | 18 +-- plugins/Clist_modern/src/modern_toolbar.cpp | 4 +- plugins/Clist_modern/src/modern_viewmodebar.cpp | 52 +++---- plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 4 +- plugins/Clist_nicer/src/clcitems.cpp | 2 +- plugins/Clist_nicer/src/clui.cpp | 6 +- plugins/Clist_nicer/src/cluiopts.cpp | 4 +- plugins/Clist_nicer/src/extBackg.cpp | 56 ++++---- plugins/Clist_nicer/src/viewmodes.cpp | 48 +++---- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 28 ++-- plugins/CrashDumper/src/exhndlr.cpp | 2 +- plugins/CrashDumper/src/upload.cpp | 8 +- plugins/Db3x_mmap/src/dbcontacts.cpp | 4 +- plugins/DbEditorPP/src/addeditsettingsdlg.cpp | 2 +- plugins/DbEditorPP/src/exportimport.cpp | 2 +- plugins/DbEditorPP/src/findwindow.cpp | 6 +- plugins/DbEditorPP/src/settinglist.cpp | 6 +- plugins/DbEditorPP/src/watchedvars.cpp | 2 +- plugins/Db_autobackups/src/backup.cpp | 2 +- plugins/Dropbox/src/dropbox_services.cpp | 2 +- plugins/FTPFileYM/src/job_delete.cpp | 8 +- plugins/FTPFileYM/src/job_upload.cpp | 20 +-- plugins/FTPFileYM/src/manager.cpp | 2 +- plugins/FTPFileYM/src/mir_db.cpp | 22 +-- plugins/FTPFileYM/src/serverlist.cpp | 2 +- plugins/FTPFileYM/src/utils.cpp | 4 +- plugins/FavContacts/src/http_api.cpp | 2 +- plugins/FileAsMessage/src/dialog.cpp | 4 +- plugins/HTTPServer/src/GuiElements.cpp | 16 +-- plugins/HTTPServer/src/main.cpp | 2 +- plugins/IEView/src/ChatHTMLBuilder.cpp | 10 +- plugins/IEView/src/HTMLBuilder.cpp | 4 +- plugins/IEView/src/HistoryHTMLBuilder.cpp | 14 +- plugins/IEView/src/MUCCHTMLBuilder.cpp | 10 +- plugins/IEView/src/ScriverHTMLBuilder.cpp | 10 +- plugins/IEView/src/TabSRMMHTMLBuilder.cpp | 10 +- plugins/ListeningTo/src/listeningto.cpp | 4 +- plugins/LotusNotify/src/LotusNotify.cpp | 4 +- plugins/MenuItemEx/src/main.cpp | 4 +- plugins/MirOTR/src/utils.cpp | 2 +- plugins/Msg_Export/src/options.cpp | 2 +- plugins/Msg_Export/src/utils.cpp | 2 +- plugins/NewXstatusNotify/src/main.cpp | 6 +- plugins/NewXstatusNotify/src/options.cpp | 16 +-- plugins/NewXstatusNotify/src/xstatus.cpp | 8 +- plugins/New_GPG/src/utilities.cpp | 24 ++-- plugins/NewsAggregator/Src/Authentication.cpp | 2 +- plugins/Non-IM Contact/src/contactinfo.cpp | 20 +-- plugins/Non-IM Contact/src/files.cpp | 36 ++--- plugins/Non-IM Contact/src/namereplacing.cpp | 2 +- plugins/Non-IM Contact/src/timer.cpp | 4 +- plugins/NotesAndReminders/src/options.cpp | 2 +- plugins/NotesAndReminders/src/reminders.cpp | 16 +-- plugins/Nudge/src/main.cpp | 2 +- plugins/PackUpdater/Src/Options.cpp | 12 +- plugins/Ping/src/pinggraph.cpp | 16 +-- plugins/Ping/src/pinglist.cpp | 6 +- plugins/Ping/src/rawping.cpp | 2 +- plugins/Ping/src/utils.cpp | 14 +- plugins/PluginUpdater/src/Notifications.cpp | 2 +- plugins/PluginUpdater/src/Options.cpp | 8 +- plugins/Popup/src/font.cpp | 4 +- plugins/Popup/src/notifications.cpp | 28 ++-- plugins/Popup/src/opt_class.cpp | 20 +-- plugins/Popup/src/services.cpp | 4 +- plugins/Popup/src/skin.cpp | 6 +- plugins/QuickContacts/src/quickcontacts.cpp | 4 +- plugins/RecentContacts/src/options.cpp | 2 +- plugins/RemovePersonalSettings/src/rps.cpp | 4 +- plugins/Scriver/src/msgdialog.cpp | 2 +- plugins/Scriver/src/msgoptions.cpp | 20 +-- plugins/SecureIM/src/options.cpp | 2 +- plugins/SecureIM/src/svcs_rsa.cpp | 2 +- plugins/SeenPlugin/src/options.cpp | 4 +- plugins/SeenPlugin/src/utils.cpp | 8 +- plugins/Sessions/Src/Main.cpp | 4 +- plugins/Sessions/Src/Utils.cpp | 10 +- plugins/SimpleStatusMsg/src/main.cpp | 70 +++++----- plugins/SimpleStatusMsg/src/msgbox.cpp | 38 ++--- plugins/SimpleStatusMsg/src/options.cpp | 66 ++++----- plugins/SimpleStatusMsg/src/utils.cpp | 8 +- plugins/SmileyAdd/src/smileys.cpp | 2 +- .../AdvancedAutoAway/advancedautoaway.cpp | 12 +- plugins/StatusPlugins/AdvancedAutoAway/options.cpp | 12 +- plugins/StatusPlugins/StartupStatus/options.cpp | 6 +- plugins/StatusPlugins/StartupStatus/profiles.cpp | 4 +- .../StatusPlugins/StartupStatus/startupstatus.cpp | 4 +- plugins/StatusPlugins/StartupStatus/toolbars.cpp | 4 +- plugins/StatusPlugins/confirmdialog.cpp | 2 +- plugins/TabSRMM/src/chat/options.cpp | 18 +-- plugins/TabSRMM/src/container.cpp | 12 +- plugins/TabSRMM/src/msgdlgutils.cpp | 2 +- plugins/TabSRMM/src/msglog.cpp | 2 +- plugins/TabSRMM/src/themeio.cpp | 30 ++-- plugins/TipperYM/src/options.cpp | 56 ++++---- plugins/TipperYM/src/subst.cpp | 4 +- plugins/TopToolBar/src/toolbar.cpp | 6 +- .../src/ex_import/classExImContactBase.cpp | 8 +- plugins/UserInfoEx/src/ex_import/tinyxml.cpp | 10 +- plugins/UserInfoEx/src/svc_contactinfo.cpp | 2 +- plugins/Variables/src/help.cpp | 4 +- plugins/WhenWasIt/src/icons.cpp | 2 +- plugins/WhenWasIt/src/utils.cpp | 4 +- plugins/XSoundNotify/src/xsn_main.cpp | 2 +- plugins/YAMN/src/browser/mailbrowser.cpp | 6 +- plugins/YAMN/src/proto/netlib.cpp | 2 +- plugins/YAPP/src/options.cpp | 10 +- plugins/YAPP/src/services.cpp | 6 +- plugins/YahooGroups/src/services.cpp | 6 +- plugins/YahooGroups/src/utils.cpp | 4 +- 127 files changed, 764 insertions(+), 764 deletions(-) (limited to 'plugins') diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index 50d487328a..0eadf15e1d 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (data && data->action & AAF_SOUND) { if (data->sound_num <= 3) { char buff[128]; - mir_snprintf(buff, SIZEOF(buff), "Triggered%d", data->sound_num); + mir_snprintf(buff, "Triggered%d", data->sound_num); SkinPlaySound(buff); } else if (data->sound_num == 4) { diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 71e5171469..0c0d224de1 100644 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -189,38 +189,38 @@ void LoadAlarms() { for(int i = 0; i < num_alarms; i++) { memset(&alarm, 0, sizeof(ALARM)); - mir_snprintf(buff, SIZEOF(buff), "Title%d", i); + mir_snprintf(buff, "Title%d", i); if (!db_get_ts(0, MODULE, buff, &dbv)) { alarm.szTitle = mir_tstrdup(dbv.ptszVal); db_free(&dbv); } - mir_snprintf(buff, SIZEOF(buff), "Desc%d", i); + mir_snprintf(buff, "Desc%d", i); if (!db_get_ts(0, MODULE, buff, &dbv)) { alarm.szDesc = mir_tstrdup(dbv.ptszVal); db_free(&dbv); } - mir_snprintf(buff, SIZEOF(buff), "Occ%d", i); + mir_snprintf(buff, "Occ%d", i); alarm.occurrence = (Occurrence)db_get_w(0, MODULE, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "STHour%d", i); + mir_snprintf(buff, "STHour%d", i); alarm.time.wHour = db_get_w(0, MODULE, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "STMinute%d", i); + mir_snprintf(buff, "STMinute%d", i); alarm.time.wMinute = db_get_w(0, MODULE, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "STSecond%d", i); + mir_snprintf(buff, "STSecond%d", i); alarm.time.wSecond = db_get_w(0, MODULE, buff, 0); switch(alarm.occurrence) { case OC_ONCE: - mir_snprintf(buff, SIZEOF(buff), "STYear%d", i); + mir_snprintf(buff, "STYear%d", i); alarm.time.wYear = db_get_w(0, MODULE, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "STMonth%d", i); + mir_snprintf(buff, "STMonth%d", i); alarm.time.wMonth = db_get_w(0, MODULE, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "STDay%d", i); + mir_snprintf(buff, "STDay%d", i); alarm.time.wDay = db_get_w(0, MODULE, buff, 0); break; case OC_WEEKLY: - mir_snprintf(buff, SIZEOF(buff), "STDayOfWeek%d", i); + mir_snprintf(buff, "STDayOfWeek%d", i); alarm.time.wDayOfWeek = db_get_w(0, MODULE, buff, 0); break; case OC_WEEKDAYS: @@ -228,26 +228,26 @@ void LoadAlarms() { case OC_DAILY: break; case OC_MONTHLY: - mir_snprintf(buff, SIZEOF(buff), "STDay%d", i); + mir_snprintf(buff, "STDay%d", i); alarm.time.wDay = db_get_w(0, MODULE, buff, 0); break; case OC_YEARLY: - mir_snprintf(buff, SIZEOF(buff), "STMonth%d", i); + mir_snprintf(buff, "STMonth%d", i); alarm.time.wMonth = db_get_w(0, MODULE, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "STDay%d", i); + mir_snprintf(buff, "STDay%d", i); alarm.time.wDay = db_get_w(0, MODULE, buff, 0); break; } if (UpdateAlarm(alarm.time, alarm.occurrence)) { - mir_snprintf(buff, SIZEOF(buff), "ActionFlags%d", i); + mir_snprintf(buff, "ActionFlags%d", i); alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND); if (alarm.action & AAF_COMMAND) { - mir_snprintf(buff, SIZEOF(buff), "ActionCommand%d", i); + mir_snprintf(buff, "ActionCommand%d", i); if (!db_get_ts(0, MODULE, buff, &dbv)) { alarm.szCommand = mir_tstrdup(dbv.ptszVal); db_free(&dbv); - mir_snprintf(buff, SIZEOF(buff), "ActionParams%d", i); + mir_snprintf(buff, "ActionParams%d", i); if (!db_get_ts(0, MODULE, buff, &dbv)) { alarm.szCommandParams = mir_tstrdup(dbv.ptszVal); db_free(&dbv); @@ -255,22 +255,22 @@ void LoadAlarms() { } } - mir_snprintf(buff, SIZEOF(buff), "SoundNum%d", i); + mir_snprintf(buff, "SoundNum%d", i); alarm.sound_num = (int)db_get_b(0, MODULE, buff, 1); - mir_snprintf(buff, SIZEOF(buff), "Snoozer%d", i); + mir_snprintf(buff, "Snoozer%d", i); alarm.snoozer = db_get_b(0, MODULE, buff, 0) == 1; - mir_snprintf(buff, SIZEOF(buff), "Hidden%d", i); + mir_snprintf(buff, "Hidden%d", i); alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_HIDDEN : 0); - mir_snprintf(buff, SIZEOF(buff), "Suspended%d", i); + mir_snprintf(buff, "Suspended%d", i); alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_SUSPENDED : 0); - mir_snprintf(buff, SIZEOF(buff), "NoStartup%d", i); + mir_snprintf(buff, "NoStartup%d", i); alarm.flags |= (db_get_b(0, MODULE, buff, 0) == 1 ? ALF_NOSTARTUP : 0); - mir_snprintf(buff, SIZEOF(buff), "Flags%d", i); + mir_snprintf(buff, "Flags%d", i); alarm.flags = db_get_dw(0, MODULE, buff, alarm.flags); alarm.id = next_alarm_id++; @@ -288,18 +288,18 @@ void SaveAlarms() { ALARM *i; for(alarms.reset(); i = alarms.current(); alarms.next(), index++) { - mir_snprintf(buff, SIZEOF(buff), "Title%d", index); + mir_snprintf(buff, "Title%d", index); db_set_ts(0, MODULE, buff, i->szTitle); - mir_snprintf(buff, SIZEOF(buff), "Desc%d", index); + mir_snprintf(buff, "Desc%d", index); db_set_ts(0, MODULE, buff, i->szDesc); - mir_snprintf(buff, SIZEOF(buff), "Occ%d", index); + mir_snprintf(buff, "Occ%d", index); db_set_w(0, MODULE, buff, i->occurrence); - mir_snprintf(buff, SIZEOF(buff), "STHour%d", index); + mir_snprintf(buff, "STHour%d", index); db_set_w(0, MODULE, buff, i->time.wHour); - mir_snprintf(buff, SIZEOF(buff), "STMinute%d", index); + mir_snprintf(buff, "STMinute%d", index); db_set_w(0, MODULE, buff, i->time.wMinute); - mir_snprintf(buff, SIZEOF(buff), "STSecond%d", index); + mir_snprintf(buff, "STSecond%d", index); db_set_w(0, MODULE, buff, i->time.wSecond); switch(i->occurrence) { @@ -308,41 +308,41 @@ void SaveAlarms() { case OC_WEEKDAYS: break; case OC_WEEKLY: - mir_snprintf(buff, SIZEOF(buff), "STDayOfWeek%d", index); + mir_snprintf(buff, "STDayOfWeek%d", index); db_set_w(0, MODULE, buff, i->time.wDayOfWeek); break; case OC_ONCE: - mir_snprintf(buff, SIZEOF(buff), "STYear%d", index); + mir_snprintf(buff, "STYear%d", index); db_set_w(0, MODULE, buff, i->time.wYear); case OC_YEARLY: - mir_snprintf(buff, SIZEOF(buff), "STMonth%d", index); + mir_snprintf(buff, "STMonth%d", index); db_set_w(0, MODULE, buff, i->time.wMonth); case OC_MONTHLY: - mir_snprintf(buff, SIZEOF(buff), "STDay%d", index); + mir_snprintf(buff, "STDay%d", index); db_set_w(0, MODULE, buff, i->time.wDay); break; } - mir_snprintf(buff, SIZEOF(buff), "ActionFlags%d", index); + mir_snprintf(buff, "ActionFlags%d", index); db_set_dw(0, MODULE, buff, i->action); if (i->action & AAF_COMMAND) { if (mir_tstrlen(i->szCommand)) { - mir_snprintf(buff, SIZEOF(buff), "ActionCommand%d", index); + mir_snprintf(buff, "ActionCommand%d", index); db_set_ts(0, MODULE, buff, i->szCommand); if (mir_tstrlen(i->szCommandParams)) { - mir_snprintf(buff, SIZEOF(buff), "ActionParams%d", index); + mir_snprintf(buff, "ActionParams%d", index); db_set_ts(0, MODULE, buff, i->szCommandParams); } } } - mir_snprintf(buff, SIZEOF(buff), "SoundNum%d", index); + mir_snprintf(buff, "SoundNum%d", index); db_set_b(0, MODULE, buff, i->sound_num); - mir_snprintf(buff, SIZEOF(buff), "Snoozer%d", index); + mir_snprintf(buff, "Snoozer%d", index); db_set_b(0, MODULE, buff, i->snoozer ? 1 : 0); - mir_snprintf(buff, SIZEOF(buff), "Flags%d", index); + mir_snprintf(buff, "Flags%d", index); db_set_dw(0, MODULE, buff, i->flags); } db_set_w(0, MODULE, "Count", index); @@ -521,7 +521,7 @@ void DoAlarm(ALARM *alarm) if (alarm->action & AAF_SOUND) { if (alarm->sound_num > 0 && alarm->sound_num <= 3) { char buff[128]; - mir_snprintf(buff, SIZEOF(buff), "Triggered%d", alarm->sound_num); + mir_snprintf(buff, "Triggered%d", alarm->sound_num); SkinPlaySound(buff); } else if (alarm->sound_num == 4) { if (alarm->szTitle != NULL && alarm->szTitle[0] != '\0') { diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 08616eb610..e85385a2f5 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -50,7 +50,7 @@ static mir_cs csAssocList; static BOOL IsAssocEnabled(const ASSOCDATA *assoc) { char szSetting[MAXMODULELABELLENGTH]; - mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName); + mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName); return db_get_b(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0; } @@ -58,13 +58,13 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) { char szSetting[MAXMODULELABELLENGTH]; TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH]; - mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName); + mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName); db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled); /* dll name for uninstall */ if(assoc->hInstance!= NULL && assoc->hInstance!= hInst && assoc->hInstance!= GetModuleHandle(NULL)) if( GetModuleFileName(assoc->hInstance, szBuf, SIZEOF(szBuf))) if( PathToRelativeT(szBuf, szDLL)) { - mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", assoc->pszClassName); + mir_snprintf(szSetting, "module_%s", assoc->pszClassName); db_set_ts(NULL, "AssocMgr", szSetting, szDLL); } } @@ -72,10 +72,10 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) static void DeleteAssocEnabledSetting(const ASSOCDATA *assoc) { char szSetting[MAXMODULELABELLENGTH]; - mir_snprintf(szSetting, SIZEOF(szSetting), "enabled_%s", assoc->pszClassName); + mir_snprintf(szSetting, "enabled_%s", assoc->pszClassName); db_unset(NULL, "AssocMgr", szSetting); /* dll name for uninstall */ - mir_snprintf(szSetting, SIZEOF(szSetting), "module_%s", assoc->pszClassName); + mir_snprintf(szSetting, "module_%s", assoc->pszClassName); db_unset(NULL, "AssocMgr", szSetting); } @@ -94,7 +94,7 @@ void CleanupAssocEnabledSettings(void) mir_cslock lck(csAssocList); for(i = 0;i::iterator it = customFilters[i].events.begin(); it != customFilters[i].events.end(); ++it) { @@ -478,7 +478,7 @@ void Options::Save() events += ";"; } - mir_snprintf(buf, SIZEOF(buf), "filterEvents_%d", i); + mir_snprintf(buf, "filterEvents_%d", i); db_set_s(0, MODULE, buf, events.c_str()); } @@ -507,54 +507,54 @@ void Options::SaveTasks(std::list* tasks) int i = 0; char buf[256]; for (std::list::iterator it = tasks->begin(); it != tasks->end(); ++it) { - mir_snprintf(buf, SIZEOF(buf), "Task_compress_%d", i); + mir_snprintf(buf, "Task_compress_%d", i); db_set_b(0, MODULE, buf, it->compress); - mir_snprintf(buf, SIZEOF(buf), "Task_useFtp_%d", i); + mir_snprintf(buf, "Task_useFtp_%d", i); db_set_b(0, MODULE, buf, it->useFtp); - mir_snprintf(buf, SIZEOF(buf), "Task_isSystem_%d", i); + mir_snprintf(buf, "Task_isSystem_%d", i); db_set_b(0, MODULE, buf, it->isSystem); - mir_snprintf(buf, SIZEOF(buf), "Task_active_%d", i); + mir_snprintf(buf, "Task_active_%d", i); db_set_b(0, MODULE, buf, it->active); - mir_snprintf(buf, SIZEOF(buf), "Task_exportImported_%d", i); + mir_snprintf(buf, "Task_exportImported_%d", i); db_set_b(0, MODULE, buf, it->exportImported); - mir_snprintf(buf, SIZEOF(buf), "Task_type_%d", i); + mir_snprintf(buf, "Task_type_%d", i); db_set_b(0, MODULE, buf, it->type); - mir_snprintf(buf, SIZEOF(buf), "Task_eventUnit_%d", i); + mir_snprintf(buf, "Task_eventUnit_%d", i); db_set_b(0, MODULE, buf, it->eventUnit); - mir_snprintf(buf, SIZEOF(buf), "Task_trigerType_%d", i); + mir_snprintf(buf, "Task_trigerType_%d", i); db_set_b(0, MODULE, buf, it->trigerType); - mir_snprintf(buf, SIZEOF(buf), "Task_exportType_%d", i); + mir_snprintf(buf, "Task_exportType_%d", i); db_set_b(0, MODULE, buf, it->exportType); - mir_snprintf(buf, SIZEOF(buf), "Task_importType_%d", i); + mir_snprintf(buf, "Task_importType_%d", i); db_set_b(0, MODULE, buf, it->importType); - mir_snprintf(buf, SIZEOF(buf), "Task_eventDeltaTime_%d", i); + mir_snprintf(buf, "Task_eventDeltaTime_%d", i); db_set_dw(0, MODULE, buf, it->eventDeltaTime); - mir_snprintf(buf, SIZEOF(buf), "Task_filterId_%d", i); + mir_snprintf(buf, "Task_filterId_%d", i); db_set_dw(0, MODULE, buf, it->filterId); - mir_snprintf(buf, SIZEOF(buf), "Task_dayTime_%d", i); + mir_snprintf(buf, "Task_dayTime_%d", i); db_set_dw(0, MODULE, buf, it->dayTime); - mir_snprintf(buf, SIZEOF(buf), "Task_dayOfWeek_%d", i); + mir_snprintf(buf, "Task_dayOfWeek_%d", i); db_set_dw(0, MODULE, buf, it->dayOfWeek); - mir_snprintf(buf, SIZEOF(buf), "Task_dayOfMonth_%d", i); + mir_snprintf(buf, "Task_dayOfMonth_%d", i); db_set_dw(0, MODULE, buf, it->dayOfMonth); - mir_snprintf(buf, SIZEOF(buf), "Task_deltaTime_%d", i); + mir_snprintf(buf, "Task_deltaTime_%d", i); db_set_dw(0, MODULE, buf, it->deltaTime); - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i); + mir_snprintf(buf, "Task_lastExport_low_%d", i); db_set_dw(0, MODULE, buf, (int)it->lastExport); - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i); + mir_snprintf(buf, "Task_lastExport_hi_%d", i); db_set_dw(0, MODULE, buf, ((unsigned long long int)it->lastExport) >> 32); - mir_snprintf(buf, SIZEOF(buf), "Task_ftpName_%d", i); + mir_snprintf(buf, "Task_ftpName_%d", i); db_set_ws(0, MODULE, buf, it->ftpName.c_str()); - mir_snprintf(buf, SIZEOF(buf), "Task_filterName_%d", i); + mir_snprintf(buf, "Task_filterName_%d", i); db_set_ws(0, MODULE, buf, it->filterName.c_str()); - mir_snprintf(buf, SIZEOF(buf), "Task_filePath_%d", i); + mir_snprintf(buf, "Task_filePath_%d", i); db_set_ws(0, MODULE, buf, it->filePath.c_str()); - mir_snprintf(buf, SIZEOF(buf), "Task_taskName_%d", i); + mir_snprintf(buf, "Task_taskName_%d", i); db_set_ws(0, MODULE, buf, it->taskName.c_str()); - mir_snprintf(buf, SIZEOF(buf), "Task_zipPassword_%d", i); + mir_snprintf(buf, "Task_zipPassword_%d", i); db_set_s(0, MODULE, buf, it->zipPassword.c_str()); - mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i); + mir_snprintf(buf, "IsInTask_%d", i); for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) db_unset(hContact, MODULE, buf); @@ -568,48 +568,48 @@ void Options::SaveTasks(std::list* tasks) db_set_dw(0, MODULE, "Task_count", i); for (i = (int)tasks->size(); i < oldTaskNr; ++i) { - mir_snprintf(buf, SIZEOF(buf), "Task_compress_%d", i); + mir_snprintf(buf, "Task_compress_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_useFtp_%d", i); + mir_snprintf(buf, "Task_useFtp_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_isSystem_%d", i); + mir_snprintf(buf, "Task_isSystem_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_active_%d", i); + mir_snprintf(buf, "Task_active_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_type_%d", i); + mir_snprintf(buf, "Task_type_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_eventUnit_%d", i); + mir_snprintf(buf, "Task_eventUnit_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_trigerType_%d", i); + mir_snprintf(buf, "Task_trigerType_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_exportType_%d", i); + mir_snprintf(buf, "Task_exportType_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_eventDeltaTime_%d", i); + mir_snprintf(buf, "Task_eventDeltaTime_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_filterId_%d", i); + mir_snprintf(buf, "Task_filterId_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_dayTime_%d", i); + mir_snprintf(buf, "Task_dayTime_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_dayOfWeek_%d", i); + mir_snprintf(buf, "Task_dayOfWeek_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_dayOfMonth_%d", i); + mir_snprintf(buf, "Task_dayOfMonth_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_deltaTime_%d", i); + mir_snprintf(buf, "Task_deltaTime_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i); + mir_snprintf(buf, "Task_lastExport_low_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i); + mir_snprintf(buf, "Task_lastExport_hi_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_ftpName_%d", i); + mir_snprintf(buf, "Task_ftpName_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_filterName_%d", i); + mir_snprintf(buf, "Task_filterName_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_filePath_%d", i); + mir_snprintf(buf, "Task_filePath_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "Task_taskName_%d", i); + mir_snprintf(buf, "Task_taskName_%d", i); db_unset(NULL, MODULE, buf); - mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i); + mir_snprintf(buf, "IsInTask_%d", i); for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) db_unset(hContact, MODULE, buf); } @@ -619,9 +619,9 @@ void Options::SaveTaskTime(TaskOptions& to) { int i = to.orderNr; char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i); + mir_snprintf(buf, "Task_lastExport_low_%d", i); db_set_dw(0, MODULE, buf, (int)to.lastExport); - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i); + mir_snprintf(buf, "Task_lastExport_hi_%d", i); db_set_dw(0, MODULE, buf, ((unsigned long long int)to.lastExport) >> 32); } @@ -631,71 +631,71 @@ void Options::LoadTasks() char buf[256]; for (int i = 0; i < taskCount; ++i) { TaskOptions to; - mir_snprintf(buf, SIZEOF(buf), "Task_compress_%d", i); + mir_snprintf(buf, "Task_compress_%d", i); to.compress = db_get_b(0, MODULE, buf, to.compress) != 0; - mir_snprintf(buf, SIZEOF(buf), "Task_useFtp_%d", i); + mir_snprintf(buf, "Task_useFtp_%d", i); to.useFtp = db_get_b(0, MODULE, buf, to.useFtp) != 0; - mir_snprintf(buf, SIZEOF(buf), "Task_isSystem_%d", i); + mir_snprintf(buf, "Task_isSystem_%d", i); to.isSystem = db_get_b(0, MODULE, buf, to.isSystem) != 0; - mir_snprintf(buf, SIZEOF(buf), "Task_active_%d", i); + mir_snprintf(buf, "Task_active_%d", i); to.active = db_get_b(0, MODULE, buf, to.active) != 0; - mir_snprintf(buf, SIZEOF(buf), "Task_exportImported_%d", i); + mir_snprintf(buf, "Task_exportImported_%d", i); to.exportImported = db_get_b(0, MODULE, buf, to.exportImported) != 0; - mir_snprintf(buf, SIZEOF(buf), "Task_type_%d", i); + mir_snprintf(buf, "Task_type_%d", i); to.type = (TaskOptions::TaskType)db_get_b(0, MODULE, buf, to.type); - mir_snprintf(buf, SIZEOF(buf), "Task_eventUnit_%d", i); + mir_snprintf(buf, "Task_eventUnit_%d", i); to.eventUnit = (TaskOptions::EventUnit)db_get_b(0, MODULE, buf, to.eventUnit); - mir_snprintf(buf, SIZEOF(buf), "Task_trigerType_%d", i); + mir_snprintf(buf, "Task_trigerType_%d", i); to.trigerType = (TaskOptions::TrigerType)db_get_b(0, MODULE, buf, to.trigerType); - mir_snprintf(buf, SIZEOF(buf), "Task_exportType_%d", i); + mir_snprintf(buf, "Task_exportType_%d", i); to.exportType = (IExport::ExportType)db_get_b(0, MODULE, buf, to.exportType); - mir_snprintf(buf, SIZEOF(buf), "Task_importType_%d", i); + mir_snprintf(buf, "Task_importType_%d", i); to.importType = (IImport::ImportType)db_get_b(0, MODULE, buf, to.importType); - mir_snprintf(buf, SIZEOF(buf), "Task_eventDeltaTime_%d", i); + mir_snprintf(buf, "Task_eventDeltaTime_%d", i); to.eventDeltaTime = db_get_dw(0, MODULE, buf, to.eventDeltaTime); - mir_snprintf(buf, SIZEOF(buf), "Task_filterId_%d", i); + mir_snprintf(buf, "Task_filterId_%d", i); to.filterId = db_get_dw(0, MODULE, buf, to.filterId); - mir_snprintf(buf, SIZEOF(buf), "Task_dayTime_%d", i); + mir_snprintf(buf, "Task_dayTime_%d", i); to.dayTime = db_get_dw(0, MODULE, buf, to.dayTime); - mir_snprintf(buf, SIZEOF(buf), "Task_dayOfWeek_%d", i); + mir_snprintf(buf, "Task_dayOfWeek_%d", i); to.dayOfWeek = db_get_dw(0, MODULE, buf, to.dayOfWeek); - mir_snprintf(buf, SIZEOF(buf), "Task_dayOfMonth_%d", i); + mir_snprintf(buf, "Task_dayOfMonth_%d", i); to.dayOfMonth = db_get_dw(0, MODULE, buf, to.dayOfMonth); - mir_snprintf(buf, SIZEOF(buf), "Task_deltaTime_%d", i); + mir_snprintf(buf, "Task_deltaTime_%d", i); to.deltaTime = db_get_dw(0, MODULE, buf, to.deltaTime); unsigned long long int le = to.lastExport; - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_low_%d", i); + mir_snprintf(buf, "Task_lastExport_low_%d", i); to.lastExport = db_get_dw(0, MODULE, buf, (int)le) & 0xffffffff; - mir_snprintf(buf, SIZEOF(buf), "Task_lastExport_hi_%d", i); + mir_snprintf(buf, "Task_lastExport_hi_%d", i); to.lastExport |= ((unsigned long long int)db_get_dw(0, MODULE, buf, le >> 32)) << 32; - mir_snprintf(buf, SIZEOF(buf), "Task_ftpName_%d", i); + mir_snprintf(buf, "Task_ftpName_%d", i); DBVARIANT var; if (!db_get_ws(0, MODULE, buf, &var)) { to.ftpName = var.ptszVal; db_free(&var); } - mir_snprintf(buf, SIZEOF(buf), "Task_filterName_%d", i); + mir_snprintf(buf, "Task_filterName_%d", i); if (!db_get_ws(0, MODULE, buf, &var)) { to.filterName = var.ptszVal; db_free(&var); } - mir_snprintf(buf, SIZEOF(buf), "Task_filePath_%d", i); + mir_snprintf(buf, "Task_filePath_%d", i); if (!db_get_ws(0, MODULE, buf, &var)) { to.filePath = var.ptszVal; db_free(&var); } - mir_snprintf(buf, SIZEOF(buf), "Task_taskName_%d", i); + mir_snprintf(buf, "Task_taskName_%d", i); if (!db_get_ws(0, MODULE, buf, &var)) { to.taskName = var.ptszVal; db_free(&var); } - mir_snprintf(buf, SIZEOF(buf), "Task_zipPassword_%d", i); + mir_snprintf(buf, "Task_zipPassword_%d", i); if (!db_get_s(0, MODULE, buf, &var)) { to.zipPassword = var.pszVal; db_free(&var); } - mir_snprintf(buf, SIZEOF(buf), "IsInTask_%d", i); + mir_snprintf(buf, "IsInTask_%d", i); for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) if (db_get_b(hContact, MODULE, buf, 0) == 1) to.contacts.push_back(hContact); diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 9cd70916c5..b9bf0c759e 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -234,7 +234,7 @@ void addProtoStatusMenuItem(char *protoName) return; char buf[200]; - mir_snprintf(buf, SIZEOF(buf), "CSList/ShowList/%s", protoName); + mir_snprintf(buf, "CSList/ShowList/%s", protoName); if (!ServiceExists(buf)) CreateServiceFunctionParam(buf, showList, (LPARAM)protoName); diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 99a496b4cf..42d4e19b2e 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -138,9 +138,9 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_HSCROLL: { char str[10]; - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str); - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); } if (wParam != 0x12345678) diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp index 1d287f65d0..f7406fd5fb 100644 --- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp @@ -85,7 +85,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) tmi.ownerdata = mmep; char buf[1024]; - mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName); + mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName); OptParam op; op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi); @@ -398,7 +398,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam) tmi.ownerdata = mmep; char buf[1024]; - mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName); + mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName); OptParam op; op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi); diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 22cd91558f..eb3442289b 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -712,7 +712,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc } // check the proto, use it as a base filter result for all further checks if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) { - mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", szProto); + mir_snprintf(szTemp, "%s|", szProto); filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0; } if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) { diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 9d762dd183..ea2cdbfbdb 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -146,7 +146,7 @@ void RegisterCLUIFonts(void) mir_tstrncpy(fontid.group, fontOptionsList[i].szGroup, SIZEOF(fontid.group)); mir_tstrncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name)); - mir_snprintf(idstr, SIZEOF(idstr), "Font%d", fontOptionsList[i].fontID); + mir_snprintf(idstr, "Font%d", fontOptionsList[i].fontID); mir_strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix)); fontid.order = i + 1; @@ -160,7 +160,7 @@ void RegisterCLUIFonts(void) mir_tstrncpy(effectid.group, fontOptionsList[i].szGroup, SIZEOF(effectid.group)); mir_tstrncpy(effectid.name, fontOptionsList[i].szDescr, SIZEOF(effectid.name)); - mir_snprintf(idstr, SIZEOF(idstr), "Font%d", fontOptionsList[i].fontID); + mir_snprintf(idstr, "Font%d", fontOptionsList[i].fontID); mir_strncpy(effectid.setting, idstr, SIZEOF(effectid.setting)); effectid.order = i + 1; @@ -220,11 +220,11 @@ void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *colour = col; if (effect) { - mir_snprintf(idstr, SIZEOF(idstr), "Font%dEffect", i); + mir_snprintf(idstr, "Font%dEffect", i); *effect = db_get_b(NULL, "CLC", idstr, 0); - mir_snprintf(idstr, SIZEOF(idstr), "Font%dEffectCol1", i); + mir_snprintf(idstr, "Font%dEffectCol1", i); *eColour1 = db_get_dw(NULL, "CLC", idstr, 0); - mir_snprintf(idstr, SIZEOF(idstr), "Font%dEffectCol2", i); + mir_snprintf(idstr, "Font%dEffectCol2", i); *eColour2 = db_get_dw(NULL, "CLC", idstr, 0); } } @@ -1111,9 +1111,9 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP case WM_HSCROLL: { char str[10]; - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str); - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); } if (wParam != 0x12345678) @@ -1695,9 +1695,9 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar break; case WM_HSCROLL: - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str); - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); if (wParam != 0x12345678 && !bInit) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index f68832d1b9..c98a8645b5 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -524,7 +524,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst) int defItemsOrder[NUM_ITEM_TYPE] = SETTINS_ROWITEMORDER_DEFAULT; for (int i = 0; i < NUM_ITEM_TYPE; i++) { char tmp[128]; - mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i); + mir_snprintf(tmp, "RowPos%d", i); dat->row_items[i] = db_get_w(NULL, "CList", tmp, defItemsOrder[i]); } } diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 0f317ee373..20e6f19089 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -62,7 +62,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam int type; int pos = 0; - mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i); + mir_snprintf(tmp, "RowPos%d", i); type = db_get_w(NULL, "CList", tmp, i); switch (type) { @@ -207,7 +207,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST_ORDER); for (int i = 0; i < NUM_ITEM_TYPE; i++) { char tmp[128]; - mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i); + mir_snprintf(tmp, "RowPos%d", i); db_set_w(NULL, "CList", tmp, (WORD)SendMessage(hwndList, LB_GETITEMDATA, i, 0)); } } diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 8474bb8961..c3a8f275a7 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -2477,7 +2477,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam) HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU); CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 1, dis->itemState); - mir_snprintf(buf, SIZEOF(buf), "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False"); + mir_snprintf(buf, "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False"); SkinDrawGlyph(dis->hDC, &dis->rcItem, &dis->rcItem, buf); int x = (dis->rcItem.right + dis->rcItem.left - GetSystemMetrics(SM_CXSMICON)) / 2 + offset; @@ -2511,7 +2511,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam) } CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 2, dis->itemState); SetBkMode(dis->hDC, TRANSPARENT); - mir_snprintf(buf, SIZEOF(buf), "Main,ID=StatusMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False"); + mir_snprintf(buf, "Main,ID=StatusMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False"); SkinDrawGlyph(dis->hDC, &dis->rcItem, &dis->rcItem, buf); SetTextColor(dis->hDC, (dis->itemState&ODS_SELECTED/*|dis->itemState&ODS_HOTLIGHT*/) ? dat->MenuTextHiColor : dat->MenuTextColor); DrawText(dis->hDC, TranslateT("Status"), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE); @@ -2530,7 +2530,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam) short dx = 1 + (dis->itemState&ODS_SELECTED ? 1 : 0) - (dis->itemState&ODS_HOTLIGHT ? 1 : 0); HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 3, dis->itemState); - mir_snprintf(buf, SIZEOF(buf), "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False"); + mir_snprintf(buf, "Main,ID=MainMenu,Selected=%s,Hot=%s", (dis->itemState&ODS_SELECTED) ? "True" : "False", (dis->itemState&ODS_HOTLIGHT) ? "True" : "False"); SkinDrawGlyph(dis->hDC, &dis->rcItem, &dis->rcItem, buf); DrawState(dis->hDC, NULL, NULL, (LPARAM)hIcon, 0, (dis->rcItem.right + dis->rcItem.left - GetSystemMetrics(SM_CXSMICON)) / 2 + dx, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2 + dx, 0, 0, DST_ICON); Skin_ReleaseIcon(hIcon); diff --git a/plugins/Clist_modern/src/modern_log.cpp b/plugins/Clist_modern/src/modern_log.cpp index 25122fef72..f14ec4ca36 100644 --- a/plugins/Clist_modern/src/modern_log.cpp +++ b/plugins/Clist_modern/src/modern_log.cpp @@ -31,7 +31,7 @@ void Log(const char *file, int line, const char *fmt, ...) tmp++; } } - mir_snprintf(buf, SIZEOF(buf), "clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n", GetCurrentThreadId(), GetTickCount(), str, file_tmp, line); + mir_snprintf(buf, "clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n", GetCurrentThreadId(), GetTickCount(), str, file_tmp, line); #ifdef _FILELOG_ { FILE *fp; diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp index 8da157d3c4..d435f7e0e2 100644 --- a/plugins/Clist_modern/src/modern_newrowopts.cpp +++ b/plugins/Clist_modern/src/modern_newrowopts.cpp @@ -120,7 +120,7 @@ void TraceTreeLevel(NodeList * node) PrintIdent(); { char buf[255]; - mir_snprintf(buf, SIZEOF(buf), "%d\n", node->pData); + mir_snprintf(buf, "%d\n", node->pData); TRACE(buf); } ident += 5; @@ -134,7 +134,7 @@ void TraceTreeLevel(NodeList * node) PrintIdent(); { char buf[255]; - mir_snprintf(buf, SIZEOF(buf), "%d\n", node->childNodes[i].pData); + mir_snprintf(buf, "%d\n", node->childNodes[i].pData); TRACE(buf); } } diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 892b9a983f..24bccdd60c 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -38,28 +38,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //Implementation -#pragma pack(push, 1) -/* tga header */ -struct tga_header_t -{ - BYTE id_lenght; /* size of image id */ - BYTE colormap_type; /* 1 is has a colormap */ - BYTE image_type; /* compression type */ - - short cm_first_entry; /* colormap origin */ - short cm_length; /* colormap length */ - BYTE cm_size; /* colormap size */ - - short x_origin; /* bottom left x coord origin */ - short y_origin; /* bottom left y coord origin */ - - short width; /* picture width (in pixels) */ - short height; /* picture height (in pixels) */ - - BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */ - BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */ -}; -#pragma pack(pop) +#pragma pack(push, 1) +/* tga header */ +struct tga_header_t +{ + BYTE id_lenght; /* size of image id */ + BYTE colormap_type; /* 1 is has a colormap */ + BYTE image_type; /* compression type */ + + short cm_first_entry; /* colormap origin */ + short cm_length; /* colormap length */ + BYTE cm_size; /* colormap size */ + + short x_origin; /* bottom left x coord origin */ + short y_origin; /* bottom left y coord origin */ + + short width; /* picture width (in pixels) */ + short height; /* picture height (in pixels) */ + + BYTE pixel_depth; /* bits per pixel: 8, 16, 24 or 32 */ + BYTE image_descriptor; /* 24 bits = 0x00; 32 bits = 0x80 */ +}; +#pragma pack(pop) /* Global variables */ @@ -3300,7 +3300,7 @@ static DWORD ske_HexToARGB(char * Hex) { char buf[10] = { 0 }; char buf2[11] = { 0 }; - mir_snprintf(buf, SIZEOF(buf), "%s\n", Hex); + mir_snprintf(buf, "%s\n", Hex); if (buf[1] == 'x' || buf[1] == 'X') mir_snprintf(buf2, SIZEOF(buf2), "0x%s\n", buf + 2); else diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index fcd2fc2bf0..7f5e2e6e3d 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -187,18 +187,18 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) continue; char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", szProto); + mir_snprintf(buf, "SBarAccountIsCustom_%s", szProto); ProtoItemData *p = NULL; if (g_StatusBarData.perProtoConfig && db_get_b(NULL, "CLUI", buf, SETTING_SBARACCOUNTISCUSTOM_DEFAULT)) { - mir_snprintf(buf, SIZEOF(buf), "HideAccount_%s", szProto); + mir_snprintf(buf, "HideAccount_%s", szProto); if (db_get_b(NULL, "CLUI", buf, SETTING_SBARHIDEACCOUNT_DEFAULT)) { iProtoInStatusMenu++; continue; } - mir_snprintf(buf, SIZEOF(buf), "SBarShow_%s", szProto); + mir_snprintf(buf, "SBarShow_%s", szProto); BYTE showOps = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT); p = new ProtoItemData; @@ -206,22 +206,22 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) p->bShowProtoName = (showOps & 2) != 0; p->bShowStatusName = (showOps & 4) != 0; - mir_snprintf(buf, SIZEOF(buf), "ShowXStatus_%s", szProto); + mir_snprintf(buf, "ShowXStatus_%s", szProto); p->xStatusMode = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "UseConnectingIcon_%s", szProto); + mir_snprintf(buf, "UseConnectingIcon_%s", szProto); p->bConnectingIcon = db_get_b(NULL, "CLUI", buf, SETTING_USECONNECTINGICON_DEFAULT) != 0; - mir_snprintf(buf, SIZEOF(buf), "ShowUnreadEmails_%s", szProto); + mir_snprintf(buf, "ShowUnreadEmails_%s", szProto); p->bShowProtoEmails = db_get_b(NULL, "CLUI", buf, SETTING_SHOWUNREADEMAILS_DEFAULT) != 0; - mir_snprintf(buf, SIZEOF(buf), "SBarRightClk_%s", szProto); + mir_snprintf(buf, "SBarRightClk_%s", szProto); p->SBarRightClk = db_get_b(NULL, "CLUI", buf, SETTING_SBARRIGHTCLK_DEFAULT) != 0; - mir_snprintf(buf, SIZEOF(buf), "PaddingLeft_%s", szProto); + mir_snprintf(buf, "PaddingLeft_%s", szProto); p->PaddingLeft = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGLEFT_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "PaddingRight_%s", szProto); + mir_snprintf(buf, "PaddingRight_%s", szProto); p->PaddingRight = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGRIGHT_DEFAULT); } else { @@ -258,7 +258,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) p->bIsDimmed = 0; if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) { char szTemp[2048]; - mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", p->szAccountName); + mir_snprintf(szTemp, "%s|", p->szAccountName); p->bIsDimmed = strstr(g_CluiData.protoFilter, szTemp) ? 0 : 1; } diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 569bfbe3b3..acf1c22e7e 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -180,31 +180,31 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendMessage(hwndComboBox, CB_SETITEMDATA, dwNewId, (LPARAM)dat); char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", szName); + mir_snprintf(buf, "SBarAccountIsCustom_%s", szName); dat->AccountIsCustomized = db_get_b(NULL, "CLUI", buf, SETTING_SBARACCOUNTISCUSTOM_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "HideAccount_%s", szName); + mir_snprintf(buf, "HideAccount_%s", szName); dat->HideAccount = db_get_b(NULL, "CLUI", buf, SETTING_SBARHIDEACCOUNT_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "SBarShow_%s", szName); + mir_snprintf(buf, "SBarShow_%s", szName); dat->SBarShow = db_get_b(NULL, "CLUI", buf, SETTING_SBARSHOW_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "SBarRightClk_%s", szName); + mir_snprintf(buf, "SBarRightClk_%s", szName); dat->SBarRightClk = db_get_b(NULL, "CLUI", buf, SETTING_SBARRIGHTCLK_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "ShowUnreadEmails_%s", szName); + mir_snprintf(buf, "ShowUnreadEmails_%s", szName); dat->ShowUnreadEmails = db_get_b(NULL, "CLUI", buf, SETTING_SHOWUNREADEMAILS_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "ShowXStatus_%s", szName); + mir_snprintf(buf, "ShowXStatus_%s", szName); dat->ShowXStatus = db_get_b(NULL, "CLUI", buf, SETTING_SHOWXSTATUS_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "UseConnectingIcon_%s", szName); + mir_snprintf(buf, "UseConnectingIcon_%s", szName); dat->UseConnectingIcon = db_get_b(NULL, "CLUI", buf, SETTING_USECONNECTINGICON_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "PaddingLeft_%s", szName); + mir_snprintf(buf, "PaddingLeft_%s", szName); dat->PaddingLeft = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGLEFT_DEFAULT); - mir_snprintf(buf, SIZEOF(buf), "PaddingRight_%s", szName); + mir_snprintf(buf, "PaddingRight_%s", szName); dat->PaddingRight = db_get_dw(NULL, "CLUI", buf, SETTING_PADDINGRIGHT_DEFAULT); } diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 3771fc2324..e3b12a3db7 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -70,13 +70,13 @@ void Modern_InitButtons() char buf[255]; if (i != 0) { - mir_snprintf(buf, SIZEOF(buf), "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn"); + mir_snprintf(buf, "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn"); tbb.hIconHandleUp = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipUp, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx, g_hInst, BTNS[i].defResource); } else tbb.hIconHandleUp = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipUp, NULL, 0, NULL, SKINICON_OTHER_MAINMENU); if (BTNS[i].pszTooltipDn) { - mir_snprintf(buf, SIZEOF(buf), "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up"); + mir_snprintf(buf, "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up"); tbb.hIconHandleDn = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipDn, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx + 1, g_hInst, BTNS[i].defResource2); } else tbb.hIconHandleDn = NULL; diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 62280566a4..e8d28ed80a 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -349,17 +349,17 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr CLVM_EnumModes(DeleteAutoModesCallback); char szSetting[512]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name); + mir_snprintf(szSetting, "%c%s_PF", 246, name); db_set_s(NULL, CLVM_MODULE, szSetting, szProtoFilter); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name); + mir_snprintf(szSetting, "%c%s_GF", 246, name); db_set_ws(NULL, CLVM_MODULE, szSetting, szGroupFilter); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, name); + mir_snprintf(szSetting, "%c%s_SM", 246, name); db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, name); + mir_snprintf(szSetting, "%c%s_SSM", 246, name); db_set_dw(NULL, CLVM_MODULE, szSetting, stickyStatusMask); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name); + mir_snprintf(szSetting, "%c%s_OPT", 246, name); db_set_dw(NULL, CLVM_MODULE, szSetting, options); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, name); + mir_snprintf(szSetting, "%c%s_LM", 246, name); db_set_dw(NULL, CLVM_MODULE, szSetting, lmdat); db_set_dw(NULL, CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies)); @@ -504,23 +504,23 @@ static void UpdateFilters() mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Configuring view mode: %s"), szTempBuf); SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szBuf); + mir_snprintf(szSetting, "%c%s_PF", 246, szBuf); ptrA szPF(db_get_sa(NULL, CLVM_MODULE, szSetting)); if (szPF == NULL) return; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szBuf); + mir_snprintf(szSetting, "%c%s_GF", 246, szBuf); ptrT szGF(db_get_tsa(NULL, CLVM_MODULE, szSetting)); if (szGF == NULL) return; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, szBuf); + mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf); if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) != -1) SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0)); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_SM", 246, szBuf); DWORD statusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, 0); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf); stickyStatusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1); dwFlags = db_get_dw(NULL, CLVM_MODULE, szBuf, 0); { @@ -593,7 +593,7 @@ static void UpdateFilters() EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMSGVALUE), useLastMsg); EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMESSAGEUNIT), useLastMsg); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_LM", 246, szBuf); DWORD lmdat = db_get_dw(NULL, CLVM_MODULE, szSetting, 0); SetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE); @@ -610,15 +610,15 @@ void DeleteViewMode(char * szName) { char szSetting[256]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szName); + mir_snprintf(szSetting, "%c%s_PF", 246, szName); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szName); + mir_snprintf(szSetting, "%c%s_GF", 246, szName); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szName); + mir_snprintf(szSetting, "%c%s_SM", 246, szName); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_VA", 246, szName); + mir_snprintf(szSetting, "%c%s_VA", 246, szName); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szName); + mir_snprintf(szSetting, "%c%s_SSM", 246, szName); db_unset(NULL, CLVM_MODULE, szSetting); db_unset(NULL, CLVM_MODULE, szName); @@ -1223,7 +1223,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) g_CluiData.bFilterEffective = 0; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246); + mir_snprintf(szSetting, "%c_LastMode", 246); if (!Name) { // Name is null - apply last stored view mode if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) { @@ -1238,7 +1238,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) g_CluiData.bFilterEffective = 0; // remove last applied view mode - mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246); + mir_snprintf(szSetting, "%c_LastMode", 246); db_unset(NULL, CLVM_MODULE, szSetting); if (g_CluiData.bOldUseGroups != (BYTE)-1) @@ -1259,7 +1259,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) } if (!onlySelector) { - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, Name); + mir_snprintf(szSetting, "%c%s_PF", 246, Name); if (!db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) { if (mir_strlen(dbv.pszVal) >= 2) { mir_strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter)); @@ -1268,7 +1268,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) } mir_free(dbv.pszVal); } - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, Name); + mir_snprintf(szSetting, "%c%s_GF", 246, Name); if (!db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv)) { if (mir_tstrlen(dbv.ptszVal) >= 2) { mir_tstrncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter)); @@ -1277,12 +1277,12 @@ void ApplyViewMode(const char *Name, bool onlySelector) } mir_free(dbv.ptszVal); } - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, Name); + mir_snprintf(szSetting, "%c%s_SM", 246, Name); g_CluiData.statusMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1); if (g_CluiData.statusMaskFilter >= 1) g_CluiData.bFilterEffective |= CLVM_FILTER_STATUS; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, Name); + mir_snprintf(szSetting, "%c%s_SSM", 246, Name); g_CluiData.stickyMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1); if (g_CluiData.stickyMaskFilter != -1) g_CluiData.bFilterEffective |= CLVM_FILTER_STICKYSTATUS; @@ -1292,14 +1292,14 @@ void ApplyViewMode(const char *Name, bool onlySelector) KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE); if (g_CluiData.filterFlags & CLVM_AUTOCLEAR) { - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, Name); + mir_snprintf(szSetting, "%c%s_OPT", 246, Name); DWORD timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0)); mir_strncpy(g_CluiData.old_viewmode, g_CluiData.current_viewmode, SIZEOF(g_CluiData.old_viewmode)); g_CluiData.old_viewmode[255] = 0; CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL); } else { //store last selected view mode only if it is not autoclear - mir_snprintf(szSetting, SIZEOF(szSetting), "%c_LastMode", 246); + mir_snprintf(szSetting, "%c_LastMode", 246); db_set_s(NULL, CLVM_MODULE, szSetting, Name); } mir_strncpy(g_CluiData.current_viewmode, Name, SIZEOF(g_CluiData.current_viewmode)); @@ -1316,7 +1316,7 @@ void ApplyViewMode(const char *Name, bool onlySelector) g_CluiData.bSortByOrder[0] = bSaved; g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, Name); + mir_snprintf(szSetting, "%c%s_LM", 246, Name); g_CluiData.lastMsgFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, 0); if (LOBYTE(HIWORD(g_CluiData.lastMsgFilter))) g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN; diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index 5634ab1cc1..e2ef621a41 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -93,7 +93,7 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam) tmi.ownerdata = mmep; char buf[1024]; - mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName); + mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName); OptParam op; op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi); @@ -428,7 +428,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam) tmi.ownerdata = mmep; char buf[1024]; - mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName); + mir_snprintf(buf, "%s/%s", mi->pszService, mi->pszName); OptParam op; op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi); diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 2d1cf246f3..c171a09813 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -480,7 +480,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str } // check the proto, use it as a base filter result for all further checks if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) { - mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", szProto); + mir_snprintf(szTemp, "%s|", szProto); filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0; } if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) { diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 3d3f28348a..096fe9ff54 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1618,7 +1618,7 @@ buttons_done: GetWindowRect(pcli->hwndContactTree, &rc); // x/y might be -1 if it was generated by a kb click - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; if (pt.x == -1 && pt.y == -1) { // all this is done in screen-coords! GetCursorPos(&pt); @@ -1851,7 +1851,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar { char str[64]; DWORD v = pluginInfo.version; - mir_snprintf(str, SIZEOF(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v))); + mir_snprintf(str, "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v))); SetDlgItemTextA(hwndDlg, IDC_VERSION, str); } { @@ -2033,7 +2033,7 @@ void FS_RegisterFonts() _tcsncpy(fid.name, clistFontDescr[i].tszName, SIZEOF(fid.name)); char idstr[10]; - mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i); + mir_snprintf(idstr, "Font%d", i); strncpy(fid.prefix, idstr, SIZEOF(fid.prefix)); fid.order = i; FontRegisterT(&fid); diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index baa147581a..7fac4e76ba 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -152,9 +152,9 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case WM_HSCROLL: { char str[10]; - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str); - mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); + mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); } if (wParam != 0x12345678) { diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index f569932195..2c9b7f4e74 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -302,7 +302,7 @@ void LoadExtBkSettingsFromDB() continue; p->imageItem = 0; - char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname); + char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, "%s_", p->szDBname); mir_strcpy(pszEnd, "IGNORE"); p->IGNORED = (BYTE)cfg::getByte("CLCExt", buffer, p->IGNORED); mir_strcpy(pszEnd, "GRADIENT"); p->GRADIENT = (BYTE)cfg::getDword("CLCExt", buffer, p->GRADIENT); mir_strcpy(pszEnd, "CORNER"); p->CORNER = (BYTE)cfg::getDword("CLCExt", buffer, p->CORNER); @@ -338,31 +338,31 @@ static void SaveCompleteStructToDB() StatusItems_t *p = arStatusItems[n]; if (p->statusID != ID_EXTBKSEPARATOR) { char buffer[255]; - mir_snprintf(buffer, SIZEOF(buffer), "%s_IGNORE", p->szDBname); + mir_snprintf(buffer, "%s_IGNORE", p->szDBname); cfg::writeByte("CLCExt", buffer, p->IGNORED); - mir_snprintf(buffer, SIZEOF(buffer), "%s_GRADIENT", p->szDBname); + mir_snprintf(buffer, "%s_GRADIENT", p->szDBname); cfg::writeDword("CLCExt", buffer, p->GRADIENT); - mir_snprintf(buffer, SIZEOF(buffer), "%s_CORNER", p->szDBname); + mir_snprintf(buffer, "%s_CORNER", p->szDBname); cfg::writeDword("CLCExt", buffer, p->CORNER); - mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR", p->szDBname); + mir_snprintf(buffer, "%s_COLOR", p->szDBname); cfg::writeDword("CLCExt", buffer, p->COLOR); - mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2", p->szDBname); + mir_snprintf(buffer, "%s_COLOR2", p->szDBname); cfg::writeDword("CLCExt", buffer, p->COLOR2); - mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2_TRANSPARENT", p->szDBname); + mir_snprintf(buffer, "%s_COLOR2_TRANSPARENT", p->szDBname); cfg::writeByte("CLCExt", buffer, p->COLOR2_TRANSPARENT); - mir_snprintf(buffer, SIZEOF(buffer), "%s_TEXTCOLOR", p->szDBname); + mir_snprintf(buffer, "%s_TEXTCOLOR", p->szDBname); cfg::writeDword("CLCExt", buffer, p->TEXTCOLOR); - mir_snprintf(buffer, SIZEOF(buffer), "%s_ALPHA", p->szDBname); + mir_snprintf(buffer, "%s_ALPHA", p->szDBname); cfg::writeByte("CLCExt", buffer, (BYTE)p->ALPHA); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_LEFT", p->szDBname); + mir_snprintf(buffer, "%s_MRGN_LEFT", p->szDBname); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_LEFT); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_TOP", p->szDBname); + mir_snprintf(buffer, "%s_MRGN_TOP", p->szDBname); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_TOP); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_RIGHT", p->szDBname); + mir_snprintf(buffer, "%s_MRGN_RIGHT", p->szDBname); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_RIGHT); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MRGN_BOTTOM", p->szDBname); + mir_snprintf(buffer, "%s_MRGN_BOTTOM", p->szDBname); cfg::writeByte("CLCExt", buffer, (BYTE)p->MARGIN_BOTTOM); - mir_snprintf(buffer, SIZEOF(buffer), "%s_BDRSTYLE", p->szDBname); + mir_snprintf(buffer, "%s_BDRSTYLE", p->szDBname); cfg::writeDword("CLCExt", buffer, p->BORDERSTYLE); } } @@ -470,7 +470,7 @@ void extbk_export(char *file) if (p->statusID == ID_EXTBKSEPARATOR) continue; - char *pszEnd = buffer + mir_snprintf(buffer, SIZEOF(buffer), "%s_", p->szDBname); + char *pszEnd = buffer + mir_snprintf(buffer, "%s_", p->szDBname); mir_strcpy(pszEnd, "ALPHA"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file); mir_strcpy(pszEnd, "COLOR"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file); mir_strcpy(pszEnd, "COLOR2"); WritePrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file); @@ -1331,31 +1331,31 @@ void extbk_import(char *file, HWND hwndDlg) if (p->statusID == ID_EXTBKSEPARATOR) continue; - mir_snprintf(buffer, SIZEOF(buffer), "%s_ALPHA", p->szDBname); + mir_snprintf(buffer, "%s_ALPHA", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->ALPHA), sizeof(p->ALPHA), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR", p->szDBname); + mir_snprintf(buffer, "%s_COLOR", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR), sizeof(p->COLOR), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2", p->szDBname); + mir_snprintf(buffer, "%s_COLOR2", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2), sizeof(p->COLOR2), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_COLOR2_TRANSPARENT", p->szDBname); + mir_snprintf(buffer, "%s_COLOR2_TRANSPARENT", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->COLOR2_TRANSPARENT), sizeof(p->COLOR2_TRANSPARENT), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_TEXTCOLOR", p->szDBname); + mir_snprintf(buffer, "%s_TEXTCOLOR", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->TEXTCOLOR), sizeof(p->TEXTCOLOR), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_CORNER", p->szDBname); + mir_snprintf(buffer, "%s_CORNER", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->CORNER), sizeof(p->CORNER), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_GRADIENT", p->szDBname); + mir_snprintf(buffer, "%s_GRADIENT", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->GRADIENT), sizeof(p->GRADIENT), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_IGNORED", p->szDBname); + mir_snprintf(buffer, "%s_IGNORED", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->IGNORED), sizeof(p->IGNORED), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_BOTTOM", p->szDBname); + mir_snprintf(buffer, "%s_MARGIN_BOTTOM", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_BOTTOM), sizeof(p->MARGIN_BOTTOM), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_LEFT", p->szDBname); + mir_snprintf(buffer, "%s_MARGIN_LEFT", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_LEFT), sizeof(p->MARGIN_LEFT), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_RIGHT", p->szDBname); + mir_snprintf(buffer, "%s_MARGIN_RIGHT", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_RIGHT), sizeof(p->MARGIN_RIGHT), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_MARGIN_TOP", p->szDBname); + mir_snprintf(buffer, "%s_MARGIN_TOP", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->MARGIN_TOP), sizeof(p->MARGIN_TOP), file); - mir_snprintf(buffer, SIZEOF(buffer), "%s_BORDERSTYLE", p->szDBname); + mir_snprintf(buffer, "%s_BORDERSTYLE", p->szDBname); GetPrivateProfileStructA("ExtBKSettings", buffer, &(p->BORDERSTYLE), sizeof(p->BORDERSTYLE), file); } diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index b2d6d8e753..7903d52204 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -302,17 +302,17 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr { char szSetting[512]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name); + mir_snprintf(szSetting, "%c%s_PF", 246, name); cfg::writeString(NULL, CLVM_MODULE, szSetting, szProtoFilter); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name); + mir_snprintf(szSetting, "%c%s_GF", 246, name); cfg::writeTString(NULL, CLVM_MODULE, szSetting, szGroupFilter); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, name); + mir_snprintf(szSetting, "%c%s_SM", 246, name); cfg::writeDword(CLVM_MODULE, szSetting, statusMask); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, name); + mir_snprintf(szSetting, "%c%s_SSM", 246, name); cfg::writeDword(CLVM_MODULE, szSetting, stickyStatusMask); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name); + mir_snprintf(szSetting, "%c%s_OPT", 246, name); cfg::writeDword(CLVM_MODULE, szSetting, options); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, name); + mir_snprintf(szSetting, "%c%s_LM", 246, name); cfg::writeDword(CLVM_MODULE, szSetting, lmdat); cfg::writeDword(CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies)); @@ -449,21 +449,21 @@ void UpdateFilters() SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szBuf); strncpy(g_szModename, szBuf, sizeof(g_szModename)); g_szModename[sizeof(g_szModename) - 1] = 0; - mir_snprintf(szTemp, SIZEOF(szTemp), Translate("Current view mode: %s"), g_szModename); + mir_snprintf(szTemp, Translate("Current view mode: %s"), g_szModename); SetDlgItemTextA(clvmHwnd, IDC_CURVIEWMODE2, szTemp); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szBuf); + mir_snprintf(szSetting, "%c%s_PF", 246, szBuf); if (db_get(NULL, CLVM_MODULE, szSetting, &dbv_pf)) goto cleanup; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szBuf); + mir_snprintf(szSetting, "%c%s_GF", 246, szBuf); if (cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv_gf)) goto cleanup; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, szBuf); + mir_snprintf(szSetting, "%c%s_OPT", 246, szBuf); if ((opt = cfg::getDword(NULL, CLVM_MODULE, szSetting, -1)) != -1) { SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0)); } - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_SM", 246, szBuf); statusMask = cfg::getDword(CLVM_MODULE, szSetting, -1); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf); stickyStatusMask = cfg::getDword(CLVM_MODULE, szSetting, -1); dwFlags = cfg::getDword(CLVM_MODULE, szBuf, 0); { @@ -538,7 +538,7 @@ void UpdateFilters() Utils::enableDlgControl(clvmHwnd, IDC_LASTMSGVALUE, useLastMsg); Utils::enableDlgControl(clvmHwnd, IDC_LASTMESSAGEUNIT, useLastMsg); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_LM", 246, szBuf); lmdat = cfg::getDword(CLVM_MODULE, szSetting, 0); SetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE); @@ -652,15 +652,15 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP char *szBuf = (char*)malloc(iLen + 1); if (szBuf) { SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szBuf); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, szBuf); + mir_snprintf(szSetting, "%c%s_PF", 246, szBuf); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, szBuf); + mir_snprintf(szSetting, "%c%s_GF", 246, szBuf); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_SM", 246, szBuf); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_VA", 246, szBuf); + mir_snprintf(szSetting, "%c%s_VA", 246, szBuf); db_unset(NULL, CLVM_MODULE, szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, szBuf); + mir_snprintf(szSetting, "%c%s_SSM", 246, szBuf); db_unset(NULL, CLVM_MODULE, szSetting); db_unset(NULL, CLVM_MODULE, szBuf); if (!mir_strcmp(cfg::dat.current_viewmode, szBuf) && mir_strlen(szBuf) == mir_strlen(cfg::dat.current_viewmode)) { @@ -1048,7 +1048,7 @@ void ApplyViewMode(const char *name) cfg::dat.bFilterEffective = 0; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name); + mir_snprintf(szSetting, "%c%s_PF", 246, name); if (!cfg::getString(NULL, CLVM_MODULE, szSetting, &dbv)) { if (mir_strlen(dbv.pszVal) >= 2) { strncpy(cfg::dat.protoFilter, dbv.pszVal, sizeof(cfg::dat.protoFilter)); @@ -1057,7 +1057,7 @@ void ApplyViewMode(const char *name) } mir_free(dbv.pszVal); } - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_GF", 246, name); + mir_snprintf(szSetting, "%c%s_GF", 246, name); if (!cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv)) { if (mir_tstrlen(dbv.ptszVal) >= 2) { _tcsncpy(cfg::dat.groupFilter, dbv.ptszVal, SIZEOF(cfg::dat.groupFilter)); @@ -1066,12 +1066,12 @@ void ApplyViewMode(const char *name) } mir_free(dbv.ptszVal); } - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SM", 246, name); + mir_snprintf(szSetting, "%c%s_SM", 246, name); cfg::dat.statusMaskFilter = cfg::getDword(CLVM_MODULE, szSetting, -1); if (cfg::dat.statusMaskFilter >= 1) cfg::dat.bFilterEffective |= CLVM_FILTER_STATUS; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_SSM", 246, name); + mir_snprintf(szSetting, "%c%s_SSM", 246, name); cfg::dat.stickyMaskFilter = cfg::getDword(CLVM_MODULE, szSetting, -1); if (cfg::dat.stickyMaskFilter != -1) cfg::dat.bFilterEffective |= CLVM_FILTER_STICKYSTATUS; @@ -1082,7 +1082,7 @@ void ApplyViewMode(const char *name) if (cfg::dat.filterFlags & CLVM_AUTOCLEAR) { DWORD timerexpire; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_OPT", 246, name); + mir_snprintf(szSetting, "%c%s_OPT", 246, name); timerexpire = LOWORD(cfg::getDword(CLVM_MODULE, szSetting, 0)); strncpy(cfg::dat.old_viewmode, cfg::dat.current_viewmode, 256); cfg::dat.old_viewmode[255] = 0; @@ -1103,7 +1103,7 @@ void ApplyViewMode(const char *name) cfg::dat.sortOrder[0] = bSaved; cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG; - mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_LM", 246, name); + mir_snprintf(szSetting, "%c%s_LM", 246, name); cfg::dat.lastMsgFilter = cfg::getDword(CLVM_MODULE, szSetting, 0); if (LOBYTE(HIWORD(cfg::dat.lastMsgFilter))) cfg::dat.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN; diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 4f2f4b5afc..7969de2489 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -96,17 +96,17 @@ void saveSettingsConnections(struct CONNECTION *connHead) while (tmp != NULL) { - mir_snprintf(buff, SIZEOF(buff), "%dFilterIntIp", i); + mir_snprintf(buff, "%dFilterIntIp", i); db_set_ts(NULL, PLUGINNAME, buff, tmp->strIntIp); - mir_snprintf(buff, SIZEOF(buff), "%dFilterExtIp", i); + mir_snprintf(buff, "%dFilterExtIp", i); db_set_ts(NULL, PLUGINNAME, buff, tmp->strExtIp); - mir_snprintf(buff, SIZEOF(buff), "%dFilterPName", i); + mir_snprintf(buff, "%dFilterPName", i); db_set_ws(NULL, PLUGINNAME, buff, tmp->PName); - mir_snprintf(buff, SIZEOF(buff), "%dFilterIntPort", i); + mir_snprintf(buff, "%dFilterIntPort", i); db_set_dw(NULL, PLUGINNAME, buff, tmp->intIntPort); - mir_snprintf(buff, SIZEOF(buff), "%dFilterExtPort", i); + mir_snprintf(buff, "%dFilterExtPort", i); db_set_dw(NULL, PLUGINNAME, buff, tmp->intExtPort); - mir_snprintf(buff, SIZEOF(buff), "%dFilterAction", i); + mir_snprintf(buff, "%dFilterAction", i); db_set_dw(NULL, PLUGINNAME, buff, tmp->Pid); i++; tmp = tmp->next; @@ -126,26 +126,26 @@ struct CONNECTION* LoadSettingsConnections() for (i = settingFiltersCount - 1; i >= 0; i--) { struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION)); - mir_snprintf(buff, SIZEOF(buff), "%dFilterIntIp", i); + mir_snprintf(buff, "%dFilterIntIp", i); if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv)) wcsncpy(conn->strIntIp, dbv.ptszVal, _countof(conn->strIntIp)); db_free(&dbv); - mir_snprintf(buff, SIZEOF(buff), "%dFilterExtIp", i); + mir_snprintf(buff, "%dFilterExtIp", i); if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv)) wcsncpy(conn->strExtIp, dbv.ptszVal, _countof(conn->strExtIp)); db_free(&dbv); - mir_snprintf(buff, SIZEOF(buff), "%dFilterPName", i); + mir_snprintf(buff, "%dFilterPName", i); if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv)) wcsncpy(conn->PName, dbv.ptszVal, _countof(conn->PName)); db_free(&dbv); - mir_snprintf(buff, SIZEOF(buff), "%dFilterIntPort", i); + mir_snprintf(buff, "%dFilterIntPort", i); conn->intIntPort = db_get_dw(0, PLUGINNAME, buff, -1); - mir_snprintf(buff, SIZEOF(buff), "%dFilterExtPort", i); + mir_snprintf(buff, "%dFilterExtPort", i); conn->intExtPort = db_get_dw(0, PLUGINNAME, buff, -1); - mir_snprintf(buff, SIZEOF(buff), "%dFilterAction", i); + mir_snprintf(buff, "%dFilterAction", i); conn->Pid = db_get_dw(0, PLUGINNAME, buff, 0); conn->next = connHead; @@ -169,7 +169,7 @@ void LoadSettings() for (int i = 0; i < STATUS_COUNT; i++) { char buff[128]; - mir_snprintf(buff, SIZEOF(buff), "Status%d", i); + mir_snprintf(buff, "Status%d", i); settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1); } //lookupLotusDefaultSettings(); @@ -534,7 +534,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar for (int i = 0; i < STATUS_COUNT; i++) { char buff[128]; - mir_snprintf(buff, SIZEOF(buff), "Status%d", i); + mir_snprintf(buff, "Status%d", i); settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE); db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0); } diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index 0253f5823a..a7aaab2a45 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -29,7 +29,7 @@ int myDebugFilter(unsigned int code, PEXCEPTION_POINTERS ep) PDelayLoadInfo dlld = (PDelayLoadInfo)ep->ExceptionRecord->ExceptionInformation[0]; char str[256]; - int off = mir_snprintf(str, SIZEOF(str), "dbghelp.dll v.5.0 or later required to provide a crash report\n"); + int off = mir_snprintf(str, "dbghelp.dll v.5.0 or later required to provide a crash report\n"); off += mir_snprintf(str + off, SIZEOF(str) - off, "Missing Module: %s ", dlld->szDll); if (dlld->dlp.fImportByName) diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 7e331f37ce..f277c1eec7 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -69,8 +69,8 @@ void OpenAuthUrl(const char* url) if (user[0] && pass[0]) { char str[256]; - mir_snprintf(str, SIZEOF(str), url, user); // XXX: fix me - mir_snprintf(str, SIZEOF(str), "http://vi.miranda-ng.org/detail/%s", user); + mir_snprintf(str, url, user); // XXX: fix me + mir_snprintf(str, "http://vi.miranda-ng.org/detail/%s", user); CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)str); } else CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW, (LPARAM)"http://vi.miranda-ng.org/"); @@ -82,7 +82,7 @@ void CreateAuthString(char* auth) GetLoginStr(user, sizeof(user), pass); char str[110]; - int len = mir_snprintf(str, SIZEOF(str), "%s:%s", user, pass); + int len = mir_snprintf(str, "%s:%s", user, pass); mir_snprintf(auth, 250, "Basic %s", ptrA(mir_base64_encode((PBYTE)str, len))); } @@ -205,7 +205,7 @@ void __cdecl VersionInfoUploadThread(void* arg) char user[64], pass[40]; GetLoginStr(user, sizeof(user), pass); char str[256]; - mir_snprintf(str, SIZEOF(str), "http://vi.miranda-ng.org/en/upload?login=%s&pass=%s", user, pass); + mir_snprintf(str, "http://vi.miranda-ng.org/en/upload?login=%s&pass=%s", user, pass); InternetDownloadFile(str, trn); mir_free(trn->buf); diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index d201b2cedd..484cbf9340 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -423,7 +423,7 @@ void CDb3Mmap::FillContacts() cc->pSubs = (MCONTACT*)mir_alloc(cc->nSubs*sizeof(MCONTACT)); for (int i = 0; i < cc->nSubs; i++) { char setting[100]; - mir_snprintf(setting, SIZEOF(setting), "Handle%d", i); + mir_snprintf(setting, "Handle%d", i); cc->pSubs[i] = (0 != GetContactSetting(dwContactID, META_PROTO, setting, &dbv)) ? NULL : dbv.dVal; } } @@ -461,7 +461,7 @@ void CDb3Mmap::FillContacts() ccMeta->pSubs[dbv.dVal] = hh; char setting[100]; - mir_snprintf(setting, SIZEOF(setting), "Handle%d", dbv.dVal); + mir_snprintf(setting, "Handle%d", dbv.dVal); dbws.szSetting = setting; dbws.value.dVal = hh; WriteContactSetting(ccMeta->contactID, &dbws); diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp index 4a4cdc8cd8..52c14c0f32 100644 --- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp +++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp @@ -231,7 +231,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l for (j = 0; j < len; j++) { - mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)p[j]); + mir_snprintf(tmp, "%02X ", (BYTE)p[j]); mir_strcat(data, tmp); } diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 9c07ce46b7..25d1d4779a 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -91,7 +91,7 @@ void exportModule(MCONTACT hContact, char *module, FILE *file) data[0] = '\0'; for (int j = 0; j < dbv.cpbVal; j++) { char tmp[16]; - mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv.pbVal[j]); + mir_snprintf(tmp, "%02X ", (BYTE)dbv.pbVal[j]); mir_strcat(data, tmp); } fprintf(file, "\n%s=n%s", setting->name, data); diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index d05f2b8cef..ee86cba930 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -612,11 +612,11 @@ void __cdecl FindSettings(LPVOID di) if (mode) { if (!replace[0]) - mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found, %d items were deleted."), foundCount, replaceCount); + mir_snprintf(szTmp, Translate("Finished. %d items were found, %d items were deleted."), foundCount, replaceCount); else - mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found, %d items were replaced."), foundCount, replaceCount); + mir_snprintf(szTmp, Translate("Finished. %d items were found, %d items were replaced."), foundCount, replaceCount); } - else mir_snprintf(szTmp, SIZEOF(szTmp), Translate("Finished. %d items were found."), foundCount); + else mir_snprintf(szTmp, Translate("Finished. %d items were found."), foundCount); SendDlgItemMessage(prnthwnd, IDC_SBAR, SB_SETTEXT, 0, (LPARAM)szTmp); diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index a0f080a974..2f903bb431 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -32,7 +32,7 @@ void saveListSettings(HWND hwnd2List) for (int i = 0; i <= 3; i++) if (ListView_GetColumn(hwnd2List, i, &sLC)) { - mir_snprintf(tmp, SIZEOF(tmp), "Column%dwidth", i); + mir_snprintf(tmp, "Column%dwidth", i); db_set_w(NULL, modname, tmp, (WORD)sLC.cx); } } @@ -122,7 +122,7 @@ void additem(HWND hwnd2Settings, MCONTACT hContact, char* module, char* setting, data[0] = '\0'; for (int j = 0; j < dbv.cpbVal; j++) { char tmp[16]; - mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv.pbVal[j]); + mir_snprintf(tmp, "%02X ", (BYTE)dbv.pbVal[j]); mir_strcat(data, tmp); } lvi.iImage = 0; @@ -624,7 +624,7 @@ void EditLabel(HWND hwnd2List, int item, int subitem) data[0] = '\0'; for (j = 0; j < dbv.cpbVal; j++) { - mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv.pbVal[j]); + mir_snprintf(tmp, "%02X ", (BYTE)dbv.pbVal[j]); mir_strcat(data, tmp); } diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 7474835c98..4059035738 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -92,7 +92,7 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam) for (j = 0; j < dbv->cpbVal; j++) { char tmp[16]; - mir_snprintf(tmp, SIZEOF(tmp), "%02X ", (BYTE)dbv->pbVal[j]); + mir_snprintf(tmp, "%02X ", (BYTE)dbv->pbVal[j]); mir_strcat(data, tmp); } ListView_SetItemText(hwnd2list, index, 4, data); diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 2af4bebcc1..d18693c2f0 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -138,7 +138,7 @@ bool MakeZip(TCHAR *tszSource, TCHAR *tszDest, TCHAR *dbname, HWND progress_dial zipCloseFileInZip(hZip); } if (ret) { - mir_snprintf(buf, SIZEOF(buf), "%s\r\n%s %s %d.%d.%d.%d\r\n", + mir_snprintf(buf, "%s\r\n%s %s %d.%d.%d.%d\r\n", Translate("Miranda NG database"), Translate("Created by:"), __PLUGIN_NAME, __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM); } diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index f72ba6de39..24dd3c62c8 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -3,7 +3,7 @@ HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASERVICEOBJ serviceProc, void *obj) { char str[MAXMODULELABELLENGTH]; - mir_snprintf(str, SIZEOF(str), "%s%s", MODULE, szService); + mir_snprintf(str, "%s%s", MODULE, szService); str[MAXMODULELABELLENGTH - 1] = 0; return CreateServiceFunctionObj(str, serviceProc, obj); } diff --git a/plugins/FTPFileYM/src/job_delete.cpp b/plugins/FTPFileYM/src/job_delete.cpp index 0baa219117..9d57719211 100644 --- a/plugins/FTPFileYM/src/job_delete.cpp +++ b/plugins/FTPFileYM/src/job_delete.cpp @@ -105,9 +105,9 @@ void DeleteJob::run() char *DeleteJob::getDelFileString() { if (ftp->ftpProto == ServerList::FTP::FT_SSH) - mir_snprintf(buff, SIZEOF(buff), "rm \"%s/%s\"", ftp->szDir, entry->szFileName); + mir_snprintf(buff, "rm \"%s/%s\"", ftp->szDir, entry->szFileName); else - mir_snprintf(buff, SIZEOF(buff), "DELE %s", entry->szFileName); + mir_snprintf(buff, "DELE %s", entry->szFileName); return buff; } @@ -115,9 +115,9 @@ char *DeleteJob::getDelFileString() char *DeleteJob::getDelUrlString() { if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH) - mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir); + mir_snprintf(buff, "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir); else - mir_snprintf(buff, SIZEOF(buff), "%s%s/", ftp->getProtoString(), ftp->szServer); + mir_snprintf(buff, "%s%s/", ftp->getProtoString(), ftp->szServer); return buff; } \ No newline at end of file diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index ace85a52a6..506c704609 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -99,7 +99,7 @@ void UploadJob::copyLinkToML() { if (this->hContact != NULL) { char buff[256]; - mir_snprintf(buff, SIZEOF(buff), "%s\r\n", this->szFileLink); + mir_snprintf(buff, "%s\r\n", this->szFileLink); CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)this->hContact, (LPARAM)buff); } } @@ -182,9 +182,9 @@ void UploadJob::start() char *UploadJob::getChmodString() { if (ftp->ftpProto == ServerList::FTP::FT_SSH) - mir_snprintf(buff, SIZEOF(buff), "%s \"%s/%s\"", ftp->szChmod, ftp->szDir, this->szSafeFileName); + mir_snprintf(buff, "%s \"%s/%s\"", ftp->szChmod, ftp->szDir, this->szSafeFileName); else - mir_snprintf(buff, SIZEOF(buff), "%s %s", ftp->szChmod, this->szSafeFileName); + mir_snprintf(buff, "%s %s", ftp->szChmod, this->szSafeFileName); return buff; } @@ -192,9 +192,9 @@ char *UploadJob::getChmodString() char *UploadJob::getDelFileString() { if (ftp->ftpProto == ServerList::FTP::FT_SSH) - mir_snprintf(buff, SIZEOF(buff), "rm \"%s/%s\"", ftp->szDir, this->szSafeFileName); + mir_snprintf(buff, "rm \"%s/%s\"", ftp->szDir, this->szSafeFileName); else - mir_snprintf(buff, SIZEOF(buff), "DELE %s", this->szSafeFileName); + mir_snprintf(buff, "DELE %s", this->szSafeFileName); return buff; } @@ -202,9 +202,9 @@ char *UploadJob::getDelFileString() char *UploadJob::getUrlString() { if (ftp->szDir[0]) - mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/%s", ftp->getProtoString(), ftp->szServer, ftp->szDir, this->szSafeFileName); + mir_snprintf(buff, "%s%s/%s/%s", ftp->getProtoString(), ftp->szServer, ftp->szDir, this->szSafeFileName); else - mir_snprintf(buff, SIZEOF(buff), "%s%s/%s", ftp->getProtoString(), ftp->szServer, this->szSafeFileName); + mir_snprintf(buff, "%s%s/%s", ftp->getProtoString(), ftp->szServer, this->szSafeFileName); return buff; } @@ -212,9 +212,9 @@ char *UploadJob::getUrlString() char *UploadJob::getDelUrlString() { if (ftp->szDir[0] && ftp->ftpProto != ServerList::FTP::FT_SSH) - mir_snprintf(buff, SIZEOF(buff), "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir); + mir_snprintf(buff, "%s%s/%s/", ftp->getProtoString(), ftp->szServer, ftp->szDir); else - mir_snprintf(buff, SIZEOF(buff), "%s%s/", ftp->getProtoString(), ftp->szServer); + mir_snprintf(buff, "%s%s/", ftp->getProtoString(), ftp->szServer); return buff; } @@ -316,7 +316,7 @@ void UploadJob::upload() if (result != CURLE_OK && result != CURLE_ABORTED_BY_CALLBACK) { char buff[256]; - mir_snprintf(buff, SIZEOF(buff), Translate("FTP error occurred.\n%s"), this->szError); + mir_snprintf(buff, Translate("FTP error occurred.\n%s"), this->szError); Utils::msgBoxA(buff, MB_OK | MB_ICONERROR); } diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index cee488915b..3c6481ba31 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -83,7 +83,7 @@ void Manager::initImageList() for (int i = 0; i < ServerList::FTP_COUNT; i++) { - mir_snprintf(buff, SIZEOF(buff), "ftp%d", i); + mir_snprintf(buff, "ftp%d", i); ImageList_AddIcon(himlStates, Utils::loadIconEx(buff)); } diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp index 4ba9ce13a3..6256b314aa 100644 --- a/plugins/FTPFileYM/src/mir_db.cpp +++ b/plugins/FTPFileYM/src/mir_db.cpp @@ -21,56 +21,56 @@ along with this program. If not, see . int DB::setByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_set_b(hContact, szModule, formSet, iValue); } int DB::setWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_set_w(hContact, szModule, formSet, iValue); } int DB::setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_set_dw(hContact, szModule, formSet, iValue); } int DB::setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_set_s(hContact, szModule, formSet, szValue); } int DB::setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *stzValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_set_ts(hContact, szModule, formSet, stzValue); } int DB::getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_get_b(hContact, szModule, formSet, iErrorValue); } int DB::getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_get_w(hContact, szModule, formSet, iErrorValue); } int DB::getDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_get_dw(hContact, szModule, formSet, iErrorValue); } @@ -91,7 +91,7 @@ int DB::getAString(MCONTACT hContact, char *szModule, char *szSetting, char *buf int DB::getAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *buff) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return getAString(hContact, szModule, formSet, buff); } @@ -112,13 +112,13 @@ int DB::getString(MCONTACT hContact, char *szModule, char *szSetting, TCHAR *buf int DB::getStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, TCHAR *buff) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return getString(hContact, szModule, formSet, buff); } int DB::deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id) { char formSet[256]; - mir_snprintf(formSet, SIZEOF(formSet), szSetting, id); + mir_snprintf(formSet, szSetting, id); return db_unset(hContact, szModule, formSet); } diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp index 5b7d5396ad..95c677b77c 100644 --- a/plugins/FTPFileYM/src/serverlist.cpp +++ b/plugins/FTPFileYM/src/serverlist.cpp @@ -45,7 +45,7 @@ void ServerList::saveToDb() const ServerList::FTP *ftp = ftpList.getSelected(); char buff[256]; - mir_snprintf(buff, SIZEOF(buff), "Password%d", opt.selected); + mir_snprintf(buff, "Password%d", opt.selected); DB::setAStringF(0, MODULE, buff, opt.selected, ftp->szPass); DB::setStringF(0, MODULE, "Name%d", opt.selected, ftp->stzName); diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp index 04d0e185cd..75b5ee1da5 100644 --- a/plugins/FTPFileYM/src/utils.cpp +++ b/plugins/FTPFileYM/src/utils.cpp @@ -48,7 +48,7 @@ int Utils::msgBoxA(char *szMsg, UINT uType) HICON Utils::loadIconEx(char *szName) { char buff[100]; - mir_snprintf(buff, SIZEOF(buff), "%s_%s", MODULE, szName); + mir_snprintf(buff, "%s_%s", MODULE, szName); return Skin_GetIcon(buff); } @@ -139,7 +139,7 @@ void Utils::curlSetOpt(CURL *hCurl, ServerList::FTP *ftp, char *url, struct curl else curl_easy_setopt(hCurl, CURLOPT_FTPPORT, "-"); - mir_snprintf(buff, SIZEOF(buff), "%s:%s", ftp->szUser, ftp->szPass); + mir_snprintf(buff, "%s:%s", ftp->szUser, ftp->szPass); curl_easy_setopt(hCurl, CURLOPT_USERPWD, buff); if (ftp->ftpProto == ServerList::FTP::FT_SSL_EXPLICIT || ftp->ftpProto == ServerList::FTP::FT_SSL_IMPLICIT) diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index 14a65dca5c..5e8b839217 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -110,7 +110,7 @@ public: void Send(int i) { char buf[32]; - mir_snprintf(buf, SIZEOF(buf), "%d", i); + mir_snprintf(buf, "%d", i); Send(buf); } diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index ca8a746957..c958e08dcc 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -443,7 +443,7 @@ void FILEECHO::incomeRequest(char *param) chunkCountx = atoi(p); fileSize = atoi(param); - mir_snprintf(buf, SIZEOF(buf), Translate("Size: %d bytes"), fileSize); + mir_snprintf(buf, Translate("Size: %d bytes"), fileSize); SetDlgItemText(hDlg, IDC_FILENAME, filename); SetDlgItemText(hDlg, IDC_FILESIZE, buf); @@ -1167,7 +1167,7 @@ INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) int size = RetrieveFileSize(str); if (size != -1) - mir_snprintf(str, SIZEOF(str), Translate("Size: %d bytes"), size); + mir_snprintf(str, Translate("Size: %d bytes"), size); else mir_strncpy(str, Translate("Can't get a file size"), SIZEOF(str)); SetDlgItemText(hDlg, IDC_FILESIZE, str); diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index ea28a2ba26..cf1157ad3b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -201,7 +201,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) { string sCreateLink(const char * pszSrvPath) { char szTemp[30]; string sLink = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName); - mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress)); + mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress)); ReplaceAll(sLink, "%LocalIP%", szTemp); if (sLink.find("%ExternalIP%") != sLink.npos) { @@ -214,11 +214,11 @@ string sCreateLink(const char * pszSrvPath) { dwExternalIpAddressGenerated = GetTickCount(); } - mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress)); + mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress)); ReplaceAll(sLink, "%ExternalIP%", szTemp); } - mir_snprintf(szTemp, SIZEOF(szTemp), "%d", dwLocalPortUsed, szTemp); + mir_snprintf(szTemp, "%d", dwLocalPortUsed, szTemp); ReplaceAll(sLink, "%Port%", szTemp); string sSrvPath = pszSrvPath; @@ -463,7 +463,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) { DWORD dwError = CommDlgExtendedError(); if (dwError) { char szTemp[200]; - mir_snprintf(szTemp, SIZEOF(szTemp), "Failed to create File Open dialog the error returned was %d", dwError); + mir_snprintf(szTemp, "Failed to create File Open dialog the error returned was %d", dwError); MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK); } return false; @@ -560,7 +560,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { ListView_InsertItem(hShareList, &sItem); - mir_snprintf(szTmp, SIZEOF(szTmp), "%d", pclCur->st.nMaxDownloads); + mir_snprintf(szTmp, "%d", pclCur->st.nMaxDownloads); sItem.iSubItem = 1; sItem.pszText = szTmp; ListView_SetItem(hShareList, &sItem); @@ -600,7 +600,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { ListView_SetItem(hUserList, &sItem); if (pclCurUser->dwTotalSize) { - mir_snprintf(szTmp, SIZEOF(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize); + mir_snprintf(szTmp, "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize); } else { mir_strcpy(szTmp, "? %%"); } @@ -612,9 +612,9 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { if (dwSpeed > 10000) { dwSpeed += 512; // make sure we round ot down correctly. dwSpeed /= 1024; - mir_snprintf(szTmp, SIZEOF(szTmp), "%d KB/Sec", dwSpeed); + mir_snprintf(szTmp, "%d KB/Sec", dwSpeed); } else { - mir_snprintf(szTmp, SIZEOF(szTmp), "%d B/Sec", dwSpeed); + mir_snprintf(szTmp, "%d B/Sec", dwSpeed); } sItem.iSubItem = 4; sItem.pszText = szTmp; diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index f63d31db5a..d89e8a4588 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -643,7 +643,7 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) { hDirectBoundPort = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM) & nlb); if (!hDirectBoundPort) { TCHAR szTemp[200]; - mir_snprintf(szTemp, SIZEOF(szTemp), TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") , + mir_snprintf(szTemp, TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") , nlb.wPort == 80 ? "80" : nus.szIncomingPorts); MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK); return 1001; diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp index b8264298bb..46c079293b 100644 --- a/plugins/IEView/src/ChatHTMLBuilder.cpp +++ b/plugins/IEView/src/ChatHTMLBuilder.cpp @@ -50,29 +50,29 @@ void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) int style; DBVARIANT dbv; if (colour) { - mir_snprintf(str, SIZEOF(str), "Font%dCol", i); + mir_snprintf(str, "Font%dCol", i); *colour = db_get_dw(NULL, CHATFONTMOD, str, 0x000000); } if (lf) { - mir_snprintf(str, SIZEOF(str), "Font%dSize", i); + mir_snprintf(str, "Font%dSize", i); lf->lfHeight = (char)db_get_b(NULL, CHATFONTMOD, str, 10); lf->lfHeight = abs(lf->lfHeight); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; - mir_snprintf(str, SIZEOF(str), "Font%dSty", i); + mir_snprintf(str, "Font%dSty", i); style = db_get_b(NULL, CHATFONTMOD, str, 0); lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; lf->lfItalic = style & FONTF_ITALIC ? 1 : 0; lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0; lf->lfStrikeOut = 0; - mir_snprintf(str, SIZEOF(str), "Font%dSet", i); + mir_snprintf(str, "Font%dSet", i); lf->lfCharSet = db_get_b(NULL, CHATFONTMOD, str, DEFAULT_CHARSET); 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 (db_get(NULL, CHATFONTMOD, str, &dbv)) mir_strcpy(lf->lfFaceName, "Verdana"); else { diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 3a4031f2ec..611d7c74de 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -205,7 +205,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) mir_free(ci.pszVal); break; case CNFT_DWORD: - mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal); + mir_snprintf(buf, "%u", ci.dVal); break; } } @@ -219,7 +219,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) mir_free(ci.pszVal); break; case CNFT_DWORD: - mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal); + mir_snprintf(buf, "%u", ci.dVal); break; } } diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp index 03c083eaef..513e8eb9ae 100644 --- a/plugins/IEView/src/HistoryHTMLBuilder.cpp +++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp @@ -100,34 +100,34 @@ void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, CO int style; DBVARIANT dbv; if (bkgColour) { - mir_snprintf(str, SIZEOF(str), "Back.%s", dbSetting); + mir_snprintf(str, "Back.%s", dbSetting); *bkgColour = db_get_dw(NULL, HPPMOD, str, 0xFFFFFF); } if (colour) { - mir_snprintf(str, SIZEOF(str), "Font.%s.Color", dbSetting); + mir_snprintf(str, "Font.%s.Color", dbSetting); *colour = db_get_dw(NULL, HPPMOD, str, 0x000000); } if (lf) { - mir_snprintf(str, SIZEOF(str), "Font.%s.Size", dbSetting); + mir_snprintf(str, "Font.%s.Size", dbSetting); lf->lfHeight = (char)db_get_b(NULL, HPPMOD, str, 10); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; - mir_snprintf(str, SIZEOF(str), "Font.%s.Style.Bold", dbSetting); + mir_snprintf(str, "Font.%s.Style.Bold", dbSetting); style = db_get_b(NULL, HPPMOD, str, 0); lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; - mir_snprintf(str, SIZEOF(str), "Font.%s.Style.Italic", dbSetting); + mir_snprintf(str, "Font.%s.Style.Italic", dbSetting); style = db_get_b(NULL, HPPMOD, str, 0) << 1; lf->lfItalic = style & FONTF_ITALIC ? 1 : 0; lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0; lf->lfStrikeOut = 0; - mir_snprintf(str, SIZEOF(str), "Font.%s.Charset", dbSetting); + mir_snprintf(str, "Font.%s.Charset", dbSetting); lf->lfCharSet = db_get_b(NULL, HPPMOD, str, DEFAULT_CHARSET); 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.%s.Name", dbSetting); + mir_snprintf(str, "Font.%s.Name", dbSetting); if (db_get(NULL, HPPMOD, str, &dbv)) mir_strcpy(lf->lfFaceName, "Verdana"); else { diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp index dc34b47dca..c34e794f41 100644 --- a/plugins/IEView/src/MUCCHTMLBuilder.cpp +++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp @@ -46,29 +46,29 @@ void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) int style; DBVARIANT dbv; if (colour) { - mir_snprintf(str, SIZEOF(str), "Font%dCol", i); + mir_snprintf(str, "Font%dCol", i); *colour = db_get_dw(NULL, MUCCMOD, str, 0x000000); } if (lf) { - mir_snprintf(str, SIZEOF(str), "Font%dSize", i); + mir_snprintf(str, "Font%dSize", i); lf->lfHeight = (char)db_get_b(NULL, MUCCMOD, str, 10); lf->lfHeight = abs(lf->lfHeight); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; - mir_snprintf(str, SIZEOF(str), "Font%dStyle", i); + mir_snprintf(str, "Font%dStyle", i); style = db_get_b(NULL, MUCCMOD, str, 0); lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; lf->lfItalic = style & FONTF_ITALIC ? 1 : 0; lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0; lf->lfStrikeOut = 0; - mir_snprintf(str, SIZEOF(str), "Font%dSet", i); + mir_snprintf(str, "Font%dSet", i); lf->lfCharSet = db_get_b(NULL, MUCCMOD, str, DEFAULT_CHARSET); 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%dFace", i); + mir_snprintf(str, "Font%dFace", i); if (db_get(NULL, MUCCMOD, str, &dbv)) mir_strcpy(lf->lfFaceName, "Verdana"); else { diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp index 8d9e6aa737..ec87e8877c 100644 --- a/plugins/IEView/src/ScriverHTMLBuilder.cpp +++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp @@ -88,29 +88,29 @@ void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) int style; DBVARIANT dbv; if (colour) { - mir_snprintf(str, SIZEOF(str), "SRMFont%dCol", i); + mir_snprintf(str, "SRMFont%dCol", i); *colour = db_get_dw(NULL, SRMMMOD, str, 0x000000); } if (lf) { - mir_snprintf(str, SIZEOF(str), "SRMFont%dSize", i); + mir_snprintf(str, "SRMFont%dSize", i); lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, 10); lf->lfHeight = abs(lf->lfHeight); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; - mir_snprintf(str, SIZEOF(str), "SRMFont%dSty", i); + mir_snprintf(str, "SRMFont%dSty", i); style = db_get_b(NULL, SRMMMOD, str, 0); lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; lf->lfItalic = style & FONTF_ITALIC ? 1 : 0; lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0; lf->lfStrikeOut = 0; - mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i); + mir_snprintf(str, "SRMFont%dSet", i); lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET); 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), "SRMFont%d", i); + mir_snprintf(str, "SRMFont%d", i); if (db_get(NULL, SRMMMOD, str, &dbv)) mir_strcpy(lf->lfFaceName, "Verdana"); else { diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp index d64d1851d7..aa08a7b73a 100644 --- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp +++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp @@ -117,31 +117,31 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) int style; DBVARIANT dbv; if (colour) { - mir_snprintf(str, SIZEOF(str), "Font%dCol", i); + mir_snprintf(str, "Font%dCol", i); *colour = db_get_dw(NULL, TABSRMM_FONTMODULE, str, 0x000000); } if (lf) { HDC hdc = GetDC(NULL); - mir_snprintf(str, SIZEOF(str), "Font%dSize", i); + mir_snprintf(str, "Font%dSize", i); lf->lfHeight = (char)db_get_b(NULL, TABSRMM_FONTMODULE, str, 10); ReleaseDC(NULL, hdc); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; - mir_snprintf(str, SIZEOF(str), "Font%dSty", i); + mir_snprintf(str, "Font%dSty", i); style = db_get_b(NULL, TABSRMM_FONTMODULE, str, 0); lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; lf->lfItalic = style & FONTF_ITALIC ? 1 : 0; lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0; lf->lfStrikeOut = 0; - mir_snprintf(str, SIZEOF(str), "Font%dSet", i); + mir_snprintf(str, "Font%dSet", i); lf->lfCharSet = db_get_b(NULL, TABSRMM_FONTMODULE, str, DEFAULT_CHARSET); 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 (db_get(NULL, TABSRMM_FONTMODULE, str, &dbv)) mir_strcpy(lf->lfFaceName, "Verdana"); else { diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 0e1094cd17..9002b5baab 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -504,7 +504,7 @@ BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal) else { char setting[256]; - mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto); + mir_snprintf(setting, "%sEnabled", proto); return (BOOL) db_get_b(NULL, MODULE_NAME, setting, FALSE); } } @@ -708,7 +708,7 @@ INT_PTR EnableListeningTo(char *proto,BOOL enabled) return 0; char setting[256]; - mir_snprintf(setting, SIZEOF(setting), "%sEnabled", proto); + mir_snprintf(setting, "%sEnabled", proto); db_set_b(NULL, MODULE_NAME, setting, enabled); // Modify menu info diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index a83b42f0a5..f508c27906 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1027,7 +1027,7 @@ void LoadSettings() for(int i = 0; i < STATUS_COUNT; i++) { char buff[128]; - mir_snprintf(buff, SIZEOF(buff), "LNStatus%d", i); + mir_snprintf(buff, "LNStatus%d", i); settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1); } //lookupLotusDefaultSettings(); @@ -1291,7 +1291,7 @@ INT_PTR CALLBACK DlgProcLotusNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L db_set_b(NULL, PLUGINNAME, "LNIniAnswer", settingIniAnswer); for(int i = 0; i < STATUS_COUNT ; i++){ - mir_snprintf(buff, SIZEOF(buff), "LNStatus%d", i); + mir_snprintf(buff, "LNStatus%d", i); settingStatus[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_STATUS), i) ? TRUE : FALSE); db_set_b(0, PLUGINNAME, buff, settingStatus[i] ? 1 : 0); } diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index b75ad82428..3a97fb52fb 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -602,9 +602,9 @@ INT_PTR onCopyID(WPARAM wparam, LPARAM lparam) PROTOACCOUNT *pa = ProtoGetAccount(szProto); if (!pa->bOldProto) - mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", pa->szProtoName, szID); + mir_snprintf(buffer, "%s: %s", pa->szProtoName, szID); else - mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", szProto, szID); + mir_snprintf(buffer, "%s: %s", szProto, szID); } else strncpy(buffer, szID, SIZEOF(buffer)-1); diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index b4615bc689..5414ab4568 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -327,7 +327,7 @@ void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) { void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg) { char buff[1024]; - mir_snprintf(buff, SIZEOF(buff), "%s%s", LANG_INLINE_PREFIX, msg); + mir_snprintf(buff, "%s%s", LANG_INLINE_PREFIX, msg); PROTORECVEVENT pre = {0}; pre.timestamp = time(0); diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 299ff0b2dd..3b11046a5e 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1292,7 +1292,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts2(HWND hwndDlg, UINT msg, WPARAM wPa for (int i = 0; i < nCount; i++) { - mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", proto[i]->szModuleName); + mir_snprintf(szTemp, "DisableProt_%s", proto[i]->szModuleName); sItem.pszText = proto[i]->szModuleName; sItem.iImage = db_get_b(NULL, MODULE, szTemp, 1); ::SendMessage(hMapUser, LVM_INSERTITEMA, 0, (LPARAM)&sItem); diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 528ff489d5..ac9781fa49 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -1426,7 +1426,7 @@ int nExportEvent(WPARAM hContact, LPARAM hDbEvent) if (!db_event_get(hDbEvent, &dbei)) { char szTemp[500]; - mir_snprintf(szTemp, SIZEOF(szTemp), "DisableProt_%s", dbei.szModule); + mir_snprintf(szTemp, "DisableProt_%s", dbei.szModule); if (db_get_b(NULL, MODULE, szTemp, 1)) ExportDBEventInfo(hContact, dbei); } 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; diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 21815bd625..3b9f390634 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1412,21 +1412,21 @@ void ExportGpGKeysFunc(int type) case DBVT_BYTE: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal); + mir_snprintf(_id, "%d", dbv.bVal); id += _id; } break; case DBVT_WORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal); + mir_snprintf(_id, "%d", dbv.wVal); id += _id; } break; case DBVT_DWORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal); + mir_snprintf(_id, "%d", dbv.dVal); id += _id; } break; @@ -1463,21 +1463,21 @@ void ExportGpGKeysFunc(int type) case DBVT_BYTE: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal); + mir_snprintf(_id, "%d", dbv.bVal); id += _id; } break; case DBVT_WORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal); + mir_snprintf(_id, "%d", dbv.wVal); id += _id; } break; case DBVT_DWORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal); + mir_snprintf(_id, "%d", dbv.dVal); id += _id; } break; @@ -1616,7 +1616,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) case DBVT_BYTE: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal); + mir_snprintf(_id, "%d", dbv.bVal); id += _id; if(id == login) acc = accs[i]->szModuleName; @@ -1625,7 +1625,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) case DBVT_WORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal); + mir_snprintf(_id, "%d", dbv.wVal); id += _id; if(id == login) acc = accs[i]->szModuleName; @@ -1634,7 +1634,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) case DBVT_DWORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal); + mir_snprintf(_id, "%d", dbv.dVal); id += _id; if(id == login) acc = accs[i]->szModuleName; @@ -1685,7 +1685,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) case DBVT_BYTE: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.bVal); + mir_snprintf(_id, "%d", dbv.bVal); id += _id; if(id == contact_id) found = true; @@ -1694,7 +1694,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) case DBVT_WORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.wVal); + mir_snprintf(_id, "%d", dbv.wVal); id += _id; if(id == contact_id) found = true; @@ -1703,7 +1703,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) case DBVT_DWORD: { char _id[64]; - mir_snprintf(_id, SIZEOF(_id), "%d", dbv.dVal); + mir_snprintf(_id, "%d", dbv.dVal); id += _id; if(id == contact_id) found = true; diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index 5d3a56b645..1cfe612b5a 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -36,7 +36,7 @@ void CreateAuthString(char *auth, MCONTACT hContact, HWND hwndDlg) char *user = mir_t2a(tlogin), *pass = mir_t2a(tpass); char str[MAX_PATH]; - int len = mir_snprintf(str, SIZEOF(str), "%s:%s", user, pass); + int len = mir_snprintf(str, "%s:%s", user, pass); mir_free(user); mir_free(pass); mir_free(tlogin); diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index af83f83cb5..ff3e1795e6 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -588,23 +588,23 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) if (icon) { char tmp[64]; if (icon == ID_STATUS_ONLINE) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: Online\r\n"); + mir_snprintf(tmp, "Icon: Online\r\n"); else if (icon == ID_STATUS_AWAY) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: Away\r\n"); + mir_snprintf(tmp, "Icon: Away\r\n"); else if (icon == ID_STATUS_NA) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: NA\r\n"); + mir_snprintf(tmp, "Icon: NA\r\n"); else if (icon == ID_STATUS_DND) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: DND\r\n"); + mir_snprintf(tmp, "Icon: DND\r\n"); else if (icon == ID_STATUS_OCCUPIED) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: Occupied\r\n"); + mir_snprintf(tmp, "Icon: Occupied\r\n"); else if (icon == ID_STATUS_FREECHAT) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: Free For Chat\r\n"); + mir_snprintf(tmp, "Icon: Free For Chat\r\n"); else if (icon == ID_STATUS_INVISIBLE) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: Invisible\r\n"); + mir_snprintf(tmp, "Icon: Invisible\r\n"); else if (icon == ID_STATUS_ONTHEPHONE) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: On The Phone\r\n"); + mir_snprintf(tmp, "Icon: On The Phone\r\n"); else if (icon == ID_STATUS_OUTTOLUNCH) - mir_snprintf(tmp, SIZEOF(tmp), "Icon: Out To Lunch\r\n"); + mir_snprintf(tmp, "Icon: Out To Lunch\r\n"); else { free(msg); continue; @@ -620,7 +620,7 @@ INT_PTR ImportContacts(WPARAM wParam, LPARAM lParam) if (minutes) mir_strcpy(tmp2, "Minutes"); else mir_strcpy(tmp2, "Seconds"); - mir_snprintf(tmp, SIZEOF(tmp), "UseTimer: Yes\r\nTimer: %d %s", timer, tmp2); + mir_snprintf(tmp, "UseTimer: Yes\r\nTimer: %d %s", timer, tmp2); char *msgtemp = (char*)realloc(msg, mir_strlen(msg) + mir_strlen(tmp) + 1); if (msgtemp) { msg = msgtemp; diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp index 5f7044cf12..677f2d2455 100644 --- a/plugins/Non-IM Contact/src/files.cpp +++ b/plugins/Non-IM Contact/src/files.cpp @@ -75,7 +75,7 @@ void reloadFiles(HWND fileList) char file[MAX_PATH], fn[6]; SendMessage(fileList, CB_RESETCONTENT, 0, 0); for (i = 0;; i++) { - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); if (db_get_static(NULL, MODNAME, fn, file, SIZEOF(file))) { index = SendMessageA(fileList, CB_ADDSTRING, 0, (LPARAM)file); SendMessage(fileList, CB_SETITEMDATA, index, (LPARAM)i); @@ -104,7 +104,7 @@ void readFile(HWND hwnd) int lineNumber, fileLength = 0, width = 0; char temp[MAX_STRING_LENGTH], szFileName[512], temp1[MAX_STRING_LENGTH], fn[8]; int fileNumber = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0); - mir_snprintf(fn, SIZEOF(fn), "fn%d", fileNumber); + mir_snprintf(fn, "fn%d", fileNumber); if (!db_get_static(NULL, MODNAME, fn, szFileName, SIZEOF(szFileName))) { msg(Translate("File couldn't be opened"), fn); return; @@ -147,12 +147,12 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) reloadFiles(GetDlgItem(hwnd, IDC_FILE_LIST)); { int i = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0); - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); SendDlgItemMessage(hwnd, IDC_FILE_CONTENTS, LB_RESETCONTENT, 0, 0); if (db_get_static(NULL, MODNAME, fn, string, SIZEOF(string))) { if ((!strncmp("http://", string, mir_strlen("http://"))) || (!strncmp("https://", string, mir_strlen("https://")))) { SetDlgItemTextA(hwnd, IDC_URL, string); - mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i); + mir_snprintf(fn, "fn%d_timer", i); SetDlgItemTextA(hwnd, IDC_WWW_TIMER, _itoa(db_get_w(NULL, MODNAME, fn, 60), tmp, 10)); } readFile(hwnd); @@ -176,13 +176,13 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) mir_strcpy(url, text); if (!InternetDownloadFile(text)) { for (i = 0;; i++) { - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); if (!db_get_static(NULL, MODNAME, fn, text, SIZEOF(text))) break; } mir_snprintf(szFileName, SIZEOF(szFileName), "%s\\plugins\\%s.html", getMimDir(temp), fn); if (savehtml(szFileName)) { - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); db_set_s(NULL, MODNAME, fn, url); if (!GetWindowTextLength(GetDlgItem(hwnd, IDC_WWW_TIMER))) timer = 60; @@ -190,7 +190,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) GetDlgItemTextA(hwnd, IDC_WWW_TIMER, text, SIZEOF(text)); timer = atoi(text); } - mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i); + mir_snprintf(fn, "fn%d_timer", i); db_set_w(NULL, MODNAME, fn, (WORD)timer); SendMessage(hwnd, WM_RELOADWINDOW, 0, 0); } @@ -206,7 +206,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int i, index; char file[MAX_PATH], fn[6]; for (i = 0;; i++) { - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); if (!db_get_static(NULL, MODNAME, fn, file, SIZEOF(file))) break; } @@ -216,7 +216,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_SETITEMDATA, index, (LPARAM)i); SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_SETCURSEL, index, 0); SetDlgItemTextA(hwnd, IDC_FN, _itoa(i, fn, 10)); - mir_snprintf(fn, SIZEOF(fn), "fn%d", index); + mir_snprintf(fn, "fn%d", index); readFile(hwnd); } break; @@ -227,7 +227,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int index = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0), i = (int)SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETITEMDATA, index, 0); int count = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCOUNT, 0, 0) - 1; if (index == count) { - mir_snprintf(fn, SIZEOF(fn), "fn%d", index); + mir_snprintf(fn, "fn%d", index); db_unset(NULL, MODNAME, fn); SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_DELETESTRING, index, 0); SendMessage(hwnd, WM_RELOADWINDOW, 0, 0); @@ -238,13 +238,13 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } else { - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); while (db_get_static(NULL, MODNAME, fn, tmp, SIZEOF(tmp))) { - mir_snprintf(fn1, SIZEOF(fn1), "fn%d", i - 1); + mir_snprintf(fn1, "fn%d", i - 1); db_set_s(NULL, MODNAME, fn1, tmp); - mir_snprintf(fn, SIZEOF(fn), "fn%d", ++i); + mir_snprintf(fn, "fn%d", ++i); } - mir_snprintf(fn, SIZEOF(fn), "fn%d", --i); + mir_snprintf(fn, "fn%d", --i); db_unset(NULL, MODNAME, fn); SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_DELETESTRING, index, 0); SendMessage(hwnd, WM_RELOADWINDOW, 0, 0); @@ -257,11 +257,11 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int index = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0); char fn[20], tmp[MAX_PATH]; SetDlgItemTextA(hwnd, IDC_FN, _itoa(index, fn, 10)); - mir_snprintf(fn, SIZEOF(fn), "fn%d", index); + mir_snprintf(fn, "fn%d", index); if (db_get_static(NULL, MODNAME, fn, tmp, SIZEOF(tmp))) { if (!strncmp("http://", tmp, mir_strlen("http://")) || !strncmp("https://", tmp, mir_strlen("https://"))) { SetDlgItemTextA(hwnd, IDC_URL, tmp); - mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", index); + mir_snprintf(fn, "fn%d_timer", index); SetDlgItemTextA(hwnd, IDC_WWW_TIMER, _itoa(db_get_w(NULL, MODNAME, fn, 60), tmp, 10)); } else { @@ -287,7 +287,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int i = SendDlgItemMessage(hwnd, IDC_FILE_LIST, CB_GETCURSEL, 0, 0); int timer; char fn[MAX_PATH], string[1000]; - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); if (GetWindowTextLength(GetDlgItem(hwnd, IDC_WWW_TIMER))) { TCHAR text[5]; GetDlgItemText(hwnd, IDC_WWW_TIMER, text, SIZEOF(text)); @@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (db_get_static(NULL, MODNAME, fn, string, SIZEOF(string))) if (!strncmp("http://", string, mir_strlen("http://")) || !strncmp("https://", string, mir_strlen("https://"))) { - mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i); + mir_snprintf(fn, "fn%d_timer", i); db_set_w(NULL, MODNAME, fn, (WORD)timer); } diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 4b9c4449d8..456fc8d86e 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -398,7 +398,7 @@ int lastChecked(CMStringA &szNewStr, const char *str) int file; char tszFileName[MAX_PATH], temp[MAX_PATH], szSetting[20]; sscanf(&str[cbPattern], "%d", &file); - mir_snprintf(szSetting, SIZEOF(szSetting), "fn%d", file); + mir_snprintf(szSetting, "fn%d", file); char *szVar = db_get_sa(NULL, MODNAME, szSetting); if (szVar == NULL) diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp index a3195ecad3..cbd5ba7f29 100644 --- a/plugins/Non-IM Contact/src/timer.cpp +++ b/plugins/Non-IM Contact/src/timer.cpp @@ -23,12 +23,12 @@ void timerFunc(void *di) /* update the web pages*/ for (int i = 0;; i++) { - mir_snprintf(fn, SIZEOF(fn), "fn%d", i); + mir_snprintf(fn, "fn%d", i); if (!db_get_static(NULL, MODNAME, fn, text, SIZEOF(text))) break; if (!strncmp("http://", text, mir_strlen("http://")) || !strncmp("https://", text, mir_strlen("https://"))) { - mir_snprintf(fn, SIZEOF(fn), "fn%d_timer", i); + mir_snprintf(fn, "fn%d_timer", i); int timer = db_get_w(NULL, MODNAME, fn, 60); if (timer && !(timerCount % timer)) { if (!InternetDownloadFile(text)) { diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 20ac2bab12..f80376d434 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -242,7 +242,7 @@ void RegisterFontServiceFonts() for (int i = 0; i < SIZEOF(fontOptionsList); i++) { fontid.order = i; - mir_snprintf(szTemp, SIZEOF(szTemp), "Font%d", i); + mir_snprintf(szTemp, "Font%d", i); strncpy(fontid.prefix, szTemp, SIZEOF(fontid.prefix)); _tcsncpy(fontid.name, fontOptionsList[i].szDescr, SIZEOF(fontid.name)); fontid.deffontsettings.colour = fontOptionsList[i].defColour; diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 719c25afec..7f743492cd 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -1257,9 +1257,9 @@ static int ReformatTimeInputEx(HWND Dialog, UINT nIDTime, UINT nIDRefTime, int h dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime)); if (dt < 60) - mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes")); + mir_snprintf(buf, "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes")); else - mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours")); + mir_snprintf(buf, "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours")); // search for preset n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf); @@ -1282,7 +1282,7 @@ static int ReformatTimeInputEx(HWND Dialog, UINT nIDTime, UINT nIDRefTime, int h // - mir_snprintf(buf, SIZEOF(buf), "%02d:%02d", h, m); + mir_snprintf(buf, "%02d:%02d", h, m); // search for preset first n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf); @@ -1368,9 +1368,9 @@ output_result: dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime)); if (dt < 60) - mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes")); + mir_snprintf(buf, "%02d:%02d (%d %s)", h, m, dt, Translate("Minutes")); else - mir_snprintf(buf, SIZEOF(buf), "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours")); + mir_snprintf(buf, "%02d:%02d (%d.%d %s)", h, m, dt/60, ((dt%60)*10)/60, Translate("Hours")); } } else @@ -1389,7 +1389,7 @@ output_result: if ((int)Date.wHour != h || (int)Date.wMinute != m) { - mir_snprintf(buf, SIZEOF(buf), "%02d:%02d", (UINT)Date.wHour, (UINT)Date.wMinute); + mir_snprintf(buf, "%02d:%02d", (UINT)Date.wHour, (UINT)Date.wMinute); // search for preset again n = SendDlgItemMessage(Dialog, nIDTime, CB_FINDSTRING, (WPARAM)-1, (LPARAM)buf); @@ -1684,12 +1684,12 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP if (h) { LPCSTR lpszHours = Translate("Hours"); - mir_snprintf(buf, SIZEOF(buf), "%d:%02d %s", h, m, lpszHours); + mir_snprintf(buf, "%d:%02d %s", h, m, lpszHours); } else { LPCSTR lpszMinutes = Translate("Minutes"); - mir_snprintf(buf, SIZEOF(buf), "%d %s", m, lpszMinutes); + mir_snprintf(buf, "%d %s", m, lpszMinutes); } SetDlgItemText(Dialog, IDC_REMINDAGAININ, buf); } diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index b515b3dbff..4c554c263c 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -505,7 +505,7 @@ void Nudge_ShowStatus(CNudgeElement *n, MCONTACT hContact, DWORD timestamp) void Nudge_AddAccount(PROTOACCOUNT *proto) { char str[MAXMODULELABELLENGTH + 10]; - mir_snprintf(str, SIZEOF(str), "%s/Nudge", proto->szModuleName); + mir_snprintf(str, "%s/Nudge", proto->szModuleName); HANDLE hevent = HookEvent(str, NudgeReceived); if (hevent == NULL) return; diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 66e3601d8b..56a35e8ecf 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -64,7 +64,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA } else { for (int i = 1; i < POPUPS; i++) { - mir_snprintf(str, SIZEOF(str), "Popups%dM", i); + mir_snprintf(str, "Popups%dM", i); CheckDlgButton(hwndDlg, (i + 1029), (db_get_b(NULL, MODNAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED); } } @@ -148,7 +148,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA db_set_b(NULL, MODNAME, "Reminder", Reminder); if (!ServiceExists(MS_POPUP_ADDPOPUPT)) { for (int i = 1; i < POPUPS; i++) { - mir_snprintf(str, SIZEOF(str), "Popups%dM", i); + mir_snprintf(str, "Popups%dM", i); db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i + 1029)))); } } @@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hdlg, IDC_RC, CB_SETCURSEL, MyOptions.RightClickAction, 0); //Popups nitified for (i = 0; i < POPUPS; i++) { - mir_snprintf(str, SIZEOF(str), "Popups%d", i); + mir_snprintf(str, "Popups%d", i); mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i); CheckDlgButton(hdlg, (i + 40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, (i + 1024), (db_get_b(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED : BST_UNCHECKED); @@ -353,11 +353,11 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0; i <= POPUPS - 1; i++) { ctlColor = SendDlgItemMessage(hdlg, (i + 42071), CPM_GETCOLOUR, 0, 0); PopupsList[i].colorBack = ctlColor; - mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iBg", i); + mir_snprintf(szSetting, "Popups%iBg", i); db_set_dw(NULL, MODNAME, szSetting, ctlColor); ctlColor = SendDlgItemMessage(hdlg, (i + 41071), CPM_GETCOLOUR, 0, 0); PopupsList[i].colorText = ctlColor; - mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iTx", i); + mir_snprintf(szSetting, "Popups%iTx", i); db_set_dw(NULL, MODNAME, szSetting, ctlColor); } //Colors @@ -371,7 +371,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) db_set_b(NULL, MODNAME, "RightClickAction", MyOptions.RightClickAction); //Notified popups for (i = 0; i < POPUPS; i++) { - mir_snprintf(str, SIZEOF(str), "Popups%d", i); + mir_snprintf(str, "Popups%d", i); db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071)))); mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i); db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024)))); diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index 64be901181..3dd8c82452 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -231,7 +231,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar WindowData *wd = (WindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); { char buff[30]; - mir_snprintf(buff, SIZEOF(buff), "pinggraphwnd%d", wd->item_id); + mir_snprintf(buff, "pinggraphwnd%d", wd->item_id); Utils_SaveWindowPosition(hwnd, 0, PLUG, buff); } } @@ -241,7 +241,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar WindowData *wd = (WindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); { char buff[30]; - mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", wd->item_id); + mir_snprintf(buff, "WindowHandle%d", wd->item_id); db_set_dw(0, PLUG, buff, 0); } delete wd; @@ -254,7 +254,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { char buff[30]; - mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", (DWORD)wParam); + mir_snprintf(buff, "WindowHandle%d", (DWORD)wParam); HWND hGraphWnd = (HWND)db_get_dw(0, PLUG, buff, 0); if (hGraphWnd) { ShowWindow(hGraphWnd, SW_SHOW); @@ -298,7 +298,7 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { SetWindowLongPtr(hGraphWnd, GWLP_USERDATA, (LONG_PTR)wd); - mir_snprintf(buff, SIZEOF(buff), "pinggraphwnd%d", wd->item_id); + mir_snprintf(buff, "pinggraphwnd%d", wd->item_id); Utils_RestoreWindowPosition(hGraphWnd, 0, PLUG, buff); if (!IsWindowVisible(hGraphWnd)) @@ -314,11 +314,11 @@ void graphs_cleanup() { HWND hwnd; for (int i = 0; i < list_size; i++) { - mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", i); + mir_snprintf(buff, "WindowHandle%d", i); if (hwnd = (HWND)db_get_dw(0, PLUG, buff, 0)) { DestroyWindow(hwnd); db_set_dw(0, PLUG, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "WindowWasOpen%d", i); + mir_snprintf(buff, "WindowWasOpen%d", i); db_set_b(0, PLUG, buff, 1); } } @@ -330,9 +330,9 @@ void graphs_init() { char buff[64]; CallService(PLUG "/GetPingList", 0, (LPARAM)&pl); for (pinglist_it i = pl.begin(); i != pl.end(); ++i) { - mir_snprintf(buff, SIZEOF(buff), "WindowHandle%d", i->item_id); // clean up from possible crash + mir_snprintf(buff, "WindowHandle%d", i->item_id); // clean up from possible crash db_set_dw(0, PLUG, buff, 0); - mir_snprintf(buff, SIZEOF(buff), "WindowWasOpen%d", i->item_id); // restore windows that were open on shutdown + mir_snprintf(buff, "WindowWasOpen%d", i->item_id); // restore windows that were open on shutdown if (db_get_b(0, PLUG, buff, 0)) { db_set_b(0, PLUG, buff, 0); ShowGraph((WPARAM)i->item_id, (LPARAM)i->pszLabel); diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index e3a0e7b6bb..cbd590c503 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -55,7 +55,7 @@ INT_PTR GetListSize(WPARAM, LPARAM) void write_ping_address(PINGADDRESS &i) { char buff[16]; - mir_snprintf(buff, SIZEOF(buff), "PING_DEST_%d", i.index); + mir_snprintf(buff, "PING_DEST_%d", i.index); if (i.item_id == 0) { i.item_id = NextID++; @@ -97,7 +97,7 @@ void write_ping_addresses() do { found = false; - mir_snprintf(buff, SIZEOF(buff), "PING_DEST_%d", index++); + mir_snprintf(buff, "PING_DEST_%d", index++); if (db_get_dw(0, buff, "Id", 0) != 0) { found = true; db_set_dw(0, buff, "Id", 0); @@ -109,7 +109,7 @@ bool read_ping_address(PINGADDRESS &pa) { int index = pa.index; char buff[16]; - mir_snprintf(buff, SIZEOF(buff), "PING_DEST_%d", index); + mir_snprintf(buff, "PING_DEST_%d", index); // return if not more contacts, or only deleted contacts remaining if ((pa.item_id = db_get_dw(0, buff, "Id", 0)) == 0) return false; diff --git a/plugins/Ping/src/rawping.cpp b/plugins/Ping/src/rawping.cpp index 98cdace9bd..aad13b220e 100644 --- a/plugins/Ping/src/rawping.cpp +++ b/plugins/Ping/src/rawping.cpp @@ -198,7 +198,7 @@ extern int raw_ping(char *host, int timeout) if (reply->type == PT_ICMP_SOURCE_QUENCH) { char buff[1024]; - mir_snprintf(buff, SIZEOF(buff), Translate("Host %s requests that you reduce the amount of traffic you are sending."), host); + mir_snprintf(buff, Translate("Host %s requests that you reduce the amount of traffic you are sending."), host); MessageBoxA(0, buff, Translate(PLUG " Warning"), MB_OK | MB_ICONWARNING); } diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 84d86718b7..f61f0f9399 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -219,7 +219,7 @@ INT_PTR DblClick(WPARAM wParam, LPARAM lParam) { void import_ping_address(int index, PINGADDRESS &pa) { DBVARIANT dbv; char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "Address%d", index); + mir_snprintf(buf, "Address%d", index); if (!db_get_ts(0, "PingPlug", buf, &dbv)) { mir_tstrncpy(pa.pszName, dbv.ptszVal, SIZEOF(pa.pszName)); db_free(&dbv); @@ -227,7 +227,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { else mir_tstrncpy(pa.pszName, TranslateT("Unknown Address"), SIZEOF(pa.pszName)); - mir_snprintf(buf, SIZEOF(buf), "Label%d", index); + mir_snprintf(buf, "Label%d", index); if (!db_get_ts(0, "PingPlug", buf, &dbv)) { mir_tstrncpy(pa.pszLabel, dbv.ptszVal, SIZEOF(pa.pszLabel)); db_free(&dbv); @@ -235,16 +235,16 @@ void import_ping_address(int index, PINGADDRESS &pa) { else mir_tstrncpy(pa.pszLabel, TranslateT("Unknown"), SIZEOF(pa.pszLabel)); - mir_snprintf(buf, SIZEOF(buf), "Port%d", index); + mir_snprintf(buf, "Port%d", index); pa.port = (int)db_get_dw(0, "PingPlug", buf, -1); - mir_snprintf(buf, SIZEOF(buf), "Proto%d", index); + mir_snprintf(buf, "Proto%d", index); if (!db_get_s(0, "PingPlug", buf, &dbv)) { mir_strncpy(pa.pszProto, dbv.pszVal, SIZEOF(pa.pszProto)); db_free(&dbv); - mir_snprintf(buf, SIZEOF(buf), "Status%d", index); + mir_snprintf(buf, "Status%d", index); pa.set_status = db_get_w(0, "PingPlug", buf, ID_STATUS_ONLINE); - mir_snprintf(buf, SIZEOF(buf), "Status2%d", index); + mir_snprintf(buf, "Status2%d", index); pa.get_status = db_get_w(0, "PingPlug", buf, ID_STATUS_OFFLINE); } else @@ -259,7 +259,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { pa.pszParams[0] = '\0'; pa.item_id = 0; - mir_snprintf(buf, SIZEOF(buf), "Enabled%d", index); + mir_snprintf(buf, "Enabled%d", index); if (db_get_b(0, "PingPlug", buf, 1) == 1) pa.status = PS_NOTRESPONDING; else diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 8e869d2349..b7ac68c75c 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -97,7 +97,7 @@ void ShowPopup(LPCTSTR ptszTitle, LPCTSTR ptszText, int Number) { if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) { char setting[100]; - mir_snprintf(setting, SIZEOF(setting), "Popups%d", Number); + mir_snprintf(setting, "Popups%d", Number); if (db_get_b(NULL, MODNAME, setting, DEFAULT_POPUP_ENABLED)) { POPUPDATAT pd = { 0 }; pd.lchContact = NULL; diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index df04c64977..4721a71e40 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) //Popups notified for (int i = 0; i < POPUPS; i++) { char str[20] = {0}; - mir_snprintf(str, SIZEOF(str), "Popups%d", i); + mir_snprintf(str, "Popups%d", i); CheckDlgButton(hdlg, (i+40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED); } return TRUE; @@ -361,11 +361,11 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) for (int i = 0; i < POPUPS; i++) { ctlColor = SendDlgItemMessage(hdlg, (i+42071), CPM_GETCOLOUR, 0, 0); PopupsList[i].colorBack = ctlColor; - mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iBg", i); + mir_snprintf(szSetting, "Popups%iBg", i); db_set_dw(NULL, MODNAME, szSetting, ctlColor); ctlColor = SendDlgItemMessage(hdlg, (i+41071), CPM_GETCOLOUR, 0, 0); PopupsList[i].colorText = ctlColor; - mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iTx", i); + mir_snprintf(szSetting, "Popups%iTx", i); db_set_dw(NULL, MODNAME, szSetting, ctlColor); } //Colors @@ -380,7 +380,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) //Notified popups for (int i = 0; i < POPUPS; i++) { char str[20] = {0}; - mir_snprintf(str, SIZEOF(str), "Popups%d", i); + mir_snprintf(str, "Popups%d", i); db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071)))); } return TRUE; 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); } diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 1bf057c0cd..03f98dd87f 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -361,7 +361,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) { // See if has to show char setting[128]; - mir_snprintf(setting, SIZEOF(setting), "ShowOffline%s", pszProto); + mir_snprintf(setting, "ShowOffline%s", pszProto); if (!db_get_b(NULL, MODULE_NAME, setting, FALSE)) continue; @@ -383,7 +383,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) continue; char setting[128]; - mir_snprintf(setting, SIZEOF(setting), "ShowOffline%s", META_PROTO); + mir_snprintf(setting, "ShowOffline%s", META_PROTO); if (db_get_b(NULL, MODULE_NAME, setting, FALSE)) continue; } diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index e73e67e49c..daae18a680 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -14,7 +14,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, (LastUCOpt.HideOffline ? BST_CHECKED : BST_UNCHECKED)); CheckDlgButton(hwndDlg, IDC_WINDOWAUTOSIZE, (LastUCOpt.WindowAutoSize ? BST_CHECKED : BST_UNCHECKED)); - mir_snprintf(str, SIZEOF(str), "%d", LastUCOpt.MaxShownContacts); + mir_snprintf(str, "%d", LastUCOpt.MaxShownContacts); SetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str); strncpy_s(str, LastUCOpt.DateTimeFormat.c_str(), _TRUNCATE); diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index d15119b7f9..b9c5b567b0 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -579,7 +579,7 @@ void DeleteFileOrFolder(const char *name) else if (attibs & FILE_ATTRIBUTE_DIRECTORY) { // Is a directory // Get all files and delete then char tmp[MAX_PATH]; - mir_snprintf(tmp, SIZEOF(tmp), "%s\\*.*", name); + mir_snprintf(tmp, "%s\\*.*", name); // Delete files WIN32_FIND_DATAA findData; @@ -587,7 +587,7 @@ void DeleteFileOrFolder(const char *name) if (hwnd != INVALID_HANDLE_VALUE) { do { if (mir_strcmp(findData.cFileName, ".") && mir_strcmp(findData.cFileName, "..")) { - mir_snprintf(tmp, SIZEOF(tmp), "%s\\%s", name, findData.cFileName); + mir_snprintf(tmp, "%s\\%s", name, findData.cFileName); DeleteFileOrFolder(tmp); } } diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 4bc091ccdc..14d5606ac9 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1040,7 +1040,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam; char idbuf[128], buf[128]; GetContactUniqueId(dat, idbuf, sizeof(idbuf)); - mir_snprintf(buf, SIZEOF(buf), Translate("User menu - %s"), idbuf); + mir_snprintf(buf, Translate("User menu - %s"), idbuf); SendDlgItemMessage(hwndDlg, IDC_USERMENU, BUTTONADDTOOLTIP, (WPARAM)buf, 0); if (cws && !mir_strcmp(cws->szModule, dat->szProto) && !mir_strcmp(cws->szSetting, "Status")) diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 9bf514bd3d..171ebfca17 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -114,7 +114,7 @@ void RegisterFontServiceFonts() fid.order = i; char szTemp[100]; - mir_snprintf(szTemp, SIZEOF(szTemp), "SRMFont%d", i); + mir_snprintf(szTemp, "SRMFont%d", i); strncpy(fid.prefix, szTemp, SIZEOF(fid.prefix)); _tcsncpy(fid.name, fontOptionsList[i].szDescr, SIZEOF(fid.name)); fid.deffontsettings.colour = fontOptionsList[i].defColour; @@ -166,17 +166,17 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) char str[32]; if (colour) { - mir_snprintf(str, SIZEOF(str), "%s%dCol", "SRMFont", i); + mir_snprintf(str, "%s%dCol", "SRMFont", i); *colour = db_get_dw(NULL, SRMMMOD, str, fontOptionsList[i].defColour); } if (lf) { - mir_snprintf(str, SIZEOF(str), "%s%dSize", "SRMFont", i); + mir_snprintf(str, "%s%dSize", "SRMFont", i); lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defSize); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; - mir_snprintf(str, SIZEOF(str), "%s%dSty", "SRMFont", i); + mir_snprintf(str, "%s%dSty", "SRMFont", i); int style = db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defStyle); lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; lf->lfItalic = style & FONTF_ITALIC ? 1 : 0; @@ -186,7 +186,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; lf->lfQuality = DEFAULT_QUALITY; lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; - mir_snprintf(str, SIZEOF(str), "%s%d", "SRMFont", i); + mir_snprintf(str, "%s%d", "SRMFont", i); ptrT tszFace(db_get_tsa(NULL, SRMMMOD, str)); if (tszFace == NULL) @@ -194,7 +194,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour) else _tcsncpy(lf->lfFaceName, tszFace, SIZEOF(lf->lfFaceName)); - mir_snprintf(str, SIZEOF(str), "%s%dSet", "SRMFont", i); + mir_snprintf(str, "%s%dSet", "SRMFont", i); lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET); } } @@ -407,9 +407,9 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_SETPOS, TRUE, db_get_dw(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA)); SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_SETRANGE, FALSE, MAKELONG(0,255)); SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_SETPOS, TRUE, db_get_dw(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SRMSGDEFSET_INACTIVEALPHA)); - mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255)); + mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255)); SetDlgItemTextA(hwndDlg, IDC_ATRANSPARENCYPERC, str); - mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255)); + mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 255)); SetDlgItemTextA(hwndDlg, IDC_ITRANSPARENCYPERC, str); SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETRANGE, 0, MAKELONG(100, 1)); SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETPOS, 0, db_get_w(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES)); @@ -451,9 +451,9 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar case WM_HSCROLL: { char str[10]; - mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256)); + mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ATRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256)); SetDlgItemTextA(hwndDlg, IDC_ATRANSPARENCYPERC, str); - mir_snprintf(str, SIZEOF(str), "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256)); + mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256)); SetDlgItemTextA(hwndDlg, IDC_ITRANSPARENCYPERC, str); MarkChanges(16, hwndDlg); } diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index cadba31b28..a3e2b75b60 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1298,7 +1298,7 @@ void ApplyProtoSettings(HWND hDlg) pSupPro p = arProto[getListViewProto(hLV, i)]; p->inspecting = ListView_GetCheckState(hLV, i); char tmp[128]; - mir_snprintf(tmp, SIZEOF(tmp), "%s:%d:%d:%d;", p->name, p->inspecting, p->tsplit_on, p->tsplit_off); + mir_snprintf(tmp, "%s:%d:%d:%d;", p->name, p->inspecting, p->tsplit_on, p->tsplit_off); mir_strcat(szNames, tmp); p->split_on = p->tsplit_on; p->split_off = p->tsplit_off; diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index 9f59e6d3ba..63e3e2455a 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -118,7 +118,7 @@ void __cdecl rsa_notify(HANDLE context, int state) case -0x60: { char buf[1024]; - mir_snprintf(buf, SIZEOF(buf), sim510, -state); + mir_snprintf(buf, sim510, -state); showPopupDCmsg(ptr->hContact, buf); ShowStatusIconNotify(ptr->hContact); if (ptr->cntx) deleteRSAcntx(ptr); diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 1c010e02c8..140175b128 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp EnableWindow(GetDlgItem(hdlg, IDC_POPUPSTAMPTEXT), hasPopups); for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) { char szSetting[100]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Col_%d", i - ID_STATUS_OFFLINE); + mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE); DWORD sett = db_get_dw(NULL, S_MOD, szSetting, StatusColors15bits[i - ID_STATUS_OFFLINE]); COLORREF back, text; @@ -147,7 +147,7 @@ INT_PTR CALLBACK OptsPopupsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp DWORD sett = GetDWordFromColors(back, text); char szSetting[100]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Col_%d", i - ID_STATUS_OFFLINE); + mir_snprintf(szSetting, "Col_%d", i - ID_STATUS_OFFLINE); if (sett != StatusColors15bits[i - ID_STATUS_OFFLINE]) db_set_dw(NULL, S_MOD, szSetting, sett); else diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index ce2391d99e..32329e7a99 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -486,7 +486,7 @@ void ShowPopup(MCONTACT hcontact, const char * lpzProto, int newStatus) DBVARIANT dbv; char szSetting[10]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Col_%d", newStatus - ID_STATUS_OFFLINE); + mir_snprintf(szSetting, "Col_%d", newStatus - ID_STATUS_OFFLINE); DWORD sett = db_get_dw(NULL, S_MOD, szSetting, StatusColors15bits[newStatus - ID_STATUS_OFFLINE]); POPUPDATAT ppd = { 0 }; @@ -591,7 +591,7 @@ int UpdateValues(WPARAM hContact, LPARAM lparam) { char str[MAXMODULELABELLENGTH + 9]; - mir_snprintf(str, SIZEOF(str), "OffTime-%s", szProto); + mir_snprintf(str, "OffTime-%s", szProto); DWORD t = db_get_dw(NULL, S_MOD, str, 0); if (!t) t = time(NULL); @@ -672,7 +672,7 @@ static void cleanThread(void *param) } char str[MAXMODULELABELLENGTH + 9]; - mir_snprintf(str, SIZEOF(str), "OffTime-%s", infoParam->sProtoName); + mir_snprintf(str, "OffTime-%s", infoParam->sProtoName); db_unset(NULL, S_MOD, str); } free(infoParam); @@ -711,7 +711,7 @@ int ModeChange(WPARAM wparam, LPARAM lparam) time_t t; time(&t); - mir_snprintf(str, SIZEOF(str), "OffTime-%s", ack->szModule); + mir_snprintf(str, "OffTime-%s", ack->szModule); db_set_dw(NULL, S_MOD, str, t); } } diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 54108687db..7842865d55 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -491,7 +491,7 @@ int SaveSessionDate() mir_sntprintf(szSessionTime, lenn, _T("%s - %s"), szTimeBuf, szDateBuf); char szSetting[256]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%d", "SessionDate", 0); + mir_snprintf(szSetting, "%s_%d", "SessionDate", 0); TCHAR *ptszSaveSessionDate = db_get_tsa(NULL, MODNAME, szSetting); db_set_ts(NULL, MODNAME, szSetting, szSessionTime); @@ -516,7 +516,7 @@ int SaveUserSessionName(TCHAR *szUSessionName) return 1; char szSetting[256]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%u", "UserSessionDsc", 0); + mir_snprintf(szSetting, "%s_%u", "UserSessionDsc", 0); TCHAR *ptszUserSessionName = db_get_tsa(NULL, MODNAME, szSetting); if (ptszUserSessionName) ResaveSettings("UserSessionDsc", 1, 255, ptszUserSessionName); diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index d0bb1134ea..9b15bfe40e 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -202,7 +202,7 @@ int GetInSessionOrder(MCONTACT hContact, int mode, int count) void SetInSessionOrder(MCONTACT hContact, int mode, int count, unsigned int ordernum) { char szTemp[3]; - mir_snprintf(szTemp, SIZEOF(szTemp), "%02u", ordernum); + mir_snprintf(szTemp, "%02u", ordernum); if (mode == 0) { ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsOrder")); @@ -385,18 +385,18 @@ void SavePosition(HWND hwnd, char *wndName) RECT rc; GetWindowRect(hwnd, &rc); char buffer[512]; - mir_snprintf(buffer, SIZEOF(buffer), "%sPosX", wndName); + mir_snprintf(buffer, "%sPosX", wndName); db_set_dw(0, MODNAME, buffer, rc.left); - mir_snprintf(buffer, SIZEOF(buffer), "%sPosY", wndName); + mir_snprintf(buffer, "%sPosY", wndName); db_set_dw(0, MODNAME, buffer, rc.top); } void LoadPosition(HWND hWnd, char *wndName) { char buffer[512]; - mir_snprintf(buffer, SIZEOF(buffer), "%sPosX", wndName); + mir_snprintf(buffer, "%sPosX", wndName); int x = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2) - 130); - mir_snprintf(buffer, SIZEOF(buffer), "%sPosY", wndName); + mir_snprintf(buffer, "%sPosY", wndName); int y = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CYSCREEN)) / 2) - 80); SetWindowPos(hWnd, NULL, x, y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE); } diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 488610a156..fcc879976a 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -288,7 +288,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) k2++; if (k2 == maxk || k2 > maxk) rmark[0] = TRUE; - mir_snprintf(buff, SIZEOF(buff), "SMsg%d", k); + mir_snprintf(buff, "SMsg%d", k); if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { if (dbv.ptszVal == NULL) @@ -336,7 +336,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) k2++; if (k2 == maxk || k2 > maxk) rmark[0] = TRUE; - mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", k); + mir_snprintf(buff, "DefMsg%d", k); if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { if (dbv.ptszVal == NULL) @@ -372,7 +372,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (szProto) { char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", szProto); + mir_snprintf(szSetting, "Proto%sMaxLen", szProto); len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024); if (len < mir_tstrlen(msg)) { @@ -407,7 +407,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) char szSetting[80]; TCHAR *format; - mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : ""); + mir_snprintf(szSetting, "%sFlags", szProto ? szProto : ""); flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT); if (flags & STATUS_EMPTY_MSG) @@ -416,9 +416,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) if (flags & STATUS_LAST_STATUS_MSG) { if (szProto) - mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", szProto); + mir_snprintf(szSetting, "%sMsg", szProto); else - mir_snprintf(szSetting, SIZEOF(szSetting), "Msg"); + mir_snprintf(szSetting, "Msg"); if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv)) return NULL; //mir_tstrdup(_T("")); @@ -429,9 +429,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else if (flags & STATUS_LAST_MSG) { if (szProto) - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", szProto); + mir_snprintf(szSetting, "Last%sMsg", szProto); else - mir_snprintf(szSetting, SIZEOF(szSetting), "LastMsg"); + mir_snprintf(szSetting, "LastMsg"); if (db_get(NULL, "SimpleStatusMsg", szSetting, &dbv2)) return NULL; //mir_tstrdup(_T("")); @@ -449,9 +449,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else if (flags & STATUS_THIS_MSG) { if (szProto) - mir_snprintf(szSetting, SIZEOF(szSetting), "%sDefault", szProto); + mir_snprintf(szSetting, "%sDefault", szProto); else - mir_snprintf(szSetting, SIZEOF(szSetting), "Default"); + mir_snprintf(szSetting, "Default"); if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv)) return mir_tstrdup(_T("")); @@ -490,7 +490,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(szSetting, SIZEOF(szSetting), bIsFormat ? "FCur%sMsg" : "Cur%sMsg", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, bIsFormat ? "FCur%sMsg" : "Cur%sMsg", accounts->pa[i]->szModuleName); DBWriteMessage(szSetting, tszMsg); #ifdef _DEBUG if (bIsFormat) @@ -505,7 +505,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) return; - mir_snprintf(szSetting, SIZEOF(szSetting), bIsFormat ? "FCur%sMsg" : "Cur%sMsg", szProto); + mir_snprintf(szSetting, bIsFormat ? "FCur%sMsg" : "Cur%sMsg", szProto); DBWriteMessage(szSetting, tszMsg); #ifdef _DEBUG if (bIsFormat) @@ -519,7 +519,7 @@ void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat) void SaveStatusAsCurrent(const char *szProto, int iStatus) { char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto); + mir_snprintf(szSetting, "Cur%sStatus", szProto); db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus); } @@ -531,7 +531,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, if ((!iStatus || iStatus == ID_STATUS_CURRENT) && szProto) { DBVARIANT dbv; - mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto); + mir_snprintf(szSetting, "FCur%sMsg", szProto); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { format = mir_tstrdup(dbv.ptszVal); @@ -550,7 +550,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, if (szProto && !(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus))) return NULL; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto ? szProto : ""); + mir_snprintf(szSetting, "Proto%sFlags", szProto ? szProto : ""); flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT); //if (flags & PROTO_NO_MSG) @@ -561,7 +561,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, if (flags & PROTO_THIS_MSG) { DBVARIANT dbv; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto); + mir_snprintf(szSetting, "Proto%sDefault", szProto); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { format = mir_tstrdup(dbv.ptszVal); @@ -573,7 +573,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, else if (flags & PROTO_NOCHANGE && szProto) { DBVARIANT dbv; - mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto); + mir_snprintf(szSetting, "FCur%sMsg", szProto); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { format = mir_tstrdup(dbv.ptszVal); @@ -654,7 +654,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus char szSetting[80]; int flags; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto); + mir_snprintf(szSetting, "Proto%sFlags", szProto); flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT); if (flags & PROTO_NO_MSG) @@ -669,7 +669,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus DBVARIANT dbv; TCHAR *msg; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto); + mir_snprintf(szSetting, "Proto%sDefault", szProto); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { SaveMessageToDB(szProto, dbv.ptszVal, TRUE); @@ -806,11 +806,11 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA { int iProfileNumber = iStatus - 40083; char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%d_%s", iProfileNumber, accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "%d_%s", iProfileNumber, accounts->pa[i]->szModuleName); iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE); if (iStatus == ID_STATUS_IDLE) // the same as ID_STATUS_LAST in StartupStatus { - mir_snprintf(szSetting, SIZEOF(szSetting), "last_%s", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "last_%s", accounts->pa[i]->szModuleName); iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE); } else if (iStatus == ID_STATUS_CURRENT) @@ -1021,7 +1021,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) } char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : ""); + mir_snprintf(szSetting, "%sFlags", szProto ? szProto : ""); int iDlgFlags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT); BOOL bShowDlg = iDlgFlags & STATUS_SHOW_DLG || bOnStartup; @@ -1046,7 +1046,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) return 0; } - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto); + mir_snprintf(szSetting, "Proto%sFlags", szProto); iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT); if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG) { if (HasProtoStaticStatusMsg(szProto, iStatus, iStatus)) @@ -1056,7 +1056,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) DBVARIANT dbv; TCHAR *msg = NULL; - mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto); + mir_snprintf(szSetting, "FCur%sMsg", szProto); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { msg = mir_tstrdup(dbv.ptszVal); @@ -1126,7 +1126,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (iProtoFlags & PROTO_NOCHANGE) { DBVARIANT dbv; - mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { msg = mir_tstrdup(dbv.ptszVal); @@ -1204,7 +1204,7 @@ int SetStartupStatus(int i) return -1; } - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Proto%sFlags", accounts->pa[i]->szModuleName); flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT); if (flags & PROTO_NO_MSG || flags & PROTO_THIS_MSG) { @@ -1214,7 +1214,7 @@ int SetStartupStatus(int i) else if (flags & PROTO_NOCHANGE) { DBVARIANT dbv; - mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "FCur%sMsg", accounts->pa[i]->szModuleName); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { fmsg = mir_tstrdup(dbv.ptszVal); @@ -1481,7 +1481,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) continue; char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", pa[i]->szModuleName); + mir_snprintf(szSetting, "Proto%sFlags", pa[i]->szModuleName); int iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT); if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG) continue; @@ -1601,13 +1601,13 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10); for (j = 1; j <= max_hist_msgs; j++) { - mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j); + mir_snprintf(buff, "SMsg%d", j); if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { if (!mir_tstrcmp(dbv.ptszVal, szMsgW)) { found = TRUE; - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName); + mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName); db_set_s(NULL, "SimpleStatusMsg", szSetting, buff); db_free(&dbv); break; @@ -1618,12 +1618,12 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) if (!found) { - mir_snprintf(buff, SIZEOF(buff), "FCur%sMsg", ps[i]->szName); - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName); + mir_snprintf(buff, "FCur%sMsg", ps[i]->szName); + mir_snprintf(szSetting, "Last%sMsg", ps[i]->szName); db_set_s(NULL, "SimpleStatusMsg", szSetting, buff); } - mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", ps[i]->szName); + mir_snprintf(szSetting, "%sMsg", ps[i]->szName); db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW); msg = InsertVarsIntoMsg(szMsgW, ps[i]->szName, status_mode, NULL); @@ -1823,7 +1823,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) continue; char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Set%sStatusDelay", accounts->pa[i]->szModuleName); g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), SetStartupStatusProc); } } @@ -1844,7 +1844,7 @@ static int OnOkToExit(WPARAM, LPARAM) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0))) continue; - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Last%sStatus", accounts->pa[i]->szModuleName); db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0)); } diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 3ce328a87a..3faaa205aa 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -238,7 +238,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) // history messages if (j < 1) j = data->max_hist_msgs; - mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j); + mir_snprintf(buff, "SMsg%d", j); j--; if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0') { @@ -332,7 +332,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) for (i = 1; i <= data->num_def_msgs; ++i) { // predefined messages - mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i); + mir_snprintf(buff, "DefMsg%d", i); if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { if (dbv.ptszVal) { if (!mir_tstrlen(dbv.ptszVal)) { @@ -500,7 +500,7 @@ static LRESULT CALLBACK EditBoxSubProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L switch (uMsg) { case WM_CONTEXTMENU: { - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; RECT rc; GetClientRect(hwndDlg, &rc); @@ -709,14 +709,14 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) num_start = SendMessage(data->recent_cbex, CB_GETCOUNT, 0, 0); num_start -= data->num_def_msgs + 1; - mir_snprintf(setting, SIZEOF(setting), "%sFlags", data->m_szProto ? data->m_szProto : ""); + mir_snprintf(setting, "%sFlags", data->m_szProto ? data->m_szProto : ""); flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, setting), STATUS_DEFAULT); if (flags & STATUS_LAST_MSG) { if (data->m_szProto) - mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", data->m_szProto); + mir_snprintf(setting, "Last%sMsg", data->m_szProto); else - mir_snprintf(setting, SIZEOF(setting), "LastMsg"); + mir_snprintf(setting, "LastMsg"); if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) { if (dbv.pszVal && mir_strlen(dbv.pszVal)) { @@ -744,9 +744,9 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) } else if (flags & STATUS_THIS_MSG) { if (data->m_szProto) - mir_snprintf(setting, SIZEOF(setting), "%sDefault", data->m_szProto); + mir_snprintf(setting, "%sDefault", data->m_szProto); else - mir_snprintf(setting, SIZEOF(setting), "Default"); + mir_snprintf(setting, "Default"); if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv)) { SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal); @@ -758,9 +758,9 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) } else if (flags & STATUS_LAST_STATUS_MSG) { if (data->m_szProto) - mir_snprintf(setting, SIZEOF(setting), "%sMsg", data->m_szProto); + mir_snprintf(setting, "%sMsg", data->m_szProto); else - mir_snprintf(setting, SIZEOF(setting), "Msg"); + mir_snprintf(setting, "Msg"); if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv)) { SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal); @@ -1129,10 +1129,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (iMsgLen == 0) { char szSetting[80]; if (msgbox_data->m_szProto) { - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", msgbox_data->m_szProto); + mir_snprintf(szSetting, "Last%sMsg", msgbox_data->m_szProto); db_set_s(NULL, "SimpleStatusMsg", szSetting, ""); - mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", msgbox_data->m_szProto); + mir_snprintf(szSetting, "%sMsg", msgbox_data->m_szProto); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), _T("")); } else { @@ -1150,10 +1150,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(szSetting, "Last%sMsg", accounts->pa[j]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", szSetting, ""); - mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(szSetting, "%sMsg", accounts->pa[j]->szModuleName); iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), _T("")); } @@ -1174,7 +1174,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA BOOL found = FALSE; for (int i = 1; i <= msgbox_data->max_hist_msgs; i++) { - mir_snprintf(buff, SIZEOF(buff), "SMsg%d", i); + mir_snprintf(buff, "SMsg%d", i); if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv)) { if (!mir_tstrcmp(dbv.ptszVal, tszMsg)) { found = TRUE; @@ -1223,7 +1223,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else last_modified_msg++; - mir_snprintf(buff, SIZEOF(buff), "SMsg%d", last_modified_msg); + mir_snprintf(buff, "SMsg%d", last_modified_msg); db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg); if (msgbox_data->m_szProto) { @@ -1387,7 +1387,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(histitem.lParam) == HISTORY_MSG) { char szSetting[16]; - mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", (int)HIWORD(histitem.lParam)); + mir_snprintf(szSetting, "SMsg%d", (int)HIWORD(histitem.lParam)); db_set_ts(NULL, "SimpleStatusMsg", szSetting, _T("")); SendMessage(msgbox_data->recent_cbex, CBEM_DELETEITEM, (WPARAM)msgbox_data->curr_sel_msg, 0); } @@ -1505,7 +1505,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA SendMessage(msgbox_data->recent_cbex, CBEM_GETITEM, 0, (LPARAM)&histitem); if (LOWORD(histitem.lParam) == HISTORY_MSG) { - mir_snprintf(buff, SIZEOF(buff), "SMsg%d", (int)HIWORD(histitem.lParam)); + mir_snprintf(buff, "SMsg%d", (int)HIWORD(histitem.lParam)); db_set_ts(NULL, "SimpleStatusMsg", buff, _T("")); } else if (LOWORD(histitem.lParam) == PREDEFINED_MSG) @@ -1597,7 +1597,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA cbitem.pszText = text; SendMessage(msgbox_data->recent_cbex, CBEM_GETITEM, 0, (LPARAM)&cbitem); - mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i); + mir_snprintf(buff, "DefMsg%d", i); if (LOWORD(cbitem.lParam) == PREDEFINED_MSG) { new_num_def_msgs++; db_set_ts(NULL, "SimpleStatusMsg", buff, text); diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 99ca669461..0c19914ee0 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -146,10 +146,10 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (!IsAccountEnabled(accounts->pa[j]) || !CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(setting, SIZEOF(setting), "%sFlags", accounts->pa[j]->szModuleName); + mir_snprintf(setting, "%sFlags", accounts->pa[j]->szModuleName); val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT); data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val; - mir_snprintf(setting, SIZEOF(setting), "%sDefault", accounts->pa[j]->szModuleName); + mir_snprintf(setting, "%sDefault", accounts->pa[j]->szModuleName); text = db_get_tsa(NULL, "SRAway", StatusModeToDbSetting(i, setting)); mir_tstrncpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], (text == NULL) ? GetDefaultMessage(i) : text, 1024); } @@ -202,14 +202,14 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l // SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, index, (LPARAM)i + 1); if (index != CB_ERR && index != CB_ERRSPACE) { - mir_snprintf(setting, SIZEOF(setting), "Proto%sDefault", accounts->pa[i]->szModuleName); + mir_snprintf(setting, "Proto%sDefault", accounts->pa[i]->szModuleName); data->proto_msg[i+1].msg = db_get_tsa(NULL, "SimpleStatusMsg", setting); - mir_snprintf(setting, SIZEOF(setting), "Proto%sFlags", accounts->pa[i]->szModuleName); + mir_snprintf(setting, "Proto%sFlags", accounts->pa[i]->szModuleName); val = db_get_b(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT); data->proto_msg[i+1].flags = val; - mir_snprintf(setting, SIZEOF(setting), "Proto%sMaxLen", accounts->pa[i]->szModuleName); + mir_snprintf(setting, "Proto%sMaxLen", accounts->pa[i]->szModuleName); val = db_get_w(NULL, "SimpleStatusMsg", setting, 1024); data->proto_msg[i+1].max_length = val; SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i + 1); @@ -442,9 +442,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv, dbv2; if (i) - mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[k]->szModuleName); + mir_snprintf(setting, "Last%sMsg", accounts->pa[k]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "LastMsg"); + mir_snprintf(setting, "LastMsg"); SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T("")); if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) @@ -486,9 +486,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv; if (i) - mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[k]->szModuleName); + mir_snprintf(setting, "%sMsg", accounts->pa[k]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "Msg"); + mir_snprintf(setting, "Msg"); if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv)) { @@ -597,9 +597,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv, dbv2; if (i) - mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[i-1]->szModuleName); + mir_snprintf(setting, "Last%sMsg", accounts->pa[i-1]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "LastMsg"); + mir_snprintf(setting, "LastMsg"); SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T("")); if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) @@ -640,9 +640,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv; if (i) - mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[i-1]->szModuleName); + mir_snprintf(setting, "%sMsg", accounts->pa[i-1]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "Msg"); + mir_snprintf(setting, "Msg"); if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv)) { @@ -697,9 +697,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv,dbv2; if (j) - mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[j-1]->szModuleName); + mir_snprintf(setting, "Last%sMsg", accounts->pa[j-1]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "LastMsg"); + mir_snprintf(setting, "LastMsg"); SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T("")); if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) @@ -732,9 +732,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv; if (j) - mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[j-1]->szModuleName); + mir_snprintf(setting, "%sMsg", accounts->pa[j-1]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "Msg"); + mir_snprintf(setting, "Msg"); if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting), &dbv)) { @@ -811,9 +811,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv, dbv2; if (j) - mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[j-1]->szModuleName); + mir_snprintf(setting, "Last%sMsg", accounts->pa[j-1]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "LastMsg"); + mir_snprintf(setting, "LastMsg"); SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T("")); if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv)) @@ -846,9 +846,9 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l DBVARIANT dbv; if (j) - mir_snprintf(setting, SIZEOF(setting), "%sMsg", accounts->pa[j-1]->szModuleName); + mir_snprintf(setting, "%sMsg", accounts->pa[j-1]->szModuleName); else - mir_snprintf(setting, SIZEOF(setting), "Msg"); + mir_snprintf(setting, "Msg"); if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i+ID_STATUS_ONLINE, setting), &dbv)) { @@ -1028,10 +1028,10 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(i)) { - mir_snprintf(szSetting, SIZEOF(szSetting), "%sDefault", accounts->pa[j]->szModuleName); + mir_snprintf(szSetting, "%sDefault", accounts->pa[j]->szModuleName); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]); - mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", accounts->pa[j]->szModuleName); + mir_snprintf(szSetting, "%sFlags", accounts->pa[j]->szModuleName); db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]); } } @@ -1055,16 +1055,16 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Proto%sDefault", accounts->pa[i]->szModuleName); if (data->proto_msg[i+1].msg && (data->proto_msg[i+1].flags & PROTO_THIS_MSG)) db_set_ts(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg); // else // db_unset(NULL, "SimpleStatusMsg", szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Proto%sMaxLen", accounts->pa[i]->szModuleName); db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->proto_msg[i+1].max_length); - mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Proto%sFlags", accounts->pa[i]->szModuleName); db_set_b(NULL, "SimpleStatusMsg", szSetting, (BYTE)data->proto_msg[i+1].flags); } } @@ -1197,7 +1197,7 @@ static BOOL IsHistoryMsgsFound(HWND hwndDlg, int histMax) for (int i = 1; i <= histMax; ++i, --j) { if (j < 1) j = histMax; - mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", j); + mir_snprintf(szSetting, "SMsg%d", j); if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv)) { if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0') { db_free(&dbv); @@ -1360,7 +1360,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[i]->szModuleName); + mir_snprintf(setting, "Last%sMsg", accounts->pa[i]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", setting, ""); } db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)max_hist_msgs); @@ -1379,7 +1379,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w nDefMSgCount = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0); for (int i = 1; i <= nDefMSgCount; i++) { - mir_snprintf(szSetting, SIZEOF(szSetting), "DefMsg%d", i); + mir_snprintf(szSetting, "DefMsg%d", i); db_unset(NULL, "SimpleStatusMsg", szSetting); } db_set_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0); @@ -1458,9 +1458,9 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa if (index != LB_ERR && index != LB_ERRSPACE) { char setting[80]; - mir_snprintf(setting, SIZEOF(setting), "Startup%sStatus", accounts->pa[i]->szModuleName); + mir_snprintf(setting, "Startup%sStatus", accounts->pa[i]->szModuleName); data->status[i] = db_get_w(NULL, "SimpleStatusMsg", setting, ID_STATUS_CURRENT); - mir_snprintf(setting, SIZEOF(setting), "Set%sStatusDelay", accounts->pa[i]->szModuleName); + mir_snprintf(setting, "Set%sStatusDelay", accounts->pa[i]->szModuleName); data->setdelay[i] = db_get_w(NULL, "SimpleStatusMsg", setting, 300); SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_SETITEMDATA, (WPARAM)index, (LPARAM)i); } @@ -1640,10 +1640,10 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa if (!IsAccountEnabled(accounts->pa[i]) || !(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0))) continue; - mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Startup%sStatus", accounts->pa[i]->szModuleName); db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->status[i]); - mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName); + mir_snprintf(szSetting, "Set%sStatusDelay", accounts->pa[i]->szModuleName); db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->setdelay[i]); } db_set_w(NULL, "SimpleStatusMsg", "SetStatusDelay", (WORD)data->setglobaldelay); diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index b77b652757..2d1b04e920 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -126,7 +126,7 @@ const char *StatusModeToDbSetting(int status, const char *suffix) case ID_STATUS_IDLE: prefix = "Idl"; break; default: return NULL; } - mir_snprintf(str, SIZEOF(str), "%s%s", prefix, suffix); + mir_snprintf(str, "%s%s", prefix, suffix); return str; } @@ -134,7 +134,7 @@ int GetCurrentStatus(const char *szProto) { if (szProto) { char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto); + mir_snprintf(szSetting, "Cur%sStatus", szProto); return (int)db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE); } @@ -147,11 +147,11 @@ int GetStartupStatus(const char *szProto) int status_mode; char szSetting[80]; - mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", szProto); + mir_snprintf(szSetting, "Startup%sStatus", szProto); status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_CURRENT); if (status_mode == ID_STATUS_CURRENT) { // load status used for this proto last time - mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", szProto); + mir_snprintf(szSetting, "Last%sStatus", szProto); status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE); } return status_mode; diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 559e0baa6a..67b39b5945 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -190,7 +190,7 @@ void SmileyType::CallSmileyService(MCONTACT hContact) proto = (const char*)GetContactProto(hContact); if (proto == NULL) return; } - mir_snprintf(str, SIZEOF(str), "%s%s", proto, T2A_SM(name.c_str())); + mir_snprintf(str, "%s%s", proto, T2A_SM(name.c_str())); CallService(str, ConvertServiceParam(hContact, par1.c_str()), ConvertServiceParam(hContact, par2.c_str())); 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); } 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); } } diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 85ca77b699..64a5543b09 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -95,7 +95,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) char setting[512]; DBVARIANT dbv; - mir_snprintf(setting, SIZEOF(setting), "Name%d", index); + mir_snprintf(setting, "Name%d", index); ds->swzName[0] = 0; if (db_get_ts(0, MODULE_ITEMS, setting, &dbv)) return false; @@ -104,10 +104,10 @@ bool LoadDS(DISPLAYSUBST *ds, int index) ds->swzName[SIZEOF(ds->swzName) - 1] = 0; db_free(&dbv); - mir_snprintf(setting, SIZEOF(setting), "Type%d", index); + mir_snprintf(setting, "Type%d", index); ds->type = (DisplaySubstType)db_get_b(0, MODULE_ITEMS, setting, DVT_PROTODB); - mir_snprintf(setting, SIZEOF(setting), "Module%d", index); + mir_snprintf(setting, "Module%d", index); ds->szModuleName[0] = 0; if (!db_get(0, MODULE_ITEMS, setting, &dbv)) { strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN); @@ -115,7 +115,7 @@ bool LoadDS(DISPLAYSUBST *ds, int index) db_free(&dbv); } - mir_snprintf(setting, SIZEOF(setting), "Setting%d", index); + mir_snprintf(setting, "Setting%d", index); ds->szSettingName[0] = 0; if (!db_get(0, MODULE_ITEMS, setting, &dbv)) { strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN); @@ -123,12 +123,12 @@ bool LoadDS(DISPLAYSUBST *ds, int index) db_free(&dbv); } - mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index); + mir_snprintf(setting, "TransFuncId%d", index); ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1); // a little backward compatibility if ((DWORD)ds->iTranslateFuncId == (DWORD)-1) { - mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index); + mir_snprintf(setting, "TransFunc%d", index); ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0); } @@ -139,15 +139,15 @@ void SaveDS(DISPLAYSUBST *ds, int index) { char setting[512]; - mir_snprintf(setting, SIZEOF(setting), "Name%d", index); + mir_snprintf(setting, "Name%d", index); db_set_ts(0, MODULE_ITEMS, setting, ds->swzName); - mir_snprintf(setting, SIZEOF(setting), "Type%d", index); + mir_snprintf(setting, "Type%d", index); db_set_b(0, MODULE_ITEMS, setting, (BYTE)ds->type); - mir_snprintf(setting, SIZEOF(setting), "Module%d", index); + mir_snprintf(setting, "Module%d", index); db_set_s(0, MODULE_ITEMS, setting, ds->szModuleName); - mir_snprintf(setting, SIZEOF(setting), "Setting%d", index); + mir_snprintf(setting, "Setting%d", index); db_set_s(0, MODULE_ITEMS, setting, ds->szSettingName); - mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index); + mir_snprintf(setting, "TransFuncId%d", index); db_set_dw(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId); } @@ -156,7 +156,7 @@ bool LoadDI(DISPLAYITEM *di, int index) char setting[512]; DBVARIANT dbv; - mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index); + mir_snprintf(setting, "DILabel%d", index); di->swzLabel[0] = 0; if (db_get_ts(0, MODULE_ITEMS, setting, &dbv)) return false; @@ -165,7 +165,7 @@ bool LoadDI(DISPLAYITEM *di, int index) di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0; db_free(&dbv); - mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index); + mir_snprintf(setting, "DIValue%d", index); di->swzValue[0] = 0; if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv)) { _tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue)); @@ -173,15 +173,15 @@ bool LoadDI(DISPLAYITEM *di, int index) db_free(&dbv); } - mir_snprintf(setting, SIZEOF(setting), "DIType%d", index); + mir_snprintf(setting, "DIType%d", index); di->type = (DisplayItemType)db_get_b(0, MODULE_ITEMS, setting, DIT_ALL); - mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index); + mir_snprintf(setting, "DILineAbove%d", index); di->bLineAbove = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1); - mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index); + mir_snprintf(setting, "DIValNewline%d", index); di->bValueNewline = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1); - mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index); + mir_snprintf(setting, "DIVisible%d", index); di->bIsVisible = (db_get_b(0, MODULE_ITEMS, setting, 1) == 1); - mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index); + mir_snprintf(setting, "DITipperVarsFirst%d", index); di->bParseTipperVarsFirst = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1); return true; @@ -191,29 +191,29 @@ void SaveDI(DISPLAYITEM *di, int index) { char setting[512]; - mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index); + mir_snprintf(setting, "DILabel%d", index); if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel)) { char buff[LABEL_LEN]; t2a(di->swzLabel, buff, LABEL_LEN); db_set_s(0, MODULE_ITEMS, setting, buff); } - mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index); + mir_snprintf(setting, "DIValue%d", index); if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue)) { char buff[VALUE_LEN]; t2a(di->swzValue, buff, VALUE_LEN); db_set_s(0, MODULE_ITEMS, setting, buff); } - mir_snprintf(setting, SIZEOF(setting), "DIType%d", index); + mir_snprintf(setting, "DIType%d", index); db_set_b(0, MODULE_ITEMS, setting, (BYTE)di->type); - mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index); + mir_snprintf(setting, "DILineAbove%d", index); db_set_b(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0); - mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index); + mir_snprintf(setting, "DIValNewline%d", index); db_set_b(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0); - mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index); + mir_snprintf(setting, "DIVisible%d", index); db_set_b(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0); - mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index); + mir_snprintf(setting, "DITipperVarsFirst%d", index); db_set_b(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0); } @@ -304,15 +304,15 @@ void LoadObsoleteSkinSetting() DBVARIANT dbv; for (int i = 0; i < SKIN_ITEMS_COUNT; i++) { - mir_snprintf(setting, SIZEOF(setting), "SPaintMode%d", i); + mir_snprintf(setting, "SPaintMode%d", i); opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0); - mir_snprintf(setting, SIZEOF(setting), "SImgFile%d", i); + mir_snprintf(setting, "SImgFile%d", i); if (!db_get_ts(NULL, MODULE, setting, &dbv)) { opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal); db_free(&dbv); } - mir_snprintf(setting, SIZEOF(setting), "SGlyphMargins%d", i); + mir_snprintf(setting, "SGlyphMargins%d", i); DWORD margins = db_get_dw(NULL, MODULE, setting, 0); opt.margins[i].top = LOBYTE(LOWORD(margins)); opt.margins[i].right = HIBYTE(LOWORD(margins)); diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 998694c0e6..789621bfe9 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -814,7 +814,7 @@ TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szV return NULL; char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue); + mir_snprintf(szSetting, "%s/%s/%s", szProto, szSlot, szValue); if (!db_get_ts(0, "AdvStatus", szSetting, &dbv)) { if (mir_tstrlen(dbv.ptszVal) != 0) swzText = mir_tstrdup(dbv.ptszVal); @@ -836,7 +836,7 @@ HICON GetJabberActivityIcon(MCONTACT hContact, char *szProto) return NULL; char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, "activity", "icon"); + mir_snprintf(szSetting, "%s/%s/%s", szProto, "activity", "icon"); if (!db_get_s(hContact, "AdvStatus", szSetting, &dbv)) { hIcon = Skin_GetIcon(dbv.pszVal); db_free(&dbv); diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 6e2d173092..930925a7a7 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -151,12 +151,12 @@ static void Icon2button(TTBButton *but, HANDLE &hIcoLib, HICON &hIcon, bool bIsU hIcoLib = (HANDLE)CallService(MS_SKIN2_ISMANAGEDICON, WPARAM(hSrc), 0); if (!hIcoLib) { char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "toptoolbar_%s%s", but->name, bIsUp ? (but->hIconDn ? "%s_up" : "%s") : "%s_dn"); + mir_snprintf(buf, "toptoolbar_%s%s", but->name, bIsUp ? (but->hIconDn ? "%s_up" : "%s") : "%s_dn"); SKINICONDESC sid = { sizeof(sid) }; sid.pszSection = "Toolbar"; sid.pszName = buf; sid.pszDefaultFile = NULL; - mir_snprintf(buf, SIZEOF(buf), "%s%s", but->name, bIsUp ? "" : " (pressed)"); + mir_snprintf(buf, "%s%s", but->name, bIsUp ? "" : " (pressed)"); sid.pszDescription = buf; sid.hDefaultIcon = bIsUp ? but->hIconUp : but->hIconDn; hIcoLib = Skin_AddIcon(&sid); @@ -598,7 +598,7 @@ static int OnModulesLoad(WPARAM, LPARAM) if (HookEvent(ME_BACKGROUNDCONFIG_CHANGED, OnBGChange)) { char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "%s/%s", LPGEN("TopToolBar background"), TTB_OPTDIR); + mir_snprintf(buf, "%s/%s", LPGEN("TopToolBar background"), TTB_OPTDIR); CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)buf, 0); } return 0; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp index f5f1e05bee..e968284786 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp @@ -292,9 +292,9 @@ void CExImContactBase::toIni(FILE* file, int modCount) if (_pszProto == NULL || !loaded) { if (_pszProto){ if (_pszNick) - mir_snprintf(name, SIZEOF(name),"%s (%s)", _pszNick, _pszProto); + mir_snprintf(name,"%s (%s)", _pszNick, _pszProto); else - mir_snprintf(name, SIZEOF(name),"(UNKNOWN) (%s)", _pszProto); + mir_snprintf(name,"(UNKNOWN) (%s)", _pszProto); } else strncpy_s(name, "(UNKNOWN)", _TRUNCATE); @@ -316,9 +316,9 @@ void CExImContactBase::toIni(FILE* file, int modCount) } LPSTR pszUID = uid2String(FALSE); if (_pszUIDKey && pszUID) - mir_snprintf(name, SIZEOF(name), "%s *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID); + mir_snprintf(name, "%s *(%s)*<%s>*{%s}*", pszCI, _pszProto, _pszUIDKey, pszUID); else - mir_snprintf(name, SIZEOF(name), "%s (%s)", pszCI, _pszProto); + mir_snprintf(name, "%s (%s)", pszCI, _pszProto); mir_free(pszCI); mir_free(pszUID); diff --git a/plugins/UserInfoEx/src/ex_import/tinyxml.cpp b/plugins/UserInfoEx/src/ex_import/tinyxml.cpp index 27ba54d82a..b41bffa85e 100644 --- a/plugins/UserInfoEx/src/ex_import/tinyxml.cpp +++ b/plugins/UserInfoEx/src/ex_import/tinyxml.cpp @@ -110,7 +110,7 @@ void TiXmlBase::PutString(const TIXML_STRING& str, TIXML_STRING* outString) // Easy pass at non-alpha/numeric/symbol // Below 32 is symbolic. char buf[32]; - mir_snprintf(buf, SIZEOF(buf), "&#x%02X;", (unsigned) (c & 0xff)); + mir_snprintf(buf, "&#x%02X;", (unsigned) (c & 0xff)); //*ME: warning C4267: convert 'size_t' to 'int' //*ME: Int-Cast to make compiler happy ... @@ -758,7 +758,7 @@ int TiXmlElement::QueryDoubleAttribute(const char* name, double* dval) const void TiXmlElement::SetAttribute(const char * name, int val) { char buf[64]; - mir_snprintf(buf, SIZEOF(buf), "%d", val); + mir_snprintf(buf, "%d", val); SetAttribute(name, buf); } @@ -776,7 +776,7 @@ void TiXmlElement::SetAttribute(const std::string& name, int val) void TiXmlElement::SetDoubleAttribute(const char * name, double val) { char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "%f", val); + mir_snprintf(buf, "%f", val); SetAttribute(name, buf); } @@ -1422,14 +1422,14 @@ int TiXmlAttribute::QueryDoubleValue(double* dval) const void TiXmlAttribute::SetIntValue(int _value) { char buf[64]; - mir_snprintf(buf, SIZEOF(buf), "%d", _value); + mir_snprintf(buf, "%d", _value); SetValue(buf); } void TiXmlAttribute::SetDoubleValue(double _value) { char buf[256]; - mir_snprintf(buf, SIZEOF(buf), "%lf", _value); + mir_snprintf(buf, "%lf", _value); SetValue(buf); } diff --git a/plugins/UserInfoEx/src/svc_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp index f0faf6faaa..1219e9ec17 100644 --- a/plugins/UserInfoEx/src/svc_contactinfo.cpp +++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp @@ -571,7 +571,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam) int offset = tzi->Bias + tzi->StandardBias; char str[80]; - mir_snprintf(str, SIZEOF(str), offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60)); + mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60)); ci->pszVal = ci->dwFlag & CNF_UNICODE ? (TCHAR*)mir_a2u(str) : (TCHAR*)mir_strdup(str); ci->type = CNFT_ASCIIZ; return 0; diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index 22abffcfd3..5338f4695d 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -322,12 +322,12 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr) } if (tr->flags&TRF_FIELD) - mir_sntprintf(desc, len, _T("%c%s%c"), FIELD_CHAR, tr->szTokenString, FIELD_CHAR); + mir_sntprintf(desc, len, _T("%c%s%c"), FIELD_CHAR, tr->szTokenString, FIELD_CHAR); else { if (args != NULL) tArgs = mir_a2t(args); - mir_sntprintf(desc, len, _T("%c%s%s"), FUNC_CHAR, tr->tszTokenString, (tArgs!=NULL?tArgs:_T(""))); + mir_sntprintf(desc, len, _T("%c%s%s"), FUNC_CHAR, tr->tszTokenString, (tArgs!=NULL?tArgs:_T(""))); } mir_free(tArgs); diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index e3dac6f51f..864b9a81bd 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -60,7 +60,7 @@ int AddIcons() hDTB[0] = AddIcon("DTB0", LPGEN("Birthday today"), tszPath, IDI_DTB0); hDTB[1] = AddIcon("DTB1", LPGEN("1 day to birthday"), tszPath, IDI_DTB1); for (int i = 2; i < cDTB; i++) { - mir_snprintf(name, SIZEOF(name), "DTB%d", i); + mir_snprintf(name, "DTB%d", i); mir_snprintf(description, SIZEOF(description), Translate("%d days to birthday"), i); hDTB[i] = AddIcon(name, description, tszPath, IDI_DTB0 + i); } diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 42bf4be905..f8da4effb5 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -80,11 +80,11 @@ char* BinToHex(int size, PBYTE data) int maxSize = size * 2 + HEX_SIZE + 1; szresult = (char *) new char[maxSize]; memset(szresult, 0, maxSize); - mir_snprintf(buffer, SIZEOF(buffer), "%0*X", HEX_SIZE, size); + mir_snprintf(buffer, "%0*X", HEX_SIZE, size); mir_strcpy(szresult, buffer); for (int i = 0; i < size; i++) { - mir_snprintf(buffer, SIZEOF(buffer), "%02X", data[i]); + mir_snprintf(buffer, "%02X", data[i]); mir_strcpy(szresult + (HEX_SIZE + i * 2), buffer); } return szresult; diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 51fb53124e..3cfe906eec 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -89,7 +89,7 @@ static int ProtoAck(WPARAM, LPARAM lParam) for (int i = 0; i < SIZEOF(selfSounds); i++) { if (selfSounds[i].iStatus == ack->lParam) { char buf[128]; - mir_snprintf(buf, SIZEOF(buf), "%s%s", ack->szModule, selfSounds[i].szName); + mir_snprintf(buf, "%s%s", ack->szModule, selfSounds[i].szName); SkinPlaySound(buf); break; } diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 3f506bfb74..8513616923 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -808,7 +808,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D if (MN->Real.PopupTC + MN->Virtual.PopupTC) { char tmp[255]; - mir_snprintf(tmp, SIZEOF(tmp), Translate("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_snprintf(tmp, Translate("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); db_set_s(ActualAccount->hContact, "CList", "StatusMsg", tmp); } else db_set_s(ActualAccount->hContact, "CList", "StatusMsg", Translate("No new mail message")); @@ -1599,7 +1599,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (GetWindowLongPtr((HWND)wParam, GWLP_ID) == IDC_LISTHEADERS) { //MessageBox(0,"LISTHEADERS","Debug",0); HWND hList = GetDlgItem(hDlg, IDC_LISTHEADERS); - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; if (pt.x == -1) pt.x = 0; if (pt.y == -1) pt.y = 0; if (int numRows = ListView_GetItemCount(hList)) { @@ -2384,7 +2384,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (GetWindowLongPtr((HWND)wParam, GWLP_ID) == IDC_LISTMAILS) { //MessageBox(0,"LISTHEADERS","Debug",0); HWND hList = GetDlgItem(hDlg, IDC_LISTMAILS); - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; + POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; if (pt.x == -1) pt.x = 0; if (pt.y == -1) pt.y = 0; if (int numRows = ListView_GetItemCount(hList)) { diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp index 7f24b0a5db..221fbc2aaf 100644 --- a/plugins/YAMN/src/proto/netlib.cpp +++ b/plugins/YAMN/src/proto/netlib.cpp @@ -36,7 +36,7 @@ HANDLE RegisterNLClient(const char *name) static NETLIBUSER nlu={0}; char desc[128]; - mir_snprintf(desc, SIZEOF(desc), Translate("%s connection"), name); + mir_snprintf(desc, Translate("%s connection"), name); #ifdef DEBUG_COMM DebugLog(CommFile,""); diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index 5da4abb113..fc3cf8c3f3 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -37,7 +37,7 @@ void LoadOptions() char buff[128]; for (int i = 0; i < 10; i++) { - mir_snprintf(buff, SIZEOF(buff), "DisableStatus%d", i - 1); // -1 because i forgot offline status earlier! + mir_snprintf(buff, "DisableStatus%d", i - 1); // -1 because i forgot offline status earlier! options.disable_status[i] = (db_get_b(0, MODULE, buff, 0) == 1); } @@ -71,7 +71,7 @@ void SaveOptions() char buff[128]; for (int i = 0; i < 9; i++) { - mir_snprintf(buff, SIZEOF(buff), "DisableStatus%d", i - 1); + mir_snprintf(buff, "DisableStatus%d", i - 1); db_set_b(0, MODULE, buff, options.disable_status[i] ? 1 : 0); } db_set_b(0, MODULE, "DisableFullScreen", (options.disable_full_screen ? 1 : 0)); @@ -453,11 +453,11 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam char setting[256]; for (int i = 0; i < arClasses.getCount(); i++) { POPUPCLASS *pc = arClasses[i]; - mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", pc->pszName); + mir_snprintf(setting, "%s/Timeout", pc->pszName); db_set_w(0, MODULE, setting, pc->iSeconds); - mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", pc->pszName); + mir_snprintf(setting, "%s/TextCol", pc->pszName); db_set_dw(0, MODULE, setting, (DWORD)pc->colorText); - mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", pc->pszName); + mir_snprintf(setting, "%s/BgCol", pc->pszName); db_set_dw(0, MODULE, setting, (DWORD)pc->colorBack); } return TRUE; diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 67261cc058..57691eefe9 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -338,12 +338,12 @@ static INT_PTR RegisterPopupClass(WPARAM wParam, LPARAM lParam) pc->pszDescription = mir_strdup(pc->pszDescription); char setting[256]; - mir_snprintf(setting, SIZEOF(setting), "%s/Timeout", pc->pszName); + mir_snprintf(setting, "%s/Timeout", pc->pszName); pc->iSeconds = db_get_w(0, MODULE, setting, pc->iSeconds); if (pc->iSeconds == (WORD)-1) pc->iSeconds = -1; - mir_snprintf(setting, SIZEOF(setting), "%s/TextCol", pc->pszName); + mir_snprintf(setting, "%s/TextCol", pc->pszName); pc->colorText = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorText); - mir_snprintf(setting, SIZEOF(setting), "%s/BgCol", pc->pszName); + mir_snprintf(setting, "%s/BgCol", pc->pszName); pc->colorBack = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorBack); arClasses.insert(pc); diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp index f13cd473ff..fe79736be4 100644 --- a/plugins/YahooGroups/src/services.cpp +++ b/plugins/YahooGroups/src/services.cpp @@ -53,7 +53,7 @@ void ReadAvailableGroups() while (ok) { - mir_snprintf(tmp, SIZEOF(tmp), "%d", index); + mir_snprintf(tmp, "%d", index); GetStringFromDatabase(NULL, CLIST_GROUPS, tmp, NULL, group, sizeof(group)); if (mir_strlen(group) > 0) { @@ -76,7 +76,7 @@ int GetNextGroupIndex() while (!found) { - mir_snprintf(tmp, SIZEOF(tmp), "%d", index++); + mir_snprintf(tmp, "%d", index++); if (GetStringFromDatabase(NULL, CLIST_GROUPS, tmp, NULL, buffer, sizeof(buffer))) { @@ -97,7 +97,7 @@ void AddNewGroup(const char *newGroup) *group = 1; strncpy_s((group + 1), (SIZEOF(group) - 1), newGroup, _TRUNCATE); - mir_snprintf(tmp, SIZEOF(tmp), "%d", index); + mir_snprintf(tmp, "%d", index); const int MAX_SIZE = 1024; wchar_t wide[MAX_SIZE] = {0}; *wide = 1; diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 5da8431f39..9f6f63d865 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -102,12 +102,12 @@ char *BinToHex(int size, PBYTE data) int maxSize = size * 2 + HEX_SIZE + 1; szresult = (char *) new char[ maxSize ]; memset(szresult, 0, maxSize); - mir_snprintf(buffer, SIZEOF(buffer), "%0*X", HEX_SIZE, size); + mir_snprintf(buffer, "%0*X", HEX_SIZE, size); mir_strcpy(szresult, buffer); int i; for (i = 0; i < size; i++) { - mir_snprintf(buffer, SIZEOF(buffer), "%02X", data[i]); + mir_snprintf(buffer, "%02X", data[i]); mir_strcpy(szresult + (HEX_SIZE + i * 2), buffer); } return szresult; -- cgit v1.2.3