diff options
541 files changed, 5261 insertions, 5425 deletions
diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index f723c05f81..76526891be 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -149,7 +149,7 @@ void NotifyMetaAware(MCONTACT hContact, CacheNode *node, AVATARCACHEENTRY *ace) // Default value
if (cacn.hash[0] == '\0')
- mir_sntprintf(cacn.hash, _countof(cacn.hash), _T("AVS-HASH-%x"), GetFileHash(cacn.filename));
+ mir_sntprintf(cacn.hash, _T("AVS-HASH-%x"), GetFileHash(cacn.filename));
NotifyEventHooks(hEventContactAvatarChanged, (WPARAM)cacn.hContact, (LPARAM)&cacn);
}
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 6ed85901fd..e48e8dc82d 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -142,10 +142,10 @@ static void LoadProtoInfo(PROTOCOLDESCRIPTOR *proto) return;
char protoName[MAX_PATH];
- mir_snprintf(protoName, _countof(protoName), "Global avatar for %s accounts", proto->szName);
+ mir_snprintf(protoName, "Global avatar for %s accounts", proto->szName);
TCHAR protoNameTmp[MAX_PATH];
- mir_sntprintf(protoNameTmp, _countof(protoNameTmp), TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
+ mir_sntprintf(protoNameTmp, TranslateT("Global avatar for %s accounts"), _A2T(proto->szName));
protoPicCacheEntry *pce = new protoPicCacheEntry;
if (CreateAvatarInCache(0, pce, protoName) != 1)
db_unset(0, PPICT_MODULE, protoName);
@@ -323,7 +323,7 @@ void InternalDrawAvatar(AVATARDRAWREQUEST *r, HBITMAP hbm, LONG bmWidth, LONG bm static int ModulesLoaded(WPARAM, LPARAM)
{
TCHAR szEventName[100];
- mir_sntprintf(szEventName, _countof(szEventName), _T("avs_loaderthread_%d"), GetCurrentThreadId());
+ mir_sntprintf(szEventName, _T("avs_loaderthread_%d"), GetCurrentThreadId());
hLoaderEvent = CreateEvent(NULL, TRUE, FALSE, szEventName);
SetThreadPriority(mir_forkthread(PicLoader, 0), THREAD_PRIORITY_IDLE);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 3294089c99..5909a0d1ea 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -388,7 +388,7 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar if (!db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) { if (!PathIsAbsoluteT(VARST(dbv.ptszVal))) { TCHAR szFinalPath[MAX_PATH]; - mir_sntprintf(szFinalPath, _countof(szFinalPath), _T("%%miranda_path%%\\%s"), dbv.ptszVal); + mir_sntprintf(szFinalPath, _T("%%miranda_path%%\\%s"), dbv.ptszVal); SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, szFinalPath); } else SetDlgItemText(hwndDlg, IDC_PROTOAVATARNAME, dbv.ptszVal); diff --git a/plugins/AVS/src/services.cpp b/plugins/AVS/src/services.cpp index 33084606e9..da081abf46 100644 --- a/plugins/AVS/src/services.cpp +++ b/plugins/AVS/src/services.cpp @@ -347,7 +347,7 @@ void SaveImage(SaveProtocolData &d, char *protocol, int format) if (!Proto_IsAvatarFormatSupported(protocol, format))
return;
- mir_sntprintf(d.image_file_name, _countof(d.image_file_name), _T("%s%s"), d.temp_file, ProtoGetAvatarExtension(format));
+ mir_sntprintf(d.image_file_name, _T("%s%s"), d.temp_file, ProtoGetAvatarExtension(format));
if (BmpFilterSaveBitmap(d.hBmpProto, d.image_file_name, format == PA_FORMAT_JPEG ? JPEG_QUALITYSUPERB : 0))
return;
@@ -550,13 +550,13 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo TCHAR globalFile[1024];
BOOL saved = TRUE;
if (FoldersGetCustomPathT(hGlobalAvatarFolder, globalFile, _countof(globalFile), _T(""))) {
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s%s"), g_szDataPath, _T("GlobalAvatar"));
+ mir_sntprintf(globalFile, _T("%s%s"), g_szDataPath, _T("GlobalAvatar"));
CreateDirectory(globalFile, NULL);
}
TCHAR *ext = _tcsrchr(szFinalName, _T('.')); // Can't be NULL here
if (format == PA_FORMAT_XML || format == PA_FORMAT_SWF) {
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s\\my_global_avatar%s"), globalFile, ext);
+ mir_sntprintf(globalFile, _T("%s\\my_global_avatar%s"), globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
}
else {
@@ -574,12 +574,12 @@ static int InternalSetMyAvatar(char *protocol, TCHAR *szFinalName, SetMyAvatarHo // Check if need to resize
if (hBmpTmp == hBmp || hBmpTmp == NULL) {
// Use original image
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s\\my_global_avatar%s"), globalFile, ext);
+ mir_sntprintf(globalFile, _T("%s\\my_global_avatar%s"), globalFile, ext);
CopyFile(szFinalName, globalFile, FALSE);
}
else {
// Save as PNG
- mir_sntprintf(globalFile, _countof(globalFile), _T("%s\\my_global_avatar.png"), globalFile);
+ mir_sntprintf(globalFile, _T("%s\\my_global_avatar.png"), globalFile);
if (BmpFilterSaveBitmap(hBmpTmp, globalFile, 0))
saved = FALSE;
@@ -685,10 +685,10 @@ INT_PTR avSetMyAvatar(char* protocol, TCHAR* tszPath) TCHAR title[256];
if (protocol == NULL)
- mir_sntprintf(title, _countof(title), TranslateT("Set My Avatar"));
+ mir_sntprintf(title, TranslateT("Set My Avatar"));
else {
TCHAR* prototmp = mir_a2t(protocol);
- mir_sntprintf(title, _countof(title), TranslateT("Set My Avatar for %s"), prototmp);
+ mir_sntprintf(title, TranslateT("Set My Avatar for %s"), prototmp);
mir_free(prototmp);
}
ofn.lpstrTitle = title;
diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index 6b2ffdeb4b..5167b3714e 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -103,7 +103,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) if (pdescr == NULL)
return -1;
char key[MAX_PATH];
- mir_snprintf(key, _countof(key), "Global avatar for %s accounts", pdescr->szProtoName);
+ mir_snprintf(key, "Global avatar for %s accounts", pdescr->szProtoName);
if (tszValue = db_get_tsa(NULL, PPICT_MODULE, key))
MyPathToAbsolute(tszValue, tszFilename);
}
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 44f27182e1..def0c416ff 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -268,9 +268,9 @@ static TCHAR* GetAssocTypeDesc(const ASSOCDATA *assoc) {
static TCHAR szDesc[32];
if (assoc->pszFileExt == NULL)
- mir_sntprintf(szDesc, _countof(szDesc), _T("%hs:"), assoc->pszClassName);
+ mir_sntprintf(szDesc, _T("%hs:"), assoc->pszClassName);
else
- mir_sntprintf(szDesc, _countof(szDesc), TranslateT("%hs files"), assoc->pszFileExt);
+ mir_sntprintf(szDesc, TranslateT("%hs files"), assoc->pszFileExt);
return szDesc;
}
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 13812e61d4..79d710ff7c 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -33,7 +33,7 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, char *pszErr;
pszErr = GetWinErrorDescription(res);
pszInfo2 = s2t(pszInfo, fInfoUnicode, FALSE); /* does NULL check */
- mir_sntprintf(szMsg, _countof(szMsg), TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
+ mir_sntprintf(szMsg, TranslateT("Access failed:\n%.64hs(%.128s)\n%.250hs(%u)\n%.256hs (%u)"), pszFunc, pszInfo2, pszFile, nLine, pszErr, res);
MessageBox(NULL, szMsg, TranslateT("Registry warning"), MB_OK | MB_ICONINFORMATION | MB_SETFOREGROUND | MB_TOPMOST | MB_TASKMODAL);
if (pszErr != NULL) LocalFree(pszErr);
mir_free(pszInfo2); /* does NULL check */
@@ -156,7 +156,7 @@ TCHAR *MakeRunCommand(BOOL fMirExe,BOOL fFixedDbProfile) }
TCHAR tszBuffer[1024];
- mir_sntprintf(tszBuffer, _countof(tszBuffer), pszFmt, szExe, szDbFile);
+ mir_sntprintf(tszBuffer, pszFmt, szExe, szDbFile);
return mir_tstrdup(tszBuffer);
}
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index cd4994331a..fc8b9df999 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -36,32 +36,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HINSTANCE hInst;
/* a copy of those in m_assocmgr.h, as we did not #include those helpers */
-__inline static int AssocMgr_AddNewFileTypeT(const char *ext,const char *mime,const TCHAR *desc,const TCHAR *verb,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+__inline static int AssocMgr_AddNewFileTypeT(const char *ext, const char *mime, const TCHAR *desc, const TCHAR *verb, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
FILETYPEDESC ftd;
- ftd.cbSize=sizeof(FILETYPEDESC);
- ftd.pszFileExt=ext;
- ftd.pszMimeType=mime;
- ftd.ptszDescription=desc;
- ftd.hInstance=hinst;
- ftd.nIconResID=iconid;
- ftd.ptszVerbDesc=verb;
- ftd.pszService=service;
- ftd.flags=flags|FTDF_TCHAR;
- return CallService(MS_ASSOCMGR_ADDNEWFILETYPE,0,(LPARAM)&ftd);
+ ftd.cbSize = sizeof(FILETYPEDESC);
+ ftd.pszFileExt = ext;
+ ftd.pszMimeType = mime;
+ ftd.ptszDescription = desc;
+ ftd.hInstance = hinst;
+ ftd.nIconResID = iconid;
+ ftd.ptszVerbDesc = verb;
+ ftd.pszService = service;
+ ftd.flags = flags | FTDF_TCHAR;
+ return CallService(MS_ASSOCMGR_ADDNEWFILETYPE, 0, (LPARAM)&ftd);
}
-static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,HINSTANCE hinst,UINT iconid,const char *service,DWORD flags)
+static int __inline AssocMgr_AddNewUrlType(const char *prefix, const char *desc, HINSTANCE hinst, UINT iconid, const char *service, DWORD flags)
{
URLTYPEDESC utd;
- utd.cbSize=sizeof(URLTYPEDESC);
- utd.pszProtoPrefix=prefix;
- utd.pszDescription=desc;
- utd.hInstance=hinst;
- utd.nIconResID=iconid;
- utd.pszService=service;
- utd.flags=flags&~UTDF_UNICODE;
- return CallService(MS_ASSOCMGR_ADDNEWURLTYPE,0,(LPARAM)&utd);
+ utd.cbSize = sizeof(URLTYPEDESC);
+ utd.pszProtoPrefix = prefix;
+ utd.pszDescription = desc;
+ utd.hInstance = hinst;
+ utd.nIconResID = iconid;
+ utd.pszService = service;
+ utd.flags = flags&~UTDF_UNICODE;
+ return CallService(MS_ASSOCMGR_ADDNEWURLTYPE, 0, (LPARAM)&utd);
}
// -----------------------------------------
@@ -72,10 +72,10 @@ static int __inline AssocMgr_AddNewUrlType(const char *prefix,const char *desc,H #define IDI_AOL 28
#define MOD_KEY_CL "CList"
#define AIM_KEY_NL "NotOnList"
-struct oscar_data { HINSTANCE hInstance; } static conn;
+struct oscar_data { HINSTANCE hInstance; } static conn;
static __inline HANDLE find_contact(const char *nick) { nick; return NULL; }
static __inline HANDLE add_contact(const char *nick) { nick; return db_find_first(); }
-static __inline void aim_gchat_joinrequest(const char *room, int exchange) { room; exchange; MessageBoxA(NULL,"Join group chat!",room,MB_OK); return; }
+static __inline void aim_gchat_joinrequest(const char *room, int exchange) { room; exchange; MessageBoxA(NULL, "Join group chat!", room, MB_OK); return; }
#include <m_protosvc.h>
#include <m_message.h>
@@ -83,116 +83,116 @@ static __inline void aim_gchat_joinrequest(const char *room, int exchange) { roo static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseLink;
-static int ServiceParseAimLink(WPARAM,LPARAM lParam)
+static int ServiceParseAimLink(WPARAM, LPARAM lParam)
{
- char *arg=(char*)lParam;
- if(arg==NULL) return 1; /* sanity check */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
+ char *arg = (char*)lParam;
+ if (arg == NULL) return 1; /* sanity check */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
/*
add user: aim:addbuddy?screenname=NICK&groupname=GROUP
send message: aim:goim?screenname=NICK&message=MSG
open chatroom: aim:gochat?roomname=ROOM&exchange=NUM
*/
- /* add a contact to the list */
- if (!_strnicmp(arg,"addbuddy?",9)) {
- char *tok,*sn=NULL,*group=NULL;
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if (*(arg+=9)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
- sn=Netlib_UrlDecode(tok+11);
- if (!_strnicmp(tok,"groupname=",10) && *(tok+10)!=0)
- group=Netlib_UrlDecode(tok+10); /* group is currently ignored */
- tok=strtok(NULL,"&"); /* next token */
- }
- if(sn==NULL) return 1; /* parse failed */
- if(find_contact(sn)==NULL) { /* does not yet check if sn is current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=AIM_PROTOCOL_NAME;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=sn;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ /* add a contact to the list */
+ if (!_strnicmp(arg, "addbuddy?", 9)) {
+ char *tok, *sn = NULL, *group = NULL;
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (*(arg += 9) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "screenname=", 11) && *(tok + 11) != 0)
+ sn = Netlib_UrlDecode(tok + 11);
+ if (!_strnicmp(tok, "groupname=", 10) && *(tok + 10) != 0)
+ group = Netlib_UrlDecode(tok + 10); /* group is currently ignored */
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (sn == NULL) return 1; /* parse failed */
+ if (find_contact(sn) == NULL) { /* does not yet check if sn is current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = AIM_PROTOCOL_NAME;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = sn;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
- /* send a message to a contact */
- else if (!_strnicmp(arg,"goim?",5)) {
- char *tok,*sn=NULL,*msg=NULL;
- MCONTACT hContact;
- if (*(arg+=5)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"screenname=",11) && *(tok+11)!=0)
- sn=Netlib_UrlDecode(tok+11);
- if (!_strnicmp(tok,"message=",8) && *(tok+8)!=0)
- msg=Netlib_UrlDecode(tok+8);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(sn==NULL) return 1; /* parse failed */
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=find_contact(sn);
- if(hContact==NULL) {
- hContact=add_contact(sn); /* does not yet check if sn is current user */
- if(hContact!=NULL)
- db_set_b(hContact,MOD_KEY_CL,AIM_KEY_NL,1);
- }
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,(LPARAM)msg);
+ }
+ /* send a message to a contact */
+ else if (!_strnicmp(arg, "goim?", 5)) {
+ char *tok, *sn = NULL, *msg = NULL;
+ MCONTACT hContact;
+ if (*(arg += 5) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "screenname=", 11) && *(tok + 11) != 0)
+ sn = Netlib_UrlDecode(tok + 11);
+ if (!_strnicmp(tok, "message=", 8) && *(tok + 8) != 0)
+ msg = Netlib_UrlDecode(tok + 8);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (sn == NULL) return 1; /* parse failed */
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = find_contact(sn);
+ if (hContact == NULL) {
+ hContact = add_contact(sn); /* does not yet check if sn is current user */
+ if (hContact != NULL)
+ db_set_b(hContact, MOD_KEY_CL, AIM_KEY_NL, 1);
+ }
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)msg);
}
return 0;
- }
- /* open a chatroom */
- else if (!_strnicmp(arg,"gochat?",7)) {
- char *tok,*rm=NULL;
- int exchange=0;
- if (*(arg+=7)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"roomname=",9) && *(tok+9)!=0)
- rm=Netlib_UrlDecode(tok+9);
- if (!_strnicmp(tok,"exchange=",9))
- exchange=atoi(Netlib_UrlDecode(tok+9));
- tok=strtok(NULL,"&"); /* next token */
- }
- if(rm==NULL || exchange<=0) return 1; /* parse failed */
- aim_gchat_joinrequest(rm,exchange);
+ }
+ /* open a chatroom */
+ else if (!_strnicmp(arg, "gochat?", 7)) {
+ char *tok, *rm = NULL;
+ int exchange = 0;
+ if (*(arg += 7) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "roomname=", 9) && *(tok + 9) != 0)
+ rm = Netlib_UrlDecode(tok + 9);
+ if (!_strnicmp(tok, "exchange=", 9))
+ exchange = atoi(Netlib_UrlDecode(tok + 9));
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (rm == NULL || exchange <= 0) return 1; /* parse failed */
+ aim_gchat_joinrequest(rm, exchange);
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int AimLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int AimLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char service_name[MAXMODULELABELLENGTH];
+ char service_name[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(service_name,_countof(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
+ mir_snprintf(service_name, _countof(service_name), "%s%s", AIM_PROTOCOL_NAME, "ParseAimLink");
/* or "AOL Instant Messenger Links" */
- AssocMgr_AddNewUrlType("aim:",Translate("AIM link protocol"),conn.hInstance,IDI_AOL,service_name,0);
- return 0;
+ AssocMgr_AddNewUrlType("aim:", Translate("AIM link protocol"), conn.hInstance, IDI_AOL, service_name, 0);
+ return 0;
}
void aim_links_init()
{
- char service_name[MAXMODULELABELLENGTH];
- //LOG(LOG_DEBUG,"Links: init");
- mir_snprintf(service_name,_countof(service_name),"%s%s",AIM_PROTOCOL_NAME,"ParseAimLink");
- hServiceParseLink=CreateServiceFunction(service_name,ServiceParseAimLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,AimLinksModulesLoaded);
+ char service_name[MAXMODULELABELLENGTH];
+ //LOG(LOG_DEBUG,"Links: init");
+ mir_snprintf(service_name, _countof(service_name), "%s%s", AIM_PROTOCOL_NAME, "ParseAimLink");
+ hServiceParseLink = CreateServiceFunction(service_name, ServiceParseAimLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, AimLinksModulesLoaded);
}
void aim_links_destroy()
{
- //LOG(LOG_DEBUG,"Links: destroy");
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseLink);
+ //LOG(LOG_DEBUG,"Links: destroy");
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseLink);
}
#endif
@@ -203,19 +203,20 @@ void aim_links_destroy() #define gpszICQProtoName "ICQ"
#define IDI_ICQ 101
#define hInst GetModuleHandleA("ICQ")
-static __inline HANDLE HContactFromUIN(DWORD dwUIN,int *Added) { dwUIN; Added; return db_find_first(); }
+static __inline HANDLE HContactFromUIN(DWORD dwUIN, int *Added) { dwUIN; Added; return db_find_first(); }
static __inline HANDLE ICQFindFirstContact(void) { return NULL; }
static __inline HANDLE ICQFindNextContact(MCONTACT hContact) { hContact; return NULL; }
-static __inline void AddToCache(MCONTACT hContact,DWORD dwUin) { hContact; dwUin; }
+static __inline void AddToCache(MCONTACT hContact, DWORD dwUin) { hContact; dwUin; }
static __inline DWORD ICQGetContactSettingUIN(MCONTACT hContact) { hContact; return 0; }
static __inline HANDLE HandleFromCacheByUin(DWORD dwUin) { dwUin; return NULL; }
#include <m_protosvc.h>
#include <m_message.h>
-typedef struct {
- PROTOSEARCHRESULT hdr;
- DWORD uin;
- BYTE auth;
- char* uid;
+typedef struct
+{
+ PROTOSEARCHRESULT hdr;
+ DWORD uin;
+ BYTE auth;
+ char* uid;
} ICQSEARCHRESULT;
#include "m_assocmgr.h"
@@ -224,25 +225,26 @@ static HANDLE hServiceOpenFile; static void TrimString(char *str)
{
- int len,start;
- len=mir_strlen(str);
- while(str[0]!='\0' && (unsigned char)str[len-1]<=' ') str[--len]=0;
- for(start=0;str[start] && (unsigned char)str[start]<=' ';++start);
- memmove(str,str+start,len-start+1);
+ int len, start;
+ len = mir_strlen(str);
+ while (str[0] != '\0' && (unsigned char)str[len - 1] <= ' ') str[--len] = 0;
+ for (start = 0; str[start] && (unsigned char)str[start] <= ' '; ++start);
+ memmove(str, str + start, len - start + 1);
}
static BOOL IsEmpty(const char *str)
{
int i;
- for(i=0;str[i]!='\0';i++)
- if(str[i]!=' ' && str[i]!='\r' && str[i]!='\n')
+ for (i = 0; str[i] != '\0'; i++)
+ if (str[i] != ' ' && str[i] != '\r' && str[i] != '\n')
return FALSE;
return TRUE;
}
#define ICQFILE_MESSAGEUSER 1
#define ICQFILE_ADDUSER 2
-typedef struct {
+typedef struct
+{
int type;
char uin[64];
char email[128];
@@ -255,16 +257,16 @@ static HANDLE IsHContactFromUIN(DWORD uin) {
MCONTACT hContact;
DWORD dwUin;
- hContact=HandleFromCacheByUin(uin);
- if(hContact!=NULL) return hContact;
- hContact=ICQFindFirstContact();
- while(hContact!=NULL) {
- dwUin=ICQGetContactSettingUIN(hContact);
- if(dwUin==uin) {
- AddToCache(hContact,dwUin);
+ hContact = HandleFromCacheByUin(uin);
+ if (hContact != NULL) return hContact;
+ hContact = ICQFindFirstContact();
+ while (hContact != NULL) {
+ dwUin = ICQGetContactSettingUIN(hContact);
+ if (dwUin == uin) {
+ AddToCache(hContact, dwUin);
return hContact;
}
- hContact=ICQFindNextContact(hContact);
+ hContact = ICQFindNextContact(hContact);
}
return NULL;
}
@@ -275,24 +277,24 @@ static void AddIcqUser(ICQFILEINFO *info) ICQSEARCHRESULT psr;
DWORD uin;
/* check that uin does not belong to current user */
- uin=atoi(info->uin);
- if(uin!=0 && uin!=ICQGetContactSettingUIN(NULL)) {
+ uin = atoi(info->uin);
+ if (uin != 0 && uin != ICQGetContactSettingUIN(NULL)) {
/* not yet present? */
- if(IsHContactFromUIN(uin)==NULL) {
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=gpszICQProtoName;
- acs.psr=(PROTOSEARCHRESULT*)&psr;
+ if (IsHContactFromUIN(uin) == NULL) {
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = gpszICQProtoName;
+ acs.psr = (PROTOSEARCHRESULT*)&psr;
memset(&psr, 0, sizeof(ICQSEARCHRESULT));
- psr.hdr.cbSize=sizeof(ICQSEARCHRESULT);
- if(info->nick[0]) psr.hdr.nick=info->nick;
- else psr.hdr.nick=info->uin;
- if(info->email[0]) psr.hdr.email=info->email;
- if(info->firstName[0]) psr.hdr.firstName=info->firstName;
- if(info->lastName[0]) psr.hdr.lastName=info->lastName;
- psr.uin=uin;
- psr.auth=1; /* authentication needed flag */
- psr.uid=NULL; /* icq contact */
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
+ psr.hdr.cbSize = sizeof(ICQSEARCHRESULT);
+ if (info->nick[0]) psr.hdr.nick = info->nick;
+ else psr.hdr.nick = info->uin;
+ if (info->email[0]) psr.hdr.email = info->email;
+ if (info->firstName[0]) psr.hdr.firstName = info->firstName;
+ if (info->lastName[0]) psr.hdr.lastName = info->lastName;
+ psr.uin = uin;
+ psr.auth = 1; /* authentication needed flag */
+ psr.uid = NULL; /* icq contact */
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
}
}
}
@@ -300,19 +302,19 @@ static void AddIcqUser(ICQFILEINFO *info) static void MessageIcqUser(ICQFILEINFO *info)
{
MCONTACT hContact;
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=HContactFromUIN(atoi(info->uin),NULL); /* adds the contact if needed */
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,0);
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = HContactFromUIN(atoi(info->uin), NULL); /* adds the contact if needed */
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
}
-static int IcqOpenFile(WPARAM wParam,LPARAM lParam)
+static int IcqOpenFile(WPARAM wParam, LPARAM lParam)
{
- TCHAR *pszFile=(TCHAR*)lParam; /* TCHAR is specified on AssocMgr_AddNewFileTypeT() */
+ TCHAR *pszFile = (TCHAR*)lParam; /* TCHAR is specified on AssocMgr_AddNewFileTypeT() */
FILE *fp;
ICQFILEINFO info;
- char line[4096],*sep;
+ char line[4096], *sep;
UNREFERENCED_PARAMETER(wParam);
/*
send message:
@@ -328,64 +330,64 @@ static int IcqOpenFile(WPARAM wParam,LPARAM lParam) FirstName=
LastName=
*/
- if(pszFile==NULL) return 1; /* sanity check */
- fp=_tfopen(pszFile,_T("rt"));
- if(fp==NULL) return 1; /* open failed */
- info.type=0;
- while(!feof(fp)) {
- if(fgets(line,sizeof(line),fp)==NULL) break;
+ if (pszFile == NULL) return 1; /* sanity check */
+ fp = _tfopen(pszFile, _T("rt"));
+ if (fp == NULL) return 1; /* open failed */
+ info.type = 0;
+ while (!feof(fp)) {
+ if (fgets(line, sizeof(line), fp) == NULL) break;
TrimString(line);
- if(IsEmpty(line)) continue;
- if(line[0]=='[') {
+ if (IsEmpty(line)) continue;
+ if (line[0] == '[') {
memset(&info, 0, sizeof(info));
- if (!mir_strcmpi(line,"[ICQ Message User]"))
- info.type=ICQFILE_MESSAGEUSER;
- else if (!mir_strcmpi(line,"[ICQ User]"))
- info.type=ICQFILE_ADDUSER;
+ if (!mir_strcmpi(line, "[ICQ Message User]"))
+ info.type = ICQFILE_MESSAGEUSER;
+ else if (!mir_strcmpi(line, "[ICQ User]"))
+ info.type = ICQFILE_ADDUSER;
continue;
}
- if(info.type==0) continue;
- sep=strchr(line,'=');
- if(sep==NULL) { info.type=0; break; } /* format error */
- *(sep++)='\0';
- if (!mir_strcmp("UIN",line)) mir_strncpy(info.uin,sep,sizeof(info.uin)); /* buffer safe */
- else if (!mir_strcmp("Email",line)) mir_strncpy(info.email,sep,sizeof(info.email)); /* buffer safe */
- else if (!mir_strcmp("NickName",line)) mir_strncpy(info.nick,sep,sizeof(info.nick)); /* buffer safe */
- else if (!mir_strcmp("FirstName",line)) mir_strncpy(info.firstName,sep,sizeof(info.firstName)); /* buffer safe */
- else if (!mir_strcmp("LastName",line)) mir_strncpy(info.lastName,sep,sizeof(info.lastName)); /* buffer safe */
+ if (info.type == 0) continue;
+ sep = strchr(line, '=');
+ if (sep == NULL) { info.type = 0; break; } /* format error */
+ *(sep++) = '\0';
+ if (!mir_strcmp("UIN", line)) mir_strncpy(info.uin, sep, sizeof(info.uin)); /* buffer safe */
+ else if (!mir_strcmp("Email", line)) mir_strncpy(info.email, sep, sizeof(info.email)); /* buffer safe */
+ else if (!mir_strcmp("NickName", line)) mir_strncpy(info.nick, sep, sizeof(info.nick)); /* buffer safe */
+ else if (!mir_strcmp("FirstName", line)) mir_strncpy(info.firstName, sep, sizeof(info.firstName)); /* buffer safe */
+ else if (!mir_strcmp("LastName", line)) mir_strncpy(info.lastName, sep, sizeof(info.lastName)); /* buffer safe */
}
fclose(fp);
- switch(info.type) {
- case ICQFILE_MESSAGEUSER: MessageIcqUser(&info); return 0;
- case ICQFILE_ADDUSER: AddIcqUser(&info); return 0;
- default: return 1; /* open failed */
+ switch (info.type) {
+ case ICQFILE_MESSAGEUSER: MessageIcqUser(&info); return 0;
+ case ICQFILE_ADDUSER: AddIcqUser(&info); return 0;
+ default: return 1; /* open failed */
}
}
-static int IcqFilesModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int IcqFilesModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAX_PATH+32];
+ char szService[MAX_PATH + 32];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_strcat(mir_strcpy(szService,gpszICQProtoName),"OpenFile");
+ mir_strcat(mir_strcpy(szService, gpszICQProtoName), "OpenFile");
/* .icq files are not used, just by the ProtoLink plugin */
- //AssocMgr_AddNewFileTypeT(".icq","application/x-icq",TranslateT("ICQ link shortcut"),TranslateT("&Add to contact list..."),hInst,IDI_ICQ,szService,FTDF_BROWSERAUTOOPEN|FTDF_ISTEXT|FTDF_ISSHORTCUT|FTDF_DEFAULTDISABLED);
- AssocMgr_AddNewFileTypeT(".uin","application/x-icq",TranslateT("ICQ link shortcut"),TranslateT("&Add to contact list..."),hInst,IDI_ICQ,szService,FTDF_BROWSERAUTOOPEN|FTDF_ISTEXT|FTDF_ISSHORTCUT);
- return 0;
+ //AssocMgr_AddNewFileTypeT(".icq","application/x-icq",TranslateT("ICQ link shortcut"),TranslateT("&Add to contact list..."),hInst,IDI_ICQ,szService,FTDF_BROWSERAUTOOPEN|FTDF_ISTEXT|FTDF_ISSHORTCUT|FTDF_DEFAULTDISABLED);
+ AssocMgr_AddNewFileTypeT(".uin", "application/x-icq", TranslateT("ICQ link shortcut"), TranslateT("&Add to contact list..."), hInst, IDI_ICQ, szService, FTDF_BROWSERAUTOOPEN | FTDF_ISTEXT | FTDF_ISSHORTCUT);
+ return 0;
}
void InitIcqFiles(void)
{
- char szService[MAX_PATH+32];
- mir_strcat(mir_strcpy(szService,gpszICQProtoName),"OpenFile");
- hServiceOpenFile=CreateServiceFunction(szService,IcqOpenFile);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,IcqFilesModulesLoaded);
+ char szService[MAX_PATH + 32];
+ mir_strcat(mir_strcpy(szService, gpszICQProtoName), "OpenFile");
+ hServiceOpenFile = CreateServiceFunction(szService, IcqOpenFile);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, IcqFilesModulesLoaded);
}
void UninitIcqFiles(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceOpenFile);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceOpenFile);
}
#undef hInst
@@ -399,7 +401,7 @@ void UninitIcqFiles(void) #define IDI_YAHOO 10101
#define hinstance GetModuleHandleA("YAHOO")
static __inline HANDLE getbuddyH(const char *yahoo_id) { yahoo_id; return NULL; }
-static __inline HANDLE add_buddy(const char *yahoo_id,const char *yahoo_name,DWORD flags) { yahoo_id; yahoo_name; flags; return db_find_first(); }
+static __inline HANDLE add_buddy(const char *yahoo_id, const char *yahoo_name, DWORD flags) { yahoo_id; yahoo_name; flags; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -407,95 +409,95 @@ static __inline HANDLE add_buddy(const char *yahoo_id,const char *yahoo_name,DWO static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseYmsgrLink;
-static int ServiceParseYmsgrLink(WPARAM wParam,LPARAM lParam)
+static int ServiceParseYmsgrLink(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /*
- add user: ymsgr:addfriend?ID
- send message: ymsgr:sendim?ID&m=MESSAGE
- add chatroom: ymsgr:chat?ROOM
- */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
- /* add a contact to the list */
- if (!_strnicmp(arg,"addfriend?",10)) {
- char *tok,*id=NULL;
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if (*(arg+=10)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- if(tok!=NULL) id=Netlib_UrlDecode(tok);
- if(id==NULL || *id==0) return 1; /* parse failed */
- if(getbuddyH(id)==NULL) { /* does not yet check if id is current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=yahooProtocolName;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=id;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ if (arg == NULL) return 1; /* sanity check */
+ /*
+ add user: ymsgr:addfriend?ID
+ send message: ymsgr:sendim?ID&m=MESSAGE
+ add chatroom: ymsgr:chat?ROOM
+ */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
+ /* add a contact to the list */
+ if (!_strnicmp(arg, "addfriend?", 10)) {
+ char *tok, *id = NULL;
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (*(arg += 10) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ if (tok != NULL) id = Netlib_UrlDecode(tok);
+ if (id == NULL || *id == 0) return 1; /* parse failed */
+ if (getbuddyH(id) == NULL) { /* does not yet check if id is current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = yahooProtocolName;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = id;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
- /* send a message to a contact */
- else if (!_strnicmp(arg,"sendim?",7)) {
- char *tok,*id=NULL,*msg=NULL;
- MCONTACT hContact;
- if (*(arg+=7)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- if(tok!=NULL) id=tok;
- while(tok!=NULL) {
- if (!_strnicmp(tok,"m=",2) && *(tok+2)!=0)
- msg=Netlib_UrlDecode(tok+2);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(id==NULL || *id==0) return 1; /* parse failed */
- if(ServiceExists(MS_MSG_SENDMESSAGE)) { /* does not yet check if sn is current user */
- hContact=add_buddy(id,id,PALF_TEMPORARY); /* ensure contact is on list */
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,(LPARAM)msg);
+ }
+ /* send a message to a contact */
+ else if (!_strnicmp(arg, "sendim?", 7)) {
+ char *tok, *id = NULL, *msg = NULL;
+ MCONTACT hContact;
+ if (*(arg += 7) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ if (tok != NULL) id = tok;
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "m=", 2) && *(tok + 2) != 0)
+ msg = Netlib_UrlDecode(tok + 2);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (id == NULL || *id == 0) return 1; /* parse failed */
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) { /* does not yet check if sn is current user */
+ hContact = add_buddy(id, id, PALF_TEMPORARY); /* ensure contact is on list */
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)msg);
}
return 0;
}
- /* open a chatroom */
- else if (!_strnicmp(arg,"chat?",5)) {
- char *tok,*rm=NULL;
- if (*(arg+=5)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- if(tok!=NULL) rm=Netlib_UrlDecode(tok);
- if(rm==NULL) return 1; /* parse failed */
- /* not yet implemented (rm contains name of chatroom)*/
+ /* open a chatroom */
+ else if (!_strnicmp(arg, "chat?", 5)) {
+ char *tok, *rm = NULL;
+ if (*(arg += 5) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ if (tok != NULL) rm = Netlib_UrlDecode(tok);
+ if (rm == NULL) return 1; /* parse failed */
+ /* not yet implemented (rm contains name of chatroom)*/
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int YmsgrLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int YmsgrLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
- AssocMgr_AddNewUrlType("ymsgr:",Translate("Yahoo link protocol"),hinstance,IDI_YAHOO,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", yahooProtocolName, "ParseYmsgrLink");
+ AssocMgr_AddNewUrlType("ymsgr:", Translate("Yahoo link protocol"), hinstance, IDI_YAHOO, szService, 0);
+ return 0;
}
void YmsgrLinksInit(void)
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",yahooProtocolName,"ParseYmsgrLink");
- hServiceParseYmsgrLink=CreateServiceFunction(szService,ServiceParseYmsgrLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,YmsgrLinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", yahooProtocolName, "ParseYmsgrLink");
+ hServiceParseYmsgrLink = CreateServiceFunction(szService, ServiceParseYmsgrLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, YmsgrLinksModulesLoaded);
}
void YmsgrLinksUninit(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseYmsgrLink);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseYmsgrLink);
}
#undef hinstance
@@ -509,7 +511,7 @@ void YmsgrLinksUninit(void) #define IDI_MSN 101
#define hInst GetModuleHandleA("MSN")
static __inline HANDLE MSN_HContactFromEmailT(const char *msnEmail) { msnEmail; return NULL; }
-static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail,const char *msnNick,int addIfNeeded,int temporary) { msnEmail; msnNick; addIfNeeded; temporary; return db_find_first(); }
+static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail, const char *msnNick, int addIfNeeded, int temporary) { msnEmail; msnNick; addIfNeeded; temporary; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -517,93 +519,93 @@ static __inline HANDLE MSN_HContactFromEmail(const char *msnEmail,const char *ms static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseMsnimLink;
-static int ServiceParseMsnimLink(WPARAM wParam,LPARAM lParam)
+static int ServiceParseMsnimLink(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /*
- add user: msnim:add?contact=netpassport@emailaddress.com
- send message: msnim:chat?contact=netpassport@emailaddress.com
- voice chat: msnim:voice?contact=netpassport@emailaddress.com
- video chat: msnim:video?contact=netpassport@emailaddress.com
- */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
- /* add a contact to the list */
- if (!_strnicmp(arg,"add?",4)) {
- char *tok,*email=NULL;
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if (*(arg+=4)==0) return 1; /* parse failed */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
- email=Netlib_UrlDecode(tok+11);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(email==NULL || *email==0) return 1; /* parse failed */
- if(MSN_HContactFromEmailT(email)==NULL) { /* does not yet check if email is current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=AIM_PROTOCOL_NAME;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=email;
- psr.email.t=email;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ if (arg == NULL) return 1; /* sanity check */
+ /*
+ add user: msnim:add?contact=netpassport@emailaddress.com
+ send message: msnim:chat?contact=netpassport@emailaddress.com
+ voice chat: msnim:voice?contact=netpassport@emailaddress.com
+ video chat: msnim:video?contact=netpassport@emailaddress.com
+ */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
+ /* add a contact to the list */
+ if (!_strnicmp(arg, "add?", 4)) {
+ char *tok, *email = NULL;
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (*(arg += 4) == 0) return 1; /* parse failed */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "contact=", 8) && *(tok + 11) != 0)
+ email = Netlib_UrlDecode(tok + 11);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (email == NULL || *email == 0) return 1; /* parse failed */
+ if (MSN_HContactFromEmailT(email) == NULL) { /* does not yet check if email is current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = AIM_PROTOCOL_NAME;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = email;
+ psr.email.t = email;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
- /* send a message to a contact */
- /* "voice" and "video" not yet implemented, perform same action as "chat" */
- else if (!_strnicmp(arg,"chat?",5) || !_strnicmp(arg,"voice?",6) || !_strnicmp(arg,"video?",6)) {
- char *tok,*email=NULL;
- MCONTACT hContact;
- if (*(arg+=5)==0) return 1; /* parse failed */
- if (*arg=='?' && *(++arg)==0) return 1; /* for "voice?" and "video?" */
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"contact=",8) && *(tok+11)!=0)
- email=Netlib_UrlDecode(tok+11);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(email==NULL || *email==0) return 1; /* parse failed */
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=MSN_HContactFromEmail(email,email,TRUE,TRUE); /* does not yet check if email is current user */
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,0);
+ }
+ /* send a message to a contact */
+ /* "voice" and "video" not yet implemented, perform same action as "chat" */
+ else if (!_strnicmp(arg, "chat?", 5) || !_strnicmp(arg, "voice?", 6) || !_strnicmp(arg, "video?", 6)) {
+ char *tok, *email = NULL;
+ MCONTACT hContact;
+ if (*(arg += 5) == 0) return 1; /* parse failed */
+ if (*arg == '?' && *(++arg) == 0) return 1; /* for "voice?" and "video?" */
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "contact=", 8) && *(tok + 11) != 0)
+ email = Netlib_UrlDecode(tok + 11);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (email == NULL || *email == 0) return 1; /* parse failed */
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = MSN_HContactFromEmail(email, email, TRUE, TRUE); /* does not yet check if email is current user */
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int MsnLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int MsnLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
- AssocMgr_AddNewUrlType("msnim:",Translate("MSN link protocol"),hInst,IDI_MSN,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", msnProtocolName, "ParseMsnimLink");
+ AssocMgr_AddNewUrlType("msnim:", Translate("MSN link protocol"), hInst, IDI_MSN, szService, 0);
+ return 0;
}
int LoadMsnLinks(void)
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",msnProtocolName,"ParseMsnimLink");
- hServiceParseMsnimLink=CreateServiceFunction(szService,ServiceParseMsnimLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,MsnLinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", msnProtocolName, "ParseMsnimLink");
+ hServiceParseMsnimLink = CreateServiceFunction(szService, ServiceParseMsnimLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, MsnLinksModulesLoaded);
return 0;
}
void UnloadMsnLinks(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseMsnimLink);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseMsnimLink);
}
#undef hInst
@@ -617,7 +619,7 @@ void UnloadMsnLinks(void) #define IDI_GG 251
#define hInstance GetModuleHandleA("GG")
typedef DWORD uin_t;
-static __inline HANDLE gg_getcontact(uin_t uin,int create,int inlist,char *szNick) { uin; create; inlist; szNick; return db_find_first(); }
+static __inline HANDLE gg_getcontact(uin_t uin, int create, int inlist, char *szNick) { uin; create; inlist; szNick; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -625,49 +627,49 @@ static __inline HANDLE gg_getcontact(uin_t uin,int create,int inlist,char *szNic static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseLink;
-static int ServiceParseLink(WPARAM wParam,LPARAM lParam)
+static int ServiceParseLink(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /* send message: gg:UID */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
- /* send a message to a contact */
+ if (arg == NULL) return 1; /* sanity check */
+ /* send message: gg:UID */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
+ /* send a message to a contact */
{ MCONTACT hContact;
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=gg_getcontact(atoi(arg),TRUE,FALSE,arg);
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,0);
- }
- }
- return 0;
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = gg_getcontact(atoi(arg), TRUE, FALSE, arg);
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
+ }
+ }
+ return 0;
}
-static int LinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int LinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",GG_PROTO,"ParseMsnimLink");
- AssocMgr_AddNewUrlType("gg:",Translate("Gadu-Gadu link protocol"),hInstance,IDI_GG,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", GG_PROTO, "ParseMsnimLink");
+ AssocMgr_AddNewUrlType("gg:", Translate("Gadu-Gadu link protocol"), hInstance, IDI_GG, szService, 0);
+ return 0;
}
void gg_registerlinks(void)
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",GG_PROTO,"ParseLink");
- hServiceParseLink=CreateServiceFunction(szService,ServiceParseLink);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,LinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", GG_PROTO, "ParseLink");
+ hServiceParseLink = CreateServiceFunction(szService, ServiceParseLink);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, LinksModulesLoaded);
}
void gg_unregisterlinks(void)
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseLink);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseLink);
}
#undef hInstance
@@ -681,7 +683,7 @@ void gg_unregisterlinks(void) #define IDI_JABBER 102
#define hInst GetModuleHandleA("JABBER")
static __inline HANDLE JabberHContactFromJID(const char *jid) { jid; return NULL; }
-static __inline HANDLE JabberDBCreateContact(char *jid,char *nick,BOOL temporary,BOOL stripResource) { jid; nick; temporary; stripResource; return db_find_first(); }
+static __inline HANDLE JabberDBCreateContact(char *jid, char *nick, BOOL temporary, BOOL stripResource) { jid; nick; temporary; stripResource; return db_find_first(); }
#include <m_protosvc.h>
#include <m_message.h>
@@ -689,16 +691,16 @@ static __inline HANDLE JabberDBCreateContact(char *jid,char *nick,BOOL temporary static HANDLE hHookModulesLoaded;
static HANDLE hServiceParseXmppURI;
-static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam)
+static int ServiceParseXmppURI(WPARAM wParam, LPARAM lParam)
{
- char *arg=(char*)lParam;
+ char *arg = (char*)lParam;
char *jid;
UNREFERENCED_PARAMETER(wParam);
- if(arg==NULL) return 1; /* sanity check */
- /* skip leading prefix */
- arg=strchr(arg,':');
- if(arg==NULL) return 1; /* parse failed */
- for (++arg;*arg=='/';++arg);
+ if (arg == NULL) return 1; /* sanity check */
+ /* skip leading prefix */
+ arg = strchr(arg, ':');
+ if (arg == NULL) return 1; /* parse failed */
+ for (++arg; *arg == '/'; ++arg);
/*
complete specification: http://www.xmpp.org/extensions/xep-0147.html
send message: xmpp:JID?message;subject=TEXT&body=TEXT
@@ -706,95 +708,96 @@ static int ServiceParseXmppURI(WPARAM wParam,LPARAM lParam) remove user: xmpp:JID?remove
*/
/* user id */
- arg=strchr(jid=arg,'?');
- if(arg==NULL) arg+=mir_strlen(arg); /* points to terminating nul */
- else *(arg++)=0;
- if (*jid==0) return 1; /* parse failed */
- /* send a message to a contact */
- else if (*arg==0 || (!_strnicmp(arg,"message",7) && (*(arg+7)==';' || *(arg+7)==0))) {
- char *tok,*subj=NULL,*body=NULL;
- MCONTACT hContact;
+ arg = strchr(jid = arg, '?');
+ if (arg == NULL) arg += mir_strlen(arg); /* points to terminating nul */
+ else *(arg++) = 0;
+ if (*jid == 0) return 1; /* parse failed */
+ /* send a message to a contact */
+ else if (*arg == 0 || (!_strnicmp(arg, "message", 7) && (*(arg + 7) == ';' || *(arg + 7) == 0))) {
+ char *tok, *subj = NULL, *body = NULL;
+ MCONTACT hContact;
char msg[1024];
- arg+=7;
- while(*arg==';') ++arg;
- tok=strtok(arg,"&"); /* first token */
- while(tok!=NULL) {
- if (!_strnicmp(tok,"subject=",8) && *(tok+8)!=0)
- subj=Netlib_UrlDecode(tok+8);
- if (!_strnicmp(tok,"body=",5) && *(tok+5)!=0)
- body=Netlib_UrlDecode(tok+5);
- tok=strtok(NULL,"&"); /* next token */
- }
- if(ServiceExists(MS_MSG_SENDMESSAGE)) {
- hContact=JabberDBCreateContact(jid,jid,TRUE,FALSE);
- if(subj!=NULL && body!=NULL) {
- mir_snprintf(msg,_countof(msg),"%.128s %s",subj,body);
- body=msg;
- } else if(body==NULL) body=subj;
- if(hContact!=NULL)
- CallService(MS_MSG_SENDMESSAGE,hContact,(LPARAM)body);
+ arg += 7;
+ while (*arg == ';') ++arg;
+ tok = strtok(arg, "&"); /* first token */
+ while (tok != NULL) {
+ if (!_strnicmp(tok, "subject=", 8) && *(tok + 8) != 0)
+ subj = Netlib_UrlDecode(tok + 8);
+ if (!_strnicmp(tok, "body=", 5) && *(tok + 5) != 0)
+ body = Netlib_UrlDecode(tok + 5);
+ tok = strtok(NULL, "&"); /* next token */
+ }
+ if (ServiceExists(MS_MSG_SENDMESSAGE)) {
+ hContact = JabberDBCreateContact(jid, jid, TRUE, FALSE);
+ if (subj != NULL && body != NULL) {
+ mir_snprintf(msg, _countof(msg), "%.128s %s", subj, body);
+ body = msg;
+ }
+ else if (body == NULL) body = subj;
+ if (hContact != NULL)
+ CallService(MS_MSG_SENDMESSAGE, hContact, (LPARAM)body);
}
return 0;
- }
- /* add user to contact list */
- else if (!_strnicmp(arg,"roster",6) && (*(arg+6)==';' || *(arg+6)==0)) {
- ADDCONTACTSTRUCT acs;
- PROTOSEARCHRESULT psr;
- if(JabberHContactFromJID(jid)==NULL) { /* does not yet check if jid belongs to current user */
- acs.handleType=HANDLE_SEARCHRESULT;
- acs.szProto=jabberProtoName;
- acs.psr=&psr;
- memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
- psr.cbSize=sizeof(PROTOSEARCHRESULT);
- psr.nick.t=jid;
- CallService(MS_ADDCONTACT_SHOW,0,(LPARAM)&acs);
- }
+ }
+ /* add user to contact list */
+ else if (!_strnicmp(arg, "roster", 6) && (*(arg + 6) == ';' || *(arg + 6) == 0)) {
+ ADDCONTACTSTRUCT acs;
+ PROTOSEARCHRESULT psr;
+ if (JabberHContactFromJID(jid) == NULL) { /* does not yet check if jid belongs to current user */
+ acs.handleType = HANDLE_SEARCHRESULT;
+ acs.szProto = jabberProtoName;
+ acs.psr = &psr;
+ memset(&psr, 0, sizeof(PROTOSEARCHRESULT));
+ psr.cbSize = sizeof(PROTOSEARCHRESULT);
+ psr.nick.t = jid;
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ }
return 0;
- }
+ }
/* remove user from contact list */
- else if (!_strnicmp(arg,"remove",6) && (*(arg+6)==';' || *(arg+6)==0)) {
+ else if (!_strnicmp(arg, "remove", 6) && (*(arg + 6) == ';' || *(arg + 6) == 0)) {
MCONTACT hContact;
- hContact=JabberHContactFromJID(jid);
- if(hContact==NULL) /* not yet implemented: show standard miranda dialog here */
- CallService(MS_DB_CONTACT_DELETE,hContact,0);
+ hContact = JabberHContactFromJID(jid);
+ if (hContact == NULL) /* not yet implemented: show standard miranda dialog here */
+ CallService(MS_DB_CONTACT_DELETE, hContact, 0);
return 0;
- }
- /* add user subscription */
- else if (!_strnicmp(arg,"subscribe",9) && (*(arg+9)==';' || *(arg+9)==0)) {
+ }
+ /* add user subscription */
+ else if (!_strnicmp(arg, "subscribe", 9) && (*(arg + 9) == ';' || *(arg + 9) == 0)) {
/* not yet implemented */
return 0;
- }
+ }
/* remove user subscription */
- else if (!_strnicmp(arg,"unsubscribe",11) && (*(arg+11)==';' || *(arg+11)==0)) {
+ else if (!_strnicmp(arg, "unsubscribe", 11) && (*(arg + 11) == ';' || *(arg + 11) == 0)) {
/* not yet implemented */
return 0;
- }
- return 1; /* parse failed */
+ }
+ return 1; /* parse failed */
}
-static int JabberLinksModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int JabberLinksModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- char szService[MAXMODULELABELLENGTH];
+ char szService[MAXMODULELABELLENGTH];
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
- mir_snprintf(szService,_countof(szService),"%s%s",jabberProtoName,"ParseXmppURI");
- AssocMgr_AddNewUrlType("xmpp:",Translate("Jabber link protocol"),hInst,IDI_JABBER,szService,0);
- return 0;
+ mir_snprintf(szService, _countof(szService), "%s%s", jabberProtoName, "ParseXmppURI");
+ AssocMgr_AddNewUrlType("xmpp:", Translate("Jabber link protocol"), hInst, IDI_JABBER, szService, 0);
+ return 0;
}
int JabberLinksInit()
{
- char szService[MAXMODULELABELLENGTH];
- mir_snprintf(szService,_countof(szService),"%s%s",jabberProtoName,"ParseXmppURI");
- hServiceParseXmppURI=CreateServiceFunction(szService,ServiceParseXmppURI);
- hHookModulesLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,JabberLinksModulesLoaded);
+ char szService[MAXMODULELABELLENGTH];
+ mir_snprintf(szService, _countof(szService), "%s%s", jabberProtoName, "ParseXmppURI");
+ hServiceParseXmppURI = CreateServiceFunction(szService, ServiceParseXmppURI);
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, JabberLinksModulesLoaded);
return 0;
}
int JabberLinksUninit()
{
- UnhookEvent(hHookModulesLoaded);
- DestroyServiceFunction(hServiceParseXmppURI);
+ UnhookEvent(hHookModulesLoaded);
+ DestroyServiceFunction(hServiceParseXmppURI);
return 0;
}
@@ -806,7 +809,7 @@ int JabberLinksUninit() void InitTest(void)
{
#ifdef AIM_SUPPORT_TEST
- conn.hInstance=GetModuleHandleA("AIM");
+ conn.hInstance = GetModuleHandleA("AIM");
aim_links_init();
#endif
#ifdef ICQ_SUPPORT_TEST
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 5c00f93395..1b275e1ffe 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -468,7 +468,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP if (dat->fTimeFlags&SDWTF_ST_TIME)
GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
- mir_sntprintf(ttdi->szText, _countof(ttdi->szText), _T("%s %s"), (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
+ mir_sntprintf(ttdi->szText, _T("%s %s"), (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
ttdi->lpszText = ttdi->szText;
}
return 0;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index f947eedfcd..17c30d59f6 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -48,7 +48,7 @@ static BOOL CALLBACK DisplayCpuUsageProc(BYTE nCpuUsage, LPARAM lParam) return FALSE; /* stop poll thread */
TCHAR str[64];
- mir_sntprintf(str, _countof(str), TranslateT("(current: %u%%)"), nCpuUsage);
+ mir_sntprintf(str, TranslateT("(current: %u%%)"), nCpuUsage);
SetWindowText((HWND)lParam, str);
return TRUE;
}
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 68f398d0f5..6f35543e29 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -384,7 +384,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case M_UPDATE_COUNTDOWN: /* lParam=(WORD)countdown */
{
TCHAR szText[256];
- mir_sntprintf(szText, _countof(szText), TranslateTS(desc[shutdownType - 1]), lParam);
+ mir_sntprintf(szText, TranslateTS(desc[shutdownType - 1]), lParam);
SetDlgItemText(hwndDlg, IDC_TEXT_HEADER, szText);
/* countdown finished */
if (!lParam)
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index a748ae039a..0747bf7041 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -136,7 +136,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l TCHAR *displayName = pcli->pfnGetContactDisplayName(data->hContact, 0);
if (displayName) {
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), TranslateT("Avatar History for %s"), displayName);
+ mir_sntprintf(title, TranslateT("Avatar History for %s"), displayName);
SetWindowText(hwnd, title);
}
@@ -374,7 +374,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
- mir_sntprintf(path, _countof(path), _T("%s\\*.*"), dir);
+ mir_sntprintf(path, _T("%s\\*.*"), dir);
HANDLE hFind = FindFirstFile(path, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
@@ -384,7 +384,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) {
if (finddata.cFileName[0] != '.')
{
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), dir, finddata.cFileName);
+ mir_sntprintf(path, _T("%s\\%s"), dir, finddata.cFileName);
max_pos = AddFileToList(path,finddata.cFileName,finddata.cFileName,list);
}
}
@@ -401,7 +401,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata;
GetContactFolder(dir, hContact);
- mir_sntprintf(path, _countof(path), _T("%s\\*.lnk"), dir);
+ mir_sntprintf(path, _T("%s\\*.lnk"), dir);
HANDLE hFind = FindFirstFile(path, &finddata);
if (hFind == INVALID_HANDLE_VALUE)
@@ -412,7 +412,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) if (finddata.cFileName[0] != '.')
{
TCHAR lnk[MAX_PATH];
- mir_sntprintf(lnk, _countof(lnk), _T("%s\\%s"), dir, finddata.cFileName);
+ mir_sntprintf(lnk, _T("%s\\%s"), dir, finddata.cFileName);
if (ResolveShortcut(lnk, path))
max_pos = AddFileToList(path,lnk,finddata.cFileName,list);
}
@@ -549,7 +549,7 @@ int ShowSaveDialog(HWND hwnd, TCHAR* fn, MCONTACT hContact) TCHAR title[MAX_PATH];
if (displayName)
{
- mir_sntprintf(title, _countof(title), TranslateT("Save Avatar for %s"), displayName);
+ mir_sntprintf(title, TranslateT("Save Avatar for %s"), displayName);
ofn.lpstrTitle = title;
}
else
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index bbf9da67b1..e12e54d4f2 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -187,7 +187,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) else
GetProtocolFolder(history_filename, proto);
- mir_sntprintf(history_filename, _countof(history_filename),
+ mir_sntprintf(history_filename,
_T("%s\\%s"), history_filename, hash);
if (CopyImageFile(avatar->filename, history_filename))
@@ -236,7 +236,7 @@ static int PreShutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM)
{
- mir_sntprintf(basedir, _countof(basedir), _T("%s\\Avatars History"), profilePath);
+ mir_sntprintf(basedir, _T("%s\\Avatars History"), profilePath);
hFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatar History"),
PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\Avatars History"));
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 9344544a1e..637458b60d 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -151,7 +151,7 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) #ifdef DBGPOPUPS
TCHAR log[1024];
- mir_sntprintf(log, _countof(log), _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin);
+ mir_sntprintf(log, _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin);
ShowPopup(hContact, _T("AVH Debug: GetContactFolder"), log);
#endif
@@ -178,7 +178,7 @@ void CreateOldStyleShortcut(MCONTACT hContact, TCHAR *history_filename) GetOldStyleAvatarName(shortcut, hContact);
- mir_sntprintf(shortcut, _countof(shortcut), _T("%s.%s.lnk"), shortcut,
+ mir_sntprintf(shortcut, _T("%s.%s.lnk"), shortcut,
GetExtension(history_filename));
if (!CreateShortcut(history_filename, shortcut))
@@ -208,7 +208,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) else
GetProtocolFolder(file, proto);
- mir_sntprintf(search, _countof(search), _T("%s\\%s.*"), file, hash);
+ mir_sntprintf(search, _T("%s\\%s.*"), file, hash);
WIN32_FIND_DATA finddata;
HANDLE hFind = FindFirstFile(search, &finddata);
@@ -225,7 +225,7 @@ TCHAR * GetCachedAvatar(char *proto, TCHAR *hash) || !mir_tstrcmpi(&finddata.cFileName[len-4], _T(".jpg"))
|| !mir_tstrcmpi(&finddata.cFileName[len-5], _T(".jpeg"))))
{
- mir_sntprintf(file, _countof(file), _T("%s\\%s"), file, finddata.cFileName);
+ mir_sntprintf(file, _T("%s\\%s"), file, finddata.cFileName);
ret = mir_tstrdup(file);
break;
}
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index 4fcefa4b21..c27974f8b5 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -185,7 +185,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
else {
DWORD bassver = BASS_GetVersion();
- mir_sntprintf(tmp, _countof(tmp), TranslateT("un4seen's bass version: %d.%d.%d.%d"), bassver >> 24, (bassver >> 16) & 0xff, (bassver >> 8) & 0xff, bassver & 0xff);
+ mir_sntprintf(tmp, TranslateT("un4seen's bass version: %d.%d.%d.%d"), bassver >> 24, (bassver >> 16) & 0xff, (bassver >> 8) & 0xff, bassver & 0xff);
SetDlgItemText(hwndDlg, IDC_BASSVERSION, tmp);
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_RESETCONTENT, 0, 0);
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 8dd5516bcc..96caf57292 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -346,11 +346,11 @@ void HistoryEventList::InitNames() TCHAR str[200];
if (m_hContact) {
_tcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0));
- mir_sntprintf(str, _countof(str), TranslateT("History for %s"), m_contactName);
+ mir_sntprintf(str, TranslateT("History for %s"), m_contactName);
}
else {
_tcscpy_s(m_contactName, TranslateT("System"));
- mir_sntprintf(str, _countof(str), TranslateT("History"));
+ mir_sntprintf(str, TranslateT("History"));
}
if (m_isWnd)
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index 8c05d7bc67..35aa7045e6 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -41,7 +41,7 @@ std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open) _tcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
- mir_sntprintf(filter, _countof(filter), TranslateT("%s Files (*.%s)"), extUpper, ext);
+ mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, _T("*.%s"), ext);
len += mir_tstrlen(filter + len);
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 247f7cdd5b..a1ad2df7d8 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1949,7 +1949,7 @@ void HistoryWindow::Delete(int what) return;
TCHAR message[256];
- mir_sntprintf(message, _countof(message), TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
+ mir_sntprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete);
if (MessageBox(m_hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK)
return;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 523cc4bce1..8a795f769e 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -805,7 +805,7 @@ bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const TCHAR* defName, const TCHAR* TCHAR extUpper[32];
_tcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
- mir_sntprintf(filter, _countof(filter), TranslateT("%s Files (*.%s)"), extUpper, ext);
+ mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext);
size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, _countof(filter) - len, _T("*.%s"), ext);
len += mir_tstrlen(filter + len) + 1;
@@ -1701,7 +1701,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, TCHAR sep = _T(':');
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, timeFormat, 10) > 0)
sep = timeFormat[0];
- mir_sntprintf(timeFormat, _countof(timeFormat), _T("HH%cmm"), sep);
+ mir_sntprintf(timeFormat, _T("HH%cmm"), sep);
}
SYSTEMTIME st;
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index cd4129a5f5..1dc8a3b79f 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -236,9 +236,9 @@ bool DoTask(TaskOptions& to) if (err.empty())
_tcscpy_s(msg, TranslateT("Some value is invalid"));
else if (errDescr.empty())
- mir_sntprintf(msg, _countof(msg), TranslateT("Invalid '%s' value."), err.c_str());
+ mir_sntprintf(msg, TranslateT("Invalid '%s' value."), err.c_str());
else
- mir_sntprintf(msg, _countof(msg), TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
+ mir_sntprintf(msg, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str());
DoError(to, msg);
return true;
@@ -395,7 +395,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n";
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
+ mir_sntprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str());
errorStr += msg;
}
else {
@@ -404,7 +404,7 @@ bool DoTask(TaskOptions& to) TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
+ mir_sntprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str());
errorStr += msg;
}
}
@@ -460,7 +460,7 @@ bool DoTask(TaskOptions& to) TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
+ mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
}
@@ -481,7 +481,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n";
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
+ mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str());
errorStr += msg;
break;
}
@@ -586,7 +586,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName, TCHAR time[256];
SYSTEMTIME st;
GetLocalTime(&st);
- mir_sntprintf(time, _countof(time), _T("%d-%02d-%02d %02d%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
+ mir_sntprintf(time, _T("%d-%02d-%02d %02d%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
std::wstring str1 = str.substr(0, pos);
str1 += time;
str1 += str.substr(pos + 6);
@@ -1129,7 +1129,7 @@ bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std:: DeleteFile(log.c_str());
TCHAR cmdLine[MAX_PATH];
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
+ mir_sntprintf(cmdLine, _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
startupInfo.cb = sizeof(STARTUPINFO);
@@ -1220,7 +1220,7 @@ bool FtpGetFiles(const std::wstring& dir, const std::list<std::wstring>& files, CreateDirectory(GetDirectoryName(log).c_str(), NULL);
DeleteFile(log.c_str());
TCHAR cmdLine[MAX_PATH];
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
+ mir_sntprintf(cmdLine, _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str());
STARTUPINFO startupInfo = { 0 };
PROCESS_INFORMATION processInfo;
startupInfo.cb = sizeof(STARTUPINFO);
@@ -1283,7 +1283,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM) void DoError(const TaskOptions& to, const std::wstring _error)
{
TCHAR msg[256];
- mir_sntprintf(msg, _countof(msg), TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
+ mir_sntprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str());
if (Options::instance->schedulerHistoryAlerts) {
std::wstring error = msg;
error += L"\n";
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 154885f92f..39d094ba1e 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -111,7 +111,7 @@ static bool LoadMind(const TCHAR* filename, int &line) #ifdef DEBUG_LOAD_TIME
t = __rdtsc() - t;
char dest[101];
- mir_snprintf(dest, _countof(dest), "%I64d ticks\n", t / 3200000);
+ mir_snprintf(dest, "%I64d ticks\n", t / 3200000);
MessageBoxA(NULL, dest, NULL, 0);
//exit(0);
#endif
@@ -407,7 +407,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP bTranslated = blInit = LoadMind(c, line);
if (!bTranslated) {
TCHAR message[5000];
- mir_sntprintf(message, _countof(message), TranslateTS(FAILED_TO_LOAD_BASE), line, c);
+ mir_sntprintf(message, TranslateTS(FAILED_TO_LOAD_BASE), line, c);
MessageBox(NULL, message, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
}
@@ -571,7 +571,7 @@ extern "C" int __declspec(dllexport) Load(void) blInit = LoadMind(Config.MindFileName, line);
if (!blInit) {
TCHAR path[2000];
- mir_sntprintf(path, _countof(path), TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
+ mir_sntprintf(path, TranslateTS(FAILED_TO_LOAD_BASE), line, (const TCHAR*)Config.MindFileName);
MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR | MB_TASKMODAL | MB_OK);
}
return 0;
@@ -589,7 +589,7 @@ extern "C" int __declspec(dllexport) Unload(void) //So in case of saving error we will remain silent
#if 0
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
+ mir_sntprintf(path, TranslateTS(FAILED_TO_SAVE_BASE), (const TCHAR*)Config.MindFileName);
TCHAR* err = TranslateTS(BOLTUN_ERROR);
MessageBox(NULL, path, err, MB_ICONERROR | MB_TASKMODAL | MB_OK); */
#endif
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index ff4a7676a5..6ef497ee08 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -231,11 +231,8 @@ bool isContactGoneFor(MCONTACT hContact, int days) ppd.lchContact = hContact;
ppd.lchIcon = IcoLib_GetIcon("enabled_icon");
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), TranslateT("Hiding %s (%S)"),
- pcli->pfnGetContactDisplayName(hContact, 0),
- GetContactProto(hContact));
-
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d days since last message"), daysSinceMessage);
+ mir_sntprintf(ppd.lptzContactName, TranslateT("Hiding %s (%S)"), pcli->pfnGetContactDisplayName(hContact, 0), GetContactProto(hContact));
+ mir_sntprintf(ppd.lptzText, TranslateT("%d days since last message"), daysSinceMessage);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
@@ -289,7 +286,7 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR tmpMsg[512];
- mir_sntprintf(tmpMsg, _countof(tmpMsg), _T("%s %s"), nick, message);
+ mir_sntprintf(tmpMsg, _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
@@ -327,7 +324,7 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) TCHAR* nick = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR tmpMsg[512];
- mir_sntprintf(tmpMsg, _countof(tmpMsg), _T("%s %s"), nick, message);
+ mir_sntprintf(tmpMsg, _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 27337be821..49fb08103f 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -327,7 +327,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchIcon = hIcon;
_tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
TCHAR szPreviewText[250];
- mir_sntprintf(szPreviewText, _countof(szPreviewText), TranslateT("has returned after being absent since %d days"), rand() % 30);
+ mir_sntprintf(szPreviewText, TranslateT("has returned after being absent since %d days"), rand() % 30);
_tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
// Get current popups colors options
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index 4d579257db..14230d91cb 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -16,7 +16,7 @@ void populateContacts(MCONTACT BPhContact, HWND hwnd2CB) char *szProto = GetContactProto(hContact);
if (szProto && (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) {
TCHAR name[300];
- mir_sntprintf(name, _countof(name), _T("%s (%s)"), pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
+ mir_sntprintf(name, _T("%s (%s)"), pcli->pfnGetContactDisplayName(hContact, 0), _A2T(szProto));
int index = SendMessage(hwnd2CB, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwnd2CB, CB_SETITEMDATA, index, hContact);
if (BPhContact == hContact)
@@ -201,7 +201,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lParam);
getDefaultMessage(hwnd, IDC_MESSAGE, hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
return FALSE;
@@ -210,7 +210,7 @@ INT_PTR CALLBACK BuddyPounceSimpleDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, L case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), length);
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
}
break;
@@ -258,7 +258,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
@@ -272,7 +272,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), length);
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
}
break;
@@ -315,7 +315,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case IDC_DEFAULT:
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
db_set_w(wi->hContact, modname, "SendIfMyStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfMyStatusIsFLAG",0));
@@ -390,7 +390,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)wi);
getDefaultMessage(hwnd, IDC_MESSAGE, wi->hContact);
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)));
SetDlgItemText(hwnd, GRP_MSG, msg);
populateSettingsList(GetDlgItem(hwnd, IDC_SETTINGS));
SendDlgItemMessage(hwnd, IDC_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)1024, (short)0));
@@ -433,7 +433,7 @@ INT_PTR CALLBACK BuddyPounceOptionsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, case IDC_MESSAGE:
if (HIWORD(wParam) == EN_CHANGE) {
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE));
- mir_sntprintf(msg, _countof(msg), TranslateT("The Message (%d Characters)"), length);
+ mir_sntprintf(msg, TranslateT("The Message (%d Characters)"), length);
SetDlgItemText(hwnd, GRP_MSG, msg);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
}
@@ -524,7 +524,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_TIMER:
{
TCHAR message[1024];
- mir_sntprintf(message, _countof(message), TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
+ mir_sntprintf(message, TranslateT("Pounce being sent to %s in %d seconds"), pcli->pfnGetContactDisplayName(spdps->hContact, 0), spdps->timer);
SetDlgItemText(hwnd, LBL_CONTACT, message);
}
spdps->timer--;
@@ -601,12 +601,12 @@ void CreateMessageAcknowlegedWindow(MCONTACT hContact, int SentSuccess) HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMSEND), 0, PounceSentDlgProc, hContact);
TCHAR msg[256];
if (SentSuccess) {
- mir_sntprintf(msg, _countof(msg), TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(msg, TranslateT("Message successfully sent to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("OK"));
ShowWindow(GetDlgItem(hwnd, IDCANCEL), 0);
}
else {
- mir_sntprintf(msg, _countof(msg), TranslateT("Message failed to send to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(msg, TranslateT("Message failed to send to %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetDlgItemText(hwnd, IDOK, TranslateT("Retry"));
}
SetDlgItemText(hwnd, LBL_CONTACT, msg);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index aabf619a4b..6063ce4306 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -134,7 +134,7 @@ extern "C" __declspec(dllexport) int Load() for (int i = 0; i < _countof(forms); i++) { char szSettingName[64]; - mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODNAME, forms[i].pszIconIcoLib); + mir_snprintf(szSettingName, "%s_%s", MODNAME, forms[i].pszIconIcoLib); sid.pszName = szSettingName; sid.description.t = forms[i].ptszDescr; @@ -260,14 +260,14 @@ void importCustomStatuses(CSWindow* csw, int result) StatusItem* si = new StatusItem(); si->m_iIcon = i - 1; - mir_snprintf(bufTitle, _countof(bufTitle), "XStatus%dName", i); + mir_snprintf(bufTitle, "XStatus%dName", i); if (!db_get_ts(NULL, protoName, bufTitle, &dbv)) { mir_tstrcpy(si->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else si->m_tszTitle[0] = 0; - mir_snprintf(bufMessage, _countof(bufMessage), "XStatus%dMsg", i); + mir_snprintf(bufMessage, "XStatus%dMsg", i); if (!db_get_ts(NULL, protoName, bufMessage, &dbv)) { mir_tstrcpy(si->m_tszMessage, dbv.ptszVal); db_free(&dbv); @@ -538,7 +538,7 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item) EDITBALLOONTIP ebt = { 0 }; ebt.cbStruct = sizeof(ebt); ebt.pszTitle = TranslateT("Warning"); - mir_sntprintf(tszPopupTip, _countof(tszPopupTip), TranslateT("This field doesn't accept string longer than %d characters. The string will be truncated."), limit); + mir_sntprintf(tszPopupTip, TranslateT("This field doesn't accept string longer than %d characters. The string will be truncated."), limit); ebt.pszText = tszPopupTip; ebt.ttiIcon = TTI_WARNING; SendDlgItemMessage(m_handle, item, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt); @@ -737,30 +737,30 @@ int CSItemsList::compareItems(const StatusItem* p1, const StatusItem* p2) void CSItemsList::loadItems(char *protoName) { char dbSetting[32]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_ItemsCount", protoName); + mir_snprintf(dbSetting, "%s_ItemsCount", protoName); unsigned int itemsCount = getWord(dbSetting, DEFAULT_ITEMS_COUNT); for (unsigned int i = 1; i <= itemsCount; i++) { StatusItem* item = new StatusItem(); DBVARIANT dbv; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dIcon", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); item->m_iIcon = getByte(dbSetting, DEFAULT_ITEM_ICON); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dTitle", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); if (!getTString(dbSetting, &dbv)) { mir_tstrcpy(item->m_tszTitle, dbv.ptszVal); db_free(&dbv); } else item->m_tszTitle[0] = 0; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dMessage", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); if (!getTString(dbSetting, &dbv)) { mir_tstrcpy(item->m_tszMessage, dbv.ptszVal); db_free(&dbv); } else item->m_tszMessage[0] = 0; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dFavourite", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); item->m_bFavourite = (BOOL)getByte(dbSetting, DEFAULT_ITEM_IS_FAVOURITE); m_list->add(item); @@ -772,34 +772,34 @@ void CSItemsList::saveItems(char *protoName) { unsigned int i; char dbSetting[32]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_ItemsCount", protoName); + mir_snprintf(dbSetting, "%s_ItemsCount", protoName); unsigned int oldItemsCount = getWord(dbSetting, DEFAULT_ITEMS_COUNT); for (i = 1; i <= m_list->getCount(); i++) { StatusItem* item = m_list->get(i - 1); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dIcon", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); setByte(dbSetting, item->m_iIcon); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dTitle", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); setTString(dbSetting, item->m_tszTitle); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dMessage", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); setTString(dbSetting, item->m_tszMessage); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dFavourite", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); setByte(dbSetting, item->m_bFavourite); } - mir_snprintf(dbSetting, _countof(dbSetting), "%s_ItemsCount", protoName); + mir_snprintf(dbSetting, "%s_ItemsCount", protoName); setWord(dbSetting, m_list->getCount()); for (; i <= oldItemsCount; i++) { - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dIcon", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dIcon", protoName, i); deleteSetting(dbSetting); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dTitle", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dTitle", protoName, i); deleteSetting(dbSetting); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dMessage", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dMessage", protoName, i); deleteSetting(dbSetting); - mir_snprintf(dbSetting, _countof(dbSetting), "%s_Item%dFavourite", protoName, i); + mir_snprintf(dbSetting, "%s_Item%dFavourite", protoName, i); deleteSetting(dbSetting); } } diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index e75ea0b1d3..5c31dc61e6 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -462,7 +462,7 @@ TCHAR* GetProtoName(struct ClcContact *item) if (acc == NULL) {
#ifdef UNICODE
CallProtoService(item->proto, PS_GETNAME, sizeof(description), (LPARAM)description);
- mir_sntprintf(proto_name, _countof(proto_name), L"%S", description);
+ mir_sntprintf(proto_name, L"%S", description);
#else
CallProtoService(item->proto, PS_GETNAME, sizeof(proto_name), (LPARAM)proto_name);
#endif
@@ -537,7 +537,7 @@ void RebuildEntireListInternal(HWND hwnd, ClcData *tmp_dat, BOOL call_orig) };
if (szCounts[0] != '\0')
- mir_sntprintf(count, _countof(count), _T("%s "), szCounts);
+ mir_sntprintf(count, _T("%s "), szCounts);
else
count[0] = _T('\0');
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index db0fceeede..891ab77fd4 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -668,7 +668,7 @@ static int LocateStorePosition(int Frameid, int maxstored) char settingname[255];
for (int i = 0; i < maxstored; i++) {
- mir_snprintf(settingname, _countof(settingname), "Name%d", i);
+ mir_snprintf(settingname, "Name%d", i);
DBVARIANT dbv = { 0 };
if (db_get_ts(NULL, CLUIFrameModule, settingname, &dbv))
continue;
@@ -2746,7 +2746,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (pos != -1) {
int oldflags;
- mir_sntprintf(TBcapt, _countof(TBcapt), _T("%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d"),
+ mir_sntprintf(TBcapt, _T("%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d"),
g_pfwFrames[pos].name, g_pfwFrames[pos].height, g_pfwFrames[pos].visible, g_pfwFrames[pos].floating,
g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y,
g_pfwFrames[pos].FloatingSize.x, g_pfwFrames[pos].FloatingSize.y,
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 280a33acbd..12d6a29765 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -525,9 +525,8 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) // They are the same -> use the name to keep the case if (mir_tstrcmpi(name, nick) == 0) mir_tstrncpy(contact->szText, name, _countof(contact->szText)); - else - // Append then - mir_sntprintf(contact->szText, _countof(contact->szText), _T("%s - %s"), name, nick); + else // Append then + mir_sntprintf(contact->szText, _T("%s - %s"), name, nick); } else mir_tstrncpy(contact->szText, name, _countof(contact->szText)); } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index a465b90bd1..5a1fd0361e 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1129,7 +1129,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (mir_strcmp(contSour->proto, META_PROTO)) { if (!contSour->isSubcontact) { MCONTACT hDest = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it?"), contDest->szText, contSour->szText); int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { MCONTACT handle = CallService(MS_MC_CONVERTTOMETA, hDest, 0); @@ -1142,7 +1142,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else { hcontact = contSour->hContact; MCONTACT hdest = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be converted to metacontact and '%s' be added to it (remove it from '%s')?"), contDest->szText, contSour->szText, contSour->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { MCONTACT handle = (MCONTACT)CallService(MS_MC_CONVERTTOMETA, (WPARAM)hdest, 0); @@ -1168,7 +1168,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!contSour->isSubcontact) { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->szText); int res = MessageBox(hwnd, Wording, TranslateT("Adding contact to metacontact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1178,7 +1178,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, } else if (contSour->subcontacts == contDest) { MCONTACT hsour = contSour->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be default?"), contSour->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be default?"), contSour->szText); int res = MessageBox(hwnd, Wording, TranslateT("Set default contact"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) db_mc_setDefault(contDest->hContact, hsour, true); @@ -1186,7 +1186,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->szText); int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1210,7 +1210,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (!contSour->isSubcontact) { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->subcontacts->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be added to metacontact '%s'?"), contSour->szText, contDest->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1222,7 +1222,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, else if (contSour->subcontacts != contDest->subcontacts) { MCONTACT hcontact = contSour->hContact; MCONTACT handle = contDest->subcontacts->hContact; - mir_sntprintf(Wording, _countof(Wording), TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->subcontacts->szText); + mir_sntprintf(Wording, TranslateT("Do you want contact '%s' to be removed from metacontact '%s' and added to '%s'?"), contSour->szText, contSour->subcontacts->szText, contDest->subcontacts->szText); int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION); if (res == 1) { if (!handle) @@ -1260,7 +1260,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, if (shortGroup) { NeedRename = TRUE; if (sourceGrName) - mir_sntprintf(newName, _countof(newName), _T("%s\\%s"), sourceGrName, shortGroup); + mir_sntprintf(newName, _T("%s\\%s"), sourceGrName, shortGroup); else mir_tstrncpy(newName, shortGroup, _countof(newName)); } diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index c4102c68a5..e57e8d6a89 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -248,7 +248,7 @@ void* AddTempGroup(HWND hwnd, ClcData *dat, const TCHAR *szName) _itoa_s(i - 1, buf, 10); TCHAR b2[255]; - mir_sntprintf(b2, _countof(b2), _T("#%s"), szName); + mir_sntprintf(b2, _T("#%s"), szName); b2[0] = 1 | GROUPF_EXPANDED; db_set_ws(NULL, "CListGroups", buf, b2); pcli->pfnGetGroupName(i, &groupFlags); @@ -718,7 +718,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, Clc } if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) { if (!db_get_ts(hContact, "CList", "Group", &dbv)) { - mir_sntprintf(szGroupMask, _countof(szGroupMask), _T("%s|"), &dbv.ptszVal[0]); + mir_sntprintf(szGroupMask, _T("%s|"), &dbv.ptszVal[0]); filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)); mir_free(dbv.ptszVal); } diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 0229e36828..bad0577a45 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -1015,7 +1015,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP SendDlgItemMessage(hwndDlg, IDC_TITLETEXT, CB_ADDSTRING, 0, (LPARAM)MIRANDANAME);
char szUin[20];
- mir_snprintf(szUin, _countof(szUin), "%u", db_get_dw(NULL, "ICQ", "UIN", 0));
+ mir_snprintf(szUin, "%u", db_get_dw(NULL, "ICQ", "UIN", 0));
SendDlgItemMessage(hwndDlg, IDC_TITLETEXT, CB_ADDSTRING, 0, (LPARAM)szUin);
if (!db_get_s(NULL, "ICQ", "Nick", &dbv)) {
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 019e95db1a..c3b0efde3f 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -896,7 +896,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) if (szAccoName) {
// first of all try to find by account name( or empty - global )
- mir_sntprintf(fileFull, _countof(fileFull), _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, szAccoName);
+ mir_sntprintf(fileFull, _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, szAccoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
@@ -904,7 +904,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) // second try to find by protocol name
PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
- mir_sntprintf(fileFull, _countof(fileFull), _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, acc->szProtoName);
+ mir_sntprintf(fileFull, _T("%s\\Icons\\proto_conn_%S.dll"), tszFolderPath, acc->szProtoName);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
}
@@ -912,7 +912,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) }
// third try global
- mir_sntprintf(fileFull, _countof(fileFull), _T("%s\\Icons\\proto_conn.dll"), tszFolderPath);
+ mir_sntprintf(fileFull, _T("%s\\Icons\\proto_conn.dll"), tszFolderPath);
if (count = ExtractIconEx(fileFull, -1, NULL, NULL, 1))
return count;
@@ -938,7 +938,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) HICON hIcon;
if (szAccoName) {
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("proto_conn_%S.dll"), szAccoName);
+ mir_sntprintf(szFullPath, _T("proto_conn_%S.dll"), szAccoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
@@ -946,7 +946,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int idx) // second try to find by protocol name
PROTOACCOUNT *acc = Proto_GetAccount(szAccoName);
if (acc && !acc->bOldProto) {
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("proto_conn_%S.dll"), acc->szProtoName);
+ mir_sntprintf(szFullPath, _T("proto_conn_%S.dll"), acc->szProtoName);
if (hIcon = CLUI_LoadIconFromExternalFile(szFullPath, idx))
return hIcon;
}
@@ -1582,7 +1582,7 @@ LRESULT CLUI::PreProcessWndProc(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bH if (msg == uMsgGetProfile && wParam != 0) { // got IPC message
int rc = 0;
char szName[MAX_PATH];
- mir_snprintf(szName, _countof(szName), "Miranda::%u", wParam); // caller will tell us the ID of the map
+ mir_snprintf(szName, "Miranda::%u", wParam); // caller will tell us the ID of the map
HANDLE hMap = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, szName);
if (hMap != NULL) {
void *hView = NULL;
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 2078d05f6f..13fd8e2bcd 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -1480,7 +1480,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL m TCHAR b2[MAX_PATH]; if (file[0] != '\\' && file[1] != ':') - mir_sntprintf(b2, _countof(b2), _T("%s\\%s"), (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : _T(""), file); + mir_sntprintf(b2, _T("%s\\%s"), (skinfolder == NULL) ? SkinPlace : ((INT_PTR)skinfolder != -1) ? skinfolder : _T(""), file); else mir_tstrncpy(b2, file, _countof(b2)); @@ -2980,13 +2980,13 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) BitBlt(g_pCachedWindow->hImageDC, rLine.left, rLine.top, rLine.right - rLine.left, rLine.bottom - rLine.top, g_pCachedWindow->hBackDC, rLine.left, rLine.top, SRCCOPY); char req[255]; - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar,Frame=%S,Part=Back", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar,Frame=%S,Part=Back", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rLine, &rLine, req); - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar,Frame=%S,Part=Thumb", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar,Frame=%S,Part=Thumb", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rThumb, &rThumb, req); - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar, Frame=%S,Part=UpLineButton", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar, Frame=%S,Part=UpLineButton", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rUpBtn, &rUpBtn, req); - mir_snprintf(req, _countof(req), "Main,ID=ScrollBar,Frame=%S,Part=DownLineButton", Frame->name); + mir_snprintf(req, "Main,ID=ScrollBar,Frame=%S,Part=DownLineButton", Frame->name); SkinDrawGlyph(g_pCachedWindow->hImageDC, &rDnBtn, &rDnBtn, req); } @@ -3301,9 +3301,9 @@ static DWORD ske_HexToARGB(char * Hex) char buf2[11] = { 0 }; mir_snprintf(buf, "%s\n", Hex); if (buf[1] == 'x' || buf[1] == 'X') - mir_snprintf(buf2, _countof(buf2), "0x%s\n", buf + 2); + mir_snprintf(buf2, "0x%s\n", buf + 2); else - mir_snprintf(buf2, _countof(buf2), "0x%s\n", buf); + mir_snprintf(buf2, "0x%s\n", buf); buf2[10] = '\0'; char *st; diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 4e95804f4e..df52146c38 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -252,7 +252,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, _countof(imfn), sd->File); IniParser::GetSkinFolder(sd->File, skinfolder); - mir_sntprintf(prfn, _countof(prfn), _T("%s\\%s"), skinfolder, imfn); + mir_sntprintf(prfn, _T("%s\\%s"), skinfolder, imfn); PathToAbsoluteT(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); @@ -332,7 +332,7 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder) struct _tfinddata_t fd = { 0 }; TCHAR mask[MAX_PATH]; long hFile; - mir_sntprintf(mask, _countof(mask), _T("%s\\*.msf"), Folder); + mir_sntprintf(mask, _T("%s\\*.msf"), Folder); //fd.attrib = _A_SUBDIR; hFile = _tfindfirst(mask, &fd); if (hFile != -1) @@ -342,14 +342,14 @@ int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder) } while (!_tfindnext(hFile, &fd)); _findclose(hFile); } - mir_sntprintf(mask, _countof(mask), _T("%s\\*"), Folder); + mir_sntprintf(mask, _T("%s\\*"), Folder); hFile = _tfindfirst(mask, &fd); { do { if (fd.attrib&_A_SUBDIR && !(mir_tstrcmpi(fd.name, _T(".")) == 0 || mir_tstrcmpi(fd.name, _T("..")) == 0)) {//Next level of subfolders TCHAR path[MAX_PATH]; - mir_sntprintf(path, _countof(path), _T("%s\\%s"), Folder, fd.name); + mir_sntprintf(path, _T("%s\\%s"), Folder, fd.name); SearchSkinFiles(hwndDlg, path); } } while (!_tfindnext(hFile, &fd)); @@ -414,7 +414,7 @@ HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file) _tcsncpy_s(fullName, TranslateT("Default Skin"), _TRUNCATE); } else { - mir_sntprintf(fullName, _countof(fullName), _T("%s\\%s"), path, file); + mir_sntprintf(fullName, _T("%s\\%s"), path, file); _tcsncpy_s(defskinname, file, _TRUNCATE); TCHAR *p = _tcsrchr(defskinname, '.'); if (p) *p = 0; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Name"), defskinname, sd->Name, _countof(sd->Name), fullName); @@ -522,7 +522,7 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) TCHAR skinfolder[MAX_PATH] = { 0 }; GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, _countof(imfn), (LPCTSTR)lParam); IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder); - mir_sntprintf(prfn, _countof(prfn), _T("%s\\%s"), skinfolder, imfn); + mir_sntprintf(prfn, _T("%s\\%s"), skinfolder, imfn); PathToAbsoluteT(prfn, imfn); hPreviewBitmap = ske_LoadGlyphImage(imfn); diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 8fc3333cff..20d96b08fc 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -770,12 +770,12 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (msg == WM_LBUTTONDOWN && bCtrl) {
if (g_CluiData.bFilterEffective != CLVM_FILTER_PROTOS || !bShift) {
ApplyViewMode("");
- mir_snprintf(g_CluiData.protoFilter, _countof(g_CluiData.protoFilter), "%s|", p.szAccountName);
+ mir_snprintf(g_CluiData.protoFilter, "%s|", p.szAccountName);
g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
else {
char protoF[sizeof(g_CluiData.protoFilter)];
- mir_snprintf(protoF, _countof(protoF), "%s|", p.szAccountName);
+ mir_snprintf(protoF, "%s|", p.szAccountName);
char *pos = strstri(g_CluiData.protoFilter, p.szAccountName);
if (pos) {
// remove filter
@@ -789,7 +789,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa }
else {
//add filter
- mir_snprintf(g_CluiData.protoFilter, _countof(g_CluiData.protoFilter), "%s%s", g_CluiData.protoFilter, protoF);
+ mir_snprintf(g_CluiData.protoFilter, "%s%s", g_CluiData.protoFilter, protoF);
g_CluiData.bFilterEffective = CLVM_FILTER_PROTOS;
}
}
@@ -809,7 +809,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa continue;
char protoF[sizeof(g_CluiData.protoFilter)];
- mir_snprintf(protoF, _countof(protoF), "%s|", accs[k]->szModuleName);
+ mir_snprintf(protoF, "%s|", accs[k]->szModuleName);
if (strstri(g_CluiData.protoFilter, protoF)) {
if (!first)
mir_strncat(filterName, "; ", _countof(filterName) - mir_strlen(filterName));
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 63ccf96317..6b8c55e12d 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -403,25 +403,25 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l StatusBarProtocolOptions *sbpo = (StatusBarProtocolOptions*)SendMessage(hwndComboBox, CB_GETITEMDATA, i, 0);
char settingBuf[256];
- mir_snprintf(settingBuf, _countof(settingBuf), "SBarAccountIsCustom_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "SBarAccountIsCustom_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->AccountIsCustomized);
- mir_snprintf(settingBuf, _countof(settingBuf), "HideAccount_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "HideAccount_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->HideAccount);
- mir_snprintf(settingBuf, _countof(settingBuf), "SBarShow_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "SBarShow_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->SBarShow);
- mir_snprintf(settingBuf, _countof(settingBuf), "SBarRightClk_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "SBarRightClk_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->SBarRightClk);
- mir_snprintf(settingBuf, _countof(settingBuf), "UseConnectingIcon_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "UseConnectingIcon_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->UseConnectingIcon);
- mir_snprintf(settingBuf, _countof(settingBuf), "ShowUnreadEmails_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "ShowUnreadEmails_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo->ShowUnreadEmails);
- mir_snprintf(settingBuf, _countof(settingBuf), "ShowXStatus_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "ShowXStatus_%s", sbpo->szName);
db_set_b(NULL, "CLUI", settingBuf, sbpo->ShowXStatus);
- mir_snprintf(settingBuf, _countof(settingBuf), "PaddingLeft_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "PaddingLeft_%s", sbpo->szName);
db_set_dw(NULL, "CLUI", settingBuf, sbpo->PaddingLeft);
- mir_snprintf(settingBuf, _countof(settingBuf), "PaddingRight_%s", sbpo->szName);
+ mir_snprintf(settingBuf, "PaddingRight_%s", sbpo->szName);
db_set_dw(NULL, "CLUI", settingBuf, sbpo->PaddingRight);
}
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp index 6644f0a846..decbcd621e 100644 --- a/plugins/Clist_modern/src/modern_tbbutton.cpp +++ b/plugins/Clist_modern/src/modern_tbbutton.cpp @@ -101,7 +101,7 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint, POINT *pOffset) if (!g_CluiData.fDisableSkinEngine) {
char szRequest[128];
/* painting */
- mir_snprintf(szRequest, _countof(szRequest), "Button,ID=%s,Hovered=%s,Pressed=%s,Focused=%s",
+ mir_snprintf(szRequest, "Button,ID=%s,Hovered=%s,Pressed=%s,Focused=%s",
bct->szButtonID, // ID
b2str(bct->stateId == PBS_HOT), // Hovered
b2str(bct->stateId == PBS_PRESSED || bct->bIsPushed == TRUE), // Pressed
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index f3d98a0056..121fbf4bef 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -538,7 +538,7 @@ static void UpdateFilters() for (i = 0; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- mir_snprintf(szMask, _countof(szMask), "%s|", szTemp);
+ mir_snprintf(szMask, "%s|", szTemp);
if (szPF && strstr(szPF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
@@ -561,7 +561,7 @@ static void UpdateFilters() for (i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, _countof(szMask), _T("%s|"), szTemp);
+ mir_sntprintf(szMask, _T("%s|"), szTemp);
if (szGF && _tcsstr(szGF, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 1efaba03ad..6dbfb937d6 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -485,7 +485,7 @@ int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, str }
if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
- mir_sntprintf(szGroupMask, _countof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
+ mir_sntprintf(szGroupMask, _T("%s|"), &dbv.ptszVal[1]);
filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
}
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index e590392b4d..b1e87183be 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -66,7 +66,7 @@ int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact, HICON if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE && phIcon != NULL) {
if (szProto) {
char szBuf[128];
- mir_snprintf(szBuf, _countof(szBuf), "%s_conn", szProto);
+ mir_snprintf(szBuf, "%s_conn", szProto);
*phIcon = IcoLib_GetIcon(szBuf);
}
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 752cc0c8c2..d7705d4239 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -246,7 +246,7 @@ static void CacheClientIcons() for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) { char szBuffer[128]; - mir_snprintf(szBuffer, _countof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); + mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); overlayicons[i - IDI_OVL_OFFLINE] = IcoLib_GetIcon(szBuffer); } } @@ -257,7 +257,7 @@ static void InitIcoLib() for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) { char szBuffer[128]; - mir_snprintf(szBuffer, _countof(szBuffer), "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); + mir_snprintf(szBuffer, "cln_ovl_%d", ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE)); IconItemT icon = { pcli->pfnGetStatusModeDescription(ID_STATUS_OFFLINE + (i - IDI_OVL_OFFLINE), 0), szBuffer, i }; Icon_RegisterT(g_hInst, LPGENT("Contact list") _T("/") LPGENT("Overlay icons"), &icon, 1); } @@ -270,7 +270,7 @@ static void InitIcoLib() continue; TCHAR szDescr[128]; - mir_sntprintf(szDescr, _countof(szDescr), TranslateT("%s connecting"), accs[k]->tszAccountName); + mir_sntprintf(szDescr, TranslateT("%s connecting"), accs[k]->tszAccountName); IconItemT icon = { szDescr, "conn", IDI_PROTOCONNECTING }; Icon_RegisterT(g_hInst, LPGENT("Contact list") _T("/") LPGENT("Connecting icons"), &icon, 1, accs[k]->szModuleName); } @@ -1420,7 +1420,7 @@ skipbg: if (serviceFailure) { char szError[512]; - mir_snprintf(szError, _countof(szError), Translate("The service %s specified by the %s button definition was not found. You may need to install additional plugins."), item->szService, item->szName); + mir_snprintf(szError, Translate("The service %s specified by the %s button definition was not found. You may need to install additional plugins."), item->szService, item->szName); MessageBoxA(0, szError, Translate("Service failure"), MB_OK); } break; @@ -1669,7 +1669,7 @@ buttons_done: if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE) { char szBuffer[128]; - mir_snprintf(szBuffer, _countof(szBuffer), "%s_conn", pd->RealName); + mir_snprintf(szBuffer, "%s_conn", pd->RealName); hIcon = IcoLib_GetIcon(szBuffer); } else if (cfg::dat.bShowXStatusOnSbar && status > ID_STATUS_OFFLINE) { diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index bbf7b4f8e0..2e42ddf769 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -468,7 +468,7 @@ int LocateStorePosition(int Frameid, int maxstored) for (int i = 0; i < maxstored; i++) { char settingname[255]; - mir_snprintf(settingname, _countof(settingname), "Name%d", i); + mir_snprintf(settingname, "Name%d", i); ptrT frmname(db_get_tsa(0, CLUIFrameModule, settingname)); if (frmname == NULL) continue; if (mir_tstrcmpi(frmname, Frames[Frameid].name) == 0) @@ -2445,7 +2445,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA if (pos != -1) { int oldflags; char TBcapt[255]; - mir_snprintf(TBcapt, _countof(TBcapt), "%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d", + mir_snprintf(TBcapt, "%s - h:%d, vis:%d, fl:%d, fl:(%d,%d,%d,%d),or: %d", Frames[pos].name, Frames[pos].height, Frames[pos].visible, Frames[pos].floating, Frames[pos].FloatingPos.x, Frames[pos].FloatingPos.y, Frames[pos].FloatingSize.x, Frames[pos].FloatingSize.y, @@ -2929,7 +2929,7 @@ TCHAR g_ptszEventName[100]; static int CLUIFrameOnModulesLoad(WPARAM, LPARAM) { - mir_sntprintf(g_ptszEventName, _countof(g_ptszEventName), _T("mf_update_evt_%d"), GetCurrentThreadId()); + mir_sntprintf(g_ptszEventName, _T("mf_update_evt_%d"), GetCurrentThreadId()); g_hEventThread = CreateEvent(NULL, TRUE, FALSE, g_ptszEventName); hThreadMFUpdate = mir_forkthread(MF_UpdateThread, NULL); SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE); diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index e5e059f787..ccdb98ccc4 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -33,7 +33,7 @@ static INT_PTR GetClistVersion(WPARAM, LPARAM lParam) {
static char g_szVersionString[256];
- mir_snprintf(g_szVersionString, _countof(g_szVersionString), "%s, %d.%d.%d.%d", pluginInfo.shortName, HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOBYTE(pluginInfo.version)));
+ mir_snprintf(g_szVersionString, "%s, %d.%d.%d.%d", pluginInfo.shortName, HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOBYTE(pluginInfo.version)));
if (!IsBadWritePtr((LPVOID)lParam, 4))
*((DWORD *)lParam) = pluginInfo.version;
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 48486e1456..0cf73d44aa 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -253,13 +253,13 @@ INT_PTR CALLBACK API::Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) case WM_INITDIALOG: {
char szBuffer[2048];
#ifdef _WIN64
- mir_snprintf(szBuffer, _countof(szBuffer),
+ mir_snprintf(szBuffer,
"Exception %16.16X at address %16.16X occured in %s at line %d.\r\n\r\nEAX=%16.16X EBX=%16.16X ECX=%16.16X\r\nEDX=%16.16X ESI=%16.16X EDI=%16.16X\r\nEBP=%16.16X ESP=%16.16X EIP=%16.16X",
exRecord.ExceptionCode, exRecord.ExceptionAddress, exSzFile, exLine,
exCtx.Rax, exCtx.Rbx, exCtx.Rcx, exCtx.Rdx,
exCtx.Rsi, exCtx.Rdi, exCtx.Rbp, exCtx.Rsp, exCtx.Rip);
#else
- mir_snprintf(szBuffer, _countof(szBuffer),
+ mir_snprintf(szBuffer,
"Exception %8.8X at address %8.8X occured in %s at line %d.\r\n\r\nEAX=%8.8X EBX=%8.8X ECX=%8.8X\r\nEDX=%8.8X ESI=%8.8X EDI=%8.8X\r\nEBP=%8.8X ESP=%8.8X EIP=%8.8X",
exRecord.ExceptionCode, exRecord.ExceptionAddress, exSzFile, exLine,
exCtx.Eax,exCtx.Ebx, exCtx.Ecx, exCtx.Edx,
@@ -303,8 +303,8 @@ int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, TCH memcpy(&exRecord, ep->ExceptionRecord, sizeof(EXCEPTION_RECORD));
memcpy(&exCtx, ep->ContextRecord, sizeof(CONTEXT));
- mir_snprintf(exSzFile, _countof(exSzFile), "%s%s", szName, szExt);
- mir_sntprintf(exReason, _countof(exReason), _T("An application error has occured: %s"), szReason);
+ mir_snprintf(exSzFile, "%s%s", szName, szExt);
+ mir_sntprintf(exReason, _T("An application error has occured: %s"), szReason);
exLine = line;
exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), 0, Ex_DlgProc, 0);
exAllowContinue = fAllowContinue;
@@ -370,7 +370,7 @@ void CRTException::display() const TCHAR *tszMsg = mir_a2t(what());
TCHAR tszBoxMsg[500];
- mir_sntprintf(tszBoxMsg, _countof(tszBoxMsg), _T("%s\n\n(%s)"), tszMsg, m_szParam);
+ mir_sntprintf(tszBoxMsg, _T("%s\n\n(%s)"), tszMsg, m_szParam);
::MessageBox(0, tszBoxMsg, _T("Clist_nicer runtime error"), MB_OK | MB_ICONERROR);
mir_free(tszMsg);
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index aad2b8689c..27d3b837ed 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -287,9 +287,9 @@ void LoadExtBkSettingsFromDB() *p = _StatusItems[0];
ID_EXTBK_LAST++;
- mir_snprintf(p->szDBname, _countof(p->szDBname), "EXBK_%s", accs[i]->szModuleName);
+ mir_snprintf(p->szDBname, "EXBK_%s", accs[i]->szModuleName);
if (i == 0)
- mir_snprintf(p->szName, _countof(p->szName), "{-}%s", accs[i]->szModuleName);
+ mir_snprintf(p->szName, "{-}%s", accs[i]->szModuleName);
else
strncpy_s(p->szName, accs[i]->szModuleName, _TRUNCATE);
p->statusID = ID_EXTBK_LAST;
@@ -487,34 +487,34 @@ void extbk_export(char *file) }
for (n = 0; n <= FONTID_LAST; n++) {
- mir_snprintf(szSection, _countof(szSection), "Font%d", n);
+ mir_snprintf(szSection, "Font%d", n);
- mir_snprintf(szKey, _countof(szKey), "Font%dName", n);
+ mir_snprintf(szKey, "Font%dName", n);
if (!cfg::getString(NULL, "CLC", szKey, &dbv)) {
WritePrivateProfileStringA(szSection, "Name", dbv.pszVal, file);
mir_free(dbv.pszVal);
}
- mir_snprintf(szKey, _countof(szKey), "Font%dSize", n);
+ mir_snprintf(szKey, "Font%dSize", n);
data = (DWORD)cfg::getByte("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Size", &data, 1, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dSty", n);
+ mir_snprintf(szKey, "Font%dSty", n);
data = (DWORD)cfg::getByte("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Style", &data, 1, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dSet", n);
+ mir_snprintf(szKey, "Font%dSet", n);
data = (DWORD)cfg::getByte("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Set", &data, 1, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dCol", n);
+ mir_snprintf(szKey, "Font%dCol", n);
data = cfg::getDword("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Color", &data, 4, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dFlags", n);
+ mir_snprintf(szKey, "Font%dFlags", n);
data = (DWORD)cfg::getDword("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "Flags", &data, 4, file);
- mir_snprintf(szKey, _countof(szKey), "Font%dAs", n);
+ mir_snprintf(szKey, "Font%dAs", n);
data = (DWORD)cfg::getWord("CLC", szKey, 8);
WritePrivateProfileStructA(szSection, "SameAs", &data, 2, file);
}
@@ -555,7 +555,7 @@ DWORD __fastcall HexStringToLong(const char *szSource) static StatusItems_t default_item = {
"{--Contact--}", "", 0,
CLCDEFAULT_GRADIENT, CLCDEFAULT_CORNER,
- CLCDEFAULT_COLOR, CLCDEFAULT_COLOR2, CLCDEFAULT_COLOR2_TRANSPARENT, -1,
+ CLCDEFAULT_COLOR, CLCDEFAULT_COLOR2, CLCDEFAULT_COLOR2_TRANSPARENT, DWORD(-1),
CLCDEFAULT_ALPHA, CLCDEFAULT_MRGN_LEFT, CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT,
CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE
};
@@ -700,12 +700,12 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file) this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_snprintf(def_color, _countof(def_color), "%6.6x", clr);
+ mir_snprintf(def_color, "%6.6x", clr);
GetPrivateProfileStringA(szItem, "Color1", def_color, buffer, 400, file);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_snprintf(def_color, _countof(def_color), "%6.6x", clr);
+ mir_snprintf(def_color, "%6.6x", clr);
GetPrivateProfileStringA(szItem, "Color2", def_color, buffer, 400, file);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -777,7 +777,7 @@ done_with_glyph: strncpy(tmpItem.szName, &itemname[1], sizeof(tmpItem.szName));
tmpItem.szName[sizeof(tmpItem.szName) - 1] = 0;
_splitpath(szFileName, szDrive, szPath, NULL, NULL);
- mir_snprintf(szFinalName, _countof(szFinalName), "%s\\%s\\%s", szDrive, szPath, buffer);
+ mir_snprintf(szFinalName, "%s\\%s\\%s", szDrive, szPath, buffer);
tmpItem.alpha = GetPrivateProfileIntA(itemname, "Alpha", 100, szFileName);
tmpItem.alpha = min(tmpItem.alpha, 100);
tmpItem.alpha = (BYTE)((FLOAT)(((FLOAT)tmpItem.alpha) / 100) * 255);
@@ -853,7 +853,7 @@ done_with_glyph: goto imgread_done;
}
for (n = 0;; n++) {
- mir_snprintf(szItemNr, _countof(szItemNr), "Item%d", n);
+ mir_snprintf(szItemNr, "Item%d", n);
GetPrivateProfileStringA(itemname, szItemNr, "None", buffer, 500, szFileName);
if (!mir_strcmp(buffer, "None"))
break;
@@ -1274,7 +1274,7 @@ void LoadPerContactSkins(TCHAR *tszFileName) char UIN[40];
switch (dbv.type) {
case DBVT_DWORD:
- mir_snprintf(UIN, _countof(UIN), "%d", dbv.dVal);
+ mir_snprintf(UIN, "%d", dbv.dVal);
break;
case DBVT_ASCIIZ:
strncpy_s(UIN, dbv.pszVal, _TRUNCATE);
@@ -1363,38 +1363,38 @@ void extbk_import(char *file, HWND hwndDlg) GetPrivateProfileStructA("Global", "Version", &version, 4, file);
if (version >= 2) {
for (n = 0; n <= FONTID_LAST; n++) {
- mir_snprintf(szSection, _countof(szSection), "Font%d", n);
+ mir_snprintf(szSection, "Font%d", n);
- mir_snprintf(szKey, _countof(szKey), "Font%dName", n);
+ mir_snprintf(szKey, "Font%dName", n);
GetPrivateProfileStringA(szSection, "Name", "Arial", buffer, sizeof(buffer), file);
cfg::writeString(NULL, "CLC", szKey, buffer);
- mir_snprintf(szKey, _countof(szKey), "Font%dSize", n);
+ mir_snprintf(szKey, "Font%dSize", n);
data = 0;
GetPrivateProfileStructA(szSection, "Size", &data, 1, file);
cfg::writeByte("CLC", szKey, (BYTE)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dSty", n);
+ mir_snprintf(szKey, "Font%dSty", n);
data = 0;
GetPrivateProfileStructA(szSection, "Style", &data, 1, file);
cfg::writeByte("CLC", szKey, (BYTE)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dSet", n);
+ mir_snprintf(szKey, "Font%dSet", n);
data = 0;
GetPrivateProfileStructA(szSection, "Set", &data, 1, file);
cfg::writeByte("CLC", szKey, (BYTE)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dCol", n);
+ mir_snprintf(szKey, "Font%dCol", n);
data = 0;
GetPrivateProfileStructA(szSection, "Color", &data, 4, file);
cfg::writeDword("CLC", szKey, data);
- mir_snprintf(szKey, _countof(szKey), "Font%dFlags", n);
+ mir_snprintf(szKey, "Font%dFlags", n);
data = 0;
GetPrivateProfileStructA(szSection, "Flags", &data, 4, file);
cfg::writeDword("CLC", szKey, (WORD)data);
- mir_snprintf(szKey, _countof(szKey), "Font%dAs", n);
+ mir_snprintf(szKey, "Font%dAs", n);
data = 0;
GetPrivateProfileStructA(szSection, "SameAs", &data, 2, file);
cfg::writeDword("CLC", szKey, (WORD)data);
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 2aec05b640..22268a7df3 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -160,7 +160,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM BYTE isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0);
TCHAR szTipText[256];
- mir_sntprintf(szTipText, _countof(szTipText), _T("<b>%s</b>: %s%s"),
+ mir_sntprintf(szTipText, _T("<b>%s</b>: %s%s"),
PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? _T(" (LOCKED)") : _T(""));
CLCINFOTIP ti = { sizeof(ti) };
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 74107561e0..cb647b2923 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -481,7 +481,7 @@ void UpdateFilters() for (i = 0; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- mir_snprintf(szMask, _countof(szMask), "%s|", szTemp);
+ mir_snprintf(szMask, "%s|", szTemp);
if (dbv_pf.pszVal && strstr(dbv_pf.pszVal, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
@@ -505,7 +505,7 @@ void UpdateFilters() for (i = 1; i < ListView_GetItemCount(hwndList); i++) {
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_sntprintf(szMask, _countof(szMask), _T("%s|"), szTemp);
+ mir_sntprintf(szMask, _T("%s|"), szTemp);
if (dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask))
ListView_SetCheckState(hwndList, i, TRUE)
else
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 05f8c0e839..673813dc24 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -90,13 +90,13 @@ int AccountName2Protocol(const char *accountName, OUT char *uniqueProtocolName, void HandleWrongParametersCount(PCommand command, PReply reply)
{
reply->code = MIMRES_WRONGPARAMSCOUNT;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Wrong number of parameters for command '%s'."), command->command);
+ mir_snprintf(reply->message, Translate("Wrong number of parameters for command '%s'."), command->command);
}
void HandleUnknownParameter(PCommand command, char *param, PReply reply)
{
reply->code = MIMRES_UNKNOWNPARAM;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Unknown parameter '%s' for command '%s'."), param, command->command);
+ mir_snprintf(reply->message, Translate("Unknown parameter '%s' for command '%s'."), param, command->command);
}
int ParseValueParam(char *param, void *&result)
@@ -231,7 +231,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep }
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Current global status: %s.%s"), pretty, perAccountStatus.c_str());
+ mir_snprintf(reply->message, Translate("Current global status: %s.%s"), pretty, perAccountStatus.c_str());
return;
}
@@ -252,7 +252,7 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep PrettyStatusMode(status, pn, sizeof(pn));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Changed global status to '%s' (previous status was '%s')."), pn, po);
+ mir_snprintf(reply->message, Translate("Changed global status to '%s' (previous status was '%s')."), pn, po);
}
else {
HandleUnknownParameter(command, argv[2], reply);
@@ -283,17 +283,17 @@ void HandleStatusCommand(PCommand command, TArgument *argv, int argc, PReply rep switch (res) {
case 0:
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Changed '%s' status to '%s' (previous status was '%s')."), account, pn, po);
+ mir_snprintf(reply->message, Translate("Changed '%s' status to '%s' (previous status was '%s')."), account, pn, po);
return;
case CALLSERVICE_NOTFOUND:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("'%s' doesn't seem to be a valid account."), account);
+ mir_snprintf(reply->message, Translate("'%s' doesn't seem to be a valid account."), account);
return;
default:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Failed to change status for account '%s' to '%s'."), account, pn);
+ mir_snprintf(reply->message, Translate("Failed to change status for account '%s' to '%s'."), account, pn);
return;
}
}
@@ -377,22 +377,22 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re switch (res) {
case 0:
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Changed '%s' status message to '%s' (status is '%s')."), account, awayMsg, pn);
+ mir_snprintf(reply->message, Translate("Changed '%s' status message to '%s' (status is '%s')."), account, awayMsg, pn);
return;
case CALLSERVICE_NOTFOUND:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("'%s' doesn't seem to be a valid account."), account);
+ mir_snprintf(reply->message, Translate("'%s' doesn't seem to be a valid account."), account);
return;
case -2:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Account '%s' does not support away messages, skipping."), account);
+ mir_snprintf(reply->message, Translate("Account '%s' does not support away messages, skipping."), account);
return;
default:
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Failed to change status message for account '%s' to '%s' (status is '%s')."), account, awayMsg, pn);
+ mir_snprintf(reply->message, Translate("Failed to change status message for account '%s' to '%s' (status is '%s')."), account, awayMsg, pn);
return;
}
}
@@ -407,21 +407,21 @@ void Set2StateReply(PReply reply, int state, int failure, char *successTrue, cha if (state) {
if (failure) {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate(failureTrue));
+ mir_snprintf(reply->message, Translate(failureTrue));
}
else {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate(successTrue));
+ mir_snprintf(reply->message, Translate(successTrue));
}
}
else {
if (failure) {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate(failureFalse));
+ mir_snprintf(reply->message, Translate(failureFalse));
}
else {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate(successFalse));
+ mir_snprintf(reply->message, Translate(successFalse));
}
}
}
@@ -594,7 +594,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply PostMessage(hWndMiranda, WM_COMMAND, ID_ICQ_EXIT, 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued a quit command."));
+ mir_snprintf(reply->message, Translate("Issued a quit command."));
break;
}
@@ -612,7 +612,7 @@ void HandleQuitCommand(PCommand command, TArgument *argv, int argc, PReply reply PostMessage(hWndMiranda, WM_COMMAND, ID_ICQ_EXIT, 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued a quit and wait command."));
+ mir_snprintf(reply->message, Translate("Issued a quit and wait command."));
SetEvent(heServerBufferFull);
@@ -646,11 +646,11 @@ void HandleExchangeCommand(PCommand command, TArgument *argv, int argc, PReply r INT_PTR ret = CallService(MS_EXCHANGE_CHECKEMAIL, 0, 0);
if (ret != CALLSERVICE_NOTFOUND) {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued check email command to Exchange plugin."));
+ mir_snprintf(reply->message, Translate("Issued check email command to Exchange plugin."));
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Exchange plugin is not running."));
+ mir_snprintf(reply->message, Translate("Exchange plugin is not running."));
}
}
else {
@@ -678,11 +678,11 @@ void HandleYAMNCommand(PCommand command, TArgument *argv, int argc, PReply reply CallService(MS_YAMN_FORCECHECK, 0, 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Issued check email command to YAMN plugin."));
+ mir_snprintf(reply->message, Translate("Issued check email command to YAMN plugin."));
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("YAMN plugin is not running."));
+ mir_snprintf(reply->message, Translate("YAMN plugin is not running."));
}
}
else {
@@ -713,11 +713,11 @@ void HandleCallServiceCommand(PCommand command, TArgument *argv, int argc, PRepl INT_PTR res = CallService(service, ((res1 == 1) ? *((long *)wParam) : (WPARAM)wParam), (LPARAM)((res2 == 1) ? *((long *)lParam) : (LPARAM)lParam));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("CallService call successful: service '%s' returned %p."), service, res);
+ mir_snprintf(reply->message, Translate("CallService call successful: service '%s' returned %p."), service, res);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Invalid parameter '%s' passed to CallService command."), (wParam) ? argv[4] : argv[3]);
+ mir_snprintf(reply->message, Translate("Invalid parameter '%s' passed to CallService command."), (wParam) ? argv[4] : argv[3]);
}
free(wParam);
@@ -726,7 +726,7 @@ void HandleCallServiceCommand(PCommand command, TArgument *argv, int argc, PRepl }
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Service '%s' does not exist."), service);
+ mir_snprintf(reply->message, Translate("Service '%s' does not exist."), service);
}
break;
@@ -893,7 +893,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r db_unset(NULL, module, key);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Setting '%s/%s' deleted."), module, key);
+ mir_snprintf(reply->message, Translate("Setting '%s/%s' deleted."), module, key);
}
else {
HandleWrongParametersCount(command, reply);
@@ -941,7 +941,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r }
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Wrote '%s:%s' to database entry '%s/%s'."), wrote, argv[5] + 1, module, key);
+ mir_snprintf(reply->message, Translate("Wrote '%s:%s' to database entry '%s/%s'."), wrote, argv[5] + 1, module, key);
free(value);
}
@@ -962,16 +962,16 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r if (ParseDatabaseData(&var, buffer, sizeof(buffer), TRUE)) {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), "'%s/%s' - %s.", module, key, buffer);
+ mir_snprintf(reply->message, "'%s/%s' - %s.", module, key, buffer);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Could not retrieve setting '%s/%s': %s."), module, key, buffer);
+ mir_snprintf(reply->message, Translate("Could not retrieve setting '%s/%s': %s."), module, key, buffer);
}
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Setting '%s/%s' was not found."), module, key);
+ mir_snprintf(reply->message, Translate("Setting '%s/%s' was not found."), module, key);
}
}
@@ -1057,7 +1057,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe int value = db_get_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
+ mir_snprintf(buffer, "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
break;
}
@@ -1071,7 +1071,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("'%s' proxy was disabled."), protocol);
+ mir_snprintf(buffer, Translate("'%s' proxy was disabled."), protocol);
break;
}
@@ -1081,7 +1081,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLUseProxy", 1);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("'%s' proxy was enabled."), protocol);
+ mir_snprintf(buffer, Translate("'%s' proxy was enabled."), protocol);
break;
}
@@ -1093,7 +1093,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLUseProxy", value);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
+ mir_snprintf(buffer, (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
break;
}
@@ -1121,7 +1121,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe PrettyProxyType(db_get_b(NULL, module, "NLProxyType", 0), type, sizeof(type));
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
+ mir_snprintf(buffer, Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
break;
}
@@ -1140,11 +1140,11 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe db_set_b(NULL, module, "NLProxyType", type);
reply->code = MIMRES_SUCCESS;
- mir_snprintf(buffer, _countof(buffer), Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
+ mir_snprintf(buffer, Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(buffer, _countof(buffer), Translate("%s The port or the proxy type parameter is invalid."), protocol);
+ mir_snprintf(buffer, Translate("%s The port or the proxy type parameter is invalid."), protocol);
}
break;
@@ -1167,7 +1167,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe reply->message[_countof(reply->message) - 1] = 0;
}
else {
- mir_snprintf(reply->message, _countof(reply->message), buffer);
+ mir_snprintf(reply->message, buffer);
}
}
@@ -1210,7 +1210,7 @@ void HandleProxyCommand(PCommand command, TArgument *argv, int argc, PReply repl if (!found) {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("'%s' doesn't seem to be a valid account."), account);
+ mir_snprintf(reply->message, Translate("'%s' doesn't seem to be a valid account."), account);
}
}
else {
@@ -1309,7 +1309,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r char *contact = GetContactName(hContact, protocol);
char *id = GetContactID(hContact, protocol);
if (ContactMatchSearch(hContact, contact, id, protocol, &argv[3], argc - 3)) {
- mir_snprintf(buffer, _countof(buffer), "%s:[%s]:%s (%08d)", contact, id, protocol, hContact);
+ mir_snprintf(buffer, "%s:[%s]:%s (%08d)", contact, id, protocol, hContact);
if (count) {
mir_strncat(reply->message, "\n", _countof(reply->message) - mir_strlen(reply->message));
mir_strncat(reply->message, buffer, _countof(reply->message) - mir_strlen(reply->message));
@@ -1376,7 +1376,7 @@ void AddHistoryEvent(DBEVENTINFO *dbEvent, char *contact, PReply reply) char *message = DbGetEventTextA(dbEvent, CP_ACP);
static char buffer[8192];
- mir_snprintf(buffer, _countof(buffer), "[%s] %15s: %s", timestamp, sender, message);
+ mir_snprintf(buffer, "[%s] %15s: %s", timestamp, sender, message);
if (reply->message[0] != 0) {
@@ -1409,7 +1409,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re DBEVENTINFO dbEvent = { sizeof(dbEvent) };
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("No unread messages found."));
+ mir_snprintf(reply->message, Translate("No unread messages found."));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
MEVENT hEvent = db_event_firstUnread(hContact);
@@ -1426,7 +1426,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re char protocol[128];
GetContactProto(hContact, protocol, sizeof(protocol));
char *contact = GetContactName(hContact, protocol);
- mir_snprintf(buffer, _countof(buffer), Translate("%s:%s - %d unread events."), contact, protocol, count);
+ mir_snprintf(buffer, Translate("%s:%s - %d unread events."), contact, protocol, count);
if (contacts > 0) {
mir_strncat(reply->message, "\n", _countof(reply->message) - mir_strlen(reply->message));
@@ -1467,13 +1467,13 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re }
else if (_stricmp(cmd, "show") == 0) {
reply->code = MIMRES_SUCCESS;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Contact '%s' has %d events in history."), contact, db_event_count(hContact));
+ mir_snprintf(reply->message, Translate("Contact '%s' has %d events in history."), contact, db_event_count(hContact));
}
else HandleUnknownParameter(command, cmd, reply);
}
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Could not find contact handle for contact '%s'."), contact);
+ mir_snprintf(reply->message, Translate("Could not find contact handle for contact '%s'."), contact);
}
}
break;
@@ -1529,7 +1529,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re }
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Could not find contact handle for contact '%s'."), contact);
+ mir_snprintf(reply->message, Translate("Could not find contact handle for contact '%s'."), contact);
}
}
break;
@@ -1549,14 +1549,14 @@ void HandleVersionCommand(PCommand command, TArgument*, int argc, PReply reply) if (ServiceExists(MS_CRASHDUMPER_GETINFO)) {
char *data;
CallService(MS_CRASHDUMPER_GETINFO, (WPARAM)FALSE, (LPARAM)&data);
- mir_snprintf(reply->message, _countof(reply->message), data);
+ mir_snprintf(reply->message, data);
mir_free(data);
}
else {
char miranda[512];
DWORD v = pluginInfo.version;
CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM) sizeof(miranda), (LPARAM)miranda);
- mir_snprintf(reply->message, _countof(reply->message), "Miranda %s\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF));
+ mir_snprintf(reply->message, "Miranda %s\nCmdLine v.%d.%d.%d.%d", miranda, ((v >> 24) & 0xFF), ((v >> 16) & 0xFF), ((v >> 8) & 0xFF), (v & 0xFF));
}
}
else HandleWrongParametersCount(command, reply);
@@ -1577,7 +1577,7 @@ void HandleSetNicknameCommand(PCommand command, TArgument *argv, int argc, PRepl }
else {
reply->code = MIMRES_FAILURE;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Error setting nickname to '%s' for protocol '%s'"), nickname, protocol);
+ mir_snprintf(reply->message, Translate("Error setting nickname to '%s' for protocol '%s'"), nickname, protocol);
}
}
else HandleWrongParametersCount(command, reply);
@@ -1684,6 +1684,6 @@ void HandleCommand(PCommand command, TArgument *argv, int argc, PReply reply) default:
reply->code = MIMRES_NOTFOUND;
- mir_snprintf(reply->message, _countof(reply->message), Translate("Command '%s' is not currently supported."), command->command);
+ mir_snprintf(reply->message, Translate("Command '%s' is not currently supported."), command->command);
}
}
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index 4631775c63..993b300648 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -210,17 +210,17 @@ char* GetContactID(MCONTACT hContact, char *szProto) char tmp[16];
switch (ctInfo.type) {
case CNFT_BYTE:
- mir_snprintf(tmp, _countof(tmp), "%d", ctInfo.bVal);
+ mir_snprintf(tmp, "%d", ctInfo.bVal);
buffer = strdup(tmp);
break;
case CNFT_WORD:
- mir_snprintf(tmp, _countof(tmp), "%d", ctInfo.wVal);
+ mir_snprintf(tmp, "%d", ctInfo.wVal);
buffer = strdup(tmp);
break;
case CNFT_DWORD:
- mir_snprintf(tmp, _countof(tmp), "%ld", ctInfo.dVal);
+ mir_snprintf(tmp, "%ld", ctInfo.dVal);
buffer = strdup(tmp);
break;
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 6cda0d5484..4708b7da38 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -94,8 +94,7 @@ void saveSettingsConnections(struct CONNECTION *connHead) char buff[128];
int i = 0;
struct CONNECTION *tmp = connHead;
- while (tmp != NULL)
- {
+ while (tmp != NULL) {
mir_snprintf(buff, "%dFilterIntIp", i);
db_set_ts(NULL, PLUGINNAME, buff, tmp->strIntIp);
@@ -124,8 +123,7 @@ struct CONNECTION* LoadSettingsConnections() DBVARIANT dbv;
char buff[128];
int i = 0;
- for (i = settingFiltersCount - 1; i >= 0; i--)
- {
+ for (i = settingFiltersCount - 1; i >= 0; i--) {
struct CONNECTION *conn = (struct CONNECTION*)mir_alloc(sizeof(struct CONNECTION));
mir_snprintf(buff, "%dFilterIntIp", i);
if (!db_get_ts(NULL, PLUGINNAME, buff, &dbv))
@@ -167,8 +165,7 @@ void LoadSettings() settingFgColor = (COLORREF)db_get_dw(NULL, PLUGINNAME, "PopupFgColor", (DWORD)0x000000);
settingFiltersCount = (INT)db_get_dw(NULL, PLUGINNAME, "FiltersCount", 0);
settingStatusMask = (WORD)db_get_w(NULL, PLUGINNAME, "StatusMask", 16);
- for (int i = 0; i < STATUS_COUNT; i++)
- {
+ for (int i = 0; i < STATUS_COUNT; i++) {
char buff[128];
mir_snprintf(buff, "Status%d", i);
settingStatus[i] = (db_get_b(0, PLUGINNAME, buff, 0) == 1);
@@ -189,8 +186,7 @@ void fillExceptionsListView(HWND hwndDlg) // Initialize LVITEM members that are common to all
// items.
lvI.mask = LVIF_TEXT;
- while (tmp)
- {
+ while (tmp) {
TCHAR tmpAddress[25];
lvI.iItem = i++;
lvI.iSubItem = 0;
@@ -198,16 +194,16 @@ void fillExceptionsListView(HWND hwndDlg) ListView_InsertItem(hwndList, &lvI);
lvI.iSubItem = 1;
if (tmp->intIntPort == -1)
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:*"), tmp->strIntIp);
+ mir_sntprintf(tmpAddress, _T("%s:*"), tmp->strIntIp);
else
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:%d"), tmp->strIntIp, tmp->intIntPort);
+ mir_sntprintf(tmpAddress, _T("%s:%d"), tmp->strIntIp, tmp->intIntPort);
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 2;
if (tmp->intExtPort == -1)
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:*"), tmp->strExtIp);
+ mir_sntprintf(tmpAddress, _T("%s:*"), tmp->strExtIp);
else
- mir_sntprintf(tmpAddress, _countof(tmpAddress), _T("%s:%d"), tmp->strExtIp, tmp->intExtPort);
+ mir_sntprintf(tmpAddress, _T("%s:%d"), tmp->strExtIp, tmp->intExtPort);
lvI.pszText = tmpAddress;
ListView_SetItem(hwndList, &lvI);
lvI.iSubItem = 3;
@@ -221,59 +217,57 @@ void fillExceptionsListView(HWND hwndDlg) //filter editor dialog box procedure opened modally from options dialog
static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
+ switch (message) {
case WM_INITDIALOG:
- {
- struct CONNECTION *conn = (struct CONNECTION*)lParam;
- TranslateDialogDefault(hWnd);
- connCurrentEditModal = conn;
- SetDlgItemText(hWnd, ID_TEXT_NAME, conn->PName);
- SetDlgItemText(hWnd, ID_TXT_LOCAL_IP, conn->strIntIp);
- SetDlgItemText(hWnd, ID_TXT_REMOTE_IP, conn->strExtIp);
-
- if (conn->intIntPort == -1)
- SetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, _T("*"));
- else
- SetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, conn->intIntPort, FALSE);
-
- if (conn->intExtPort == -1)
- SetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, _T("*"));
- else
- SetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, conn->intExtPort, FALSE);
-
- SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Always show popup"));
- SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Never show popup"));
- SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_SETCURSEL, conn->Pid == 0 ? 1 : 0, 0);
- return TRUE;
- }
- case WM_COMMAND:
- switch (LOWORD(wParam))
{
- case ID_OK:
- {
- TCHAR tmpPort[6];
- GetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, tmpPort, _countof(tmpPort));
- if (tmpPort[0] == '*')
- connCurrentEditModal->intIntPort = -1;
- else
- connCurrentEditModal->intIntPort = GetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, NULL, FALSE);
- GetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, tmpPort, _countof(tmpPort));
- if (tmpPort[0] == '*')
- connCurrentEditModal->intExtPort = -1;
+ struct CONNECTION *conn = (struct CONNECTION*)lParam;
+ TranslateDialogDefault(hWnd);
+ connCurrentEditModal = conn;
+ SetDlgItemText(hWnd, ID_TEXT_NAME, conn->PName);
+ SetDlgItemText(hWnd, ID_TXT_LOCAL_IP, conn->strIntIp);
+ SetDlgItemText(hWnd, ID_TXT_REMOTE_IP, conn->strExtIp);
+
+ if (conn->intIntPort == -1)
+ SetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, _T("*"));
else
- connCurrentEditModal->intExtPort = GetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, NULL, FALSE);
+ SetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, conn->intIntPort, FALSE);
- GetDlgItemText(hWnd, ID_TXT_LOCAL_IP, connCurrentEditModal->strIntIp, _countof(connCurrentEditModal->strIntIp));
- GetDlgItemText(hWnd, ID_TXT_REMOTE_IP, connCurrentEditModal->strExtIp, _countof(connCurrentEditModal->strExtIp));
- GetDlgItemText(hWnd, ID_TEXT_NAME, connCurrentEditModal->PName, _countof(connCurrentEditModal->PName));
-
- connCurrentEditModal->Pid = !(BOOL)SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_GETCURSEL, 0, 0);
+ if (conn->intExtPort == -1)
+ SetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, _T("*"));
+ else
+ SetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, conn->intExtPort, FALSE);
- connCurrentEditModal = NULL;
- EndDialog(hWnd, IDOK);
+ SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Always show popup"));
+ SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_ADDSTRING, 0, (LPARAM)TranslateT("Never show popup"));
+ SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_SETCURSEL, conn->Pid == 0 ? 1 : 0, 0);
return TRUE;
}
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case ID_OK:
+ {
+ TCHAR tmpPort[6];
+ GetDlgItemText(hWnd, ID_TXT_LOCAL_PORT, tmpPort, _countof(tmpPort));
+ if (tmpPort[0] == '*')
+ connCurrentEditModal->intIntPort = -1;
+ else
+ connCurrentEditModal->intIntPort = GetDlgItemInt(hWnd, ID_TXT_LOCAL_PORT, NULL, FALSE);
+ GetDlgItemText(hWnd, ID_TXT_REMOTE_PORT, tmpPort, _countof(tmpPort));
+ if (tmpPort[0] == '*')
+ connCurrentEditModal->intExtPort = -1;
+ else
+ connCurrentEditModal->intExtPort = GetDlgItemInt(hWnd, ID_TXT_REMOTE_PORT, NULL, FALSE);
+
+ GetDlgItemText(hWnd, ID_TXT_LOCAL_IP, connCurrentEditModal->strIntIp, _countof(connCurrentEditModal->strIntIp));
+ GetDlgItemText(hWnd, ID_TXT_REMOTE_IP, connCurrentEditModal->strExtIp, _countof(connCurrentEditModal->strExtIp));
+ GetDlgItemText(hWnd, ID_TEXT_NAME, connCurrentEditModal->PName, _countof(connCurrentEditModal->PName));
+
+ connCurrentEditModal->Pid = !(BOOL)SendDlgItemMessage(hWnd, ID_CBO_ACTION, CB_GETCURSEL, 0, 0);
+
+ connCurrentEditModal = NULL;
+ EndDialog(hWnd, IDOK);
+ return TRUE;
+ }
case ID_CANCEL:
connCurrentEditModal = NULL;
EndDialog(hWnd, IDCANCEL);
@@ -282,11 +276,11 @@ static INT_PTR CALLBACK FilterEditProc(HWND hWnd, UINT message, WPARAM wParam, L return FALSE;
break;
case WM_CLOSE:
- {
- connCurrentEditModal = NULL;
- EndDialog(hWnd, IDCANCEL);
- break;
- }
+ {
+ connCurrentEditModal = NULL;
+ EndDialog(hWnd, IDCANCEL);
+ break;
+ }
}
return FALSE;
}
@@ -297,85 +291,85 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar HWND hwndList;
switch (msg) {
case WM_INITDIALOG://initialize dialog, so set properties from db.
- {
- LVCOLUMN lvc = { 0 };
- LVITEM lvI = { 0 };
- TCHAR buff[256];
- bOptionsOpen = TRUE;
- TranslateDialogDefault(hwndDlg);//translate miranda function
-#ifdef _WIN64
- mir_sntprintf(buff,_countof(buff),_T("%d.%d.%d.%d/64"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
-#else
- mir_sntprintf(buff, _T("%d.%d.%d.%d/32"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
-#endif
- SetDlgItemText(hwndDlg, IDC_VERSION, buff);
- LoadSettings();
- //connExceptionsTmp=LoadSettingsConnections();
- SetDlgItemInt(hwndDlg, IDC_INTERVAL, settingInterval, FALSE);
- SetDlgItemInt(hwndDlg, IDC_INTERVAL1, settingInterval1, TRUE);
- CheckDlgButton(hwndDlg, IDC_SETCOLOURS, settingSetColours ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_RESOLVEIP, settingResolveIp ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, ID_CHK_DEFAULTACTION, settingDefaultAction ? BST_CHECKED : BST_UNCHECKED);
-
- SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingBgColor);
- SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingFgColor);
- if (!settingSetColours) {
- HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
- CheckDlgButton(hwndDlg, IDC_SETCOLOURS, BST_UNCHECKED);
- EnableWindow(hwnd, FALSE);
- hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
- EnableWindow(hwnd, FALSE);
- }
- SendDlgItemMessage(hwndDlg, ID_ADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON6), IMAGE_ICON, 16, 16, 0));
- SendDlgItemMessage(hwndDlg, ID_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, 0));
- SendDlgItemMessage(hwndDlg, ID_DOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON4), IMAGE_ICON, 16, 16, 0));
- SendDlgItemMessage(hwndDlg, ID_UP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON5), IMAGE_ICON, 16, 16, 0));
- // initialise and fill listbox
- hwndList = GetDlgItem(hwndDlg, IDC_STATUS);
- ListView_DeleteAllItems(hwndList);
- SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
- // Initialize the LVCOLUMN structure.
- // The mask specifies that the format, width, text, and
- // subitem members of the structure are valid.
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- lvc.fmt = LVCFMT_LEFT;
- lvc.iSubItem = 0;
- lvc.pszText = TranslateT("Status");
- lvc.cx = 120; // width of column in pixels
- ListView_InsertColumn(hwndList, 0, &lvc);
- // Some code to create the list-view control.
- // Initialize LVITEM members that are common to all
- // items.
- lvI.mask = LVIF_TEXT;
- for (int i = 0; i < STATUS_COUNT; i++) {
- lvI.pszText = pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE + i, 0);
- lvI.iItem = i;
- ListView_InsertItem(hwndList, &lvI);
- ListView_SetCheckState(hwndList, i, settingStatus[i]);
- }
+ {
+ LVCOLUMN lvc = { 0 };
+ LVITEM lvI = { 0 };
+ TCHAR buff[256];
+ bOptionsOpen = TRUE;
+ TranslateDialogDefault(hwndDlg);//translate miranda function
+ #ifdef _WIN64
+ mir_sntprintf(buff, _T("%d.%d.%d.%d/64"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ #else
+ mir_sntprintf(buff, _T("%d.%d.%d.%d/32"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ #endif
+ SetDlgItemText(hwndDlg, IDC_VERSION, buff);
+ LoadSettings();
+ //connExceptionsTmp=LoadSettingsConnections();
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL, settingInterval, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_INTERVAL1, settingInterval1, TRUE);
+ CheckDlgButton(hwndDlg, IDC_SETCOLOURS, settingSetColours ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_RESOLVEIP, settingResolveIp ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, ID_CHK_DEFAULTACTION, settingDefaultAction ? BST_CHECKED : BST_UNCHECKED);
+
+ SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingBgColor);
+ SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_SETCOLOUR, 0, (LPARAM)settingFgColor);
+ if (!settingSetColours) {
+ HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
+ CheckDlgButton(hwndDlg, IDC_SETCOLOURS, BST_UNCHECKED);
+ EnableWindow(hwnd, FALSE);
+ hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
+ EnableWindow(hwnd, FALSE);
+ }
+ SendDlgItemMessage(hwndDlg, ID_ADD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON6), IMAGE_ICON, 16, 16, 0));
+ SendDlgItemMessage(hwndDlg, ID_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, 0));
+ SendDlgItemMessage(hwndDlg, ID_DOWN, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON4), IMAGE_ICON, 16, 16, 0));
+ SendDlgItemMessage(hwndDlg, ID_UP, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON5), IMAGE_ICON, 16, 16, 0));
+ // initialise and fill listbox
+ hwndList = GetDlgItem(hwndDlg, IDC_STATUS);
+ ListView_DeleteAllItems(hwndList);
+ SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
+ // Initialize the LVCOLUMN structure.
+ // The mask specifies that the format, width, text, and
+ // subitem members of the structure are valid.
+ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ lvc.fmt = LVCFMT_LEFT;
+ lvc.iSubItem = 0;
+ lvc.pszText = TranslateT("Status");
+ lvc.cx = 120; // width of column in pixels
+ ListView_InsertColumn(hwndList, 0, &lvc);
+ // Some code to create the list-view control.
+ // Initialize LVITEM members that are common to all
+ // items.
+ lvI.mask = LVIF_TEXT;
+ for (int i = 0; i < STATUS_COUNT; i++) {
+ lvI.pszText = pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE + i, 0);
+ lvI.iItem = i;
+ ListView_InsertItem(hwndList, &lvI);
+ ListView_SetCheckState(hwndList, i, settingStatus[i]);
+ }
- connExceptionsTmp = LoadSettingsConnections();
- hwndList = GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS);
- SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
-
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- lvc.fmt = LVCFMT_LEFT;
- lvc.iSubItem = 0;
- lvc.cx = 120; // width of column in pixels
- lvc.pszText = TranslateT("Application");
- ListView_InsertColumn(hwndList, 1, &lvc);
- lvc.pszText = TranslateT("Internal socket");
- ListView_InsertColumn(hwndList, 2, &lvc);
- lvc.pszText = TranslateT("External socket");
- ListView_InsertColumn(hwndList, 3, &lvc);
- lvc.pszText = TranslateT("Action");
- lvc.cx = 50;
- ListView_InsertColumn(hwndList, 4, &lvc);
-
- //fill exceptions list
- fillExceptionsListView(hwndDlg);
- }
- break;
+ connExceptionsTmp = LoadSettingsConnections();
+ hwndList = GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS);
+ SendMessage(hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
+
+ lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ lvc.fmt = LVCFMT_LEFT;
+ lvc.iSubItem = 0;
+ lvc.cx = 120; // width of column in pixels
+ lvc.pszText = TranslateT("Application");
+ ListView_InsertColumn(hwndList, 1, &lvc);
+ lvc.pszText = TranslateT("Internal socket");
+ ListView_InsertColumn(hwndList, 2, &lvc);
+ lvc.pszText = TranslateT("External socket");
+ ListView_InsertColumn(hwndList, 3, &lvc);
+ lvc.pszText = TranslateT("Action");
+ lvc.cx = 50;
+ ListView_InsertColumn(hwndList, 4, &lvc);
+
+ //fill exceptions list
+ fillExceptionsListView(hwndDlg);
+ }
+ break;
case WM_COMMAND://user changed something, so get changes to variables
PostMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -385,129 +379,122 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar case IDC_RESOLVEIP: settingResolveIp = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RESOLVEIP); break;
case ID_CHK_DEFAULTACTION: settingDefaultAction = (BYTE)IsDlgButtonChecked(hwndDlg, ID_CHK_DEFAULTACTION); break;
case ID_ADD:
- {
- struct CONNECTION *cur = (struct CONNECTION *)mir_alloc(sizeof(struct CONNECTION));
- memset(cur, 0, sizeof(struct CONNECTION));
- cur->intExtPort = -1;
- cur->intIntPort = -1;
- cur->Pid = 0;
- cur->PName[0] = '*';
- cur->strExtIp[0] = '*';
- cur->strIntIp[0] = '*';
-
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur) == IDCANCEL) {
- mir_free(cur);
- cur = NULL;
- }
- else {
- cur->next = connExceptionsTmp;
- connExceptionsTmp = cur;
- }
+ {
+ struct CONNECTION *cur = (struct CONNECTION *)mir_alloc(sizeof(struct CONNECTION));
+ memset(cur, 0, sizeof(struct CONNECTION));
+ cur->intExtPort = -1;
+ cur->intIntPort = -1;
+ cur->Pid = 0;
+ cur->PName[0] = '*';
+ cur->strExtIp[0] = '*';
+ cur->strIntIp[0] = '*';
+
+ if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur) == IDCANCEL) {
+ mir_free(cur);
+ cur = NULL;
+ }
+ else {
+ cur->next = connExceptionsTmp;
+ connExceptionsTmp = cur;
+ }
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), 0, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- }
- break;
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), 0, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ }
+ break;
case ID_DELETE:
- {
- int pos, pos1;
- struct CONNECTION *cur = connExceptionsTmp, *pre = NULL;
-
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
{
- pre = cur;
- cur = cur->next;
+ int pos, pos1;
+ struct CONNECTION *cur = connExceptionsTmp, *pre = NULL;
+
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ pre = cur;
+ cur = cur->next;
+ }
+ if (pre == NULL)
+ connExceptionsTmp = connExceptionsTmp->next;
+ else
+ (pre)->next = cur->next;
+ mir_free(cur);
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- if (pre == NULL)
- connExceptionsTmp = connExceptionsTmp->next;
- else
- (pre)->next = cur->next;
- mir_free(cur);
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
case ID_UP:
- {
- int pos, pos1;
- struct CONNECTION *cur = NULL, *pre = NULL, *prepre = NULL;
+ {
+ int pos, pos1;
+ struct CONNECTION *cur = NULL, *pre = NULL, *prepre = NULL;
- cur = connExceptionsTmp;
+ cur = connExceptionsTmp;
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
- {
- prepre = pre;
- pre = cur;
- cur = cur->next;
- }
- if (prepre != NULL)
- {
- pre->next = cur->next;
- cur->next = pre;
- prepre->next = cur;
- }
- else if (pre != NULL)
- {
- pre->next = cur->next;
- cur->next = pre;
- connExceptionsTmp = cur;
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ prepre = pre;
+ pre = cur;
+ cur = cur->next;
+ }
+ if (prepre != NULL) {
+ pre->next = cur->next;
+ cur->next = pre;
+ prepre->next = cur;
+ }
+ else if (pre != NULL) {
+ pre->next = cur->next;
+ cur->next = pre;
+ connExceptionsTmp = cur;
+ }
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 - 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 - 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
case ID_DOWN:
- {
- int pos, pos1;
- struct CONNECTION *cur = NULL, *pre = NULL;
+ {
+ int pos, pos1;
+ struct CONNECTION *cur = NULL, *pre = NULL;
- cur = connExceptionsTmp;
+ cur = connExceptionsTmp;
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
- {
- pre = cur;
- cur = cur->next;
- }
- if (cur == connExceptionsTmp&&cur->next != NULL)
- {
- connExceptionsTmp = cur->next;
- cur->next = cur->next->next;
- connExceptionsTmp->next = cur;
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ pre = cur;
+ cur = cur->next;
+ }
+ if (cur == connExceptionsTmp&&cur->next != NULL) {
+ connExceptionsTmp = cur->next;
+ cur->next = cur->next->next;
+ connExceptionsTmp->next = cur;
+ }
+ else if (cur->next != NULL) {
+ struct CONNECTION *tmp = cur->next->next;
+ pre->next = cur->next;
+ cur->next->next = cur;
+ cur->next = tmp;
+ }
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 + 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- else if (cur->next != NULL)
+ case IDC_SETCOLOURS:
{
- struct CONNECTION *tmp = cur->next->next;
- pre->next = cur->next;
- cur->next->next = cur;
- cur->next = tmp;
+ HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
+ settingSetColours = IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS);
+ EnableWindow(hwnd, settingSetColours);
+ hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
+ EnableWindow(hwnd, settingSetColours);
+ break;
}
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1 + 1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
- case IDC_SETCOLOURS:
- {
- HWND hwnd = GetDlgItem(hwndDlg, IDC_BGCOLOR);
- settingSetColours = IsDlgButtonChecked(hwndDlg, IDC_SETCOLOURS);
- EnableWindow(hwnd, settingSetColours);
- hwnd = GetDlgItem(hwndDlg, IDC_FGCOLOR);
- EnableWindow(hwnd, settingSetColours);
- break;
- }
case IDC_BGCOLOR: settingBgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0); break;
case IDC_FGCOLOR: settingFgColor = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_FGCOLOR, CPM_GETCOLOUR, 0, 0); break;
@@ -554,25 +541,24 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar if (GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS) == ((LPNMHDR)lParam)->hwndFrom) {
switch (((LPNMHDR)lParam)->code) {
case NM_DBLCLK:
- {
- int pos, pos1;
- struct CONNECTION *cur = NULL;
+ {
+ int pos, pos1;
+ struct CONNECTION *cur = NULL;
- cur = connExceptionsTmp;
+ cur = connExceptionsTmp;
- pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
- if (pos == -1)break;
- pos1 = pos;
- while (pos--)
- {
- cur = cur->next;
+ pos = (int)ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), -1, LVNI_FOCUSED);
+ if (pos == -1)break;
+ pos1 = pos;
+ while (pos--) {
+ cur = cur->next;
+ }
+ DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur);
+ fillExceptionsListView(hwndDlg);
+ ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
+ break;
}
- DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_FILTER_DIALOG), hwndDlg, FilterEditProc, (LPARAM)cur);
- fillExceptionsListView(hwndDlg);
- ListView_SetItemState(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS), pos1, LVNI_FOCUSED | LVIS_SELECTED, LVNI_FOCUSED | LVIS_SELECTED);
- SetFocus(GetDlgItem(hwndDlg, IDC_LIST_EXCEPTIONS));
- break;
- }
}
}
@@ -647,22 +633,19 @@ INT_PTR TMLoadIcon(WPARAM wParam, LPARAM) //=======================================================
INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
{
- if (wParam == ID_STATUS_OFFLINE)
- {
+ if (wParam == ID_STATUS_OFFLINE) {
diffstat = 0;
//PostThreadMessage(ConnectionCheckThreadId,WM_QUIT ,0, 0);
SetEvent(killCheckThreadEvent);
}
- else if (wParam == ID_STATUS_ONLINE)
- {
+ else if (wParam == ID_STATUS_ONLINE) {
diffstat = 0;
ResetEvent(killCheckThreadEvent);
if (!hConnectionCheckThread)
hConnectionCheckThread = (HANDLE)mir_forkthreadex(checkthread, 0, (unsigned int*)&ConnectionCheckThreadId);
}
- else
- {
+ else {
int retv = 0;
if (settingStatus[wParam - ID_STATUS_ONLINE])
@@ -696,17 +679,15 @@ INT_PTR GetStatus(WPARAM, LPARAM) static unsigned __stdcall checkthread(void *)
{
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("check thread started"));
-#endif
- while (1)
- {
+ #endif
+ while (1) {
struct CONNECTION* conn = NULL, *connOld = first, *cur = NULL;
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("checking connections table..."));
-#endif
- if (WAIT_OBJECT_0 == WaitForSingleObject(killCheckThreadEvent, 100))
- {
+ #endif
+ if (WAIT_OBJECT_0 == WaitForSingleObject(killCheckThreadEvent, 100)) {
hConnectionCheckThread = NULL;
return 0;
}
@@ -716,16 +697,14 @@ static unsigned __stdcall checkthread(void *) while (cur != NULL) {
if (searchConnection(first, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state) == NULL && (settingStatusMask & (1 << (cur->state - 1)))) {
-#ifdef _DEBUG
+ #ifdef _DEBUG
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), _T("%s:%d\n%s:%d"), cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
+ mir_sntprintf(msg, _T("%s:%d\n%s:%d"), cur->strIntIp, cur->intIntPort, cur->strExtIp, cur->intExtPort);
_OutputDebugString(_T("New connection: %s"), msg);
-#endif
+ #endif
pid2name(cur->Pid, cur->PName, _countof(cur->PName));
- if (WAIT_OBJECT_0 == WaitForSingleObject(hExceptionsMutex, 100))
- {
- if (checkFilter(connExceptions, cur))
- {
+ if (WAIT_OBJECT_0 == WaitForSingleObject(hExceptionsMutex, 100)) {
+ if (checkFilter(connExceptions, cur)) {
showMsg(cur->PName, cur->Pid, cur->strIntIp, cur->strExtIp, cur->intIntPort, cur->intExtPort, cur->state);
SkinPlaySound(PLUGINNAME_NEWSOUND);
}
@@ -800,11 +779,11 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i if (settingResolveIp) {
TCHAR hostName[128];
getDnsName(extIp, hostName, _countof(hostName));
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), _T("%s:%d\n%s:%d"), hostName, extPort, intIp, intPort);
+ mir_sntprintf(ppd.lptzText, _T("%s:%d\n%s:%d"), hostName, extPort, intIp, intPort);
}
- else mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), _T("%s:%d\n%s:%d"), extIp, extPort, intIp, intPort);
+ else mir_sntprintf(ppd.lptzText, _T("%s:%d\n%s:%d"), extIp, extPort, intIp, intPort);
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), _T("%s (%s)"), pName, tcpStates[state - 1]);
+ mir_sntprintf(ppd.lptzContactName, _T("%s (%s)"), pName, tcpStates[state - 1]);
if (settingSetColours) {
ppd.colorBack = settingBgColor;
@@ -833,9 +812,9 @@ void showMsg(TCHAR *pName, DWORD pid, TCHAR *intIp, TCHAR *extIp, int intPort, i static int modulesloaded(WPARAM, LPARAM)
{
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("Modules loaded, lets start TN..."));
-#endif
+ #endif
// hConnectionCheckThread = (HANDLE)mir_forkthreadex(checkthread, 0, 0, ConnectionCheckThreadId);
//#ifdef _DEBUG
@@ -868,9 +847,9 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) extern "C" int __declspec(dllexport) Load(void)
{
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("Entering Load dll"));
-#endif
+ #endif
mir_getLP(&pluginInfo);
mir_getCLI();
@@ -919,9 +898,8 @@ extern "C" int __declspec(dllexport) Unload(void) //if (hCurrentEditMutex) CloseHandle(hCurrentEditMutex);
if (hExceptionsMutex) CloseHandle(hExceptionsMutex);
-#ifdef _DEBUG
+ #ifdef _DEBUG
_OutputDebugString(_T("Unloaded"));
-#endif
+ #endif
return 0;
}
-
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp index 892da06cf3..3b49eebe41 100644 --- a/plugins/ConnectionNotify/src/debug.cpp +++ b/plugins/ConnectionNotify/src/debug.cpp @@ -27,7 +27,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) case 's':
{
TCHAR* s = va_arg(argptr, TCHAR *);
- mir_sntprintf(OutMsg, _countof(OutMsg), format, s);
+ mir_sntprintf(OutMsg, format, s);
_tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
@@ -37,7 +37,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) case 'c':
{
char c = (char)va_arg(argptr, int);
- mir_sntprintf(OutMsg, _countof(OutMsg), format, c);
+ mir_sntprintf(OutMsg, format, c);
_tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
@@ -47,7 +47,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...) case 'd':
{
int d = va_arg(argptr, int);
- mir_sntprintf(OutMsg, _countof(OutMsg), format, d);
+ mir_sntprintf(OutMsg, format, d);
_tcsncpy(format, OutMsg, _countof(OutMsg));
j = (int)mir_tstrlen(format);
mir_tstrcat(format, _T(" "));
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 59237178d6..e050008784 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -621,7 +621,7 @@ static INT_PTR CALLBACK ConsoleDlgProc(HWND hwndDlg, UINT message, WPARAM wParam CallService(MS_DB_GETPROFILEPATHT, (WPARAM)_countof(path), (LPARAM)path);
- mir_sntprintf(title, _countof(title), _T("%s - %s\\%s"), TranslateT("Miranda Console"), path, name);
+ mir_sntprintf(title, _T("%s - %s\\%s"), TranslateT("Miranda Console"), path, name);
SetWindowText(hwndDlg, title);
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcons[0]);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 74a3ff2672..03a2750243 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -74,7 +74,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) {
//add event to the contact list
TCHAR caToolTip[128];
- mir_sntprintf(caToolTip, _countof(caToolTip), _T("%s %s"), TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(caToolTip, _T("%s %s"), TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 1247b24e45..9a5750f90a 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -130,7 +130,7 @@ void UpdateDialogTitle(HWND hwndDlg, MCONTACT hContact, TCHAR *pszTitleStart) SetDlgItemText(hwndDlg, IDC_NAME, uid ? uid : contactName);
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
- mir_sntprintf(newtitle, _countof(newtitle), _T("%s %s (%s)"), TranslateTS(pszTitleStart), contactName, szStatus);
+ mir_sntprintf(newtitle, _T("%s %s (%s)"), TranslateTS(pszTitleStart), contactName, szStatus);
}
}
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 491d413742..82adffe7ef 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -55,7 +55,7 @@ static void CALLBACK SetExtraImage(MCONTACT hContact) ExtraIcon_Clear(hExtraIcon, hContact);
else {
char szId[20];
- mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber);
+ mir_snprintf(szId, (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber);
ExtraIcon_SetIconByName(hExtraIcon, hContact, szId);
}
}
diff --git a/plugins/CountryFlags/src/icons.cpp b/plugins/CountryFlags/src/icons.cpp index c11f0b4b9d..966af46b11 100644 --- a/plugins/CountryFlags/src/icons.cpp +++ b/plugins/CountryFlags/src/icons.cpp @@ -146,7 +146,7 @@ HICON __fastcall LoadFlagIcon(int countryNumber) szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, countryNumber = 0xFFFF, 0);
char szId[20];
- mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); /* buffer safe */
+ mir_snprintf(szId, (countryNumber == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countryNumber); /* buffer safe */
return IcoLib_GetIcon(szId);
}
@@ -244,7 +244,7 @@ void InitIcons(void) sid.description.a = (char*)countries[i].szName;
/* create identifier */
- mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */
+ mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
/* create icon */
HICON hIcon = ImageList_GetIcon(himl,index,ILD_NORMAL);
diff --git a/plugins/CountryFlags/src/ip2country.cpp b/plugins/CountryFlags/src/ip2country.cpp index 49dcc881b6..d39f6beecd 100644 --- a/plugins/CountryFlags/src/ip2country.cpp +++ b/plugins/CountryFlags/src/ip2country.cpp @@ -246,7 +246,7 @@ static int EnumIpDataLines(const char *pszFileCSV,const char *pszFileOut) }
/* not in list */
if (i == nCountriesCount) {
- mir_snprintf(out, _countof(out), "Unknown: %s-%s [%s, %s]\n", pszFrom, pszTo, pszTwo, pszCountry);
+ mir_snprintf(out, "Unknown: %s-%s [%s, %s]\n", pszFrom, pszTo, pszTwo, pszCountry);
OutputDebugStringA(out); /* all ascii */
}
}
diff --git a/plugins/CountryFlags/src/utils.cpp b/plugins/CountryFlags/src/utils.cpp index 958a99fb25..082f8f256e 100644 --- a/plugins/CountryFlags/src/utils.cpp +++ b/plugins/CountryFlags/src/utils.cpp @@ -21,7 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /************************* Buffered Functions *********************/
-struct BufferedCallData {
+struct BufferedCallData
+{
DWORD startTick;
UINT uElapse;
BUFFEREDPROC pfnBuffProc;
@@ -36,10 +37,10 @@ static struct BufferedCallData *callList; static int nCallListCount;
// always gets called in main message loop
-static void CALLBACK BufferedProcTimer(HWND hwnd,UINT,UINT_PTR idTimer,DWORD currentTick)
+static void CALLBACK BufferedProcTimer(HWND hwnd, UINT, UINT_PTR idTimer, DWORD currentTick)
{
struct BufferedCallData *buf;
- UINT uElapsed,uElapseNext=USER_TIMER_MAXIMUM;
+ UINT uElapsed, uElapseNext = USER_TIMER_MAXIMUM;
BUFFEREDPROC pfnBuffProc;
LPARAM lParam;
#ifdef _DEBUG
@@ -47,114 +48,117 @@ static void CALLBACK BufferedProcTimer(HWND hwnd,UINT,UINT_PTR idTimer,DWORD cur const char *pszProcName;
#endif
- for(int i=0; i < nCallListCount; ++i) {
+ for (int i = 0; i < nCallListCount; ++i) {
/* find elapsed procs */
- uElapsed=currentTick-callList[i].startTick; /* wraparound works */
- if ((uElapsed+USER_TIMER_MINIMUM)>=callList[i].uElapse) {
+ uElapsed = currentTick - callList[i].startTick; /* wraparound works */
+ if ((uElapsed + USER_TIMER_MINIMUM) >= callList[i].uElapse) {
/* call elapsed proc */
- pfnBuffProc=callList[i].pfnBuffProc;
- lParam=callList[i].lParam;
+ pfnBuffProc = callList[i].pfnBuffProc;
+ lParam = callList[i].lParam;
#ifdef _DEBUG
- pszProcName=callList[i].pszProcName;
+ pszProcName = callList[i].pszProcName;
#endif
/* resize storage array */
- if ((i+1)<nCallListCount)
- memmove(&callList[i],&callList[i+1],((nCallListCount-i-1)*sizeof(struct BufferedCallData)));
+ if ((i + 1) < nCallListCount)
+ memmove(&callList[i], &callList[i + 1], ((nCallListCount - i - 1)*sizeof(struct BufferedCallData)));
--nCallListCount;
--i; /* reiterate current */
if (nCallListCount) {
- buf=(struct BufferedCallData*)mir_realloc(callList,nCallListCount*sizeof(struct BufferedCallData));
- if (buf != NULL) callList=buf;
- } else {
+ buf = (struct BufferedCallData*)mir_realloc(callList, nCallListCount*sizeof(struct BufferedCallData));
+ if (buf != NULL) callList = buf;
+ }
+ else {
mir_free(callList);
- callList=NULL;
+ callList = NULL;
}
#ifdef _DEBUG
- mir_snprintf(szDbgLine,_countof(szDbgLine),"buffered call: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
- OutputDebugStringA(szDbgLine);
+ mir_snprintf(szDbgLine, "buffered call: %s(0x%X)\n", pszProcName, lParam); /* all ascii */
+ OutputDebugStringA(szDbgLine);
#endif
- CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc,(void*)lParam); /* compatible */
+ CallFunctionAsync((void (CALLBACK *)(void*))pfnBuffProc, (void*)lParam); /* compatible */
}
/* find next timer delay */
- else if ((callList[i].uElapse-uElapsed)<uElapseNext)
- uElapseNext=callList[i].uElapse-uElapsed;
+ else if ((callList[i].uElapse - uElapsed) < uElapseNext)
+ uElapseNext = callList[i].uElapse - uElapsed;
}
/* set next timer */
if (nCallListCount) {
#ifdef _DEBUG
- mir_snprintf(szDbgLine,_countof(szDbgLine),"next buffered timeout: %ums\n",uElapseNext); /* all ascii */
- OutputDebugStringA(szDbgLine);
+ mir_snprintf(szDbgLine, "next buffered timeout: %ums\n", uElapseNext); /* all ascii */
+ OutputDebugStringA(szDbgLine);
#endif
- idBufferedTimer=SetTimer(hwnd,idBufferedTimer,uElapseNext,BufferedProcTimer); /* will be reset */
- } else {
- KillTimer(hwnd,idTimer);
- idBufferedTimer=0;
+ idBufferedTimer = SetTimer(hwnd, idBufferedTimer, uElapseNext, BufferedProcTimer); /* will be reset */
+ }
+ else {
+ KillTimer(hwnd, idTimer);
+ idBufferedTimer = 0;
#ifdef _DEBUG
- OutputDebugStringA("empty buffered queue\n");
+ OutputDebugStringA("empty buffered queue\n");
#endif
}
}
// assumes to be called in context of main thread
#ifdef _DEBUG
-void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,const char *pszProcName,LPARAM lParam,BOOL fAccumulateSameParam,UINT uElapse)
+void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc, const char *pszProcName, LPARAM lParam, BOOL fAccumulateSameParam, UINT uElapse)
#else
-void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumulateSameParam,UINT uElapse)
+void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc, LPARAM lParam, BOOL fAccumulateSameParam, UINT uElapse)
#endif
{
- struct BufferedCallData *data=NULL;
+ struct BufferedCallData *data = NULL;
int i;
/* find existing */
- for(i=0;i<nCallListCount;++i)
+ for (i = 0; i < nCallListCount; ++i)
if (callList[i].pfnBuffProc == pfnBuffProc)
if (!fAccumulateSameParam || callList[i].lParam == lParam) {
- data=&callList[i];
+ data = &callList[i];
break;
}
/* append new */
if (data == NULL) {
/* resize storage array */
- data=(struct BufferedCallData*)mir_realloc(callList,(nCallListCount+1)*sizeof(struct BufferedCallData));
+ data = (struct BufferedCallData*)mir_realloc(callList, (nCallListCount + 1)*sizeof(struct BufferedCallData));
if (data == NULL) return;
- callList=data;
- data=&callList[nCallListCount];
+ callList = data;
+ data = &callList[nCallListCount];
++nCallListCount;
}
/* set delay */
- data->startTick=GetTickCount();
- data->uElapse=uElapse;
- data->lParam=lParam;
- data->pfnBuffProc=pfnBuffProc;
+ data->startTick = GetTickCount();
+ data->uElapse = uElapse;
+ data->lParam = lParam;
+ data->pfnBuffProc = pfnBuffProc;
#ifdef _DEBUG
- { char szDbgLine[256];
- data->pszProcName=pszProcName;
- mir_snprintf(szDbgLine,_countof(szDbgLine),"buffered queue: %s(0x%X)\n",pszProcName,lParam); /* all ascii */
+ {
+ char szDbgLine[256];
+ data->pszProcName = pszProcName;
+ mir_snprintf(szDbgLine, "buffered queue: %s(0x%X)\n", pszProcName, lParam); /* all ascii */
+ OutputDebugStringA(szDbgLine);
+ if (!idBufferedTimer) {
+ mir_snprintf(szDbgLine, "next buffered timeout: %ums\n", uElapse); /* all ascii */
OutputDebugStringA(szDbgLine);
- if (!idBufferedTimer) {
- mir_snprintf(szDbgLine,_countof(szDbgLine),"next buffered timeout: %ums\n",uElapse); /* all ascii */
- OutputDebugStringA(szDbgLine);
- }
}
+ }
#endif
/* set next timer */
- if (idBufferedTimer) uElapse=USER_TIMER_MINIMUM; /* will get recalculated */
- idBufferedTimer=SetTimer(NULL,idBufferedTimer,uElapse,BufferedProcTimer);
+ if (idBufferedTimer) uElapse = USER_TIMER_MINIMUM; /* will get recalculated */
+ idBufferedTimer = SetTimer(NULL, idBufferedTimer, uElapse, BufferedProcTimer);
}
// assumes to be called in context of main thread
void PrepareBufferedFunctions(void)
{
- idBufferedTimer=0;
- nCallListCount=0;
- callList=NULL;
+ idBufferedTimer = 0;
+ nCallListCount = 0;
+ callList = NULL;
}
// assumes to be called in context of main thread
void KillBufferedFunctions(void)
{
- if (idBufferedTimer) KillTimer(NULL,idBufferedTimer);
- nCallListCount=0;
+ if (idBufferedTimer) KillTimer(NULL, idBufferedTimer);
+ nCallListCount = 0;
mir_free(callList); /* does NULL check */
}
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index df5d273ae1..e49c42d7f3 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -68,7 +68,7 @@ INT_PTR StoreVersionInfoToFile(WPARAM, LPARAM lParam) CreateDirectoryTree(VersionInfoFolder);
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
HANDLE hDumpFile = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hDumpFile != INVALID_HANDLE_VALUE) {
@@ -159,7 +159,7 @@ INT_PTR CopyLinkToClipboard(WPARAM, LPARAM) ptrT tmp(db_get_wsa(NULL, PluginName, "Username"));
if (tmp != NULL) {
TCHAR buffer[MAX_PATH];
- mir_sntprintf(buffer, _countof(buffer), _T("http://vi.miranda-ng.org/detail/%s"), tmp);
+ mir_sntprintf(buffer, _T("http://vi.miranda-ng.org/detail/%s"), tmp);
int bufLen = (sizeof(buffer) + 1) * sizeof(TCHAR);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, bufLen);
@@ -359,7 +359,7 @@ extern "C" int __declspec(dllexport) Load(void) profname = Utils_ReplaceVarsT(_T("%miranda_profilename%.dat"));
profpath = Utils_ReplaceVarsT(_T("%miranda_userdata%"));
if (catchcrashes && !needrestart)
- mir_sntprintf(CrashLogFolder, _countof(CrashLogFolder), TEXT("%s\\CrashLog"), profpath);
+ mir_sntprintf(CrashLogFolder, TEXT("%s\\CrashLog"), profpath);
_tcsncpy_s(VersionInfoFolder, profpath, _TRUNCATE);
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index e35f535d7f..21a98c3e62 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -477,7 +477,7 @@ void PrintVersionInfo(CMString& buffer, unsigned flags) buffer.AppendFormat(TEXT("Build time: %s\r\n"), mirtime);
TCHAR profpn[MAX_PATH];
- mir_sntprintf(profpn, _countof(profpn), TEXT("%s\\%s"), profpathfull, profname);
+ mir_sntprintf(profpn, TEXT("%s\\%s"), profpathfull, profname);
buffer.AppendFormat(TEXT("Profile: %s\r\n"), profpn);
diff --git a/plugins/CrashDumper/src/exhndlr.cpp b/plugins/CrashDumper/src/exhndlr.cpp index 91535bb12e..fcd25a8a0d 100644 --- a/plugins/CrashDumper/src/exhndlr.cpp +++ b/plugins/CrashDumper/src/exhndlr.cpp @@ -55,13 +55,13 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) __try {
if (dtsubfldr) {
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, _countof(path), TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.mdmp"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -82,18 +82,18 @@ void myfilterWorker(PEXCEPTION_POINTERS exc_ptr, bool notify) __try {
if (dtsubfldr) {
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d"), CrashLogFolder, st.wYear, st.wMonth, st.wDay);
CreateDirectory(path, NULL);
- mir_sntprintf(path, _countof(path), TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\%02d.%02d.%02d\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
}
else
- mir_sntprintf(path, _countof(path), TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
+ mir_sntprintf(path, TEXT("%s\\crash%02d%02d%02d%02d%02d%02d.txt"), CrashLogFolder,
st.wYear, st.wMonth, st.wDay, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
hDumpFile = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
- mir_sntprintf(path, _countof(path), TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
+ mir_sntprintf(path, TranslateT("Miranda crashed. Crash report stored in the folder:\n %s\n\n Would you like store it in the clipboard as well?"), CrashLogFolder);
if (hDumpFile != INVALID_HANDLE_VALUE)
CreateCrashReport(hDumpFile, exc_ptr, notify ? path : NULL);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 26989f5ad8..41cc0f34fb 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -282,7 +282,7 @@ LRESULT CALLBACK DlgProcPopup(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case 3:
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
+ mir_sntprintf(path, TEXT("%s\\VersionInfo.txt"), VersionInfoFolder);
ShellExecute(NULL, TEXT("open"), path, NULL, NULL, SW_SHOW);
break;
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp index 8f7899db24..dae48644ac 100644 --- a/plugins/Db3x_mmap/src/database.cpp +++ b/plugins/Db3x_mmap/src/database.cpp @@ -87,7 +87,7 @@ void __cdecl dbpanic(void *) msg = TranslateT("Disk is full. Miranda will now shut down.");
TCHAR err[256];
- mir_sntprintf(err, _countof(err), msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
+ mir_sntprintf(err, msg, TranslateT("Database failure. Miranda will now shut down."), dwErr);
MessageBox(0, err, TranslateT("Database Error"), MB_SETFOREGROUND | MB_TOPMOST | MB_APPLMODAL | MB_ICONWARNING | MB_OK);
}
@@ -128,13 +128,13 @@ char* printVariant(DBVARIANT* p) static char boo[1000];
switch (p->type) {
- case DBVT_BYTE: mir_snprintf(boo, _countof(boo), "byte: %d", p->bVal ); break;
- case DBVT_WORD: mir_snprintf(boo, _countof(boo), "word: %d", p->wVal ); break;
- case DBVT_DWORD: mir_snprintf(boo, _countof(boo), "dword: %d", p->dVal ); break;
+ case DBVT_BYTE: mir_snprintf(boo, "byte: %d", p->bVal ); break;
+ case DBVT_WORD: mir_snprintf(boo, "word: %d", p->wVal ); break;
+ case DBVT_DWORD: mir_snprintf(boo, "dword: %d", p->dVal ); break;
case DBVT_UTF8:
- case DBVT_ASCIIZ: mir_snprintf(boo, _countof(boo), "string: '%s'", p->pszVal); break;
+ case DBVT_ASCIIZ: mir_snprintf(boo, "string: '%s'", p->pszVal); break;
case DBVT_DELETED: mir_strcpy(boo, "deleted"); break;
- default: mir_snprintf(boo, _countof(boo), "crap: %d", p->type ); break;
+ default: mir_snprintf(boo, "crap: %d", p->type ); break;
}
return boo;
}
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp index b3167fcdad..3b597e387a 100644 --- a/plugins/DbChecker/src/selectdb.cpp +++ b/plugins/DbChecker/src/selectdb.cpp @@ -36,7 +36,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) if (opts.dbChecker == NULL) {
DATABASELINK* dblink = FindDatabasePlugin(opts.filename);
if (dblink == NULL) {
- mir_sntprintf(tszMsg, _countof(tszMsg),
+ mir_sntprintf(tszMsg,
TranslateT("Database Checker cannot find a suitable database plugin to open '%s'."),
opts.filename);
LBL_Error:
@@ -45,7 +45,7 @@ int OpenDatabase(HWND hdlg, INT iNextPage) }
if (dblink->CheckDB == NULL) {
- mir_sntprintf(tszMsg, _countof(tszMsg),
+ mir_sntprintf(tszMsg,
TranslateT("Database driver '%s' doesn't support checking."),
TranslateTS(dblink->szFullName));
goto LBL_Error;
@@ -129,7 +129,7 @@ static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir) int iNewItem = ListView_InsertItem(hwndList, &lvi);
TCHAR szSize[20];
- mir_sntprintf(szSize, _countof(szSize), _T("%.2lf MB"), totalSize / 1048576.0);
+ mir_sntprintf(szSize, _T("%.2lf MB"), totalSize / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 1, szSize);
return iNewItem;
}
@@ -149,7 +149,7 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix) if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T("..")))
continue;
- mir_sntprintf(szFilename, _countof(szFilename), _T("%s\\%s\\%s.dat"), szProfileDir, fd.cFileName, fd.cFileName);
+ mir_sntprintf(szFilename, _T("%s\\%s\\%s.dat"), szProfileDir, fd.cFileName, fd.cFileName);
if (_taccess(szFilename, 0) == 0)
AddDatabaseToList(GetDlgItem(hdlg, IDC_DBLIST), szFilename, szPrefix);
} while (FindNextFile(hFind, &fd));
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp index c89063058b..674088d9f5 100644 --- a/plugins/DbChecker/src/worker.cpp +++ b/plugins/DbChecker/src/worker.cpp @@ -54,9 +54,9 @@ static void Finalize(time_t& ts) }
for (int i = 1;; i++) {
if (i == 1)
- mir_sntprintf(opts.backupFilename, _countof(opts.backupFilename), TranslateT("%s\\Backup of %s"), dbPath, dbFile);
+ mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup of %s"), dbPath, dbFile);
else
- mir_sntprintf(opts.backupFilename, _countof(opts.backupFilename), TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
+ mir_sntprintf(opts.backupFilename, TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
if (_taccess(opts.backupFilename, 0) == -1) break;
}
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 5f118fd7a6..18790a530c 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -119,7 +119,7 @@ char* NickFromHContact(MCONTACT hContact) if (!loaded) {
if (szProto[0])
- mir_snprintf(nick, _countof(nick), "%s (%s)", name, szProto);
+ mir_snprintf(nick, "%s (%s)", name, szProto);
else
mir_strncpy(nick, name, _countof(nick));
}
@@ -128,9 +128,9 @@ char* NickFromHContact(MCONTACT hContact) if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
char szUID[FLD_SIZE];
GetValueA(hContact, szProto, uid, szUID, _countof(szUID));
- mir_snprintf(nick, _countof(nick), "%s *(%s)*<%s>*{%s}*", name, szProto, uid, szUID);
+ mir_snprintf(nick, "%s *(%s)*<%s>*{%s}*", name, szProto, uid, szUID);
}
- else mir_snprintf(nick, _countof(nick), "%s (%s)", name, szProto);
+ else mir_snprintf(nick, "%s (%s)", name, szProto);
}
}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 8f6b19d14c..7f3ea9f087 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -225,7 +225,7 @@ char *StringFromBlob(BYTE *blob, WORD len) data[0] = 0;
for (j = 0; j < len; j++) {
- mir_snprintf(tmp, _countof(tmp), "%02X ", blob[j]);
+ mir_snprintf(tmp, "%02X ", blob[j]);
mir_strcat(data, tmp);
}
return data;
@@ -542,7 +542,7 @@ void saveListSettings(HWND hwnd, ColumnsSettings *cs) int i = 0;
while (cs[i].name) {
if (ListView_GetColumn(hwnd, cs[i].index, &sLC)) {
- mir_snprintf(tmp, _countof(tmp), cs[i].dbname, i);
+ mir_snprintf(tmp, cs[i].dbname, i);
db_set_w(NULL, modname, tmp, (WORD)sLC.cx);
}
i++;
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index db914d4a83..3a9a39b7e4 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -181,7 +181,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) if (options.num_backups == 0)
return 0; /* Roration disabled. */
- mir_sntprintf(backupfolderTmp, _countof(backupfolderTmp), _T("%s\\%s*"), backupfolder, dbname);
+ mir_sntprintf(backupfolderTmp, _T("%s\\%s*"), backupfolder, dbname);
hFind = FindFirstFile(backupfolderTmp, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
return 0;
@@ -201,7 +201,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) if (i > 0)
qsort(bf, i, sizeof(backupFile), Comp); /* Sort the list of found files by date in descending order. */
for (; i >= options.num_backups; i --) {
- mir_sntprintf(backupfolderTmp, _countof(backupfolderTmp), _T("%s\\%s"), backupfolder, bf[(i - 1)].Name);
+ mir_sntprintf(backupfolderTmp, _T("%s\\%s"), backupfolder, bf[(i - 1)].Name);
DeleteFile(backupfolderTmp);
}
err_out:
@@ -237,7 +237,7 @@ int Backup(TCHAR *backup_filename) GetLocalTime(&st);
GetComputerName(buffer, &size);
- mir_sntprintf(dest_file, _countof(dest_file), _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? _T("zip") : _T("dat"));
+ mir_sntprintf(dest_file, _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? _T("zip") : _T("dat"));
mir_free(backupfolder);
}
else {
@@ -253,7 +253,7 @@ int Backup(TCHAR *backup_filename) SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
- mir_sntprintf(source_file, _countof(source_file), _T("%s\\%s"), profilePath, dbname);
+ mir_sntprintf(source_file, _T("%s\\%s"), profilePath, dbname);
TCHAR *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index 4f143fedb9..5579e9daf4 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -37,7 +37,7 @@ static INT_PTR DBSaveAs(WPARAM, LPARAM) OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
- mir_sntprintf(tszFilter, _countof(tszFilter), _T("%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c"),
+ mir_sntprintf(tszFilter, _T("%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c"),
TranslateT("Miranda NG databases"), 0, 0,
TranslateT("Compressed Miranda NG databases"), 0, 0,
TranslateT("All files"), 0, 0);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index a9fe7d9abf..59e5ca5306 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -48,13 +48,12 @@ int LoadOptions(void) if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s\\%s"), profilePath, dbv.ptszVal);
+ mir_sntprintf(options.folder, _T("%s\\%s"), profilePath, dbv.ptszVal);
db_free(&dbv);
mir_free(tmp);
}
- else
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s%s"), DIR, SUB_DIR);
+ else mir_sntprintf(options.folder, _T("%s%s"), DIR, SUB_DIR);
}
options.num_backups = db_get_w(0, "AutoBackups", "NumBackups", 3);
@@ -76,7 +75,7 @@ int SaveOptions(void) db_set_w(0, "AutoBackups", "Period", (WORD)options.period);
db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
- mir_sntprintf(prof_dir, _countof(prof_dir), _T("%s\\"), profilePath);
+ mir_sntprintf(prof_dir, _T("%s\\"), profilePath);
size_t prof_len = mir_tstrlen(prof_dir);
size_t opt_len = mir_tstrlen(options.folder);
@@ -89,7 +88,7 @@ int SaveOptions(void) TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
_tcsncpy_s(prof_dir, options.folder, _TRUNCATE);
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s\\%s"), profilePath, prof_dir);
+ mir_sntprintf(options.folder, _T("%s\\%s"), profilePath, prof_dir);
}
mir_free(tmp);
db_set_w(0, "AutoBackups", "NumBackups", options.num_backups);
@@ -188,7 +187,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
else {
TCHAR tszTooltipText[4096];
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTooltipText, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("%miranda_path%"), TranslateT("path to Miranda root folder"),
_T("%miranda_profilesdir%"), TranslateT("path to folder containing Miranda profiles"),
_T("%miranda_profilename%"), TranslateT("name of current Miranda profile (filename, without extension)"),
@@ -346,7 +345,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
- mir_sntprintf(backupfolder, _countof(backupfolder), _T("%s\\%s"), profilePath, tmp);
+ mir_sntprintf(backupfolder, _T("%s\\%s"), profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp index 3909ea4750..1a35c464f1 100644 --- a/plugins/Dropbox/src/dropbox_services.cpp +++ b/plugins/Dropbox/src/dropbox_services.cpp @@ -199,7 +199,7 @@ INT_PTR CDropbox::ProtoSendMessage(WPARAM, LPARAM lParam) }
char help[1024];
- mir_snprintf(help, _countof(help), Translate("\"%s\" is not valid.\nUse \"/help\" for more info."), szMessage);
+ mir_snprintf(help, Translate("\"%s\" is not valid.\nUse \"/help\" for more info."), szMessage);
CallContactService(GetDefaultContact(), PSR_MESSAGE, 0, (LPARAM)help);
return 0;
}
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp index a2669f7abb..a4e80c6c7e 100644 --- a/plugins/Exchange/src/emails.cpp +++ b/plugins/Exchange/src/emails.cpp @@ -279,9 +279,9 @@ int CExchangeServer::Check(int bNoEmailsNotify) if (((count > 0) || ((bNoEmailsNotify) && (count >= 0))) && (count != -1)) {
TCHAR buffer[1024];
if (count != 1)
- mir_sntprintf(buffer, _countof(buffer), TranslateT("You have %d unread emails..."), count);
+ mir_sntprintf(buffer, TranslateT("You have %d unread emails..."), count);
else
- mir_sntprintf(buffer, _countof(buffer), TranslateT("You have one unread email..."));
+ mir_sntprintf(buffer, TranslateT("You have one unread email..."));
ShowMessage(buffer, count);
}
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 6db6412c4a..e6eda61bd5 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -131,7 +131,7 @@ void UploadDialog::Tab::select() void UploadDialog::Tab::labelCompleted()
{
TCHAR buff[64], buff2[256];
- mir_sntprintf(buff2, _countof(buff2), _T("* %s"), Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
+ mir_sntprintf(buff2, _T("* %s"), Utils::getTextFragment(m_job->m_tszFileName, 20, buff));
TCITEM tab = { 0 };
tab.mask = TCIF_TEXT;
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 8eba5013dd..d0e6b988fe 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -110,7 +110,7 @@ void InitMenuItems() for (int i = 0; i < ServerList::FTP_COUNT; i++) {
if (DB::getStringF(0, MODULE, "Name%d", i, stzName))
- mir_sntprintf(stzName, _countof(stzName), TranslateT("FTP Server %d"), i + 1);
+ mir_sntprintf(stzName, TranslateT("FTP Server %d"), i + 1);
mi.flags = CMIF_TCHAR;
mi.root = (opt.bUseSubmenu) ? hMenu : 0;
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index 0c99989da0..f3cab81cd3 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -92,7 +92,7 @@ void GenericJob::getFilesFromOpenDialog() {
TCHAR *ptr = m_tszFilePath + length + 1;
while (ptr[0]) {
- mir_sntprintf(stzFile, _countof(stzFile), _T("%s\\%s"), m_tszFilePath, ptr);
+ mir_sntprintf(stzFile, _T("%s\\%s"), m_tszFilePath, ptr);
addFile(stzFile);
ptr += mir_tstrlen(ptr) + 1;
}
@@ -116,7 +116,7 @@ int GenericJob::getFilesFromFolder(TCHAR *stzFolder) HANDLE hFind = FindFirstFile(_T("*.*"), &ffd);
while (hFind != INVALID_HANDLE_VALUE) {
if (!(ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
- mir_sntprintf(stzFile, _countof(stzFile), _T("%s\\%s"), stzFolder, ffd.cFileName);
+ mir_sntprintf(stzFile, _T("%s\\%s"), stzFolder, ffd.cFileName);
addFile(stzFile);
}
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index f2a2942636..7d98a18fbd 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -58,7 +58,7 @@ void PackerJob::getZipFilePath() GetTempPath(_countof(buff), buff);
- mir_sntprintf(m_tszFilePath, _countof(m_tszFilePath), _T("%s%s.zip"), buff, stzFileName);
+ mir_sntprintf(m_tszFilePath, _T("%s%s.zip"), buff, stzFileName);
mir_tstrcpy(m_tszFileName, Utils::getFileNameFromPath(m_tszFilePath));
if (opt.bSetZipName)
diff --git a/plugins/FTPFileYM/src/serverlist.cpp b/plugins/FTPFileYM/src/serverlist.cpp index 7610369e11..b5be374920 100644 --- a/plugins/FTPFileYM/src/serverlist.cpp +++ b/plugins/FTPFileYM/src/serverlist.cpp @@ -64,7 +64,7 @@ void ServerList::saveToDb() const ServerList::FTP::FTP(int index)
{
if (DB::getStringF(0, MODULE, "Name%d", index, m_stzName))
- mir_sntprintf(m_stzName, _countof(m_stzName), TranslateT("FTP Server %d"), index + 1);
+ mir_sntprintf(m_stzName, TranslateT("FTP Server %d"), index + 1);
DB::getAStringF(0, MODULE, "Password%d", index, m_szPass);
DB::getAStringF(0, MODULE, "Server%d", index, m_szServer);
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 9e881ae705..8864263545 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -243,9 +243,9 @@ void FILEECHO::updateTitle() contactName = (char*)pcli->pfnGetContactDisplayName(hContact, 0);
if (iState == STATE_OPERATE && chunkCount != 0)
- mir_snprintf(newtitle, _countof(newtitle), "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName);
+ mir_snprintf(newtitle, "%d%% - %s: %s", chunkSent * 100 / chunkCount, Translate(szFEMode[inSend]), contactName);
else
- mir_snprintf(newtitle, _countof(newtitle), "%s: %s", Translate(szFEMode[inSend]), contactName);
+ mir_snprintf(newtitle, "%s: %s", Translate(szFEMode[inSend]), contactName);
SetWindowText(hDlg, newtitle);
}
@@ -412,9 +412,9 @@ void FILEECHO::sendReq() if (*p == '\\')
mir_strcpy(filename, p + 1);
- mir_snprintf(sendbuf, _countof(sendbuf), Translate("Size: %d bytes"), fileSize);
+ mir_snprintf(sendbuf, Translate("Size: %d bytes"), fileSize);
SetDlgItemText(hDlg, IDC_FILESIZE, sendbuf);
- mir_snprintf(sendbuf, _countof(sendbuf), "?%c%c%d:%d \n" NOPLUGIN_MESSAGE, asBinary + '0', codeSymb, chunkCount, fileSize);
+ mir_snprintf(sendbuf, "?%c%c%d:%d \n" NOPLUGIN_MESSAGE, asBinary + '0', codeSymb, chunkCount, fileSize);
sendCmd(0, CMD_REQ, sendbuf, filename);
SetDlgItemText(hDlg, IDC_STATUS, Translate("Request sent. Awaiting of acceptance.."));
@@ -618,7 +618,7 @@ void FILEECHO::onSendTimer() }
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "%X,%X,%X>", chunkIndx + 1, chunkPos[chunkIndx], chksum);
+ mir_snprintf(prefix, "%X,%X,%X>", chunkIndx + 1, chunkPos[chunkIndx], chksum);
#ifdef DEBUG
overhead += mir_tstrlen((char*)buffer);
#endif
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 3629d57510..575fee086a 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -916,7 +916,7 @@ extern "C" int __declspec(dllexport) Load() COLORREF defColor = GetSysColor((i == FLT_FONTID_NOTONLIST) ? COLOR_3DSHADOW : COLOR_WINDOWTEXT);
char szId[20];
- mir_snprintf(szId, _countof(szId), "Font%d", i);
+ mir_snprintf(szId, "Font%d", i);
FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
}
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index 7ab90df3b8..255e2b11e9 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -199,7 +199,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETRANGE, TRUE, MAKELONG(0, 100));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETPOS, TRUE, btOpacity);
- mir_snprintf(szPercent, _countof(szPercent), "%d%%", btOpacity);
+ mir_snprintf(szPercent, "%d%%", btOpacity);
SetDlgItemTextA(hwndDlg, IDC_OPACITY, szPercent);
EnableWindow(GetDlgItem(hwndDlg, IDC_SLIDER_OPACITY), SetLayeredWindowAttributes != 0);
@@ -230,7 +230,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP fcOpt.thumbAlpha = (BYTE)((nPos * 255) / 100);
SetThumbsOpacity(fcOpt.thumbAlpha);
- mir_snprintf(szPercent, _countof(szPercent), "%d%%", nPos);
+ mir_snprintf(szPercent, "%d%%", nPos);
SetDlgItemTextA(hwndDlg, IDC_OPACITY, szPercent);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index 32835dc6cc..d0c5c3284a 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -123,7 +123,7 @@ static INT_PTR CALLBACK DlgProcVariables(HWND hWnd, UINT msg, WPARAM wParam, LPA switch (msg) {
case WM_INITDIALOG:
- mir_sntprintf(tszMessage, _countof(tszMessage), _T("%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s"),
+ mir_sntprintf(tszMessage, _T("%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s"),
TranslateT("Don't forget to click on Apply to save the changes. If you don't then the changes won't"),
TranslateT("be saved to the database, they will only be valid for this session."),
TranslateT("Variable string"),
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index ffe0b9665d..e36cadc554 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -87,7 +87,7 @@ int InitServices() pos = _tcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
TCHAR *szTemp = Utils_ReplaceVarsT(_T("%miranda_userdata%"));
- mir_sntprintf(szUserDataPath, _countof(szUserDataPath), szTemp);
+ mir_sntprintf(szUserDataPath, szTemp);
mir_free(szTemp);
CreateServiceFunction(MS_FOLDERS_GET_PATH, GetPathService);
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 176e0894cf..065d6c1b25 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -434,7 +434,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) { ofn.lStructSize = sizeof(OPENFILENAME);
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.*)%c*.*%c%c"), Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.*)%c*.*%c%c"), Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = pstNewShare->pszRealPath;
@@ -1208,7 +1208,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetDlgItemText(hwndDlg, IDC_PAGE_KEYWORD, szKeyWord, _countof(szKeyWord));
DWORD dwExternalIP = GetExternIP(szUrl, szKeyWord);
- mir_snprintf(szKeyWord, _countof(szKeyWord), Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
+ mir_snprintf(szKeyWord, Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s") ,
SplitIpAddress(dwExternalIP) ,
szUrl);
MessageBox(hwndDlg, szKeyWord, MSG_BOX_TITEL, MB_OK);
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp index a4e2597fd7..b31694142a 100644 --- a/plugins/HTTPServer/src/HttpUser.cpp +++ b/plugins/HTTPServer/src/HttpUser.cpp @@ -231,7 +231,7 @@ void CLHttpUser::SendError(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuf[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf),
+ DWORD dwBytesToWrite = mir_snprintf(szBuf,
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -281,7 +281,7 @@ void CLHttpUser::SendRedir(int iErrorCode, const char * pszError, const char * p pszDescription = pszError;
char szBuff[1000];
- DWORD dwBytesToWrite = mir_snprintf(szBuff, _countof(szBuff),
+ DWORD dwBytesToWrite = mir_snprintf(szBuff,
"HTTP/1.1 %i %s\r\n"
"Date: %s\r\n"
"Server: MirandaWeb/%s\r\n"
@@ -546,7 +546,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { char szETag[ 50 ];
{
- int nETagLen = mir_snprintf(szETag, _countof(szETag), "\"%x-%x-%x\"",
+ int nETagLen = mir_snprintf(szETag, "\"%x-%x-%x\"",
nDataSize, stFileTime.dwHighDateTime, stFileTime.dwLowDateTime);
if (!apszParam[eIfRange] || (strncmp(szETag, apszParam[eIfRange], nETagLen) == 0)) {
@@ -616,7 +616,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf), szHttpPartial,
+ dwBytesToWrite = mir_snprintf(szBuf, szHttpPartial,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
@@ -638,7 +638,7 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) { "Last-Modified: %s\r\n"
"\r\n";
- dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf), szHttpOk,
+ dwBytesToWrite = mir_snprintf(szBuf, szHttpOk,
szCurTime,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
szETag,
diff --git a/plugins/HTTPServer/src/IndexHTML.cpp b/plugins/HTTPServer/src/IndexHTML.cpp index 04a991cb4e..6bf65357ac 100644 --- a/plugins/HTTPServer/src/IndexHTML.cpp +++ b/plugins/HTTPServer/src/IndexHTML.cpp @@ -62,7 +62,7 @@ bool LoadIndexHTMLTemplate() { char szDestBuf[10000];
char* pszDestBuf = szDestBuf;
- mir_snprintf(szBuf, _countof(szBuf), "%s%s", szPluginPath, szIndexHTMLTemplateFile);
+ mir_snprintf(szBuf, "%s%s", szPluginPath, szIndexHTMLTemplateFile);
HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -282,7 +282,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, // check if directory exists
char szMask[MAX_PATH];
- mir_snprintf(szMask, _countof(szMask), "%s*", pszRealPath);
+ mir_snprintf(szMask, "%s*", pszRealPath);
WIN32_FIND_DATAA fdFindFileData;
HANDLE hFind = FindFirstFile(szMask, &fdFindFileData);
diff --git a/plugins/HTTPServer/src/IndexXML.cpp b/plugins/HTTPServer/src/IndexXML.cpp index b6b79bab1d..6e25cfce28 100644 --- a/plugins/HTTPServer/src/IndexXML.cpp +++ b/plugins/HTTPServer/src/IndexXML.cpp @@ -64,7 +64,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace, bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath, const char * pszSrvPath, DWORD dwRemoteIP)
{
char szMask[MAX_PATH+1];
- mir_snprintf(szMask, _countof(szMask), "%s*", pszRealPath);
+ mir_snprintf(szMask, "%s*", pszRealPath);
WIN32_FIND_DATAA fdFindFileData;
HANDLE hFind = FindFirstFile(szMask, &fdFindFileData);
@@ -100,7 +100,7 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath, const WriteFile(hFile, szXmlHeader1, sizeof(szXmlHeader1) - 1, &dwBytesWritten, NULL);
// check if a index.xsl exists in the same directory otherwise use the global
- mir_snprintf(szMask, _countof(szMask), "%s%s", pszRealPath, "index.xsl");
+ mir_snprintf(szMask, "%s%s", pszRealPath, "index.xsl");
HANDLE hFileExists = CreateFile(szMask, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index d7ff1aa033..5b543738b9 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -350,7 +350,7 @@ bool bWriteConfigurationFile() } else {
CLFileShareNode * pclCur = pclFirstNode;
while (pclCur) {
- DWORD dwBytesToWrite = mir_snprintf(szBuf, _countof(szBuf), szXmlData ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, szXmlData ,
pclCur->st.pszSrvPath,
pclCur->pszOrigRealPath,
pclCur->st.nMaxDownloads,
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index f24461eb23..0292052253 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -76,7 +76,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) SetClassLongPtr(hDlg, GCLP_HICON, (LONG_PTR)LoadIcon(hInst, MAKEINTRESOURCE(IDI_LINKLISTICON)));
WindowList_Add(hWindowList, hDlg, DlgParam->hContact);
- mir_sntprintf(title, _countof(title), _T("%s [%s]"), TranslateT("Linklist plugin"), pcli->pfnGetContactDisplayName(DlgParam->hContact, 0));
+ mir_sntprintf(title, _T("%s [%s]"), TranslateT("Linklist plugin"), pcli->pfnGetContactDisplayName(DlgParam->hContact, 0));
SetWindowText(hDlg, title);
GetFilterText(listMenu, filter, _countof(filter));
SetDlgItemText(hDlg, IDC_STATUS, filter);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK SearchDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara WriteLinkList(hListDlg, flags, DlgParam->listStart, buffer, 0);
mir_free(buffer);
}
- mir_sntprintf(filter, _countof(filter), _T("%s: %s"), TXT_FILTER, TXT_SEARCHFILTER);
+ mir_sntprintf(filter, _T("%s: %s"), TXT_FILTER, TXT_SEARCHFILTER);
SetDlgItemText(hWndMain, IDC_STATUS, filter);
} break;
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index dcd2ddafd8..aca2c7dd56 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -306,7 +306,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc _tcscpy_s(cf.szFaceName, _T("Arial"));
SendDlgItemMessage( hDlg, IDC_MAIN, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
- mir_sntprintf(searchText, _countof(searchText), _T("%s '%s': %d\n\n"), TranslateT("Matches for searchtext"), searchString, listCount);
+ mir_sntprintf(searchText, _T("%s '%s': %d\n\n"), TranslateT("Matches for searchtext"), searchString, listCount);
SendDlgItemMessage(hDlg, IDC_MAIN, EM_REPLACESEL, FALSE, (LPARAM)searchText);
linePos += 2;
}
@@ -455,7 +455,7 @@ void WriteLinkList(HWND hDlg, BYTE params, LISTELEMENT *listStart, LPCTSTR searc type = _T("[UNK ]");
}
- mir_sntprintf(textLine, _countof(textLine), _T("%s%s%s%s%s%s%s\n"),
+ mir_sntprintf(textLine, _T("%s%s%s%s%s%s%s\n"),
options.showDirection ? (actualElement->direction==DIRECTION_IN?_T("[in ]"):_T("[out]")) : _T(""),
options.showDirection? _T(" ") : _T(""),
options.showType ? type : _T(""),
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index cdce105537..b01f1c2f32 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -62,7 +62,7 @@ void InitIcons(void) HICON LoadIconEx(const char* name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", ModuleName, name);
+ mir_snprintf(szSettingName, "%s_%s", ModuleName, name);
return IcoLib_GetIcon(szSettingName);
}
@@ -78,7 +78,7 @@ HANDLE GetIconHandle(const char* name) void ReleaseIconEx(const char* name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", ModuleName, name);
+ mir_snprintf(szSettingName, "%s_%s", ModuleName, name);
IcoLib_Release(szSettingName);
}
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 444966f79a..59dbde9186 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -605,7 +605,7 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar MarkChanges(2, hwndDlg);
break;
case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, _countof(filter), "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s (*.*)%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
UpdateTemplateIcons(hwndDlg, path);
@@ -613,21 +613,21 @@ static INT_PTR CALLBACK IEViewSRMMOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar }
break;
case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, _countof(filter), "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.jpg,*.jpeg,*.gif,*.png,*.bmp)%c*.jpg;*.jpeg;*.gif;*.png;*.bmp%c%s (*.*)%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
MarkChanges(2, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(2, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.css%c%s (*.*)%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
MarkChanges(2, hwndDlg);
@@ -737,7 +737,7 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w MarkChanges(4, hwndDlg);
break;
case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, _countof(filter), "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
UpdateTemplateIcons(hwndDlg, path);
@@ -745,21 +745,21 @@ static INT_PTR CALLBACK IEViewHistoryOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w }
break;
case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, _countof(filter), "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
MarkChanges(4, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(4, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
MarkChanges(4, hwndDlg);
@@ -870,7 +870,7 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA MarkChanges(8, hwndDlg);
break;
case IDC_BROWSE_TEMPLATES:
- mir_snprintf(filter, _countof(filter), "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.ivt)%c*.ivt%c%s%c*.*%c%c", Translate("Template"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "ivt", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_TEMPLATES_FILENAME, path);
UpdateTemplateIcons(hwndDlg, path);
@@ -878,21 +878,21 @@ static INT_PTR CALLBACK IEViewGroupChatsOptDlgProc(HWND hwndDlg, UINT msg, WPARA }
break;
case IDC_BROWSE_BACKGROUND_IMAGE:
- mir_snprintf(filter, _countof(filter), "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.jpg,*.gif,*.png,*.bmp)%c*.ivt%c%s%c*.*%c%c", Translate("All Images"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "jpg", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_BACKGROUND_IMAGE_FILENAME, path);
MarkChanges(8, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME, path);
MarkChanges(8, hwndDlg);
}
break;
case IDC_BROWSE_EXTERNALCSS_RTL:
- mir_snprintf(filter, _countof(filter), "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
+ mir_snprintf(filter, "%s (*.css)%c*.ivt%c%s%c*.*%c%c", Translate("Style Sheet"), 0, 0, Translate("All Files"), 0, 0, 0);
if (BrowseFile(hwndDlg, filter, "css", path, _countof(path))) {
SetDlgItemTextA(hwndDlg, IDC_EXTERNALCSS_FILENAME_RTL, path);
MarkChanges(8, hwndDlg);
@@ -1495,13 +1495,13 @@ void Options::init() else continue;
/* SRMM settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
proto->setSRMMEnable(i == 0 ? true : 0 != db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
proto->setSRMMMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
proto->setSRMMFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1510,7 +1510,7 @@ void Options::init() proto->setSRMMBackgroundFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1519,7 +1519,7 @@ void Options::init() proto->setSRMMCssFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1528,13 +1528,13 @@ void Options::init() }
/* Group chat settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
proto->setChatEnable(i == 0 ? true : 0 != db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
proto->setChatMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
proto->setChatFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1543,7 +1543,7 @@ void Options::init() proto->setChatBackgroundFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1552,7 +1552,7 @@ void Options::init() proto->setChatCssFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1561,13 +1561,13 @@ void Options::init() }
/* History settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
proto->setHistoryEnable(i == 0 ? true : 0 != db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
proto->setHistoryMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
proto->setHistoryFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1576,7 +1576,7 @@ void Options::init() proto->setHistoryBackgroundFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
if (strncmp(tmpPath, "http://", 7))
@@ -1585,7 +1585,7 @@ void Options::init() proto->setHistoryCssFilename(tmpPath);
db_free(&dbv);
}
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
mir_strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
@@ -1681,67 +1681,67 @@ void Options::saveProtocolSettings() char tmpPath[MAX_PATH];
proto->copyFromTemp();
/* SRMM settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->isSRMMEnable());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->getSRMMMode());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
db_set_dw(NULL, ieviewModuleName, dbsName, proto->getSRMMFlags());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
mir_strcpy(tmpPath, proto->getSRMMBackgroundFilename());
PathToRelative(proto->getSRMMBackgroundFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
mir_strcpy(tmpPath, proto->getSRMMCssFilename());
PathToRelative(proto->getSRMMCssFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
mir_strcpy(tmpPath, proto->getSRMMTemplateFilename());
PathToRelative(proto->getSRMMTemplateFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
/* Group Chat settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->isChatEnable());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->getChatMode());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
db_set_dw(NULL, ieviewModuleName, dbsName, proto->getChatFlags());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
mir_strcpy(tmpPath, proto->getChatBackgroundFilename());
PathToRelative(proto->getChatBackgroundFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
mir_strcpy(tmpPath, proto->getChatCssFilename());
PathToRelative(proto->getChatCssFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
mir_strcpy(tmpPath, proto->getChatTemplateFilename());
PathToRelative(proto->getChatTemplateFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
/* History settings */
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->isHistoryEnable());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
db_set_b(NULL, ieviewModuleName, dbsName, proto->getHistoryMode());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
db_set_dw(NULL, ieviewModuleName, dbsName, proto->getHistoryFlags());
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
mir_strcpy(tmpPath, proto->getHistoryBackgroundFilename());
PathToRelative(proto->getHistoryBackgroundFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
mir_strcpy(tmpPath, proto->getHistoryCssFilename());
PathToRelative(proto->getHistoryCssFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
- mir_snprintf(dbsName, _countof(dbsName), "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
+ mir_snprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
mir_strcpy(tmpPath, proto->getHistoryTemplateFilename());
PathToRelative(proto->getHistoryTemplateFilename(), tmpPath);
db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 6a20622f41..b8f692cf18 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -186,7 +186,7 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr szNameOut = mir_strdup(" ");
szNameIn = mir_strdup(" ");
}
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.png", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.png", tempBase);
TCHAR szNoAvatarPath[MAX_PATH];
_tcsncpy_s(szNoAvatarPath, _A2T(protoSettings->getSRMMTemplateFilename()), _TRUNCATE);
TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
@@ -194,9 +194,9 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr *szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, _T("\\noavatar.png"));
if (_taccess(szNoAvatarPath, 0) == -1)
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.jpg", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.png", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.png", tempBase);
char *szNoAvatar = mir_utf8encode(tempStr);
char *szAvatarIn = getAvatar(event->hContact, szRealProto);
@@ -368,9 +368,9 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, *szNoAvatarPathTmp = 0;
mir_tstrcat(szNoAvatarPath, _T("\\noavatar.png"));
if (_taccess(szNoAvatarPath, 0) == -1)
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.jpg", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.jpg", tempBase);
else
- mir_snprintf(tempStr, _countof(tempStr), "%snoavatar.png", tempBase);
+ mir_snprintf(tempStr, "%snoavatar.png", tempBase);
char *szNoAvatar = mir_utf8encode(tempStr);
char *szAvatarIn = NULL;
@@ -426,12 +426,12 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, if (isSent) {
szAvatar = szAvatarOut;
szUIN = szUINOut;
- mir_snprintf(szCID, _countof(szCID), "%d", 0);
+ mir_snprintf(szCID, "%d", 0);
}
else {
szAvatar = szAvatarIn;
szUIN = szUINIn;
- mir_snprintf(szCID, _countof(szCID), "%d", (int)event->hContact);
+ mir_snprintf(szCID, "%d", (int)event->hContact);
}
tmpltName[0] = groupTemplate;
tmpltName[1] = NULL;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index a382dcf0af..8f8a8f9934 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -713,7 +713,7 @@ void ImportMeta(DBCachedContact *ccSrc) ccDst->pSubs[i] = MapContact(ccSrc->pSubs[i]);
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "Handle%d", i);
+ mir_snprintf(szSettingName, "Handle%d", i);
db_set_dw(hDest, META_PROTO, szSettingName, ccDst->pSubs[i]);
db_set_b(ccDst->pSubs[i], META_PROTO, "IsSubcontact", 1);
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index d4cad24695..edcda4e3e8 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -33,7 +33,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * {
// find in Miranda profile subfolders
TCHAR searchspec[MAX_PATH];
- mir_sntprintf(searchspec, _countof(searchspec), _T("%s\\*.*"), mirandaPath);
+ mir_sntprintf(searchspec, _T("%s\\*.*"), mirandaPath);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(searchspec, &fd);
@@ -52,7 +52,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * TCHAR buf[MAX_PATH], profile[MAX_PATH];
mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), mirandaPath, fd.cFileName, fd.cFileName);
if (_taccess(buf, 0) == 0) {
- mir_sntprintf(profile, _countof(profile), _T("%s.dat"), fd.cFileName);
+ mir_sntprintf(profile, _T("%s.dat"), fd.cFileName);
int i = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)profile);
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)mir_tstrdup(buf));
diff --git a/plugins/KeyboardNotify/src/keyboard.cpp b/plugins/KeyboardNotify/src/keyboard.cpp index fba56a5d6c..1b11915e45 100644 --- a/plugins/KeyboardNotify/src/keyboard.cpp +++ b/plugins/KeyboardNotify/src/keyboard.cpp @@ -40,11 +40,11 @@ BOOL OpenKeyboardDevice() TCHAR aux1[MAX_PATH+1], aux2[MAX_PATH+1];
do {
- mir_sntprintf(aux1, _countof(aux1), _T("Kbd%d"), i);
- mir_sntprintf(aux2, _countof(aux2), _T("\\Device\\KeyboardClass%d"), i);
+ mir_sntprintf(aux1, _T("Kbd%d"), i);
+ mir_sntprintf(aux2, _T("\\Device\\KeyboardClass%d"), i);
DefineDosDevice(DDD_RAW_TARGET_PATH, aux1, aux2);
- mir_sntprintf(aux1, _countof(aux1), _T("\\\\.\\Kbd%d"), i);
+ mir_sntprintf(aux1, _T("\\\\.\\Kbd%d"), i);
hKbdDev[i] = CreateFile(aux1, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
} while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES);
@@ -80,7 +80,7 @@ void CloseKeyboardDevice() if (hKbdDev[i] != INVALID_HANDLE_VALUE)
CloseHandle(hKbdDev[i]);
- mir_sntprintf(aux, _countof(aux), _T("Kbd%d"), i);
+ mir_sntprintf(aux, _T("Kbd%d"), i);
DefineDosDevice(DDD_REMOVE_DEFINITION, aux, NULL);
} while (hKbdDev[i] != INVALID_HANDLE_VALUE && ++i < MAX_KBDHANDLES);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 183aeb0f4e..0ae9e613f0 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -721,9 +721,9 @@ static int ModulesLoaded(WPARAM, LPARAM) // Create some synchronisation objects createEventPrefix(eventPrefix, MAX_PATH - 11); - mir_sntprintf(eventName, _countof(eventName), _T("%s/FlashEvent"), eventPrefix); + mir_sntprintf(eventName, _T("%s/FlashEvent"), eventPrefix); hFlashEvent = CreateEvent(NULL, FALSE, FALSE, eventName); - mir_sntprintf(eventName, _countof(eventName), _T("%s/ExitEvent"), eventPrefix); + mir_sntprintf(eventName, _T("%s/ExitEvent"), eventPrefix); hExitEvent = CreateEvent(NULL, FALSE, FALSE, eventName); hThread = mir_forkthread(FlashThreadFunction, 0); diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 855b12087a..c781f6c380 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -779,11 +779,11 @@ void checkthread(void*) if (attSize) {
WCHAR field_attachments_UNICODE[MAX_FIELD];
- mir_sntprintf(field_attachments_UNICODE, _countof(field_attachments_UNICODE), TranslateW(L"Attachments: %d bytes"), attSize);
- mir_sntprintf(msgSubject, _countof(msgSubject), L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
+ mir_sntprintf(field_attachments_UNICODE, TranslateW(L"Attachments: %d bytes"), attSize);
+ mir_sntprintf(msgSubject, L"%S\n%s\n%s", field_date, field_subject_UNICODE, field_attachments_UNICODE);
}
else {
- mir_sntprintf(msgSubject, _countof(msgSubject), L"%S\n%s", field_date, field_subject_UNICODE);
+ mir_sntprintf(msgSubject, L"%S\n%s", field_date, field_subject_UNICODE);
}
//check if this is not filtered msg
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index f0d217e5da..fffb4499ad 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -300,7 +300,7 @@ int StatusMsgExists(MCONTACT hContact) for (int i = 0; i < _countof(statusMsg); i++) {
if (statusMsg[i].flag & 8)
- mir_snprintf(par, _countof(par), "%s/%s", module, statusMsg[i].name);
+ mir_snprintf(par, "%s/%s", module, statusMsg[i].name);
else
strncpy(par, statusMsg[i].name, _countof(par)-1);
@@ -342,9 +342,9 @@ void getIP(MCONTACT hContact, LPSTR szProto, LPSTR szIP) DWORD mIP = db_get_dw(hContact, szProto, "IP", 0);
DWORD rIP = db_get_dw(hContact, szProto, "RealIP", 0);
if (mIP)
- mir_snprintf(szmIP, _countof(szmIP), "External IP: %d.%d.%d.%d\r\n", mIP >> 24, (mIP >> 16) & 0xFF, (mIP >> 8) & 0xFF, mIP & 0xFF);
+ mir_snprintf(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP >> 24, (mIP >> 16) & 0xFF, (mIP >> 8) & 0xFF, mIP & 0xFF);
if (rIP)
- mir_snprintf(szrIP, _countof(szrIP), "Internal IP: %d.%d.%d.%d\r\n", rIP >> 24, (rIP >> 16) & 0xFF, (rIP >> 8) & 0xFF, rIP & 0xFF);
+ mir_snprintf(szrIP, "Internal IP: %d.%d.%d.%d\r\n", rIP >> 24, (rIP >> 16) & 0xFF, (rIP >> 8) & 0xFF, rIP & 0xFF);
mir_strcpy(szIP, szrIP);
mir_strcat(szIP, szmIP);
}
@@ -507,7 +507,7 @@ void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID) szID[MAX_IDLEN + 1] = 0;
}
- mir_sntprintf(buffer, _countof(buffer), _T("%s [%S]"), TranslateT("Copy ID"), szID);
+ mir_sntprintf(buffer, _T("%s [%S]"), TranslateT("Copy ID"), szID);
Menu_ModifyItem(hmenuCopyID, buffer, hIconCID);
}
else Menu_ModifyItem(hmenuCopyID, LPGENT("Copy ID"), hIconCID);
@@ -620,7 +620,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam, LPARAM lparam) buffer[0] = 0;
for (int i = 0; i < _countof(statusMsg); i++) {
if (statusMsg[i].flag & 8)
- mir_snprintf(par, _countof(par), "%s/%s", module, statusMsg[i].name);
+ mir_snprintf(par, "%s/%s", module, statusMsg[i].name);
else
strncpy(par, statusMsg[i].name, _countof(par) - 1);
diff --git a/plugins/MirFox/src/MirfoxMiranda.cpp b/plugins/MirFox/src/MirfoxMiranda.cpp index 06e02dd65c..5d5e851cc1 100644 --- a/plugins/MirFox/src/MirfoxMiranda.cpp +++ b/plugins/MirFox/src/MirfoxMiranda.cpp @@ -116,7 +116,7 @@ void CMirfoxMiranda::initializeSharedMemoryData(MirfoxData& mirfoxData, SharedMe } else {
mirfoxData.processCsmId = result.processCsmId;
wchar_t prefix[7];
- mir_sntprintf(prefix, _countof(prefix), L"MNG%d", result.processCsmId);
+ mir_sntprintf(prefix, L"MNG%d", result.processCsmId);
logger->set6CharsPrefix(prefix);
}
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index 898cffe408..b9b14c92c8 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -42,9 +42,9 @@ INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact)); const TCHAR *name = contact_get_nameT(hContact); - mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto); + mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto); SetWindowText(hwndDlg, title); - mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_PROGRESS_DESC), name, proto); + mir_sntprintf(title, TranslateT(LANG_SMP_PROGRESS_DESC), name, proto); mir_free(proto); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEADPRO, title); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); @@ -329,7 +329,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA MCONTACT hContact = (UINT_PTR)context->app_data; TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + mir_sntprintf(title, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, title); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title); @@ -421,7 +421,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_QUESTION), 255) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { TCHAR msg[512]; - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(msg); } else { @@ -445,7 +445,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA else if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_PASSWORD), 255) == 0) { if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) { TCHAR msg[512]; - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact)); ShowError(msg); } else { @@ -746,7 +746,7 @@ unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, "verified"); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; @@ -755,7 +755,7 @@ unsigned int CALLBACK verify_context_thread(void *param) lib_cs_lock(); otrl_context_set_trust(context->active_fingerprint, NULL); otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename)); - mir_sntprintf(msg, _countof(msg), TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); break; diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 2c727f9fbb..217e535f07 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -750,8 +750,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, _countof(buff) - 1, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); - buff[_countof(buff) - 1] = '\0'; + mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else { @@ -781,8 +780,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w TCHAR buff[1024], hash[45]; otrl_privkey_hash_to_humanT(hash, it->first->fingerprint); PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact)); - mir_sntprintf(buff, _countof(buff) - 1, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); - buff[_countof(buff) - 1] = '\0'; + mir_sntprintf(buff, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName); ShowError(buff); } else otrl_context_forget_fingerprint(it->first, 1); diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 94f2dc0919..a624520afd 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -68,7 +68,7 @@ void VerifyFingerprintMessage(ConnContext *context, bool verify) { MCONTACT hContact = (UINT_PTR)context->app_data; TCHAR msg[1024]; - mir_sntprintf(msg, _countof(msg), (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); + mir_sntprintf(msg, (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact)); ShowMessage(hContact, msg); SetEncryptionStatus(hContact, otr_context_get_trust(context)); } @@ -155,7 +155,7 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA if ( !options.bHavePopups) { TCHAR title[256]; - mir_sntprintf(title, _countof(title), _T("%s Message"), _T(MODULENAME)); + mir_sntprintf(title, _T("%s Message"), _T(MODULENAME)); if(line1 && line2) { int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3); @@ -205,7 +205,7 @@ void ShowWarning(TCHAR *msg) { if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL; if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB; - mir_sntprintf(buffer, _countof(buffer), _T("%s Warning"), _T(MODULENAME)); + mir_sntprintf(buffer, _T("%s Warning"), _T(MODULENAME)); TCHAR *message; switch(disp) { @@ -251,7 +251,7 @@ void ShowError(TCHAR *msg) { if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL; if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB; - mir_sntprintf(buffer, _countof(buffer), _T("%s Error"), _T(MODULENAME)); + mir_sntprintf(buffer, _T("%s Error"), _T(MODULENAME)); TCHAR *message; diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 48f9da6346..337cad2886 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -22,7 +22,7 @@ void CConfig::Initialize() {
CConfig::LoadSettings();
m_hOptionsInitHook = HookEvent(ME_OPT_INITIALISE, CConfig::InitOptionsDialog);
-
+
}
void CConfig::Shutdown()
@@ -33,80 +33,80 @@ void CConfig::Shutdown() void CConfig::LoadSettings()
{
- m_abBoolSettings[SKIP_DRIVER_ERROR] = db_get_dw(NULL, "MirandaG15", "SkipDriverError",0) != 0;
-
- m_abBoolSettings[SCREENSAVER_LOCK] = db_get_dw(NULL, "MirandaG15", "ScreensaverLock",1) != 0;
- m_abBoolSettings[NOTIFY_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "NotifyShowProto",0) != 0;
- m_abBoolSettings[NOTIFY_NICKCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoff",0) != 0;
- m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoff",0) != 0;
-
- m_abBoolSettings[TRANSITIONS] = db_get_dw(NULL, "MirandaG15", "Transitions",0) != 0;
- m_abBoolSettings[TIMESTAMP_SECONDS] = db_get_dw(NULL, "MirandaG15", "TimestampSeconds",0) != 0;
- m_abBoolSettings[SESSION_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "SessionTimestamps",0) != 0;
- m_abBoolSettings[NOTIFY_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "NotifyTimestamps",0) != 0;
-
- m_abBoolSettings[CONTROL_BACKLIGHTS] = db_get_dw(NULL, "MirandaG15", "ControlBacklights",0) != 0;
- m_abBoolSettings[HOOK_VOLUMEWHEEL] = db_get_dw(NULL, "MirandaG15", "HookVolumeWheel",0) != 0;
-
- m_abBoolSettings[CLIST_SELECTION] = db_get_dw(NULL, "MirandaG15", "CListSelection",1) != 0;
- m_abBoolSettings[CLIST_COLUMNS] = db_get_dw(NULL, "MirandaG15", "CListColumns",0) != 0;
- m_abBoolSettings[CLIST_HIDEOFFLINE] = db_get_dw(NULL, "MirandaG15", "CListHideOffline",1) != 0;
- m_abBoolSettings[CLIST_USEIGNORE] = db_get_dw(NULL, "MirandaG15", "CListUseIgnore",1) != 0;
- m_abBoolSettings[CLIST_USEGROUPS] = db_get_dw(NULL, "MirandaG15", "CListUseGroups",1) != 0;
- m_abBoolSettings[CLIST_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "CListShowProto",1) != 0;
- m_abBoolSettings[CLIST_DRAWLINES] = db_get_dw(NULL, "MirandaG15", "CListDrawLines",1) != 0;
- m_abBoolSettings[CLIST_COUNTERS] = db_get_dw(NULL, "MirandaG15", "CListCounters",1) != 0;
- m_abBoolSettings[CLIST_POSITION] = db_get_dw(NULL, "MirandaG15", "CListPosition",0) != 0;
-
- m_abBoolSettings[NOTIFY_IRC_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCMessages", 1) != 0;
- m_abBoolSettings[NOTIFY_IRC_USERS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCUsers", 0) != 0;
- m_abBoolSettings[NOTIFY_IRC_EMOTES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCEmotes", 0) != 0;
- m_abBoolSettings[NOTIFY_IRC_NOTICES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCNotices", 1) != 0;
- m_abBoolSettings[NOTIFY_IRC_CHANNEL] = db_get_dw(NULL, "MirandaG15", "NotifyIRCChannel", 0) != 0;
- m_abBoolSettings[NOTIFY_IRC_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCStatus", 0) != 0;
-
- m_abBoolSettings[NOTIFY_PROTO_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyProtoStatus", 0) != 0;
- m_abBoolSettings[NOTIFY_PROTO_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOn", 1) != 0;
- m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] =db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOff", 1) != 0;
- m_abBoolSettings[NOTIFY_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyMessages", 1) != 0;
- m_abBoolSettings[NOTIFY_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySignOn", 1) != 0;
- m_abBoolSettings[NOTIFY_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySignOff", 1) != 0;
- m_abBoolSettings[NOTIFY_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyStatus", 0) != 0;
- m_abBoolSettings[NOTIFY_SKIP_MESSAGES] =db_get_dw(NULL, "MirandaG15", "NotifySkipMessages", 1) != 0;
- m_abBoolSettings[NOTIFY_SKIP_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOn", 0) != 0;
- m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOff", 0) != 0;
- m_abBoolSettings[NOTIFY_SKIP_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifySkipStatus", 1) != 0;
- m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = db_get_dw(NULL, "MirandaG15", "NotifyNoSkipReply",1) != 0;
- m_abBoolSettings[NOTIFY_URL] = db_get_dw(NULL, "MirandaG15", "NotifyURL", 1) != 0;
- m_abBoolSettings[NOTIFY_FILE] = db_get_dw(NULL, "MirandaG15", "NotifyFile", 1) != 0;
- m_abBoolSettings[NOTIFY_CONTACTS] = db_get_dw(NULL, "MirandaG15", "NotifyContacts", 1) != 0;
-
- m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionScrollMaximized", 1) != 0;
- m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionReplyMaximized", 1) != 0;
- m_abBoolSettings[SESSION_LOADDB] = db_get_dw(NULL, "MirandaG15", "SessionLoadDB", 0) != 0;
- m_abBoolSettings[SESSION_MARKREAD] = db_get_dw(NULL, "MirandaG15", "SessionMarkRead", 1) != 0;
- m_abBoolSettings[SESSION_SENDRETURN] = db_get_dw(NULL, "MirandaG15", "SessionSendReturn",0) != 0;
- m_abBoolSettings[SESSION_SHOWTYPING] = db_get_dw(NULL, "MirandaG15", "SessionShowTyping",1) != 0;
- m_abBoolSettings[SESSION_SENDTYPING] = db_get_dw(NULL, "MirandaG15", "SessionSendTyping",1) != 0;
- m_abBoolSettings[SESSION_SYMBOLS] = db_get_dw(NULL, "MirandaG15", "SessionSymbols",0) != 0;
- m_abBoolSettings[SESSION_CLOSE] = db_get_dw(NULL, "MirandaG15", "SessionClose",1) != 0;
-
- m_abBoolSettings[SHOW_LABELS] = db_get_dw(NULL, "MirandaG15", "ShowLabels", 1) != 0;
- m_abBoolSettings[MAXIMIZED_TITLE] = db_get_dw(NULL, "MirandaG15", "MaximizedTitle", 0) != 0;
- m_abBoolSettings[MAXIMIZED_LABELS] = db_get_dw(NULL, "MirandaG15", "MaximizedLabels", 1) != 0;
+ m_abBoolSettings[SKIP_DRIVER_ERROR] = db_get_dw(NULL, "MirandaG15", "SkipDriverError", 0) != 0;
+
+ m_abBoolSettings[SCREENSAVER_LOCK] = db_get_dw(NULL, "MirandaG15", "ScreensaverLock", 1) != 0;
+ m_abBoolSettings[NOTIFY_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "NotifyShowProto", 0) != 0;
+ m_abBoolSettings[NOTIFY_NICKCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoff", 0) != 0;
+ m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoff", 0) != 0;
+
+ m_abBoolSettings[TRANSITIONS] = db_get_dw(NULL, "MirandaG15", "Transitions", 0) != 0;
+ m_abBoolSettings[TIMESTAMP_SECONDS] = db_get_dw(NULL, "MirandaG15", "TimestampSeconds", 0) != 0;
+ m_abBoolSettings[SESSION_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "SessionTimestamps", 0) != 0;
+ m_abBoolSettings[NOTIFY_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "NotifyTimestamps", 0) != 0;
+
+ m_abBoolSettings[CONTROL_BACKLIGHTS] = db_get_dw(NULL, "MirandaG15", "ControlBacklights", 0) != 0;
+ m_abBoolSettings[HOOK_VOLUMEWHEEL] = db_get_dw(NULL, "MirandaG15", "HookVolumeWheel", 0) != 0;
+
+ m_abBoolSettings[CLIST_SELECTION] = db_get_dw(NULL, "MirandaG15", "CListSelection", 1) != 0;
+ m_abBoolSettings[CLIST_COLUMNS] = db_get_dw(NULL, "MirandaG15", "CListColumns", 0) != 0;
+ m_abBoolSettings[CLIST_HIDEOFFLINE] = db_get_dw(NULL, "MirandaG15", "CListHideOffline", 1) != 0;
+ m_abBoolSettings[CLIST_USEIGNORE] = db_get_dw(NULL, "MirandaG15", "CListUseIgnore", 1) != 0;
+ m_abBoolSettings[CLIST_USEGROUPS] = db_get_dw(NULL, "MirandaG15", "CListUseGroups", 1) != 0;
+ m_abBoolSettings[CLIST_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "CListShowProto", 1) != 0;
+ m_abBoolSettings[CLIST_DRAWLINES] = db_get_dw(NULL, "MirandaG15", "CListDrawLines", 1) != 0;
+ m_abBoolSettings[CLIST_COUNTERS] = db_get_dw(NULL, "MirandaG15", "CListCounters", 1) != 0;
+ m_abBoolSettings[CLIST_POSITION] = db_get_dw(NULL, "MirandaG15", "CListPosition", 0) != 0;
+
+ m_abBoolSettings[NOTIFY_IRC_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCMessages", 1) != 0;
+ m_abBoolSettings[NOTIFY_IRC_USERS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCUsers", 0) != 0;
+ m_abBoolSettings[NOTIFY_IRC_EMOTES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCEmotes", 0) != 0;
+ m_abBoolSettings[NOTIFY_IRC_NOTICES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCNotices", 1) != 0;
+ m_abBoolSettings[NOTIFY_IRC_CHANNEL] = db_get_dw(NULL, "MirandaG15", "NotifyIRCChannel", 0) != 0;
+ m_abBoolSettings[NOTIFY_IRC_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCStatus", 0) != 0;
+
+ m_abBoolSettings[NOTIFY_PROTO_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyProtoStatus", 0) != 0;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOn", 1) != 0;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOff", 1) != 0;
+ m_abBoolSettings[NOTIFY_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyMessages", 1) != 0;
+ m_abBoolSettings[NOTIFY_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySignOn", 1) != 0;
+ m_abBoolSettings[NOTIFY_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySignOff", 1) != 0;
+ m_abBoolSettings[NOTIFY_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyStatus", 0) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifySkipMessages", 1) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOn", 0) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOff", 0) != 0;
+ m_abBoolSettings[NOTIFY_SKIP_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifySkipStatus", 1) != 0;
+ m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = db_get_dw(NULL, "MirandaG15", "NotifyNoSkipReply", 1) != 0;
+ m_abBoolSettings[NOTIFY_URL] = db_get_dw(NULL, "MirandaG15", "NotifyURL", 1) != 0;
+ m_abBoolSettings[NOTIFY_FILE] = db_get_dw(NULL, "MirandaG15", "NotifyFile", 1) != 0;
+ m_abBoolSettings[NOTIFY_CONTACTS] = db_get_dw(NULL, "MirandaG15", "NotifyContacts", 1) != 0;
+
+ m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionScrollMaximized", 1) != 0;
+ m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionReplyMaximized", 1) != 0;
+ m_abBoolSettings[SESSION_LOADDB] = db_get_dw(NULL, "MirandaG15", "SessionLoadDB", 0) != 0;
+ m_abBoolSettings[SESSION_MARKREAD] = db_get_dw(NULL, "MirandaG15", "SessionMarkRead", 1) != 0;
+ m_abBoolSettings[SESSION_SENDRETURN] = db_get_dw(NULL, "MirandaG15", "SessionSendReturn", 0) != 0;
+ m_abBoolSettings[SESSION_SHOWTYPING] = db_get_dw(NULL, "MirandaG15", "SessionShowTyping", 1) != 0;
+ m_abBoolSettings[SESSION_SENDTYPING] = db_get_dw(NULL, "MirandaG15", "SessionSendTyping", 1) != 0;
+ m_abBoolSettings[SESSION_SYMBOLS] = db_get_dw(NULL, "MirandaG15", "SessionSymbols", 0) != 0;
+ m_abBoolSettings[SESSION_CLOSE] = db_get_dw(NULL, "MirandaG15", "SessionClose", 1) != 0;
+
+ m_abBoolSettings[SHOW_LABELS] = db_get_dw(NULL, "MirandaG15", "ShowLabels", 1) != 0;
+ m_abBoolSettings[MAXIMIZED_TITLE] = db_get_dw(NULL, "MirandaG15", "MaximizedTitle", 0) != 0;
+ m_abBoolSettings[MAXIMIZED_LABELS] = db_get_dw(NULL, "MirandaG15", "MaximizedLabels", 1) != 0;
m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", 10);
m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", 10);
- m_aiIntSettings[NOTIFY_DURATION] = db_get_dw(NULL, "MirandaG15", "NotifyDuration", 4);
- m_aiIntSettings[NOTIFY_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "NotifyLogSize", 10);
- m_aiIntSettings[SESSION_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "SessionLogSize", 10);
- m_aiIntSettings[SESSION_AUTOSCROLL] = db_get_dw(NULL, "MirandaG15", "SessionAutoScroll", SESSION_AUTOSCROLL_FIRST);
- m_aiIntSettings[SESSION_CLOSETIMER] = db_get_dw(NULL, "MirandaG15", "SessionCloseTimer", 15);
- m_aiIntSettings[NOTIFY_TITLE] = db_get_dw(NULL, "MirandaG15", "NotifyTitle", NOTIFY_TITLE_NAME);
- m_aiIntSettings[CLIST_GA] = db_get_dw(NULL, "MirandaG15", "CListGA",CLIST_GA_NONE);
- m_aiIntSettings[DEVICE] = db_get_dw(NULL, "MirandaG15", "Device",0);
-
- for(int i=0;i<FONT_SETTINGS;i++)
+ m_aiIntSettings[NOTIFY_DURATION] = db_get_dw(NULL, "MirandaG15", "NotifyDuration", 4);
+ m_aiIntSettings[NOTIFY_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "NotifyLogSize", 10);
+ m_aiIntSettings[SESSION_LOGSIZE] = db_get_dw(NULL, "MirandaG15", "SessionLogSize", 10);
+ m_aiIntSettings[SESSION_AUTOSCROLL] = db_get_dw(NULL, "MirandaG15", "SessionAutoScroll", SESSION_AUTOSCROLL_FIRST);
+ m_aiIntSettings[SESSION_CLOSETIMER] = db_get_dw(NULL, "MirandaG15", "SessionCloseTimer", 15);
+ m_aiIntSettings[NOTIFY_TITLE] = db_get_dw(NULL, "MirandaG15", "NotifyTitle", NOTIFY_TITLE_NAME);
+ m_aiIntSettings[CLIST_GA] = db_get_dw(NULL, "MirandaG15", "CListGA", CLIST_GA_NONE);
+ m_aiIntSettings[DEVICE] = db_get_dw(NULL, "MirandaG15", "Device", 0);
+
+ for (int i = 0; i < FONT_SETTINGS; i++)
LoadFontSettings(i);
// Load protocol specific settings
@@ -117,8 +117,7 @@ void CConfig::LoadSettings() tstring strSetting;
Proto_EnumAccounts(&iCount, &ppAccounts);
- for(int i=0;i<iCount;i++)
- {
+ for (int i = 0; i < iCount; i++) {
/*if(ppProtocolDescriptor[i]->type != PROTOTYPE_PROTOCOL)
continue;*/
if (ppAccounts[i]->bIsEnabled == 0)
@@ -127,220 +126,223 @@ void CConfig::LoadSettings() iProtoCount++;
pProtoFilter = new CProtoFilter();
pProtoFilter->strName = toTstring(ppAccounts[i]->szModuleName);
-
+
strSetting = _T("ProtoFilter_") + pProtoFilter->strName;
- pProtoFilter->bNotificationFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1) != 0;
+ pProtoFilter->bNotificationFilter = db_get_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), 1) != 0;
strSetting = _T("ProtoCListFilter_") + pProtoFilter->strName;
- pProtoFilter->bContactlistFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1) != 0;
+ pProtoFilter->bContactlistFilter = db_get_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), 1) != 0;
m_ProtoList.push_back(pProtoFilter);
}
}
void CConfig::SaveSettings()
{
- db_set_dw(NULL, "MirandaG15", "SkipDriverError", m_abBoolSettings[SKIP_DRIVER_ERROR]);
-
- db_set_dw(NULL, "MirandaG15", "ScreensaverLock", m_abBoolSettings[SCREENSAVER_LOCK]);
- db_set_dw(NULL, "MirandaG15", "NotifyShowProto", m_abBoolSettings[NOTIFY_SHOWPROTO]);
- db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoff", m_abBoolSettings[NOTIFY_CHANNELCUTOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifyNickCutoff", m_abBoolSettings[NOTIFY_NICKCUTOFF]);
- db_set_dw(NULL, "MirandaG15", "Transitions", m_abBoolSettings[TRANSITIONS]);
- db_set_dw(NULL, "MirandaG15", "TimestampSeconds", m_abBoolSettings[TIMESTAMP_SECONDS]);
- db_set_dw(NULL, "MirandaG15", "SessionTimestamps", m_abBoolSettings[SESSION_TIMESTAMPS]);
- db_set_dw(NULL, "MirandaG15", "NotifyTimestamps", m_abBoolSettings[NOTIFY_TIMESTAMPS]);
-
- db_set_dw(NULL, "MirandaG15", "ControlBacklights", m_abBoolSettings[CONTROL_BACKLIGHTS]);
- db_set_dw(NULL, "MirandaG15", "HookVolumeWheel", m_abBoolSettings[HOOK_VOLUMEWHEEL]);
-
- db_set_dw(NULL, "MirandaG15", "CListSelection", m_abBoolSettings[CLIST_SELECTION]);
- db_set_dw(NULL, "MirandaG15", "CListColumns", m_abBoolSettings[CLIST_COLUMNS]);
- db_set_dw(NULL, "MirandaG15", "CListHideOffline", m_abBoolSettings[CLIST_HIDEOFFLINE]);
- db_set_dw(NULL, "MirandaG15", "CListUseIgnore", m_abBoolSettings[CLIST_USEIGNORE]);
- db_set_dw(NULL, "MirandaG15", "CListUseGroups", m_abBoolSettings[CLIST_USEGROUPS]);
- db_set_dw(NULL, "MirandaG15", "CListShowProto", m_abBoolSettings[CLIST_SHOWPROTO]);
- db_set_dw(NULL, "MirandaG15", "CListDrawLines", m_abBoolSettings[CLIST_DRAWLINES]);
- db_set_dw(NULL, "MirandaG15", "CListCounters", m_abBoolSettings[CLIST_COUNTERS]);
- db_set_dw(NULL, "MirandaG15", "CListPosition", m_abBoolSettings[CLIST_POSITION]);
-
- db_set_dw(NULL, "MirandaG15", "NotifyIRCMessages", m_abBoolSettings[NOTIFY_IRC_MESSAGES]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCUsers", m_abBoolSettings[NOTIFY_IRC_USERS]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCEmotes", m_abBoolSettings[NOTIFY_IRC_EMOTES]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCNotices", m_abBoolSettings[NOTIFY_IRC_NOTICES]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCChannel", m_abBoolSettings[NOTIFY_IRC_CHANNEL]);
- db_set_dw(NULL, "MirandaG15", "NotifyIRCStatus", m_abBoolSettings[NOTIFY_IRC_STATUS]);
-
- db_set_dw(NULL, "MirandaG15", "NotifyProtoStatus", m_abBoolSettings[NOTIFY_PROTO_STATUS]);
- db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOn", m_abBoolSettings[NOTIFY_PROTO_SIGNON]);
- db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOff",m_abBoolSettings[NOTIFY_PROTO_SIGNOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifyMessages", m_abBoolSettings[NOTIFY_MESSAGES]);
- db_set_dw(NULL, "MirandaG15", "NotifySignOn", m_abBoolSettings[NOTIFY_SIGNON]);
- db_set_dw(NULL, "MirandaG15", "NotifySignOff", m_abBoolSettings[NOTIFY_SIGNOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifyStatus", m_abBoolSettings[NOTIFY_STATUS]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipMessages", m_abBoolSettings[NOTIFY_SKIP_MESSAGES]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipSignOn", m_abBoolSettings[NOTIFY_SKIP_SIGNON]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipSignOff", m_abBoolSettings[NOTIFY_SKIP_SIGNOFF]);
- db_set_dw(NULL, "MirandaG15", "NotifySkipStatus", m_abBoolSettings[NOTIFY_SKIP_STATUS]);
- db_set_dw(NULL, "MirandaG15", "NotifyNoSkipReply", m_abBoolSettings[NOTIFY_NO_SKIP_REPLY]);
- db_set_dw(NULL, "MirandaG15", "NotifyURL", m_abBoolSettings[NOTIFY_URL]);
- db_set_dw(NULL, "MirandaG15", "NotifyFile", m_abBoolSettings[NOTIFY_FILE]);
- db_set_dw(NULL, "MirandaG15", "NotifyContacts", m_abBoolSettings[NOTIFY_CONTACTS]);
-
- db_set_dw(NULL, "MirandaG15", "SessionScrollMaximized",m_abBoolSettings[SESSION_SCROLL_MAXIMIZED]);
- db_set_dw(NULL, "MirandaG15", "SessionReplyMaximized",m_abBoolSettings[SESSION_REPLY_MAXIMIZED]);
- db_set_dw(NULL, "MirandaG15", "SessionShowTyping", m_abBoolSettings[SESSION_SHOWTYPING]);
- db_set_dw(NULL, "MirandaG15", "SessionSendTyping", m_abBoolSettings[SESSION_SENDTYPING]);
- db_set_dw(NULL, "MirandaG15", "SessionLoadDB", m_abBoolSettings[SESSION_LOADDB]);
- db_set_dw(NULL, "MirandaG15", "SessionSendReturn", m_abBoolSettings[SESSION_SENDRETURN]);
- db_set_dw(NULL, "MirandaG15", "SessionMarkRead", m_abBoolSettings[SESSION_MARKREAD]);
- db_set_dw(NULL, "MirandaG15", "SessionSymbols", m_abBoolSettings[SESSION_SYMBOLS]);
- db_set_dw(NULL, "MirandaG15", "SessionClose", m_abBoolSettings[SESSION_CLOSE]);
-
- db_set_dw(NULL, "MirandaG15", "ShowLabels", m_abBoolSettings[SHOW_LABELS]);
- db_set_dw(NULL, "MirandaG15", "MaximizedTitle", m_abBoolSettings[MAXIMIZED_TITLE]);
- db_set_dw(NULL, "MirandaG15", "MaximizedLabels", m_abBoolSettings[MAXIMIZED_LABELS]);
-
- db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET]);
- db_set_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET]);
- db_set_dw(NULL, "MirandaG15", "NotifyDuration", m_aiIntSettings[NOTIFY_DURATION]);
- db_set_dw(NULL, "MirandaG15", "NotifyLogSize", m_aiIntSettings[NOTIFY_LOGSIZE]);
- db_set_dw(NULL, "MirandaG15", "SessionLogSize", m_aiIntSettings[SESSION_LOGSIZE]);
- db_set_dw(NULL, "MirandaG15", "NotifyTitle", m_aiIntSettings[NOTIFY_TITLE]);
- db_set_dw(NULL, "MirandaG15", "SessionAutoScroll", m_aiIntSettings[SESSION_AUTOSCROLL]);
- db_set_dw(NULL, "MirandaG15", "SessionCloseTimer", m_aiIntSettings[SESSION_CLOSETIMER]);
- db_set_dw(NULL, "MirandaG15", "CListGA", m_aiIntSettings[CLIST_GA]);
- db_set_dw(NULL, "MirandaG15", "Device", m_aiIntSettings[DEVICE]);
+ db_set_dw(NULL, "MirandaG15", "SkipDriverError", m_abBoolSettings[SKIP_DRIVER_ERROR]);
+
+ db_set_dw(NULL, "MirandaG15", "ScreensaverLock", m_abBoolSettings[SCREENSAVER_LOCK]);
+ db_set_dw(NULL, "MirandaG15", "NotifyShowProto", m_abBoolSettings[NOTIFY_SHOWPROTO]);
+ db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoff", m_abBoolSettings[NOTIFY_CHANNELCUTOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifyNickCutoff", m_abBoolSettings[NOTIFY_NICKCUTOFF]);
+ db_set_dw(NULL, "MirandaG15", "Transitions", m_abBoolSettings[TRANSITIONS]);
+ db_set_dw(NULL, "MirandaG15", "TimestampSeconds", m_abBoolSettings[TIMESTAMP_SECONDS]);
+ db_set_dw(NULL, "MirandaG15", "SessionTimestamps", m_abBoolSettings[SESSION_TIMESTAMPS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyTimestamps", m_abBoolSettings[NOTIFY_TIMESTAMPS]);
+
+ db_set_dw(NULL, "MirandaG15", "ControlBacklights", m_abBoolSettings[CONTROL_BACKLIGHTS]);
+ db_set_dw(NULL, "MirandaG15", "HookVolumeWheel", m_abBoolSettings[HOOK_VOLUMEWHEEL]);
+
+ db_set_dw(NULL, "MirandaG15", "CListSelection", m_abBoolSettings[CLIST_SELECTION]);
+ db_set_dw(NULL, "MirandaG15", "CListColumns", m_abBoolSettings[CLIST_COLUMNS]);
+ db_set_dw(NULL, "MirandaG15", "CListHideOffline", m_abBoolSettings[CLIST_HIDEOFFLINE]);
+ db_set_dw(NULL, "MirandaG15", "CListUseIgnore", m_abBoolSettings[CLIST_USEIGNORE]);
+ db_set_dw(NULL, "MirandaG15", "CListUseGroups", m_abBoolSettings[CLIST_USEGROUPS]);
+ db_set_dw(NULL, "MirandaG15", "CListShowProto", m_abBoolSettings[CLIST_SHOWPROTO]);
+ db_set_dw(NULL, "MirandaG15", "CListDrawLines", m_abBoolSettings[CLIST_DRAWLINES]);
+ db_set_dw(NULL, "MirandaG15", "CListCounters", m_abBoolSettings[CLIST_COUNTERS]);
+ db_set_dw(NULL, "MirandaG15", "CListPosition", m_abBoolSettings[CLIST_POSITION]);
+
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCMessages", m_abBoolSettings[NOTIFY_IRC_MESSAGES]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCUsers", m_abBoolSettings[NOTIFY_IRC_USERS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCEmotes", m_abBoolSettings[NOTIFY_IRC_EMOTES]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCNotices", m_abBoolSettings[NOTIFY_IRC_NOTICES]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCChannel", m_abBoolSettings[NOTIFY_IRC_CHANNEL]);
+ db_set_dw(NULL, "MirandaG15", "NotifyIRCStatus", m_abBoolSettings[NOTIFY_IRC_STATUS]);
+
+ db_set_dw(NULL, "MirandaG15", "NotifyProtoStatus", m_abBoolSettings[NOTIFY_PROTO_STATUS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOn", m_abBoolSettings[NOTIFY_PROTO_SIGNON]);
+ db_set_dw(NULL, "MirandaG15", "NotifyProtoSignOff", m_abBoolSettings[NOTIFY_PROTO_SIGNOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifyMessages", m_abBoolSettings[NOTIFY_MESSAGES]);
+ db_set_dw(NULL, "MirandaG15", "NotifySignOn", m_abBoolSettings[NOTIFY_SIGNON]);
+ db_set_dw(NULL, "MirandaG15", "NotifySignOff", m_abBoolSettings[NOTIFY_SIGNOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifyStatus", m_abBoolSettings[NOTIFY_STATUS]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipMessages", m_abBoolSettings[NOTIFY_SKIP_MESSAGES]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipSignOn", m_abBoolSettings[NOTIFY_SKIP_SIGNON]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipSignOff", m_abBoolSettings[NOTIFY_SKIP_SIGNOFF]);
+ db_set_dw(NULL, "MirandaG15", "NotifySkipStatus", m_abBoolSettings[NOTIFY_SKIP_STATUS]);
+ db_set_dw(NULL, "MirandaG15", "NotifyNoSkipReply", m_abBoolSettings[NOTIFY_NO_SKIP_REPLY]);
+ db_set_dw(NULL, "MirandaG15", "NotifyURL", m_abBoolSettings[NOTIFY_URL]);
+ db_set_dw(NULL, "MirandaG15", "NotifyFile", m_abBoolSettings[NOTIFY_FILE]);
+ db_set_dw(NULL, "MirandaG15", "NotifyContacts", m_abBoolSettings[NOTIFY_CONTACTS]);
+
+ db_set_dw(NULL, "MirandaG15", "SessionScrollMaximized", m_abBoolSettings[SESSION_SCROLL_MAXIMIZED]);
+ db_set_dw(NULL, "MirandaG15", "SessionReplyMaximized", m_abBoolSettings[SESSION_REPLY_MAXIMIZED]);
+ db_set_dw(NULL, "MirandaG15", "SessionShowTyping", m_abBoolSettings[SESSION_SHOWTYPING]);
+ db_set_dw(NULL, "MirandaG15", "SessionSendTyping", m_abBoolSettings[SESSION_SENDTYPING]);
+ db_set_dw(NULL, "MirandaG15", "SessionLoadDB", m_abBoolSettings[SESSION_LOADDB]);
+ db_set_dw(NULL, "MirandaG15", "SessionSendReturn", m_abBoolSettings[SESSION_SENDRETURN]);
+ db_set_dw(NULL, "MirandaG15", "SessionMarkRead", m_abBoolSettings[SESSION_MARKREAD]);
+ db_set_dw(NULL, "MirandaG15", "SessionSymbols", m_abBoolSettings[SESSION_SYMBOLS]);
+ db_set_dw(NULL, "MirandaG15", "SessionClose", m_abBoolSettings[SESSION_CLOSE]);
+
+ db_set_dw(NULL, "MirandaG15", "ShowLabels", m_abBoolSettings[SHOW_LABELS]);
+ db_set_dw(NULL, "MirandaG15", "MaximizedTitle", m_abBoolSettings[MAXIMIZED_TITLE]);
+ db_set_dw(NULL, "MirandaG15", "MaximizedLabels", m_abBoolSettings[MAXIMIZED_LABELS]);
+
+ db_set_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET]);
+ db_set_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET]);
+ db_set_dw(NULL, "MirandaG15", "NotifyDuration", m_aiIntSettings[NOTIFY_DURATION]);
+ db_set_dw(NULL, "MirandaG15", "NotifyLogSize", m_aiIntSettings[NOTIFY_LOGSIZE]);
+ db_set_dw(NULL, "MirandaG15", "SessionLogSize", m_aiIntSettings[SESSION_LOGSIZE]);
+ db_set_dw(NULL, "MirandaG15", "NotifyTitle", m_aiIntSettings[NOTIFY_TITLE]);
+ db_set_dw(NULL, "MirandaG15", "SessionAutoScroll", m_aiIntSettings[SESSION_AUTOSCROLL]);
+ db_set_dw(NULL, "MirandaG15", "SessionCloseTimer", m_aiIntSettings[SESSION_CLOSETIMER]);
+ db_set_dw(NULL, "MirandaG15", "CListGA", m_aiIntSettings[CLIST_GA]);
+ db_set_dw(NULL, "MirandaG15", "Device", m_aiIntSettings[DEVICE]);
// Save font settings
- for(int i=0;i<FONT_SETTINGS;i++)
+ for (int i = 0; i < FONT_SETTINGS; i++)
SaveFontSettings(i);
// save protocol specific settings
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
tstring strSetting = _T("");
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
strSetting = _T("ProtoFilter_") + (*iter)->strName;
- db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(),(*iter)->bNotificationFilter);
+ db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), (*iter)->bNotificationFilter);
strSetting = _T("ProtoCListFilter_") + (*iter)->strName;
- db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(),(*iter)->bContactlistFilter);
+ db_set_dw(NULL, "MirandaG15", toNarrowString(strSetting).c_str(), (*iter)->bContactlistFilter);
iter++;
}
// Notify OutputManager of configuration change
- if(CAppletManager::GetInstance()->IsInitialized())
+ if (CAppletManager::GetInstance()->IsInitialized())
CAppletManager::GetInstance()->OnConfigChanged();
}
void CConfig::UpdateFontSettings(int iFont)
{
- if(m_hSampleFont[iFont])
+ if (m_hSampleFont[iFont])
DeleteObject(m_hSampleFont[iFont]);
- m_hSampleFont[iFont] = CreateFontIndirect(&m_logfont[iFont]);
+ m_hSampleFont[iFont] = CreateFontIndirect(&m_logfont[iFont]);
HDC hDC = CreateCompatibleDC(NULL);
- SelectObject(hDC, m_hSampleFont[iFont]);
- GetTextMetrics(hDC,&m_tmFontInfo[iFont]);
+ SelectObject(hDC, m_hSampleFont[iFont]);
+ GetTextMetrics(hDC, &m_tmFontInfo[iFont]);
DeleteObject(hDC);
}
-void CConfig::OnConnectionChanged() {
+void CConfig::OnConnectionChanged()
+{
FillDeviceBox(CConfig::hDeviceBox);
}
int CConfig::InitOptionsDialog(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.position = 847000000;
- odp.hInstance = hInstance;
- odp.pszGroup = LPGEN("MirandaG15");
- odp.flags = ODPF_BOLDGROUPS;
+ odp.position = 847000000;
+ odp.hInstance = hInstance;
+ odp.pszGroup = LPGEN("MirandaG15");
+ odp.flags = ODPF_BOLDGROUPS;
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_FONTS);
- odp.pszTitle = LPGEN("Appearance");
- odp.pszGroup = LPGEN("MirandaG15");
- odp.pfnDlgProc = CConfig::AppearanceDlgProc;
+ odp.pszTitle = LPGEN("Appearance");
+ odp.pszGroup = LPGEN("MirandaG15");
+ odp.pfnDlgProc = CConfig::AppearanceDlgProc;
Options_AddPage(wParam, &odp);
-
+
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_NOTIFICATIONS);
- odp.pszTitle = LPGEN("Notifications");
- odp.pfnDlgProc = CConfig::NotificationsDlgProc;
+ odp.pszTitle = LPGEN("Notifications");
+ odp.pfnDlgProc = CConfig::NotificationsDlgProc;
Options_AddPage(wParam, &odp);
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CHAT);
- odp.pszTitle = LPGEN("Chat sessions");
- odp.pfnDlgProc = CConfig::ChatDlgProc;
+ odp.pszTitle = LPGEN("Chat sessions");
+ odp.pfnDlgProc = CConfig::ChatDlgProc;
Options_AddPage(wParam, &odp);
// ---------------------
odp.pszTemplate = MAKEINTRESOURCEA(IDD_CLIST);
- odp.pszTitle = LPGEN("Contact list");
- odp.pfnDlgProc = CConfig::ContactlistDlgProc;
+ odp.pszTitle = LPGEN("Contact list");
+ odp.pfnDlgProc = CConfig::ContactlistDlgProc;
Options_AddPage(wParam, &odp);
return 0;
}
void CConfig::SaveFontSettings(int iFont)
{
- if(iFont > FONT_SETTINGS -1 || iFont < 0)
+ if (iFont > FONT_SETTINGS - 1 || iFont < 0)
return;
char szSetting[128];
// Height
- mir_snprintf(szSetting,_countof(szSetting),"Font%dHeight",iFont);
+ mir_snprintf(szSetting, "Font%dHeight", iFont);
db_set_b(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfHeight);
+
// Style
int style = 0;
- if(m_logfont[iFont].lfWeight == FW_BOLD)
+ if (m_logfont[iFont].lfWeight == FW_BOLD)
style |= FONTF_BOLD;
- if(m_logfont[iFont].lfItalic)
+ if (m_logfont[iFont].lfItalic)
style |= FONTF_ITALIC;
- mir_snprintf(szSetting,_countof(szSetting),"Font%dStyle",iFont);
+ mir_snprintf(szSetting, "Font%dStyle", iFont);
db_set_b(NULL, "MirandaG15", szSetting, style);
+
// Charset
- mir_snprintf(szSetting,_countof(szSetting),"Font%dCharset",iFont);
+ mir_snprintf(szSetting, "Font%dCharset", iFont);
db_set_b(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfCharSet);
+
// Name
- mir_snprintf(szSetting,_countof(szSetting),"Font%dName",iFont);
+ mir_snprintf(szSetting, "Font%dName", iFont);
db_set_ts(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfFaceName);
-
+
UpdateFontSettings(iFont);
}
void CConfig::LoadFontSettings(int iFont)
{
- if(iFont > FONT_SETTINGS -1 || iFont < 0)
+ if (iFont > FONT_SETTINGS - 1 || iFont < 0)
return;
char szSetting[128];
-
+
// Fixed Values
m_logfont[iFont].lfOutPrecision = OUT_DEFAULT_PRECIS;
m_logfont[iFont].lfClipPrecision = CLIP_DEFAULT_PRECIS;
m_logfont[iFont].lfQuality = DEFAULT_QUALITY;
m_logfont[iFont].lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
// Height
- mir_snprintf(szSetting,_countof(szSetting),"Font%dHeight",iFont);
- m_logfont[iFont].lfHeight = (char) db_get_b(NULL, "MirandaG15", szSetting, -MulDiv(6, 96, 72));
+ mir_snprintf(szSetting, "Font%dHeight", iFont);
+ m_logfont[iFont].lfHeight = (char)db_get_b(NULL, "MirandaG15", szSetting, -MulDiv(6, 96, 72));
// Style
- mir_snprintf(szSetting,_countof(szSetting),"Font%dStyle",iFont);
+ mir_snprintf(szSetting, "Font%dStyle", iFont);
int style = db_get_b(NULL, "MirandaG15", szSetting, 0);
m_logfont[iFont].lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
- m_logfont[iFont].lfItalic = style & FONTF_ITALIC ? 1 : 0;
+ m_logfont[iFont].lfItalic = style & FONTF_ITALIC ? 1 : 0;
// Charset
- mir_snprintf(szSetting,_countof(szSetting),"Font%dCharset",iFont);
+ mir_snprintf(szSetting, "Font%dCharset", iFont);
m_logfont[iFont].lfCharSet = db_get_b(NULL, "MirandaG15", szSetting, DEFAULT_CHARSET);
// Name
- mir_snprintf(szSetting,_countof(szSetting),"Font%dName",iFont);
+ mir_snprintf(szSetting, "Font%dName", iFont);
DBVARIANT dbv;
if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv))
- mir_tstrcpy(m_logfont[iFont].lfFaceName,_T("Small Fonts"));
- else {
+ mir_tstrcpy(m_logfont[iFont].lfFaceName, _T("Small Fonts"));
+ else {
mir_tstrcpy(m_logfont[iFont].lfFaceName, dbv.ptszVal);
- db_free(&dbv);
- }
+ db_free(&dbv);
+ }
UpdateFontSettings(iFont);
}
@@ -357,8 +359,7 @@ int CConfig::GetFontHeight(int iFont) int CConfig::GetSampleField(int iFont)
{
- switch(iFont)
- {
+ switch (iFont) {
case 0: return IDC_SAMPLE1;
case 1: return IDC_SAMPLE2;
case 2: return IDC_SAMPLE3;
@@ -370,54 +371,51 @@ int CConfig::GetSampleField(int iFont) INT_PTR CALLBACK CConfig::AppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
-
+
// Translate the dialog
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SKIP_DRIVER_ERROR, m_abBoolSettings[SKIP_DRIVER_ERROR] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_SCREENSAVER_LOCK, m_abBoolSettings[SCREENSAVER_LOCK] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRANSITIONS, m_abBoolSettings[TRANSITIONS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CONTROL_BACKLIGHTS, m_abBoolSettings[CONTROL_BACKLIGHTS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_LABELS, m_abBoolSettings[SHOW_LABELS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HOOK_VOLUMEWHEEL, m_abBoolSettings[HOOK_VOLUMEWHEEL] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TIMESTAMP_SECONDS, m_abBoolSettings[TIMESTAMP_SECONDS] ? BST_CHECKED : BST_UNCHECKED);
-
- for(int i=0;i<FONT_SETTINGS;i++)
- {
+ CheckDlgButton(hwndDlg, IDC_SKIP_DRIVER_ERROR, m_abBoolSettings[SKIP_DRIVER_ERROR] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_SCREENSAVER_LOCK, m_abBoolSettings[SCREENSAVER_LOCK] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRANSITIONS, m_abBoolSettings[TRANSITIONS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONTROL_BACKLIGHTS, m_abBoolSettings[CONTROL_BACKLIGHTS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_LABELS, m_abBoolSettings[SHOW_LABELS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HOOK_VOLUMEWHEEL, m_abBoolSettings[HOOK_VOLUMEWHEEL] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TIMESTAMP_SECONDS, m_abBoolSettings[TIMESTAMP_SECONDS] ? BST_CHECKED : BST_UNCHECKED);
+
+ for (int i = 0; i < FONT_SETTINGS; i++) {
m_templogfont[i] = m_logfont[i];
- SendDlgItemMessage(hwndDlg,CConfig::GetSampleField(i),WM_SETFONT,(WPARAM)m_hSampleFont[i],(LPARAM)true);
+ SendDlgItemMessage(hwndDlg, CConfig::GetSampleField(i), WM_SETFONT, (WPARAM)m_hSampleFont[i], (LPARAM)true);
}
-
+
// fill device box
- CConfig::hDeviceBox = GetDlgItem(hwndDlg,IDC_DEVICE);
+ CConfig::hDeviceBox = GetDlgItem(hwndDlg, IDC_DEVICE);
FillDeviceBox(CConfig::hDeviceBox);
-
+
m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[SKIP_DRIVER_ERROR] = IsDlgButtonChecked(hwndDlg,IDC_SKIP_DRIVER_ERROR) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SKIP_DRIVER_ERROR] = IsDlgButtonChecked(hwndDlg, IDC_SKIP_DRIVER_ERROR) == BST_CHECKED ? true : false;
- m_abBoolSettings[SCREENSAVER_LOCK] = IsDlgButtonChecked(hwndDlg,IDC_SCREENSAVER_LOCK) == BST_CHECKED ? true : false;
- m_abBoolSettings[TRANSITIONS] = IsDlgButtonChecked(hwndDlg,IDC_TRANSITIONS) == BST_CHECKED ? true : false;
- m_abBoolSettings[SHOW_LABELS] = IsDlgButtonChecked(hwndDlg,IDC_SHOW_LABELS) == BST_CHECKED ? true : false;
- m_abBoolSettings[CONTROL_BACKLIGHTS] = IsDlgButtonChecked(hwndDlg,IDC_CONTROL_BACKLIGHTS) == BST_CHECKED ? true : false;
- m_abBoolSettings[HOOK_VOLUMEWHEEL] = IsDlgButtonChecked(hwndDlg,IDC_HOOK_VOLUMEWHEEL) == BST_CHECKED ? true : false;
- m_abBoolSettings[TIMESTAMP_SECONDS] = IsDlgButtonChecked(hwndDlg,IDC_TIMESTAMP_SECONDS) == BST_CHECKED ? true : false;
- m_aiIntSettings[DEVICE] = SendDlgItemMessage(hwndDlg,IDC_DEVICE,CB_GETCURSEL ,0,0);
+ m_abBoolSettings[SCREENSAVER_LOCK] = IsDlgButtonChecked(hwndDlg, IDC_SCREENSAVER_LOCK) == BST_CHECKED ? true : false;
+ m_abBoolSettings[TRANSITIONS] = IsDlgButtonChecked(hwndDlg, IDC_TRANSITIONS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SHOW_LABELS] = IsDlgButtonChecked(hwndDlg, IDC_SHOW_LABELS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CONTROL_BACKLIGHTS] = IsDlgButtonChecked(hwndDlg, IDC_CONTROL_BACKLIGHTS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[HOOK_VOLUMEWHEEL] = IsDlgButtonChecked(hwndDlg, IDC_HOOK_VOLUMEWHEEL) == BST_CHECKED ? true : false;
+ m_abBoolSettings[TIMESTAMP_SECONDS] = IsDlgButtonChecked(hwndDlg, IDC_TIMESTAMP_SECONDS) == BST_CHECKED ? true : false;
+ m_aiIntSettings[DEVICE] = SendDlgItemMessage(hwndDlg, IDC_DEVICE, CB_GETCURSEL, 0, 0);
- for(int i=0;i<FONT_SETTINGS;i++)
+ for (int i = 0; i < FONT_SETTINGS; i++)
m_logfont[i] = m_templogfont[i];
CConfig::SaveSettings();
@@ -427,17 +425,15 @@ INT_PTR CALLBACK CConfig::AppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
- if(LOWORD(wParam) == IDC_CREDITS)
- {
+ if (LOWORD(wParam) == IDC_CREDITS) {
CAppletManager::GetInstance()->ActivateCreditsScreen();
break;
}
int iFont = LOWORD(wParam);
- switch(iFont)
- {
+ switch (iFont) {
case IDC_CHOOSEFONT1: iFont = 0; break;
case IDC_CHOOSEFONT2: iFont = 1; break;
case IDC_CHOOSEFONT3: iFont = 2; break;
@@ -446,23 +442,21 @@ INT_PTR CALLBACK CConfig::AppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPar default: iFont = -1;
};
- if(iFont >= 0)
- {
+ if (iFont >= 0) {
CHOOSEFONT cf = { 0 };
cf.lStructSize = sizeof(cf);
cf.hwndOwner = hwndDlg;
cf.lpLogFont = &m_templogfont[iFont];
cf.Flags = CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS;
- if (ChooseFont(&cf))
- {
- if(m_hSampleFont[iFont])
+ if (ChooseFont(&cf)) {
+ if (m_hSampleFont[iFont])
DeleteObject(m_hSampleFont[iFont]);
- m_hSampleFont[iFont] = CreateFontIndirect(&m_templogfont[iFont]);
- SendDlgItemMessage(hwndDlg,CConfig::GetSampleField(iFont),WM_SETFONT,(WPARAM)m_hSampleFont[iFont],(LPARAM)true);
+ m_hSampleFont[iFont] = CreateFontIndirect(&m_templogfont[iFont]);
+ SendDlgItemMessage(hwndDlg, CConfig::GetSampleField(iFont), WM_SETFONT, (WPARAM)m_hSampleFont[iFont], (LPARAM)true);
TRACE(_T("Font selected!"));
}
}
- if(LOWORD(wParam) == IDC_DEVICE && SendDlgItemMessage(hwndDlg,IDC_DEVICE,CB_GETCURSEL ,0,0) != m_aiIntSettings[DEVICE]) {
+ if (LOWORD(wParam) == IDC_DEVICE && SendDlgItemMessage(hwndDlg, IDC_DEVICE, CB_GETCURSEL, 0, 0) != m_aiIntSettings[DEVICE]) {
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
@@ -480,74 +474,72 @@ INT_PTR CALLBACK CConfig::ChatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP {
char buf[128];
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
-
+
// Translate the dialog
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_MAXIMIZED_TITLE, m_abBoolSettings[MAXIMIZED_TITLE] ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_MAXIMIZED_LABELS, m_abBoolSettings[MAXIMIZED_LABELS] ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_REPLY_MAXIMIZED, m_abBoolSettings[SESSION_REPLY_MAXIMIZED]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLL_MAXIMIZED, m_abBoolSettings[SESSION_SCROLL_MAXIMIZED]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SHOWTYPING, m_abBoolSettings[SESSION_SHOWTYPING]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SENDTYPING, m_abBoolSettings[SESSION_SENDTYPING]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_LOADDB, m_abBoolSettings[SESSION_LOADDB]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_MARKREAD, m_abBoolSettings[SESSION_MARKREAD]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SYMBOLS, m_abBoolSettings[SESSION_SYMBOLS]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_TIMESTAMPS, m_abBoolSettings[SESSION_TIMESTAMPS]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_CLOSE, m_abBoolSettings[SESSION_CLOSE]? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_SESSION_SENDRETURN, m_abBoolSettings[SESSION_SENDRETURN]? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLNONE, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_NONE? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLFIRST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_FIRST? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLLAST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_LAST? BST_CHECKED : BST_UNCHECKED);
-
+ CheckDlgButton(hwndDlg, IDC_MAXIMIZED_TITLE, m_abBoolSettings[MAXIMIZED_TITLE] ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAXIMIZED_LABELS, m_abBoolSettings[MAXIMIZED_LABELS] ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_REPLY_MAXIMIZED, m_abBoolSettings[SESSION_REPLY_MAXIMIZED] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLL_MAXIMIZED, m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SHOWTYPING, m_abBoolSettings[SESSION_SHOWTYPING] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SENDTYPING, m_abBoolSettings[SESSION_SENDTYPING] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_LOADDB, m_abBoolSettings[SESSION_LOADDB] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_MARKREAD, m_abBoolSettings[SESSION_MARKREAD] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SYMBOLS, m_abBoolSettings[SESSION_SYMBOLS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_TIMESTAMPS, m_abBoolSettings[SESSION_TIMESTAMPS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_CLOSE, m_abBoolSettings[SESSION_CLOSE] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_SESSION_SENDRETURN, m_abBoolSettings[SESSION_SENDRETURN] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLNONE, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_NONE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLFIRST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_FIRST ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLLAST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_LAST ? BST_CHECKED : BST_UNCHECKED);
+
_itoa_s(m_aiIntSettings[SESSION_LOGSIZE], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_SESSION_LOGSIZE, buf);
-
+
_itoa_s(m_aiIntSettings[SESSION_CLOSETIMER], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_SESSION_CLOSETIMER, buf);
m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SCROLL_MAXIMIZED) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_REPLY_MAXIMIZED) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SHOWTYPING] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SHOWTYPING) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SENDTYPING] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SENDTYPING) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_LOADDB] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_LOADDB) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SENDRETURN] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SENDRETURN) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_MARKREAD] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_MARKREAD) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_SYMBOLS] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_SYMBOLS) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_TIMESTAMPS) == BST_CHECKED ? true : false;
- m_abBoolSettings[SESSION_CLOSE] = IsDlgButtonChecked(hwndDlg,IDC_SESSION_CLOSE) == BST_CHECKED ? true : false;
-
- if(IsDlgButtonChecked(hwndDlg,IDC_SESSION_SCROLLNONE) == BST_CHECKED)
+ m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SCROLL_MAXIMIZED) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_REPLY_MAXIMIZED) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SHOWTYPING] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SHOWTYPING) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SENDTYPING] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SENDTYPING) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_LOADDB] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_LOADDB) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SENDRETURN] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SENDRETURN) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_MARKREAD] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_MARKREAD) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_SYMBOLS] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_SYMBOLS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_TIMESTAMPS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[SESSION_CLOSE] = IsDlgButtonChecked(hwndDlg, IDC_SESSION_CLOSE) == BST_CHECKED ? true : false;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_SESSION_SCROLLNONE) == BST_CHECKED)
m_aiIntSettings[SESSION_AUTOSCROLL] = SESSION_AUTOSCROLL_NONE;
- else if(IsDlgButtonChecked(hwndDlg,IDC_SESSION_SCROLLFIRST) == BST_CHECKED)
+ else if (IsDlgButtonChecked(hwndDlg, IDC_SESSION_SCROLLFIRST) == BST_CHECKED)
m_aiIntSettings[SESSION_AUTOSCROLL] = SESSION_AUTOSCROLL_FIRST;
else
m_aiIntSettings[SESSION_AUTOSCROLL] = SESSION_AUTOSCROLL_LAST;
- m_abBoolSettings[MAXIMIZED_TITLE] = IsDlgButtonChecked(hwndDlg,IDC_MAXIMIZED_TITLE) == BST_UNCHECKED ? true : false;
- m_abBoolSettings[MAXIMIZED_LABELS] = IsDlgButtonChecked(hwndDlg,IDC_MAXIMIZED_LABELS) == BST_UNCHECKED ? true : false;
+ m_abBoolSettings[MAXIMIZED_TITLE] = IsDlgButtonChecked(hwndDlg, IDC_MAXIMIZED_TITLE) == BST_UNCHECKED ? true : false;
+ m_abBoolSettings[MAXIMIZED_LABELS] = IsDlgButtonChecked(hwndDlg, IDC_MAXIMIZED_LABELS) == BST_UNCHECKED ? true : false;
+
+ GetDlgItemTextA(hwndDlg, IDC_SESSION_LOGSIZE, buf, _countof(buf));
+ m_aiIntSettings[SESSION_LOGSIZE] = atoi(buf) > 0 ? atoi(buf) : 1;
- GetDlgItemTextA(hwndDlg,IDC_SESSION_LOGSIZE,buf,_countof(buf));
- m_aiIntSettings[SESSION_LOGSIZE] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_SESSION_CLOSETIMER,buf,_countof(buf));
- m_aiIntSettings[SESSION_CLOSETIMER] = atoi(buf) >= 0 ? atoi(buf):1;
+ GetDlgItemTextA(hwndDlg, IDC_SESSION_CLOSETIMER, buf, _countof(buf));
+ m_aiIntSettings[SESSION_CLOSETIMER] = atoi(buf) >= 0 ? atoi(buf) : 1;
CConfig::SaveSettings();
SendMessage(hwndDlg, WM_INITDIALOG, 0, 0);
@@ -556,7 +548,7 @@ INT_PTR CALLBACK CConfig::ChatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
// Activate the apply button
if (!m_bInitializingDialog && ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)))
@@ -572,9 +564,8 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w {
char buf[128];
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
@@ -582,46 +573,46 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w TranslateDialogDefault(hwndDlg);
// Initialize the protocol filter list
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOCOLS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_PROTOCOLS),GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PROTOCOLS), GWL_STYLE) | TVS_NOHSCROLL);
int iRes = 0;
-
+
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_NOTICK)));
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_TICK)));
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_PROTOCOLS),himlCheckBoxes,TVSIL_NORMAL);
-
- FillTree(GetDlgItem(hwndDlg,IDC_PROTOCOLS));
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TIMESTAMPS, m_abBoolSettings[NOTIFY_TIMESTAMPS] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SHOWPROTO, m_abBoolSettings[NOTIFY_SHOWPROTO] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF, m_abBoolSettings[NOTIFY_CHANNELCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_NICKCUTOFF, m_abBoolSettings[NOTIFY_NICKCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_MESSAGES, m_abBoolSettings[NOTIFY_IRC_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_USERS, m_abBoolSettings[NOTIFY_IRC_USERS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_EMOTES, m_abBoolSettings[NOTIFY_IRC_EMOTES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_NOTICES, m_abBoolSettings[NOTIFY_IRC_NOTICES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_CHANNEL, m_abBoolSettings[NOTIFY_IRC_CHANNEL] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_STATUS, m_abBoolSettings[NOTIFY_IRC_STATUS] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_STATUS, m_abBoolSettings[NOTIFY_PROTO_STATUS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNON, m_abBoolSettings[NOTIFY_PROTO_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNOFF, m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNON, m_abBoolSettings[NOTIFY_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNOFF, m_abBoolSettings[NOTIFY_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_STATUS, m_abBoolSettings[NOTIFY_STATUS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_MESSAGES, m_abBoolSettings[NOTIFY_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_FILE, m_abBoolSettings[NOTIFY_FILE] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_CONTACTS, m_abBoolSettings[NOTIFY_CONTACTS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_URL, m_abBoolSettings[NOTIFY_URL] ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_NOTIFY_NO_SKIP_REPLY, m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNON, m_abBoolSettings[NOTIFY_SKIP_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNOFF, m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_STATUS, m_abBoolSettings[NOTIFY_SKIP_STATUS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES, m_abBoolSettings[NOTIFY_SKIP_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
-
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NOTICK)));
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TICK)));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_PROTOCOLS), himlCheckBoxes, TVSIL_NORMAL);
+
+ FillTree(GetDlgItem(hwndDlg, IDC_PROTOCOLS));
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TIMESTAMPS, m_abBoolSettings[NOTIFY_TIMESTAMPS] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SHOWPROTO, m_abBoolSettings[NOTIFY_SHOWPROTO] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF, m_abBoolSettings[NOTIFY_CHANNELCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_NICKCUTOFF, m_abBoolSettings[NOTIFY_NICKCUTOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_MESSAGES, m_abBoolSettings[NOTIFY_IRC_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_USERS, m_abBoolSettings[NOTIFY_IRC_USERS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_EMOTES, m_abBoolSettings[NOTIFY_IRC_EMOTES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_NOTICES, m_abBoolSettings[NOTIFY_IRC_NOTICES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_CHANNEL, m_abBoolSettings[NOTIFY_IRC_CHANNEL] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_IRC_STATUS, m_abBoolSettings[NOTIFY_IRC_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_STATUS, m_abBoolSettings[NOTIFY_PROTO_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNON, m_abBoolSettings[NOTIFY_PROTO_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_PROTO_SIGNOFF, m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNON, m_abBoolSettings[NOTIFY_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SIGNOFF, m_abBoolSettings[NOTIFY_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_STATUS, m_abBoolSettings[NOTIFY_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_MESSAGES, m_abBoolSettings[NOTIFY_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_FILE, m_abBoolSettings[NOTIFY_FILE] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_CONTACTS, m_abBoolSettings[NOTIFY_CONTACTS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_URL, m_abBoolSettings[NOTIFY_URL] ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_NO_SKIP_REPLY, m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNON, m_abBoolSettings[NOTIFY_SKIP_SIGNON] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_SIGNOFF, m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_STATUS, m_abBoolSettings[NOTIFY_SKIP_STATUS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES, m_abBoolSettings[NOTIFY_SKIP_MESSAGES] ? BST_CHECKED : BST_UNCHECKED);
+
_itoa_s(m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF_OFFSET, buf);
@@ -630,98 +621,95 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w _itoa_s(m_aiIntSettings[NOTIFY_LOGSIZE], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_NOTIFY_LOGSIZE, buf);
-
+
_itoa_s(m_aiIntSettings[NOTIFY_DURATION], buf, _countof(buf), 10);
SetDlgItemTextA(hwndDlg, IDC_NOTIFY_DURATION, buf);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEHIDE, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_HIDE? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLENAME, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_NAME? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEINFO, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_INFO? BST_CHECKED : BST_UNCHECKED);
-
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEHIDE, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_HIDE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLENAME, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_NAME ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEINFO, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_INFO ? BST_CHECKED : BST_UNCHECKED);
+
m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- if(((LPNMHDR)lParam)->idFrom == IDC_PROTOCOLS)
- {
- if(((LPNMHDR)lParam)->code != NM_CLICK)
+ if (((LPNMHDR)lParam)->idFrom == IDC_PROTOCOLS) {
+ if (((LPNMHDR)lParam)->code != NM_CLICK)
return 0;
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMICON) {
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((CProtoFilter *)tvi.lParam)->bTempNotificationFilter=tvi.iImage != 0;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((CProtoFilter *)tvi.lParam)->bTempNotificationFilter = tvi.iImage != 0;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
-
+
}
break;
}
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[NOTIFY_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_TIMESTAMPS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_CHANNELCUTOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_NICKCUTOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_NICKCUTOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SHOWPROTO] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SHOWPROTO) == BST_CHECKED ? true : false;
-
- m_abBoolSettings[NOTIFY_IRC_MESSAGES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_MESSAGES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_USERS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_USERS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_EMOTES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_EMOTES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_NOTICES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_NOTICES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_CHANNEL] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_CHANNEL) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_IRC_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_IRC_STATUS) == BST_CHECKED ? true : false;
-
- m_abBoolSettings[NOTIFY_PROTO_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_PROTO_STATUS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_PROTO_SIGNON] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_PROTO_SIGNON) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_PROTO_SIGNOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_MESSAGES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_MESSAGES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SIGNON] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SIGNON) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SIGNOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SIGNOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_STATUS) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_URL] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_URL) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_FILE] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_FILE) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_CONTACTS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_CONTACTS) == BST_CHECKED ? true : false;
-
- m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_NO_SKIP_REPLY) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_MESSAGES] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_MESSAGES) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_SIGNON] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_SIGNON) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_SIGNOFF) == BST_CHECKED ? true : false;
- m_abBoolSettings[NOTIFY_SKIP_STATUS] = IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_SKIP_STATUS) == BST_CHECKED ? true : false;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_CHANNELCUTOFF_OFFSET,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_NICKCUTOFF_OFFSET,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_DURATION,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_DURATION] = atoi(buf) > 0 ? atoi(buf):1;
-
- GetDlgItemTextA(hwndDlg,IDC_NOTIFY_LOGSIZE,buf,_countof(buf));
- m_aiIntSettings[NOTIFY_LOGSIZE] = atoi(buf) > 0 ? atoi(buf):1;
-
- if(IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_TITLEHIDE) == BST_CHECKED)
+ m_abBoolSettings[NOTIFY_TIMESTAMPS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_TIMESTAMPS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_NICKCUTOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_NICKCUTOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SHOWPROTO] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SHOWPROTO) == BST_CHECKED ? true : false;
+
+ m_abBoolSettings[NOTIFY_IRC_MESSAGES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_MESSAGES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_USERS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_USERS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_EMOTES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_EMOTES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_NOTICES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_NOTICES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_CHANNEL] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_CHANNEL) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_IRC_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_IRC_STATUS) == BST_CHECKED ? true : false;
+
+ m_abBoolSettings[NOTIFY_PROTO_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_PROTO_STATUS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNON] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_PROTO_SIGNON) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_PROTO_SIGNOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_MESSAGES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_MESSAGES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SIGNON] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SIGNON) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SIGNOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SIGNOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_STATUS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_URL] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_URL) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_FILE] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FILE) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_CONTACTS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_CONTACTS) == BST_CHECKED ? true : false;
+
+ m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_NO_SKIP_REPLY) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_MESSAGES] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNON] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_SIGNON) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_SIGNOFF) == BST_CHECKED ? true : false;
+ m_abBoolSettings[NOTIFY_SKIP_STATUS] = IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_SKIP_STATUS) == BST_CHECKED ? true : false;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF_OFFSET, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_NICKCUTOFF_OFFSET, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_DURATION, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_DURATION] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ GetDlgItemTextA(hwndDlg, IDC_NOTIFY_LOGSIZE, buf, _countof(buf));
+ m_aiIntSettings[NOTIFY_LOGSIZE] = atoi(buf) > 0 ? atoi(buf) : 1;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_TITLEHIDE) == BST_CHECKED)
m_aiIntSettings[NOTIFY_TITLE] = NOTIFY_TITLE_HIDE;
- else if(IsDlgButtonChecked(hwndDlg,IDC_NOTIFY_TITLENAME) == BST_CHECKED)
+ else if (IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_TITLENAME) == BST_CHECKED)
m_aiIntSettings[NOTIFY_TITLE] = NOTIFY_TITLE_NAME;
else
m_aiIntSettings[NOTIFY_TITLE] = NOTIFY_TITLE_INFO;
// apply all contactlist protocol filters
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
(*iter)->bNotificationFilter = (*iter)->bTempNotificationFilter;
iter++;
}
@@ -733,7 +721,7 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
// Activate the apply button
if (!m_bInitializingDialog && ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)))
@@ -747,40 +735,39 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg)
- {
- case WM_INITDIALOG:
+ switch (uMsg) {
+ case WM_INITDIALOG:
{
m_bInitializingDialog = true;
-
+
// Translate the dialog
TranslateDialogDefault(hwndDlg);
// Initialize the protocol filter list
- SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),GWL_STYLE)|TVS_NOHSCROLL);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), GWL_STYLE) | TVS_NOHSCROLL);
int iRes = 0;
-
+
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_NOTICK)));
- iRes = ImageList_AddIcon(himlCheckBoxes,LoadIcon(hInstance,MAKEINTRESOURCE(IDI_TICK)));
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),himlCheckBoxes,TVSIL_NORMAL);
-
- FillTree(GetDlgItem(hwndDlg,IDC_CLIST_PROTOFILTER),true);
-
- CheckDlgButton(hwndDlg, IDC_CLIST_SELECTION, m_abBoolSettings[CLIST_SELECTION] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_COLUMNS, m_abBoolSettings[CLIST_COLUMNS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_HIDEOFFLINE, m_abBoolSettings[CLIST_HIDEOFFLINE] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_USEIGNORE, m_abBoolSettings[CLIST_USEIGNORE] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_USEGROUPS, m_abBoolSettings[CLIST_USEGROUPS] ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_SHOWPROTO, m_abBoolSettings[CLIST_SHOWPROTO]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_DRAWLINES, m_abBoolSettings[CLIST_DRAWLINES]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_POSITION, m_abBoolSettings[CLIST_POSITION]? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIST_COUNTERS, m_abBoolSettings[CLIST_COUNTERS]? BST_CHECKED : BST_UNCHECKED);
-
- if(m_aiIntSettings[CLIST_GA] == CLIST_GA_NONE)
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NOTICK)));
+ iRes = ImageList_AddIcon(himlCheckBoxes, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_TICK)));
+ TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), himlCheckBoxes, TVSIL_NORMAL);
+
+ FillTree(GetDlgItem(hwndDlg, IDC_CLIST_PROTOFILTER), true);
+
+ CheckDlgButton(hwndDlg, IDC_CLIST_SELECTION, m_abBoolSettings[CLIST_SELECTION] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_COLUMNS, m_abBoolSettings[CLIST_COLUMNS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_HIDEOFFLINE, m_abBoolSettings[CLIST_HIDEOFFLINE] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_USEIGNORE, m_abBoolSettings[CLIST_USEIGNORE] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_USEGROUPS, m_abBoolSettings[CLIST_USEGROUPS] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_SHOWPROTO, m_abBoolSettings[CLIST_SHOWPROTO] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_DRAWLINES, m_abBoolSettings[CLIST_DRAWLINES] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_POSITION, m_abBoolSettings[CLIST_POSITION] ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIST_COUNTERS, m_abBoolSettings[CLIST_COUNTERS] ? BST_CHECKED : BST_UNCHECKED);
+
+ if (m_aiIntSettings[CLIST_GA] == CLIST_GA_NONE)
CheckDlgButton(hwndDlg, IDC_CLIST_GA_NONE, BST_CHECKED);
- else if(m_aiIntSettings[CLIST_GA] == CLIST_GA_COLLAPSE)
+ else if (m_aiIntSettings[CLIST_GA] == CLIST_GA_COLLAPSE)
CheckDlgButton(hwndDlg, IDC_CLIST_GA_COLLAPSE, BST_CHECKED);
else
CheckDlgButton(hwndDlg, IDC_CLIST_GA_EXPAND, BST_CHECKED);
@@ -788,55 +775,52 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa m_bInitializingDialog = false;
break;
}
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
- if(((LPNMHDR)lParam)->idFrom == IDC_CLIST_PROTOFILTER)
- {
- if(((LPNMHDR)lParam)->code != NM_CLICK)
+ if (((LPNMHDR)lParam)->idFrom == IDC_CLIST_PROTOFILTER) {
+ if (((LPNMHDR)lParam)->code != NM_CLICK)
return 0;
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMICON) {
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
+ if (hti.flags&TVHT_ONITEMICON) {
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem=hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((CProtoFilter *)tvi.lParam)->bTempContactlistFilter=tvi.iImage != 0;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((CProtoFilter *)tvi.lParam)->bTempContactlistFilter = tvi.iImage != 0;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
}
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
{
- m_abBoolSettings[CLIST_SELECTION] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_SELECTION) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_COLUMNS] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_COLUMNS) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_HIDEOFFLINE] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_HIDEOFFLINE) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_USEGROUPS] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_USEGROUPS) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_USEIGNORE] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_USEIGNORE) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_SHOWPROTO] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_SHOWPROTO) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_DRAWLINES] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_DRAWLINES) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_POSITION] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_POSITION) == BST_CHECKED ? true : false;
- m_abBoolSettings[CLIST_COUNTERS] = IsDlgButtonChecked(hwndDlg,IDC_CLIST_COUNTERS) == BST_CHECKED ? true : false;
-
- if(IsDlgButtonChecked(hwndDlg,IDC_CLIST_GA_NONE) == BST_CHECKED)
+ m_abBoolSettings[CLIST_SELECTION] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_SELECTION) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_COLUMNS] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_COLUMNS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_HIDEOFFLINE] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_HIDEOFFLINE) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_USEGROUPS] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_USEGROUPS) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_USEIGNORE] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_USEIGNORE) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_SHOWPROTO] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_SHOWPROTO) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_DRAWLINES] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_DRAWLINES) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_POSITION] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_POSITION) == BST_CHECKED ? true : false;
+ m_abBoolSettings[CLIST_COUNTERS] = IsDlgButtonChecked(hwndDlg, IDC_CLIST_COUNTERS) == BST_CHECKED ? true : false;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_CLIST_GA_NONE) == BST_CHECKED)
m_aiIntSettings[CLIST_GA] = CLIST_GA_NONE;
- else if(IsDlgButtonChecked(hwndDlg,IDC_CLIST_GA_COLLAPSE) == BST_CHECKED)
+ else if (IsDlgButtonChecked(hwndDlg, IDC_CLIST_GA_COLLAPSE) == BST_CHECKED)
m_aiIntSettings[CLIST_GA] = CLIST_GA_COLLAPSE;
else
m_aiIntSettings[CLIST_GA] = CLIST_GA_EXPAND;
// apply all contactlist protocol filters
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
(*iter)->bContactlistFilter = (*iter)->bTempContactlistFilter;
iter++;
}
@@ -847,7 +831,7 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa }
break;
}
- case WM_COMMAND:
+ case WM_COMMAND:
{
// Activate the apply button
if (!m_bInitializingDialog && ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)))
@@ -863,9 +847,8 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa bool CConfig::GetProtocolContactlistFilter(tstring strProtocol)
{
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
- if((*iter)->strName == strProtocol)
+ while (iter != m_ProtoList.end()) {
+ if ((*iter)->strName == strProtocol)
return (*iter)->bContactlistFilter;
iter++;
}
@@ -875,9 +858,8 @@ bool CConfig::GetProtocolContactlistFilter(tstring strProtocol) bool CConfig::GetProtocolNotificationFilter(tstring strProtocol)
{
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
- if((*iter)->strName == strProtocol)
+ while (iter != m_ProtoList.end()) {
+ if ((*iter)->strName == strProtocol)
return (*iter)->bNotificationFilter;
iter++;
}
@@ -886,14 +868,14 @@ bool CConfig::GetProtocolNotificationFilter(tstring strProtocol) bool CConfig::GetBoolSetting(int iSetting)
{
- if(iSetting >= 0 && iSetting < BOOL_SETTINGS)
+ if (iSetting >= 0 && iSetting < BOOL_SETTINGS)
return m_abBoolSettings[iSetting];
return false;
}
int CConfig::GetIntSetting(int iSetting)
{
- if(iSetting >= 0 && iSetting < INT_SETTINGS)
+ if (iSetting >= 0 && iSetting < INT_SETTINGS)
return m_aiIntSettings[iSetting];
return false;
}
@@ -903,21 +885,22 @@ void CConfig::ClearTree(HWND hTree) TreeView_DeleteAllItems(hTree);
}
-void CConfig::FillDeviceBox(HWND hBox) {
+void CConfig::FillDeviceBox(HWND hBox)
+{
CLCDConnection *connection = CAppletManager::GetInstance()->GetLCDConnection();
- SendMessage(hBox,CB_RESETCONTENT,0,0);
+ SendMessage(hBox, CB_RESETCONTENT, 0, 0);
int count = 0;
for (int i = 0; i < 10; i++) {
CLCDDevice *device = connection->GetAttachedDevice(i);
if (device != NULL) {
- SendMessage(hBox,CB_ADDSTRING,0,(LPARAM)device->GetDisplayName().c_str());
+ SendMessage(hBox, CB_ADDSTRING, 0, (LPARAM)device->GetDisplayName().c_str());
count++;
}
}
if (!count) {
- SendMessage(hBox,CB_ADDSTRING,0,(LPARAM)TranslateT("No device attached"));
+ SendMessage(hBox, CB_ADDSTRING, 0, (LPARAM)TranslateT("No device attached"));
}
int iDevice = CConfig::GetIntSetting(DEVICE);
@@ -927,33 +910,30 @@ void CConfig::FillDeviceBox(HWND hBox) { SendMessage(hBox, CB_SETCURSEL, iDevice, 0);
}
-void CConfig::FillTree(HWND hTree,bool bCList)
+void CConfig::FillTree(HWND hTree, bool bCList)
{
TreeView_DeleteAllItems(hTree);
TVINSERTSTRUCT tvis;
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
-
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+
vector<CProtoFilter*>::iterator iter = m_ProtoList.begin();
- while(iter != m_ProtoList.end())
- {
+ while (iter != m_ProtoList.end()) {
tvis.item.lParam = (LPARAM)(*iter);
- tvis.item.pszText= (LPTSTR)(*iter)->strName.c_str();
- if(!bCList)
- {
- tvis.item.iImage= (*iter)->bNotificationFilter;
+ tvis.item.pszText = (LPTSTR)(*iter)->strName.c_str();
+ if (!bCList) {
+ tvis.item.iImage = (*iter)->bNotificationFilter;
(*iter)->bTempNotificationFilter = (*iter)->bNotificationFilter;
}
- else
- {
- tvis.item.iImage= (*iter)->bContactlistFilter;
+ else {
+ tvis.item.iImage = (*iter)->bContactlistFilter;
(*iter)->bTempContactlistFilter = (*iter)->bContactlistFilter;
}
- tvis.item.iSelectedImage= tvis.item.iImage;
-
- TreeView_InsertItem(hTree,&tvis);
+ tvis.item.iSelectedImage = tvis.item.iImage;
+
+ TreeView_InsertItem(hTree, &tvis);
iter++;
}
-}
\ No newline at end of file +}
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 3bc56ce52c..7fc9aa8d42 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -199,9 +199,9 @@ void LoadConfig() {
for (int indx = 0; indx < 4; indx++) {
char szNameFG[4], szNameBG[4], szNameTO[4];
- mir_snprintf(szNameFG, _countof(szNameFG), "FG%d", indx);
- mir_snprintf(szNameBG, _countof(szNameBG), "BG%d", indx);
- mir_snprintf(szNameTO, _countof(szNameTO), "TO%d", indx);
+ mir_snprintf(szNameFG, "FG%d", indx);
+ mir_snprintf(szNameBG, "BG%d", indx);
+ mir_snprintf(szNameTO, "TO%d", indx);
options.FG[indx] = db_get_dw(NULL, SERVICENAME, szNameFG, optionsDefault.FG[indx]);
options.BG[indx] = db_get_dw(NULL, SERVICENAME, szNameBG, optionsDefault.BG[indx]);
options.Timeout[indx] = db_get_dw(NULL, SERVICENAME, szNameTO, (DWORD)optionsDefault.Timeout[indx]);
diff --git a/plugins/MsgPopup/src/options.cpp b/plugins/MsgPopup/src/options.cpp index 7ef6719f42..bb095620a5 100644 --- a/plugins/MsgPopup/src/options.cpp +++ b/plugins/MsgPopup/src/options.cpp @@ -99,9 +99,9 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l char szNameTO[4];
for (int indx = 0; indx < 4; indx++) {
- mir_snprintf(szNameFG, _countof(szNameFG), "FG%d", indx);
- mir_snprintf(szNameBG, _countof(szNameBG), "BG%d", indx);
- mir_snprintf(szNameTO, _countof(szNameTO), "TO%d", indx);
+ mir_snprintf(szNameFG, "FG%d", indx);
+ mir_snprintf(szNameBG, "BG%d", indx);
+ mir_snprintf(szNameTO, "TO%d", indx);
DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameFG, options.FG[indx], optionsDefault.FG[indx]);
DBWriteContactSettingDwordDef(NULL, SERVICENAME, szNameBG, options.BG[indx], optionsDefault.BG[indx]);
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index b68b96a430..c39b00d719 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -191,14 +191,8 @@ int CLStreamRTFInfo::nWriteHeader(char *pszTarget, int nLen) COLORREF cMyText = db_get_dw(NULL, "SRMsg", "Font3Col", RGB(64, 0, 128));
COLORREF cYourText = db_get_dw(NULL, "SRMsg", "Font0Col", RGB(240, 0, 0));
- /* original header !!
- "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n"
- "{\\colortbl ;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}\r\n"
- "\\viewkind4\\uc1\\pard\\cf2\\lang1033\\f0\\fs16 ",
-
- */
char szRtfHeader[400];
- int nSrcLen = mir_snprintf(szRtfHeader, _countof(szRtfHeader),
+ int nSrcLen = mir_snprintf(szRtfHeader,
"{\\rtf1\\ansi\r\n"
"{\\colortbl ;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}\r\n"
"\\viewkind4\\uc1\\pard\\cf2 ",
@@ -625,9 +619,9 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) TCHAR szTmp[1500];
if (nDBCount == -1)
- mir_sntprintf(szTmp, _countof(szTmp), TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
+ mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str());
else
- mir_sntprintf(szTmp, _countof(szTmp), TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
+ mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount);
SETTEXTEX stText = { 0 };
stText.codepage = 1200;
@@ -674,7 +668,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) CloseHandle(hFile);
TCHAR szTmp[100];
- mir_sntprintf(szTmp, _countof(szTmp), _T("File open time %d\n"), GetTickCount() - dwStart);
+ mir_sntprintf(szTmp, _T("File open time %d\n"), GetTickCount() - dwStart);
OutputDebugString(szTmp);
GETTEXTLENGTHEX sData = { 0 };
@@ -686,7 +680,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) if (!bScrollToBottom)
SendMessage(hRichEdit, EM_SETSCROLLPOS, 0, (LPARAM)&ptOldPos);
- mir_sntprintf(szTmp, _countof(szTmp), TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
+ mir_sntprintf(szTmp, TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart);
OutputDebugString(szTmp);
return true;
}
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 3a46bc8617..6611f692da 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -706,7 +706,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar DWORD dwUIN = db_get_dw(hContact, sTmpA.c_str(), "UIN", 0);
TCHAR szTmp[50];
- mir_sntprintf(szTmp, _countof(szTmp), _T("%d"), dwUIN);
+ mir_sntprintf(szTmp, _T("%d"), dwUIN);
sItem.iSubItem = 3;
sItem.pszText = szTmp;
ListView_SetItem(hMapUser, &sItem);
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index f078536f62..2cc790b844 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -464,7 +464,7 @@ bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize) char cBuf[10];
BYTE *p = (BYTE*)pData;
for (int n = 0; n < nSize; n++) {
- mir_snprintf(cBuf, _countof(cBuf), "%.2X ", p[n]);
+ mir_snprintf(cBuf, "%.2X ", p[n]);
if (!bWriteToFile(hFile, cBuf, 3))
return false;
}
@@ -702,7 +702,7 @@ void ReplaceDefines(MCONTACT hContact, tstring & sTarget) tstring sReplaceUin;
if (dwUIN) {
TCHAR sTmp[20];
- mir_sntprintf(sTmp, _countof(sTmp), _T("%d"), dwUIN);
+ mir_sntprintf(sTmp, _T("%d"), dwUIN);
sReplaceUin = sTmp;
}
else sReplaceUin = FileNickFromHandle(hContact);
@@ -784,11 +784,11 @@ void ReplaceTimeVariables(tstring &sRet) GetLocalTime(&stTime);
TCHAR sTmp[20];
- mir_sntprintf(sTmp, _countof(sTmp), _T("%d"), stTime.wYear);
+ mir_sntprintf(sTmp, _T("%d"), stTime.wYear);
ReplaceAll(sRet, _T("%year%"), sTmp);
- mir_sntprintf(sTmp, _countof(sTmp), _T("%.2d"), stTime.wMonth);
+ mir_sntprintf(sTmp, _T("%.2d"), stTime.wMonth);
ReplaceAll(sRet, _T("%month%"), sTmp);
- mir_sntprintf(sTmp, _countof(sTmp), _T("%.2d"), stTime.wDay);
+ mir_sntprintf(sTmp, _T("%.2d"), stTime.wDay);
ReplaceAll(sRet, _T("%day%"), sTmp);
}
}
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 1bd0754b8f..638d0a928f 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -134,7 +134,7 @@ int Protocol::GetStatus() else {
TCHAR *p = (tszXStatusName[0] != 0) ? TranslateTS(tszXStatusName) : TranslateT("<no status name>");
if (tszXStatusMessage[0])
- mir_sntprintf(status_name, _countof(status_name), _T("%s: %s"), p, tszXStatusMessage);
+ mir_sntprintf(status_name, _T("%s: %s"), p, tszXStatusMessage);
else
lcopystr(status_name, p, _countof(status_name));
}
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 8bf2303ab8..f51ce6a877 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1474,7 +1474,7 @@ void ShowListeningToMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto, P // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Enable listening to for %s"), proto->description);
+ mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1712,7 +1712,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my avatar for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1752,7 +1752,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my nickname for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1800,7 +1800,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (protocols->CanSetStatusMsgPerProtocol()) {
// Add this proto to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1819,7 +1819,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
// Add this to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1882,7 +1882,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Enable listening to for %s"), proto->description);
+ mir_sntprintf(tmp, TranslateT("Enable listening to for %s"), proto->description);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -1898,7 +1898,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
// Add this to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), pcli->pfnGetStatusModeDescription(proto->status, 0));
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -1917,7 +1917,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (protocols->CanSetStatusMsgPerProtocol()) {
// Add this proto to menu
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my status message for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my status message for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -1935,7 +1935,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
}
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my nickname for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my nickname for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
@@ -1952,7 +1952,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar InsertMenuItem(submenu, 0, TRUE, &mii);
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my avatar for %s..."), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my avatar for %s..."), proto->description);
memset(&mii, 0, sizeof(mii));
mii.cbSize = sizeof(mii);
diff --git a/plugins/MyDetails/src/services.cpp b/plugins/MyDetails/src/services.cpp index 726ae3c5c0..2cb64f53bd 100644 --- a/plugins/MyDetails/src/services.cpp +++ b/plugins/MyDetails/src/services.cpp @@ -70,7 +70,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam Protocol *proto = protocols->Get(proto_num);
TCHAR tmp[128];
- mir_sntprintf(tmp, _countof(tmp), TranslateT("Set my nickname for %s"), proto->description);
+ mir_sntprintf(tmp, TranslateT("Set my nickname for %s"), proto->description);
SetWindowText(hwndDlg, tmp);
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w }
TCHAR title[256];
- mir_sntprintf(title, _countof(title), TranslateT("Set my status message for %s"), proto->description);
+ mir_sntprintf(title, TranslateT("Set my status message for %s"), proto->description);
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, proto->GetStatusMsg());
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM w SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(NULL, data->status));
TCHAR title[256];
- mir_sntprintf(title, _countof(title), TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
+ mir_sntprintf(title, TranslateT("Set my status message for %s"), pcli->pfnGetStatusModeDescription(data->status, 0));
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, protocols->GetDefaultStatusMsg(data->status));
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 06df823b98..e3f7547623 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -306,11 +306,11 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) // the protocol supports status message sending for current status, or autoreplying
if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) ||
((Flag1 & PF1_IM) == PF1_IM && (i < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[i].DisableReplyCtlID))))
- mir_sntprintf(szSetStr, _countof(szSetStr), TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szSetStr, TranslateT("Set %s message for the contact"), pcli->pfnGetStatusModeDescription(iMode, 0), pcli->pfnGetContactDisplayName(hContact, 0));
// the protocol supports status message reading for contact's status
if (Flag1 & PF1_MODEMSGRECV && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iContactMode)) {
- mir_sntprintf(szReadStr, _countof(szReadStr), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
+ mir_sntprintf(szReadStr, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iContactMode, 0));
hReadMsgIcon = Skin_LoadProtoIcon(szProto, iContactMode);
}
}
diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index 2d004aa625..66f7160ccf 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -69,7 +69,7 @@ void ShowLog(TCString &LogFilePath) INT_PTR Result = (INT_PTR)ShellExecute(NULL, _T("open"), LogFilePath, NULL, NULL, SW_SHOW);
if (Result <= 32) {
TCHAR szError[64];
- mir_sntprintf(szError, _countof(szError), TranslateT("Error #%d"), Result);
+ mir_sntprintf(szError, TranslateT("Error #%d"), Result);
ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true);
}
}
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp index 849633183a..6eb8f63e33 100644 --- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp @@ -70,10 +70,10 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam char *szProto = GetContactProto(awayData->hContact);
TCHAR *status = pcli->pfnGetStatusModeDescription(db_get_w(awayData->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status, contactName);
+ mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
GetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status);
+ mir_sntprintf(str, format, status);
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_RETRIEVE, str);
}
return true;
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp index 6d0f2ae624..d974547d69 100644 --- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp +++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp @@ -433,7 +433,7 @@ void UpdateCheckboxesState(CCList *CList) HICON g_LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "", name);
+ mir_snprintf(szSettingName, "%s_%s", "", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -848,7 +848,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA return true;
}
TCHAR BtnTitle[64];
- mir_sntprintf(BtnTitle, _countof(BtnTitle), TranslateT("Closing in %d"), Countdown);
+ mir_sntprintf(BtnTitle, TranslateT("Closing in %d"), Countdown);
SetDlgItemText(hwndDlg, IDC_OK, BtnTitle);
Countdown--;
}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 0dad1d5e4e..089db2de2b 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -231,7 +231,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) if (pcBlob >= pcEnd)
break;
}
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Received %d contacts."), nContacts);
+ mir_sntprintf(szBuf, TranslateT("Received %d contacts."), nContacts);
comment1 = mir_tstrdup(szBuf);
}
commentFix = POPUP_COMMENT_CONTACTS;
@@ -254,7 +254,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
char *pszEmail = pszLast + mir_strlen(pszLast) + 1;
- mir_snprintf(szUin, _countof(szUin), "%d", *((DWORD*)dbei->pBlob));
+ mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
szNick = mir_utf8decodeT(pszNick);
@@ -290,7 +290,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) char *pszLast = pszFirst + mir_strlen(pszFirst) + 1;
char *pszEmail = pszLast + mir_strlen(pszLast) + 1;
- mir_snprintf(szUin, _countof(szUin), "%d", *((DWORD*)dbei->pBlob));
+ mir_snprintf(szUin, "%d", *((DWORD*)dbei->pBlob));
if (mir_strlen(pszNick) > 0) {
if (dbei->flags & DBEF_UTF)
szNick = mir_utf8decodeT(pszNick);
@@ -540,12 +540,12 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) TCHAR lpzText[MAX_SECONDLINE*2] = _T("\0\0");
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(lpzText, _countof(lpzText), TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
+ mir_sntprintf(lpzText, TranslateT("[b]Number of new message(s): %d[/b]\n"), pdata->countEvent);
int doReverse = pdata->pluginOptions->bShowON;
if ((pdata->firstShowEventData != pdata->firstEventData && doReverse) || (pdata->firstShowEventData != pdata->lastEventData && !doReverse))
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s...\n"), lpzText);
+ mir_sntprintf(lpzText, _T("%s...\n"), lpzText);
//take the active event as starting one
EVENT_DATA_EX *eventData = pdata->firstShowEventData;
@@ -578,12 +578,12 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) mir_tstrncat(formatTime, _T(" %H:%M"), _countof(formatTime) - mir_tstrlen(formatTime));
time_t localTime = dbe.timestamp;
_tcsftime(timestamp, _countof(timestamp), formatTime, localtime(&localTime));
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s[b][i]%s[/i][/b]\n"), lpzText, timestamp);
+ mir_sntprintf(lpzText, _T("%s[b][i]%s[/i][/b]\n"), lpzText, timestamp);
}
// prepare event preview
TCHAR* szEventPreview = GetEventPreview(&dbe);
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s%s"), lpzText, szEventPreview);
+ mir_sntprintf(lpzText, _T("%s%s"), lpzText, szEventPreview);
mir_free(szEventPreview);
if (dbe.pBlob)
@@ -595,11 +595,11 @@ int PopupUpdate(MCONTACT hContact, MEVENT hEvent) else if ((iEvent >= pdata->pluginOptions->iNumberMsg && pdata->pluginOptions->iNumberMsg) || !eventData->prev)
break;
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s\n"), lpzText);
+ mir_sntprintf(lpzText, _T("%s\n"), lpzText);
}
if ((doReverse && eventData->next) || (!doReverse && eventData->prev))
- mir_sntprintf(lpzText, _countof(lpzText), _T("%s\n..."), lpzText);
+ mir_sntprintf(lpzText, _T("%s\n..."), lpzText);
PUChangeTextT(pdata->hWnd, lpzText);
return 0;
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index 89488d3843..01a12dcdde 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -72,9 +72,9 @@ TCHAR *SelectSound(HWND hwndDlg, TCHAR *buff, size_t bufflen) ofn.hInstance = hInst;
TCHAR filter[MAX_PATH];
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(filter, _countof(filter), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*.*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
- mir_sntprintf(filter, _countof(filter), _T("%s (*.wav)%c*.wav%c%s (*.*)%c*%c"), TranslateT("Wave files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.wav)%c*.wav%c%s (*.*)%c*%c"), TranslateT("Wave files"), 0, 0, TranslateT("All files"), 0, 0);
ofn.lpstrFilter = filter;
ofn.lpstrFile = buff;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR;
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index e4091cb972..b2eead3fa9 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -88,7 +88,7 @@ BYTE GetGender(MCONTACT hContact) HANDLE GetIconHandle(char *szIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, szIcon);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, szIcon);
return IcoLib_GetIconHandle(szSettingName);
}
@@ -416,8 +416,8 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) // check if that proto from which we received statuschange notification, isn't in autodisable list
if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
- mir_snprintf(statusIDs, _countof(statusIDs), "s%d", myStatus);
- mir_snprintf(statusIDp, _countof(statusIDp), "p%d", myStatus);
+ mir_snprintf(statusIDs, "s%d", myStatus);
+ mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : TRUE;
bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : TRUE;
}
@@ -442,7 +442,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) if (opt.BlinkIcon && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, newStatus) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
+ mir_sntprintf(str, TranslateT("%s is now %s"), pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText);
BlinkIcon(hContact, hIcon, str);
}
@@ -458,7 +458,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("HH':'mm"), stzTime, _countof(stzTime));
GetDateFormat(LOCALE_USER_DEFAULT, 0, NULL, _T("dd/MM/yyyy"), stzDate, _countof(stzDate));
- mir_sntprintf(stzText, _countof(stzText), TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
+ mir_sntprintf(stzText, TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), StatusList[Index(newStatus)].lpzStandardText,
StatusList[Index(oldStatus)].lpzStandardText);
LogToFile(stzText);
@@ -552,7 +552,7 @@ int ProcessExtraStatus(DBCONTACTWRITESETTING *cws, MCONTACT hContact) }
else if (strstr(cws->szSetting, "text")) {
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%s", szSetting, "Msg");
+ mir_snprintf(dbSetting, "%s%s", szSetting, "Msg");
smi.compare = CompareStatusMsg(&smi, cws, dbSetting);
if (smi.compare == COMPARE_SAME) {
replaceStrT(smi.newstatusmsg, 0);
@@ -650,11 +650,11 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) goto skip_notify;
char dbSetting[64];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto);
+ mir_snprintf(dbSetting, "%s_enabled", szProto);
// this proto is not set for status message notifications
if (db_get_b(NULL, MODULE, dbSetting, 1) == 0)
goto skip_notify;
- mir_snprintf(dbSetting, _countof(dbSetting), "%d", IDC_CHK_STATUS_MESSAGE);
+ mir_snprintf(dbSetting, "%d", IDC_CHK_STATUS_MESSAGE);
// status message change notifications are disabled
if (db_get_b(NULL, MODULE, dbSetting, 1) == 0)
goto skip_notify;
@@ -665,8 +665,8 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) // check if our status isn't on autodisable list
if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
- mir_snprintf(statusIDs, _countof(statusIDs), "s%d", myStatus);
- mir_snprintf(statusIDp, _countof(statusIDp), "p%d", myStatus);
+ mir_snprintf(statusIDs, "s%d", myStatus);
+ mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : bEnableSound;
bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : bEnablePopup;
}
@@ -694,7 +694,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) TCHAR *str;
if (smi.compare == COMPARE_DEL) {
char protoname[MAX_PATH];
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgRemoved", szProto);
+ mir_snprintf(protoname, "%s_TPopupSMsgRemoved", szProto);
DBVARIANT dbVar = { 0 };
if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED);
@@ -706,7 +706,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) }
else {
char protoname[MAX_PATH];
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgChanged", szProto);
+ mir_snprintf(protoname, "%s_TPopupSMsgChanged", szProto);
DBVARIANT dbVar = { 0 };
if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED);
@@ -732,7 +732,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) if (opt.BlinkIcon && opt.BlinkIcon_ForMsgs && !opt.TempDisabled) {
HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, db_get_w(hContact, szProto, "Status", ID_STATUS_ONLINE)) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
+ mir_sntprintf(str, TranslateT("%s changed status message to %s"), pcli->pfnGetContactDisplayName(hContact, 0), smi.newstatusmsg);
BlinkIcon(hContact, hIcon, str);
}
@@ -759,7 +759,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) else
str = GetStr(&smi, templates.LogSMsgChanged);
- mir_sntprintf(stzText, _countof(stzText), _T("%s, %s. %s %s\r\n"), stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), str);
+ mir_sntprintf(stzText, _T("%s, %s. %s %s\r\n"), stzDate, stzTime, pcli->pfnGetContactDisplayName(hContact, 0), str);
LogToFile(stzText);
mir_free(str);
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 9096d049ba..d97a4993bb 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -218,7 +218,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
//Statuses notified
char status[8];
- mir_snprintf(status, _countof(status), "%d", i);
+ mir_snprintf(status, "%d", i);
CheckDlgButton(hwndDlg, i, db_get_b(0, MODULE, status, 1) ? BST_CHECKED : BST_UNCHECKED);
}
CheckDlgButton(hwndDlg, IDC_CHK_FROMOFFLINE, opt.FromOffline ? BST_CHECKED : BST_UNCHECKED);
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ofn.nMaxFile = MAX_PATH;
ofn.hwndOwner = hwndDlg;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c"), TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.*)%c*.*%c%s (*.log)%c*.log%c%s (*.txt)%c*.txt%c"), TranslateT("All Files"), 0, 0, TranslateT("Log"), 0, 0, TranslateT("Text"), 0, 0);
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 2;
ofn.lpstrInitialDir = buff;
@@ -289,7 +289,7 @@ INT_PTR CALLBACK DlgProcGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA //Notified statuses
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX2; i++) {
char status[8];
- mir_snprintf(status, _countof(status), "%d", i);
+ mir_snprintf(status, "%d", i);
db_set_b(NULL, MODULE, status, (BYTE)IsDlgButtonChecked(hwndDlg, i));
}
opt.FromOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_FROMOFFLINE);
@@ -729,7 +729,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DBVARIANT dbVar = { 0 };
char protoname[MAX_PATH] = { 0 };
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgChanged", protos[i]->szModuleName);
+ mir_snprintf(protoname, "%s_TPopupSMsgChanged", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
_tcsncpy(prototemplate->ProtoTemplateMsg, DEFAULT_POPUP_SMSGCHANGED, _countof(prototemplate->ProtoTemplateMsg));
else {
@@ -737,7 +737,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA db_free(&dbVar);
}
- mir_snprintf(protoname, _countof(protoname), "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
+ mir_snprintf(protoname, "%s_TPopupSMsgRemoved", protos[i]->szModuleName);
if (db_get_ts(NULL, MODULE, protoname, &dbVar))
_tcsncpy(prototemplate->ProtoTemplateRemoved, DEFAULT_POPUP_SMSGREMOVED, _countof(prototemplate->ProtoTemplateRemoved));
else {
@@ -749,7 +749,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ProtoTemplates.insert(prototemplate, ProtoTemplates.getCount());
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULE, dbSetting, TRUE));
lvItem.iItem++;
}
@@ -862,7 +862,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ListView_GetItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
+ mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam);
db_set_b(NULL, MODULE, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 98de23ac0b..7aed434811 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -85,7 +85,7 @@ static int AwayMsgHook(WPARAM, LPARAM lParam, LPARAM pObj) TCHAR stzText[1024];
if (pstzLast)
- mir_sntprintf(stzText, _countof(stzText), _T("%s\n%s"), pstzLast, tszStatus);
+ mir_sntprintf(stzText, _T("%s\n%s"), pstzLast, tszStatus);
else
_tcsncpy(stzText, tszStatus, _countof(stzText));
SendMessage(pdp->hWnd, WM_SETREDRAW, FALSE, 0);
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 644134d4da..55696fc3c4 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -226,7 +226,7 @@ void BlinkXStatusIcon(XSTATUSCHANGE *xsc) HICON hIcon = NULL;
TCHAR str[256] = { 0 };
TCHAR stzType[32];
- mir_sntprintf(str, _countof(str), TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
+ mir_sntprintf(str, TranslateT("%s changed %s"), pcli->pfnGetContactDisplayName(xsc->hContact, 0), GetStatusTypeAsString(xsc->type, stzType));
if (opt.BlinkIcon_Status) {
DBVARIANT dbv;
@@ -337,7 +337,7 @@ void LogChangeToFile(XSTATUSCHANGE *xsc) Template = templates.LogXMsgRemoved; break;
}
- mir_sntprintf(stzText, _countof(stzText), _T("%s, %s. %s %s\r\n"), stzDate, stzTime,
+ mir_sntprintf(stzText, _T("%s, %s. %s %s\r\n"), stzDate, stzTime,
pcli->pfnGetContactDisplayName(xsc->hContact, 0), ReplaceVars(xsc, Template).GetString());
LogToFile(stzText);
@@ -369,8 +369,8 @@ void ExtraStatusChanged(XSTATUSCHANGE *xsc) if (opt.AutoDisable) {
char statusIDs[12], statusIDp[12];
WORD myStatus = (WORD)CallProtoService(xsc->szProto, PS_GETSTATUS, 0, 0);
- mir_snprintf(statusIDs, _countof(statusIDs), "s%d", myStatus);
- mir_snprintf(statusIDp, _countof(statusIDp), "p%d", myStatus);
+ mir_snprintf(statusIDs, "s%d", myStatus);
+ mir_snprintf(statusIDp, "p%d", myStatus);
bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : bEnableSound;
bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : bEnablePopup;
}
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index a838e205b6..83a78ee173 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -57,7 +57,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) HXML child = xmlGetChild(chan, j);
if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, _T("koi8-r"))) {
TCHAR buf[MAX_PATH];
@@ -74,7 +74,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) HXML child = xmlGetChild(node, j);
if (!mir_tstrcmpi(xmlGetName(child), _T("title"))) {
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis a valid feed's address."), tszURL);
+ mir_sntprintf(mes, TranslateT("%s\nis a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
if (!mir_tstrcmpi(codepage, _T("koi8-r"))) {
TCHAR buf[MAX_PATH];
@@ -93,7 +93,7 @@ LPCTSTR CheckFeed(TCHAR *tszURL, HWND hwndDlg) }
Netlib_LogfT(hNetlibUser, _T("%s is not a valid feed's address."), tszURL);
TCHAR mes[MAX_PATH];
- mir_sntprintf(mes, _countof(mes), TranslateT("%s\nis not a valid feed's address."), tszURL);
+ mir_sntprintf(mes, TranslateT("%s\nis not a valid feed's address."), tszURL);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONERROR);
return NULL;
}
@@ -229,7 +229,7 @@ void CheckCurrentFeed(MCONTACT hContact) LPCTSTR szAttrName = xmlGetAttrName(node, i);
if (!mir_tstrcmpi(szAttrName, _T("version"))) {
TCHAR ver[MAX_PATH];
- mir_sntprintf(ver, _countof(ver), _T("RSS %s"), xmlGetAttrValue(node, szAttrName));
+ mir_sntprintf(ver, _T("RSS %s"), xmlGetAttrValue(node, szAttrName));
db_set_ts(hContact, MODULE, "MirVer", ver);
break;
}
@@ -346,7 +346,7 @@ void CheckCurrentFeed(MCONTACT hContact) CMString filename = szNick;
filename.Replace(_T("/"), _T("_"));
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename.c_str(), ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename.c_str(), ext);
CreateDirectoryTreeT(tszRoot);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
@@ -487,7 +487,7 @@ void CheckCurrentFeed(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -632,7 +632,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
@@ -665,7 +665,7 @@ void CheckCurrentFeedAvatar(MCONTACT hContact) ai.format = ProtoGetAvatarFormat(ext);
TCHAR *filename = szNick;
- mir_sntprintf(ai.filename, _countof(ai.filename), _T("%s\\%s.%s"), tszRoot, filename, ext);
+ mir_sntprintf(ai.filename, _T("%s\\%s.%s"), tszRoot, filename, ext);
if (DownloadFile(url, ai.filename)) {
db_set_ts(hContact, MODULE, "ImagePath", ai.filename);
ProtoBroadcastAck(MODULE, hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, NULL);
diff --git a/plugins/NewsAggregator/Src/ExportImport.cpp b/plugins/NewsAggregator/Src/ExportImport.cpp index fe4b799d76..20384c3e18 100644 --- a/plugins/NewsAggregator/Src/ExportImport.cpp +++ b/plugins/NewsAggregator/Src/ExportImport.cpp @@ -130,7 +130,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if ( !group)
group = (TCHAR *)xmlGetAttrValue(parent, xmlGetAttrName(parent, i));
else {
- mir_sntprintf(tmpgroup, _countof(tmpgroup), _T("%s\\%s"), xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
+ mir_sntprintf(tmpgroup, _T("%s\\%s"), xmlGetAttrValue(parent, xmlGetAttrName(parent, i)), group);
group = tmpgroup;
}
break;
@@ -209,9 +209,9 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
TCHAR mes[MAX_PATH];
if (DUPES)
- mir_sntprintf(mes, _countof(mes), TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
+ mir_sntprintf(mes, TranslateT("Imported %d feed(s)\r\nNot imported %d duplicate(s)."), count - DUPES, DUPES);
else
- mir_sntprintf(mes, _countof(mes), TranslateT("Imported %d feed(s)."), count);
+ mir_sntprintf(mes, TranslateT("Imported %d feed(s)."), count);
MessageBox(hwndDlg, mes, TranslateT("News Aggregator"), MB_OK | MB_ICONINFORMATION);
}
}
@@ -228,7 +228,7 @@ INT_PTR CALLBACK DlgProcImportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.opml, *.xml)%c*.opml;*.xml%c%c"), TranslateT("OPML files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.opml, *.xml)%c*.opml;*.xml%c%c"), TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
@@ -491,7 +491,7 @@ INT_PTR CALLBACK DlgProcExportOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.opml)%c*.opml%c%c"), TranslateT("OPML files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.opml)%c*.opml%c%c"), TranslateT("OPML files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/NewsAggregator/Src/Icons.cpp b/plugins/NewsAggregator/Src/Icons.cpp index 9a25f711c1..8cfd2716e2 100644 --- a/plugins/NewsAggregator/Src/Icons.cpp +++ b/plugins/NewsAggregator/Src/Icons.cpp @@ -39,7 +39,7 @@ void InitIcons() HICON LoadIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, name);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index dfdf630c21..80810f8a26 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -95,7 +95,7 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_TAGHELP:
TCHAR tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, _countof(tszTagHelp), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTagHelp, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("#<title>#"), TranslateT("The title of the item."),
_T("#<description>#"), TranslateT("The item synopsis."),
_T("#<link>#"), TranslateT("The URL of the item."),
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP:
TCHAR tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, _countof(tszTagHelp), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTagHelp, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("#<title>#"), TranslateT("The title of the item."),
_T("#<description>#"), TranslateT("The item synopsis."),
_T("#<link>#"), TranslateT("The URL of the item."),
@@ -418,7 +418,7 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP case IDC_TAGHELP:
TCHAR tszTagHelp[1024];
- mir_sntprintf(tszTagHelp, _countof(tszTagHelp), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTagHelp, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("#<title>#"), TranslateT("The title of the item."),
_T("#<description>#"), TranslateT("The item synopsis."),
_T("#<link>#"), TranslateT("The URL of the item."),
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 33c9778e0f..855d2eef6f 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -157,7 +157,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (!db_get_w(NULL, MODNAME, "Timer", 1))
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, TranslateT("Non-IM Contact protocol timer is Disabled"));
else {
- mir_sntprintf(string, _countof(string), TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"), db_get_w(NULL, MODNAME, "Timer", 1));
+ mir_sntprintf(string, TranslateT("Timer intervals... Non-IM Contact Protocol timer is %d seconds"), db_get_w(NULL, MODNAME, "Timer", 1));
SetDlgItemText(hwnd, IDC_TIMER_INTERVAL_MSG, string);
}
}
@@ -200,7 +200,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case IDC_OPEN_FOLDER:
if (BrowseForFolder(hwnd, szFileName)) {
- mir_snprintf(szFileName, _countof(szFileName), "%s ,/e", szFileName);
+ mir_snprintf(szFileName, "%s ,/e", szFileName);
SetDlgItemTextA(hwnd, IDC_LINK, "explorer.exe");
SetDlgItemTextA(hwnd, IDC_PARAMS, szFileName);
}
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index c5fdf36770..469fd1ee73 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -288,7 +288,7 @@ void DoPropertySheet(MCONTACT hContact) psh.hInstance = g_hInst;
psh.pszIcon = MAKEINTRESOURCEA(IDI_MAIN);
db_get_static(hContact, MODNAME, "Nick", nick, _countof(nick));
- mir_snprintf(title, _countof(title), Translate("Edit Non-IM Contact \"%s\""), nick);
+ mir_snprintf(title, Translate("Edit Non-IM Contact \"%s\""), nick);
psh.pszCaption = title;
psh.nPages = _countof(psp);
psh.ppsp = (LPCPROPSHEETPAGEA)&psp;
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp index c97369d641..9f37274b1f 100644 --- a/plugins/Non-IM Contact/src/files.cpp +++ b/plugins/Non-IM Contact/src/files.cpp @@ -114,7 +114,7 @@ void readFile(HWND hwnd) }
if (!strncmp("http://", szFileName, mir_strlen("http://")) || !strncmp("https://", szFileName, mir_strlen("https://")))
- mir_snprintf(szFileName, _countof(szFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
+ mir_snprintf(szFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
FILE *filen = fopen(szFileName, "r");
if (!filen) {
@@ -130,7 +130,7 @@ void readFile(HWND hwnd) else if (temp[mir_strlen(temp) - 1] == '\n')
temp[mir_strlen(temp) - 1] = '\0';
else temp[mir_strlen(temp)] = '\0';
- mir_snprintf(temp1, _countof(temp1), Translate("line(%-3d) = | %s"), lineNumber, temp);
+ mir_snprintf(temp1, Translate("line(%-3d) = | %s"), lineNumber, temp);
SendDlgItemMessageA(hwnd, IDC_FILE_CONTENTS, LB_ADDSTRING, 0, (LPARAM)temp1);
lineNumber++;
fileLength++;
@@ -186,7 +186,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (!db_get_static(NULL, MODNAME, fn, text, _countof(text)))
break;
}
- mir_snprintf(szFileName, _countof(szFileName), "%s\\plugins\\%s.html", getMimDir(temp), fn);
+ mir_snprintf(szFileName, "%s\\plugins\\%s.html", getMimDir(temp), fn);
if (savehtml(szFileName)) {
mir_snprintf(fn, "fn%d", i);
db_set_s(NULL, MODNAME, fn, url);
diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 973d689ee3..32237af843 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -3,7 +3,7 @@ int readFileIntoArray(int fileNumber, char *FileContents[])
{
char dbSetting[20], temp[MAX_STRING_LENGTH];
- mir_snprintf(dbSetting, _countof(dbSetting), "fn%d", fileNumber);
+ mir_snprintf(dbSetting, "fn%d", fileNumber);
char *szVar = db_get_sa(NULL, MODNAME, dbSetting);
if (szVar == NULL)
@@ -11,7 +11,7 @@ int readFileIntoArray(int fileNumber, char *FileContents[]) char tszFileName[MAX_PATH];
if (!strncmp("http://", szVar, 7) || !strncmp("https://", szVar, 7))
- mir_snprintf(tszFileName, _countof(tszFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
+ mir_snprintf(tszFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), fileNumber);
else
mir_strncpy(tszFileName, szVar, _countof(tszFileName));
mir_free(szVar);
@@ -405,7 +405,7 @@ int lastChecked(CMStringA &szNewStr, const char *str) return 0;
if (!strncmp("http://", szVar, 7) || !strncmp("https://", szVar, 8))
- mir_snprintf(tszFileName, _countof(tszFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), file);
+ mir_snprintf(tszFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), file);
else
mir_strncpy(tszFileName, szVar, _countof(tszFileName));
mir_free(szVar);
@@ -417,7 +417,7 @@ int lastChecked(CMStringA &szNewStr, const char *str) if (GetLastWriteTime(hFile, tszFileName)) {
CloseHandle(hFile);
szNewStr.Append(tszFileName);
- mir_snprintf(tszFileName, _countof(tszFileName), "%s%d))", szPattern, file);
+ mir_snprintf(tszFileName, "%s%d))", szPattern, file);
return (int)mir_strlen(tszFileName);
}
CloseHandle(hFile);
@@ -540,7 +540,7 @@ int stringReplacer(const char *oldString, CMStringA &szNewString, MCONTACT hCont return ERROR_NO_FILE;
}
else {
- mir_snprintf(tempString, _countof(tempString), "fn%d", tempInt);
+ mir_snprintf(tempString, "fn%d", tempInt);
if (db_get_static(NULL, MODNAME, tempString, tempString, _countof(tempString)))
szNewString.Append(tempString);
else return ERROR_NO_FILE;
@@ -623,7 +623,7 @@ void replaceAllStrings(MCONTACT hContact) /* tooltips*/
WriteSetting(hContact, MODNAME, "ToolTip", "UserInfo", "MyNotes");
if (db_get_static(hContact, MODNAME, "Program", tmp1, _countof(tmp1)) && db_get_static(hContact, MODNAME, "ProgramParams", tmp2, _countof(tmp2))) {
- mir_snprintf(tmp3, _countof(tmp3), "%s %s", tmp1, tmp2);
+ mir_snprintf(tmp3, "%s %s", tmp1, tmp2);
db_set_s(hContact, "UserInfo", "FirstName", tmp3);
}
else if (db_get_static(hContact, MODNAME, "Program", tmp1, _countof(tmp1))) {
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp index 3bf775e6fa..b7851eb1d1 100644 --- a/plugins/Non-IM Contact/src/timer.cpp +++ b/plugins/Non-IM Contact/src/timer.cpp @@ -32,7 +32,7 @@ void timerFunc(void*) int timer = db_get_w(NULL, MODNAME, fn, 60);
if (timer && !(timerCount % timer)) {
if (!InternetDownloadFile(text)) {
- mir_snprintf(szFileName, _countof(szFileName), "%s\\plugins\\fn%d.html", getMimDir(temp), i);
+ mir_snprintf(szFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), i);
savehtml(szFileName);
}
}
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 8ad6753abf..b017f04e94 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -381,7 +381,7 @@ void LoadNotes(BOOL bIsStartup) { char *DelPos; - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); if (Value) { @@ -694,7 +694,7 @@ void PurgeNotes(void) NotesCount = db_get_dw(0,MODULENAME,"NotesData",0); for(I = 0; I < NotesCount; I++) { - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); db_unset(0,MODULENAME,ValueName); } } @@ -940,7 +940,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) Value[0xffff] = 0; } - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB + mir_snprintf(ValueName, "NotesData%d", NotesCount - I - 1); // we do not reverse notes in DB db_set_blob(0, MODULENAME, ValueName, Value, n+1); @@ -956,7 +956,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) // delete any left over DB note entries for(; I < OldNotesCount; I++) { - mir_snprintf(ValueName, _countof(ValueName), "NotesData%d", I); + mir_snprintf(ValueName, "NotesData%d", I); db_unset(0,MODULENAME,ValueName); } diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 8e4238cff7..e356728c4a 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -215,7 +215,7 @@ void PurgeReminders(void) ReminderCount = db_get_dw(0,MODULENAME,"RemindersData",0);
for(I = 0;I < ReminderCount;I++)
{
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -287,7 +287,7 @@ void JustSaveReminders(void) Value[0xffff] = 0;
}
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
+ mir_snprintf(ValueName, "RemindersData%d", ReminderCount - I - 1); // do not want to reverse in DB
db_set_blob(0, MODULENAME, ValueName, Value, n+1);
@@ -297,7 +297,7 @@ void JustSaveReminders(void) // delete any left over DB reminder entries
for(; I < OldReminderCount; I++)
{
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
db_unset(0, MODULENAME, ValueName);
}
}
@@ -317,7 +317,7 @@ void LoadReminders(void) {
Size = 65535;
Value = NULL;
- mir_snprintf(ValueName, _countof(ValueName), "RemindersData%d", I);
+ mir_snprintf(ValueName, "RemindersData%d", I);
ReadSettingBlob(0, MODULENAME, ValueName, &Size, (void**)&Value);
@@ -607,7 +607,7 @@ INT_PTR OpenTriggeredReminder(WPARAM w, LPARAM l) pReminder->handle = H = CreateDialog(hinstance, MAKEINTRESOURCE(IDD_NOTIFYREMINDER), 0, DlgProcNotifyReminder);
- mir_snprintf(S, _countof(S), "%s! - %s", Translate("Reminder"), S1);
+ mir_snprintf(S, "%s! - %s", Translate("Reminder"), S1);
SetWindowText(H, S);
if (pReminder->Reminder)
@@ -642,7 +642,7 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName) char szShort[MAX_PATH];
char s[512];
GetShortPathNameA(szFull, szShort, sizeof(szShort));
- mir_snprintf(s, _countof(s), "play \"%s\"", szShort);
+ mir_snprintf(s, "play \"%s\"", szShort);
mciSendStringA(s, NULL, 0, NULL);
}
@@ -1055,7 +1055,7 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S const int m = (i&1) ? 30 : 0;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
// item data contains time offset from midnight in seconds (bit 31 is set to flag that
// combo box items are absolute times and not relative times like below
@@ -1086,35 +1086,35 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S FileTimeToTzLocalST((FILETIME*)&li, &tm2);
wCurHour = tm2.wHour;
wCurMinute = tm2.wMinute;
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm2.wHour, (UINT)tm2.wMinute);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 5 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (5 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 10 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (10 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 15 minutes
li.QuadPart += (ULONGLONG)5 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (15 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
// 30 minutes
li.QuadPart += (ULONGLONG)15 * MinutesToFileTime;
FileTimeToTzLocalST((FILETIME*)&li, &tm2);
- mir_snprintf(s, _countof(s), "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (30 %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog, nIDTime, CB_SETITEMDATA, n, (LPARAM)((li.QuadPart-ref)/FILETIME_TICKS_PER_SEC));
@@ -1142,13 +1142,13 @@ static void PopulateTimeCombo(HWND Dialog, UINT nIDTime, BOOL bRelative, const S }
// icq-style display 1.0, 1.5 etc. hours even though that isn't accurate due to rounding
- //mir_snprintf(s, _countof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
+ //mir_snprintf(s, "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, 1+(i>>1), (i&1) ? 5 : 0, lpszHours);
// display delta time more accurately to match reformatting (that icq doesn't do)
dt = (UINT)((li.QuadPart/MinutesToFileTime) - (ref/MinutesToFileTime));
if (dt < 60)
- mir_snprintf(s, _countof(s), "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
+ mir_snprintf(s, "%02d:%02d (%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt, lpszMinutes);
else
- mir_snprintf(s, _countof(s), "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
+ mir_snprintf(s, "%02d:%02d (%d.%d %s)", (UINT)tm2.wHour, (UINT)tm2.wMinute, dt/60, ((dt%60)*10)/60, lpszHours);
n = SendDlgItemMessage(Dialog,nIDTime,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDTime,CB_SETITEMDATA,n, dt*60);
@@ -1179,39 +1179,39 @@ static void PopulateTimeOffsetCombo(HWND Dialog, UINT nIDCombo) // 5 - 55 minutes (in 5 minute steps)
for (i = 1; i < 12; i++)
{
- mir_snprintf(s, _countof(s), "%d %s", i*5, lpszMinutes);
+ mir_snprintf(s, "%d %s", i*5, lpszMinutes);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA,n, i*5);
}
// 1 hour
- mir_snprintf(s, _countof(s), "1 %s", lpszHour);
+ mir_snprintf(s, "1 %s", lpszHour);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 60);
// 2, 4, 8 hours
for (i = 2; i <= 8; i+=2)
{
- mir_snprintf(s, _countof(s), "%d %s", i, lpszHours);
+ mir_snprintf(s, "%d %s", i, lpszHours);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*60);
}
// 1 day
- mir_snprintf(s, _countof(s), "1 %s", lpszDay);
+ mir_snprintf(s, "1 %s", lpszDay);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 24*60);
// 2-4 days
for (i = 2; i <= 4; i++)
{
- mir_snprintf(s, _countof(s), "%d %s", i, lpszDays);
+ mir_snprintf(s, "%d %s", i, lpszDays);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, i*24*60);
}
// 1 week
- mir_snprintf(s, _countof(s), "1 %s", lpszWeek);
+ mir_snprintf(s, "1 %s", lpszWeek);
n = SendDlgItemMessage(Dialog,nIDCombo,CB_ADDSTRING,0,(LPARAM)s);
SendDlgItemMessage(Dialog,nIDCombo,CB_SETITEMDATA, n, 7*24*60);
}
@@ -1570,7 +1570,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP // which could potentially mess up things otherwise)
{
char s[32];
- mir_snprintf(s, _countof(s), "%I64x", li.QuadPart);
+ mir_snprintf(s, "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1915,7 +1915,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA // which could potentially mess up things otherwise)
{
char s[32];
- mir_snprintf(s, _countof(s), "%I64x", li.QuadPart);
+ mir_snprintf(s, "%I64x", li.QuadPart);
SetDlgItemText(Dialog, IDC_REFTIME, s);
}
@@ -1938,7 +1938,7 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA {
int n;
char s[32];
- mir_snprintf(s, _countof(s), "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
+ mir_snprintf(s, "%02d:%02d", (UINT)tm.wHour, (UINT)tm.wMinute);
// search for preset first
n = SendDlgItemMessage(Dialog, IDC_TIME, CB_FINDSTRING, (WPARAM)-1, (LPARAM)s);
@@ -1966,33 +1966,33 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)Translate("Never"));
SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_SETITEMDATA, n, 0);
- mir_snprintf(s, _countof(s), "%s 5 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 5 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)5);
- mir_snprintf(s, _countof(s), "%s 10 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 10 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)10);
- mir_snprintf(s, _countof(s), "%s 15 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 15 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)15);
- mir_snprintf(s, _countof(s), "%s 20 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 20 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)20);
- mir_snprintf(s, _countof(s), "%s 30 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 30 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog,IDC_COMBO_REPEATSND,CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)30);
- mir_snprintf(s, _countof(s), "%s 60 %s", lpszEvery, lpszSeconds);
+ mir_snprintf(s, "%s 60 %s", lpszEvery, lpszSeconds);
n = SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_ADDSTRING, 0, (LPARAM)s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETITEMDATA, n, (LPARAM)60);
if (NewReminderVisible == 2 && pEditReminder->RepeatSound)
{
- mir_snprintf(s, _countof(s), "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
+ mir_snprintf(s, "%s %d %s", lpszEvery, pEditReminder->RepeatSound, lpszSeconds);
SetDlgItemText(Dialog, IDC_COMBO_REPEATSND, s);
SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_SETCURSEL, SendDlgItemMessage(Dialog, IDC_COMBO_REPEATSND, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)s), 0);
}
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index 53fc784290..526d7010b5 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -51,7 +51,7 @@ INT_PTR NudgeSend(WPARAM hContact, LPARAM lParam) int diff = time(NULL) - db_get_dw(hContact, "Nudge", "LastSent", time(NULL) - 30);
if (diff < GlobalNudge.sendTimeSec) {
TCHAR msg[500];
- mir_sntprintf(msg, _countof(msg), TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
+ mir_sntprintf(msg, TranslateT("You are not allowed to send too much nudge (only 1 each %d sec, %d sec left)"), GlobalNudge.sendTimeSec, 30 - diff);
if (GlobalNudge.useByProtocol) {
for (int i = 0; i < arNudges.getCount(); i++) {
CNudgeElement &p = arNudges[i];
@@ -208,8 +208,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) void LoadProtocols(void)
{
//Load the default nudge
- mir_snprintf(DefaultNudge.ProtocolName, _countof(DefaultNudge.ProtocolName), "Default");
- mir_snprintf(DefaultNudge.NudgeSoundname, _countof(DefaultNudge.NudgeSoundname), "Nudge : Default");
+ mir_snprintf(DefaultNudge.ProtocolName, "Default");
+ mir_snprintf(DefaultNudge.NudgeSoundname, "Nudge : Default");
SkinAddNewSoundEx(DefaultNudge.NudgeSoundname, LPGEN("Nudge"), LPGEN("Default Nudge"));
DefaultNudge.Load();
@@ -513,7 +513,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) // Add a specific sound per protocol
CNudgeElement *p = new CNudgeElement();
- mir_snprintf(p->NudgeSoundname, _countof(p->NudgeSoundname), "%s: Nudge", proto->szModuleName);
+ mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);
strcpy_s(p->ProtocolName, proto->szModuleName);
_tcscpy_s(p->AccountName, proto->tszAccountName);
@@ -522,7 +522,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto) p->hEvent = hevent;
TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
- mir_sntprintf(soundDesc, _countof(soundDesc), LPGENT("Nudge for %s"), proto->tszAccountName);
+ mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);
arNudges.insert(p);
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 65b56df049..1e0d6a0576 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -3,55 +3,55 @@ void CNudge::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "useByProtocol");
+ mir_snprintf(SectionName, "useByProtocol");
db_set_b(NULL, MODULENAME, SectionName, this->useByProtocol);
- mir_snprintf(SectionName, _countof(SectionName), "RecvTimeSec");
+ mir_snprintf(SectionName, "RecvTimeSec");
db_set_dw(NULL, MODULENAME, SectionName, this->recvTimeSec);
- mir_snprintf(SectionName, _countof(SectionName), "SendTimeSec");
+ mir_snprintf(SectionName, "SendTimeSec");
db_set_dw(NULL, MODULENAME, SectionName, this->sendTimeSec);
- mir_snprintf(SectionName, _countof(SectionName), "ResendDelaySec");
+ mir_snprintf(SectionName, "ResendDelaySec");
db_set_dw(NULL, MODULENAME, SectionName, this->resendDelaySec);
}
void CNudge::Load(void)
{
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "useByProtocol");
+ mir_snprintf(SectionName, "useByProtocol");
this->useByProtocol = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "RecvTimeSec");
+ mir_snprintf(SectionName, "RecvTimeSec");
this->recvTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30);
- mir_snprintf(SectionName, _countof(SectionName), "SendTimeSec");
+ mir_snprintf(SectionName, "SendTimeSec");
this->sendTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30);
- mir_snprintf(SectionName, _countof(SectionName), "ResendDelaySec");
+ mir_snprintf(SectionName, "ResendDelaySec");
this->resendDelaySec = db_get_dw(NULL, MODULENAME, SectionName, 3);
}
void CNudgeElement::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "%s-openMessageWindow", ProtocolName);
+ mir_snprintf(SectionName, "%s-openMessageWindow", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->openMessageWindow);
- mir_snprintf(SectionName, _countof(SectionName), "%s-openContactList", ProtocolName);
+ mir_snprintf(SectionName, "%s-openContactList", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->openContactList);
- mir_snprintf(SectionName, _countof(SectionName), "%s-useIgnore", ProtocolName);
+ mir_snprintf(SectionName, "%s-useIgnore", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->useIgnoreSettings);
- mir_snprintf(SectionName, _countof(SectionName), "%s-showStatus", ProtocolName);
+ mir_snprintf(SectionName, "%s-showStatus", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->showStatus);
- mir_snprintf(SectionName, _countof(SectionName), "%s-showPopup", ProtocolName);
+ mir_snprintf(SectionName, "%s-showPopup", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->showPopup);
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeClist", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeClist", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->shakeClist);
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeChat", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeChat", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->shakeChat);
- mir_snprintf(SectionName, _countof(SectionName), "%s-enabled", ProtocolName);
+ mir_snprintf(SectionName, "%s-enabled", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->enabled);
- mir_snprintf(SectionName, _countof(SectionName), "%s-autoResend", ProtocolName);
+ mir_snprintf(SectionName, "%s-autoResend", ProtocolName);
db_set_b(NULL, MODULENAME, SectionName, this->autoResend);
- mir_snprintf(SectionName, _countof(SectionName), "%s-statusFlags", ProtocolName);
+ mir_snprintf(SectionName, "%s-statusFlags", ProtocolName);
db_set_dw(NULL, MODULENAME, SectionName, this->statusFlags);
- mir_snprintf(SectionName, _countof(SectionName), "%s-recText", ProtocolName);
+ mir_snprintf(SectionName, "%s-recText", ProtocolName);
db_set_ts(NULL, MODULENAME, SectionName, this->recText);
- mir_snprintf(SectionName, _countof(SectionName), "%s-senText", ProtocolName);
+ mir_snprintf(SectionName, "%s-senText", ProtocolName);
db_set_ts(NULL, MODULENAME, SectionName, this->senText);
}
@@ -59,28 +59,28 @@ void CNudgeElement::Load(void) {
DBVARIANT dbv;
char SectionName[512];
- mir_snprintf(SectionName, _countof(SectionName), "%s-openMessageWindow", ProtocolName);
+ mir_snprintf(SectionName, "%s-openMessageWindow", ProtocolName);
this->openMessageWindow = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-openContactList", ProtocolName);
+ mir_snprintf(SectionName, "%s-openContactList", ProtocolName);
this->openContactList = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-useIgnore", ProtocolName);
+ mir_snprintf(SectionName, "%s-useIgnore", ProtocolName);
this->useIgnoreSettings = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-showStatus", ProtocolName);
+ mir_snprintf(SectionName, "%s-showStatus", ProtocolName);
this->showStatus = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-showPopup", ProtocolName);
+ mir_snprintf(SectionName, "%s-showPopup", ProtocolName);
this->showPopup = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeClist", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeClist", ProtocolName);
this->shakeClist = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-shakeChat", ProtocolName);
+ mir_snprintf(SectionName, "%s-shakeChat", ProtocolName);
this->shakeChat = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-enabled", ProtocolName);
+ mir_snprintf(SectionName, "%s-enabled", ProtocolName);
this->enabled = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-autoResend", ProtocolName);
+ mir_snprintf(SectionName, "%s-autoResend", ProtocolName);
this->autoResend = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0;
- mir_snprintf(SectionName, _countof(SectionName), "%s-statusFlags", ProtocolName);
+ mir_snprintf(SectionName, "%s-statusFlags", ProtocolName);
this->statusFlags = db_get_dw(NULL, MODULENAME, SectionName, 967);
- mir_snprintf(SectionName,_countof(SectionName),"%s-recText", ProtocolName);
+ mir_snprintf(SectionName, "%s-recText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
_tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
if (_tcsclen(this->recText) < 1)
@@ -89,7 +89,7 @@ void CNudgeElement::Load(void) }
else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
- mir_snprintf(SectionName, _countof(SectionName), "%s-senText", ProtocolName);
+ mir_snprintf(SectionName, "%s-senText", ProtocolName);
if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
_tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
if (_tcsclen(this->senText) < 1)
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index 959fafd6bd..57c3da1c79 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -94,14 +94,14 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM TranslateDialogDefault(hwnd);
{
TCHAR szBuf[20];
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nMoveClist);
+ mir_sntprintf(szBuf, _T("%d"), shake.nMoveClist);
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nMoveChat);
+ mir_sntprintf(szBuf, _T("%d"), shake.nMoveChat);
SetDlgItemText(hwnd, IDC_LNUMBER_CHAT, szBuf);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nScaleClist);
+ mir_sntprintf(szBuf, _T("%d"), shake.nScaleClist);
SetDlgItemText(hwnd, IDC_LSCALE_CLIST, szBuf);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), shake.nScaleChat);
+ mir_sntprintf(szBuf, _T("%d"), shake.nScaleChat);
SetDlgItemText(hwnd, IDC_LSCALE_CHAT, szBuf);
}
@@ -132,7 +132,7 @@ static INT_PTR CALLBACK DlgProcShakeOpt(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
TCHAR szBuf[20];
DWORD dwPos = SendMessage((HWND)lParam, TBM_GETPOS, 0, 0);
- mir_sntprintf(szBuf, _countof(szBuf), _T("%d"), dwPos);
+ mir_sntprintf(szBuf, _T("%d"), dwPos);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CLIST))
SetDlgItemText(hwnd, IDC_LNUMBER_CLIST, szBuf);
if ((HWND)lParam == GetDlgItem(hwnd, IDC_SNUMBER_CHAT))
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index 09aa256d42..58c9860669 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -64,7 +64,7 @@ static int ModulesLoaded(WPARAM, LPARAM) HICON LoadIconExEx(const char* IcoLibName, int)
{
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", OPENFOLDER_MODULE_NAME, IcoLibName);
+ mir_snprintf(szSettingName, "%s_%s", OPENFOLDER_MODULE_NAME, IcoLibName);
return IcoLib_GetIcon(szSettingName);
}
diff --git a/plugins/OpenSSL/src/ssl_openssl.cpp b/plugins/OpenSSL/src/ssl_openssl.cpp index 076b36d69e..22f6ba39ca 100644 --- a/plugins/OpenSSL/src/ssl_openssl.cpp +++ b/plugins/OpenSSL/src/ssl_openssl.cpp @@ -270,7 +270,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) } TCHAR szMsgBuf2[512]; - mir_sntprintf(szMsgBuf2, _countof(szMsgBuf2), _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); + mir_sntprintf(szMsgBuf2, _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf); char* szMsg = Utf8EncodeT(szMsgBuf2); SslLog(szMsg); diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 656219ef27..bbd50f4347 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -349,33 +349,33 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam if (todo[i].enabled) {
switch (todo[i].FileType) {
case 1:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Pack"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Pack"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 2:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Plugins"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Plugins"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 3:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Icons"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Icons"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 4:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Others"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Others"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
case 5:
- mir_sntprintf(tszFileDest, _countof(tszFileDest), _T("%s\\Others"), tszRoot);
+ mir_sntprintf(tszFileDest, _T("%s\\Others"), tszRoot);
CreateDirectory(tszFileDest, NULL);
break;
default:
mir_tstrncpy(tszFileDest, tszRoot, _countof(tszFileDest));
break;
}
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%s\\Backups"), tszRoot);
+ mir_sntprintf(tszBuff, _T("%s\\Backups"), tszRoot);
CreateDirectory(tszBuff, NULL);
mir_tstrncpy(tszFileName, todo[i].File.tszDiskPath, _countof(tszFileName));
- mir_sntprintf(todo[i].File.tszDiskPath, _countof(todo[i].File.tszDiskPath), _T("%s\\%s"), tszFileDest, tszFileName);
+ mir_sntprintf(todo[i].File.tszDiskPath, _T("%s\\%s"), tszFileDest, tszFileName);
UpdatesCount++;
tszExt = &todo[i].File.tszDownloadURL[mir_tstrlen(todo[i].File.tszDownloadURL) - 5];
@@ -400,7 +400,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
}
mir_tstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, _countof(todo[i].tszCurVer));
- mir_snprintf(szKey, _countof(szKey), "File_%d_CurrentVersion", todo[i].FileNum);
+ mir_snprintf(szKey, "File_%d_CurrentVersion", todo[i].FileNum);
db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
arFilePath.push_back(todo[i].File.tszDiskPath);
@@ -452,10 +452,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 2:
tszUtilRootPlug = Utils_ReplaceVarsT(_T("%miranda_path%\\Plugins"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootPlug, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootPlug, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootPlug, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootPlug, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRootPlug);
@@ -465,10 +465,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 3:
tszUtilRootIco = Utils_ReplaceVarsT(_T("%miranda_path%\\Icons"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootIco, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootIco, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootIco, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootIco, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRootIco);
@@ -478,10 +478,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 4:
tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRoot);
@@ -491,10 +491,10 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam case 5:
tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%"));
if (mir_tstrcmp(arAdvFolder[i].c_str(), _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, arFileName[i].c_str());
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
- mir_sntprintf(tszFilePathBack, _countof(tszFilePathBack), _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, arAdvFolder[i].c_str(), arFileName[i].c_str());
+ mir_sntprintf(tszFilePathBack, _T("%s\\Backups\\%s"), tszRoot, arFileName[i].c_str());
MoveFile(tszFilePathDest, tszFilePathBack);
MoveFile(arFilePath[i].c_str(), tszFilePathDest);
mir_free(tszUtilRoot);
@@ -505,7 +505,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam else { //reminder for not installed pack update
if (Reminder && (UpdatesCount == 1) && (arFileType[0] == 1))
db_set_b(NULL, MODNAME, "Reminder", 2);
- mir_sntprintf(tszBuff, _countof(tszBuff), TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
+ mir_sntprintf(tszBuff, TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
Title = TranslateT("Pack Updater");
Text = tszBuff;
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED)) {
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 53a498be66..c01a16a3e6 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -204,7 +204,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) //Popups nitified
for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
- mir_snprintf(str2, _countof(str2), "Popups%dM", i);
+ mir_snprintf(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);
if (IsDlgButtonChecked(hdlg, (i + 40071)))
@@ -373,7 +373,7 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, "Popups%d", i);
db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i + 40071))));
- mir_snprintf(str2, _countof(str2), "Popups%dM", i);
+ mir_snprintf(str2, "Popups%dM", i);
db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i + 1024))));
}
return TRUE;
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 5c2d660079..5b9351986c 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -206,7 +206,7 @@ static void CheckUpdates(void *) // Download version info
pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl));
mir_tstrncpy(pFileUrl->tszDownloadURL, tszDownloadURL, _countof(pFileUrl->tszDownloadURL));
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%s\\tmp.ini"), tszRoot);
+ mir_sntprintf(tszBuff, _T("%s\\tmp.ini"), tszRoot);
mir_tstrncpy(pFileUrl->tszDiskPath, tszBuff, _countof(pFileUrl->tszDiskPath));
mir_tstrncpy(tszTmpIni, tszBuff, _countof(tszTmpIni));
Title = TranslateT("Pack Updater");
@@ -221,14 +221,14 @@ static void CheckUpdates(void *) for (CurrentFile = 0; CurrentFile < FileCount; CurrentFile++) {
FILEINFO FileInfo = { _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), { _T(""), _T("") } };
- mir_snprintf(szKey, _countof(szKey), "File_%d_CurrentVersion", CurrentFile + 1);
+ mir_snprintf(szKey, "File_%d_CurrentVersion", CurrentFile + 1);
ptrT tszCurVer(db_get_tsa(NULL, MODNAME, szKey));
if (tszCurVer)
mir_tstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer));
else
mir_tstrncpy(FileInfo.tszCurVer, _T(""), _countof(FileInfo.tszCurVer));
- mir_snprintf(szKey, _countof(szKey), "File_%d_LastVersion", CurrentFile + 1);
+ mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
ptrT tszLastVer(db_get_tsa(NULL, MODNAME, szKey));
if (tszLastVer)
mir_tstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer));
@@ -238,7 +238,7 @@ static void CheckUpdates(void *) Files.push_back(FileInfo);
// Read version info
- mir_sntprintf(tszFileInfo, _countof(tszFileInfo), _T("FileInfo_%d"), CurrentFile + 1);
+ mir_sntprintf(tszFileInfo, _T("FileInfo_%d"), CurrentFile + 1);
GetPrivateProfileString(tszFileInfo, _T("FileVersion"), _T(""), Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszNewVer), tszTmpIni);
GetPrivateProfileString(tszFileInfo, _T("Message"), _T(""), Files[CurrentFile].tszMessage, _countof(Files[CurrentFile].tszMessage), tszTmpIni);
GetPrivateProfileString(tszFileInfo, _T("DownloadURL"), _T(""), Files[CurrentFile].File.tszDownloadURL, _countof(Files[CurrentFile].File.tszDownloadURL), tszTmpIni);
@@ -265,9 +265,9 @@ static void CheckUpdates(void *) if (Files[CurrentFile].FileType == 2) {
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszBuff, _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszBuff, _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
TCHAR pluginFolderName[MAX_PATH];
PathToAbsoluteT(tszBuff, pluginFolderName);
if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
@@ -294,26 +294,26 @@ static void CheckUpdates(void *) case 2: {
VARST tszUtilRootPlug(_T("%miranda_path%\\Plugins"));
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
case 3: {
VARST tszUtilRootIco(_T("%miranda_path%\\Icons"));
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootIco, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
case 4:
case 5: {
VARST tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%"));
if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0)
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, Files[CurrentFile].File.tszDiskPath);
else
- mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
+ mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
}
break;
}//end* switch (Files[CurrentFile].FileType)
@@ -322,7 +322,7 @@ static void CheckUpdates(void *) UpdateFiles.push_back(Files[CurrentFile]);
// Save last version
mir_tstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer));
- mir_snprintf(szKey, _countof(szKey), "File_%d_LastVersion", CurrentFile + 1);
+ mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1);
db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
} // end compare versions
} //end checking all files in for ()
diff --git a/plugins/PasteIt/src/PasteToWeb.cpp b/plugins/PasteIt/src/PasteToWeb.cpp index c57cd58c38..6c5ad07296 100644 --- a/plugins/PasteIt/src/PasteToWeb.cpp +++ b/plugins/PasteIt/src/PasteToWeb.cpp @@ -384,7 +384,7 @@ void PasteToWeb::FromFile(std::wstring file) {
if (fileSize.QuadPart > 512000LL)
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024);
+ mir_sntprintf(bufErr, TranslateT("File size is %d KB, do you really want to paste such a large file?"), fileSize.LowPart / 1024);
if (MessageBox(NULL, bufErr, TranslateT("Are You sure?"), MB_YESNO | MB_ICONQUESTION) != IDYES)
{
CloseHandle(hFile);
@@ -399,7 +399,7 @@ void PasteToWeb::FromFile(std::wstring file) mir_free(fromFileData.content);
fromFileData.content = NULL;
fromFileData.contentLen = 0;
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Cannot read file '%s'"), file.c_str());
+ mir_sntprintf(bufErr, TranslateT("Cannot read file '%s'"), file.c_str());
error = bufErr;
}
}
@@ -413,7 +413,7 @@ void PasteToWeb::FromFile(std::wstring file) }
else
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Cannot open file '%s'"), file.c_str());
+ mir_sntprintf(bufErr, TranslateT("Cannot open file '%s'"), file.c_str());
error = bufErr;
}
@@ -491,7 +491,7 @@ void PasteToWeb::FromFile(std::wstring file) }
else
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("File '%s' is empty"), file.c_str());
+ mir_sntprintf(bufErr, TranslateT("File '%s' is empty"), file.c_str());
error = bufErr;
}
mir_free(fromFileData.content);
diff --git a/plugins/PasteIt/src/PasteToWeb1.cpp b/plugins/PasteIt/src/PasteToWeb1.cpp index ecf6dd2055..c301b00b6e 100644 --- a/plugins/PasteIt/src/PasteToWeb1.cpp +++ b/plugins/PasteIt/src/PasteToWeb1.cpp @@ -304,7 +304,7 @@ void PasteToWeb1::SendToServer(std::wstring str, std::wstring fileName, std::wst {
if (memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0)
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Error during sending text to web page: %s"), resCont + 17);
+ mir_sntprintf(bufErr, TranslateT("Error during sending text to web page: %s"), resCont + 17);
error = bufErr;
}
else
@@ -336,7 +336,7 @@ std::wstring PasteToWeb1::GetUserKey(std::wstring& user, std::wstring& password) {
if (memcmp(L"Bad API request, ", resCont, 17 * sizeof(wchar_t)) == 0)
{
- mir_sntprintf(bufErr, _countof(bufErr), TranslateT("Error during getting user key from web page: %s"), resCont + 17);
+ mir_sntprintf(bufErr, TranslateT("Error during getting user key from web page: %s"), resCont + 17);
MessageBox(NULL, bufErr, TranslateT("Error"), MB_OK | MB_ICONERROR);
}
else
diff --git a/plugins/Ping/src/icmp.cpp b/plugins/Ping/src/icmp.cpp index c8b8fbdb21..f54c356998 100644 --- a/plugins/Ping/src/icmp.cpp +++ b/plugins/Ping/src/icmp.cpp @@ -68,7 +68,7 @@ bool ICMP::ping(char *host, ICMP_ECHO_REPLY &reply) {
char winmsg[512], msg[1024];
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, code, 0, winmsg, 512, 0);
- mir_snprintf(msg, _countof(msg), "Ping error (%d): %s", code, winmsg);
+ mir_snprintf(msg, "Ping error (%d): %s", code, winmsg);
PUShowMessage(msg, SM_NOTIFY);
return false;
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index 467bd008bb..6d270c713a 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -82,7 +82,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case IDC_BTN_LOGBROWSE:
{
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.txt%c%s%c*.*%c"), TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.txt%c%s%c*.*%c"), TranslateT("Text Files (*.txt)"), 0, 0, TranslateT("All Files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile = options.log_filename;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index ca291c835d..b2124a6169 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -308,9 +308,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) if (frame_id != -1 && ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
TCHAR TBcapt[255];
if (total > 0)
- mir_sntprintf(TBcapt, _countof(TBcapt), _T("Ping (%d/%d)"), upCount, total);
+ mir_sntprintf(TBcapt, _T("Ping (%d/%d)"), upCount, total);
else
- mir_sntprintf(TBcapt, _countof(TBcapt), _T("Ping"));
+ mir_sntprintf(TBcapt, _T("Ping"));
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_TBTIPNAME | FO_TCHAR, frame_id), (LPARAM)TBcapt);
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp index 60f3d2a623..da34ebfc80 100644 --- a/plugins/PluginUpdater/src/DlgListNew.cpp +++ b/plugins/PluginUpdater/src/DlgListNew.cpp @@ -53,10 +53,10 @@ static void ApplyDownloads(void *param) //create needed folders after escalating priviledges. Folders creates when we actually install updates
TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, _countof(tszFileBack), _T("%s\\Backups"), g_tszRoot);
+ mir_sntprintf(tszFileBack, _T("%s\\Backups"), g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, _countof(tszFileTemp), _T("%s\\Temp"), g_tszRoot);
+ mir_sntprintf(tszFileTemp, _T("%s\\Temp"), g_tszRoot);
SafeCreateDirectory(tszFileTemp);
VARST tszMirandaPath(_T("%miranda_path%"));
@@ -113,7 +113,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP TCHAR *p = _tcschr(tszFileName, L'.'); *p = 0;
TCHAR link[MAX_PATH];
- mir_sntprintf(link, _countof(link), PLUGIN_INFO_URL, tszFileName);
+ mir_sntprintf(link, PLUGIN_INFO_URL, tszFileName);
Utils_OpenUrlT(link);
}
}
@@ -355,8 +355,8 @@ static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* t tp = _tcschr(tszRelFileName, L'\\'); if (tp) tp++; else tp = tszRelFileName;
_tcslwr(tp);
- mir_sntprintf(FileInfo->File.tszDiskPath, _countof(FileInfo->File.tszDiskPath), _T("%s\\Temp\\%s.zip"), g_tszRoot, tszFileName);
- mir_sntprintf(FileInfo->File.tszDownloadURL, _countof(FileInfo->File.tszDownloadURL), _T("%s/%s.zip"), tszBaseUrl, tszRelFileName);
+ mir_sntprintf(FileInfo->File.tszDiskPath, _T("%s\\Temp\\%s.zip"), g_tszRoot, tszFileName);
+ mir_sntprintf(FileInfo->File.tszDownloadURL, _T("%s/%s.zip"), tszBaseUrl, tszRelFileName);
for (tp = _tcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = _tcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
@@ -386,7 +386,7 @@ static void GetList(void *) ServListEntry &hash = hashes[i];
TCHAR tszPath[MAX_PATH];
- mir_sntprintf(tszPath, _countof(tszPath), _T("%s\\%s"), dirname, hash.m_name);
+ mir_sntprintf(tszPath, _T("%s\\%s"), dirname, hash.m_name);
if (GetFileAttributes(tszPath) == INVALID_FILE_ATTRIBUTES) {
FILEINFO *FileInfo = ServerEntryToFileInfo(hash, baseUrl, tszPath);
@@ -469,7 +469,7 @@ static INT_PTR ParseUriService(WPARAM, LPARAM lParam) VARST dirName(_T("%miranda_path%"));
TCHAR tszPath[MAX_PATH];
- mir_sntprintf(tszPath, _countof(tszPath), _T("%s\\%s"), dirName, hash->m_name);
+ mir_sntprintf(tszPath, _T("%s\\%s"), dirName, hash->m_name);
FILEINFO *fileInfo = ServerEntryToFileInfo(*hash, baseUrl, tszPath);
FILELIST *fileList = new FILELIST(1);
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 8b77616451..b3298611f1 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -59,9 +59,9 @@ static void ApplyUpdates(void *param) HWND hwndList = GetDlgItem(hDlg, IDC_LIST_UPDATES);
//create needed folders after escalating priviledges. Folders creates when we actually install updates
TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, _countof(tszFileBack), _T("%s\\Backups"), g_tszRoot);
+ mir_sntprintf(tszFileBack, _T("%s\\Backups"), g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, _countof(tszFileTemp), _T("%s\\Temp"), g_tszRoot);
+ mir_sntprintf(tszFileTemp, _T("%s\\Temp"), g_tszRoot);
SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
@@ -101,7 +101,7 @@ static void ApplyUpdates(void *param) if (p.bDeleteOnly) {
// we need only to backup the old file
TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, ptszRelPath);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
else {
@@ -109,8 +109,8 @@ static void ApplyUpdates(void *param) // otherwise it would be replaced by unzip
if ( _tcsicmp(p.tszOldName, p.tszNewName)) {
TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
- mir_sntprintf(tszSrcPath, _countof(tszSrcPath), _T("%s\\%s"), tszMirandaPath, p.tszOldName);
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, p.tszOldName);
+ mir_sntprintf(tszSrcPath, _T("%s\\%s"), tszMirandaPath, p.tszOldName);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
}
@@ -377,10 +377,10 @@ static void DlgUpdateSilent(void *param) //create needed folders after escalating priviledges. Folders creates when we actually install updates
TCHAR tszFileTemp[MAX_PATH], tszFileBack[MAX_PATH];
- mir_sntprintf(tszFileBack, _countof(tszFileBack), _T("%s\\Backups"), g_tszRoot);
+ mir_sntprintf(tszFileBack, _T("%s\\Backups"), g_tszRoot);
SafeCreateDirectory(tszFileBack);
- mir_sntprintf(tszFileTemp, _countof(tszFileTemp), _T("%s\\Temp"), g_tszRoot);
+ mir_sntprintf(tszFileTemp, _T("%s\\Temp"), g_tszRoot);
SafeCreateDirectory(tszFileTemp);
// 2) Download all plugins
@@ -418,7 +418,7 @@ static void DlgUpdateSilent(void *param) if (p.bDeleteOnly) {
// we need only to backup the old file
TCHAR *ptszRelPath = p.tszNewName + _tcslen(tszMirandaPath) + 1, tszBackFile[MAX_PATH];
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, ptszRelPath);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, ptszRelPath);
BackupFile(p.tszNewName, tszBackFile);
}
else {
@@ -426,8 +426,8 @@ static void DlgUpdateSilent(void *param) // otherwise it would be replaced by unzip
if (_tcsicmp(p.tszOldName, p.tszNewName)) {
TCHAR tszSrcPath[MAX_PATH], tszBackFile[MAX_PATH];
- mir_sntprintf(tszSrcPath, _countof(tszSrcPath), _T("%s\\%s"), tszMirandaPath, p.tszOldName);
- mir_sntprintf(tszBackFile, _countof(tszBackFile), _T("%s\\%s"), tszFileBack, p.tszOldName);
+ mir_sntprintf(tszSrcPath, _T("%s\\%s"), tszMirandaPath, p.tszOldName);
+ mir_sntprintf(tszBackFile, _T("%s\\%s"), tszFileBack, p.tszOldName);
BackupFile(tszSrcPath, tszBackFile);
}
@@ -455,7 +455,7 @@ static void DlgUpdateSilent(void *param) // 5) Prepare Restart
TCHAR tszTitle[100];
- mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("%d component(s) was updated"), count);
+ mir_sntprintf(tszTitle, TranslateT("%d component(s) was updated"), count);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
ShowPopup(tszTitle,TranslateT("You need to restart your Miranda to apply installed updates."),POPUP_TYPE_MSG);
@@ -477,7 +477,7 @@ static void DlgUpdateSilent(void *param) if (!notified) {
// Error, let's try to show MessageBox as last way to inform user about successful update
TCHAR tszText[200];
- mir_sntprintf(tszText, _countof(tszText), _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
+ mir_sntprintf(tszText, _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(NULL, tszText, tszTitle, MB_ICONINFORMATION | MB_YESNO) == IDYES)
#if MIRANDA_VER >= 0x0A00
@@ -599,7 +599,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const return 0;
TCHAR tszBuf[MAX_PATH];
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s\\*"), tszFolder);
+ mir_sntprintf(tszBuf, _T("%s\\*"), tszFolder);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(tszBuf, &ffd);
@@ -613,7 +613,7 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// Scan recursively all subfolders
if (_tcscmp(ffd.cFileName, _T(".")) && _tcscmp(ffd.cFileName, _T(".."))) {
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s\\%s"), tszFolder, ffd.cFileName);
+ mir_sntprintf(tszBuf, _T("%s\\%s"), tszFolder, ffd.cFileName);
count += ScanFolder(tszBuf, cbBaseLen, level + 1, tszBaseUrl, hashes, UpdateFiles);
}
}
@@ -624,12 +624,12 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const if (level == 0)
_tcsncpy(tszNewName, ffd.cFileName, MAX_PATH);
else
- mir_sntprintf(tszNewName, _countof(tszNewName), _T("%s\\%s"), tszFolder + cbBaseLen, ffd.cFileName);
+ mir_sntprintf(tszNewName, _T("%s\\%s"), tszFolder + cbBaseLen, ffd.cFileName);
}
TCHAR *ptszUrl;
int MyCRC;
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s\\%s"), tszFolder, ffd.cFileName);
+ mir_sntprintf(tszBuf, _T("%s\\%s"), tszFolder, ffd.cFileName);
bool bDeleteOnly = (tszNewName[0] == 0);
// this file is not marked for deletion
@@ -709,8 +709,8 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const p = (p) ? p + 1 : tszBuf;
_tcslwr(p);
- mir_sntprintf(FileInfo->File.tszDiskPath, _countof(FileInfo->File.tszDiskPath), _T("%s\\Temp\\%s.zip"), g_tszRoot, p);
- mir_sntprintf(FileInfo->File.tszDownloadURL, _countof(FileInfo->File.tszDownloadURL), _T("%s/%s.zip"), tszBaseUrl, tszBuf);
+ mir_sntprintf(FileInfo->File.tszDiskPath, _T("%s\\Temp\\%s.zip"), g_tszRoot, p);
+ mir_sntprintf(FileInfo->File.tszDownloadURL, _T("%s/%s.zip"), tszBaseUrl, tszBuf);
for (p = _tcschr(FileInfo->File.tszDownloadURL, '\\'); p != 0; p = _tcschr(p, '\\'))
*p++ = '/';
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index de54bb43e5..d2cae3353b 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -71,7 +71,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hPopup, UINT uMsg, WPARAM wParam, LPAR static void _stdcall RestartPrompt(void *)
{
TCHAR tszText[200];
- mir_sntprintf(tszText, _countof(tszText), _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
+ mir_sntprintf(tszText, _T("%s\n\n%s"), TranslateT("You need to restart your Miranda to apply installed updates."), TranslateT("Would you like to restart it now?"));
if (MessageBox(0, tszText, TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION | MB_TOPMOST) == IDYES)
CallService(MS_SYSTEM_RESTART, db_get_b(NULL, MODNAME, "RestartCurrentProfile", 1) ? 1 : 0, 0);
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 8b983b49da..30f212abe1 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -151,8 +151,8 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) // Download version info
FILEURL pFileUrl;
- mir_sntprintf(pFileUrl.tszDownloadURL, _countof(pFileUrl.tszDownloadURL), _T("%s/hashes.zip"), baseUrl);
- mir_sntprintf(pFileUrl.tszDiskPath, _countof(pFileUrl.tszDiskPath), _T("%s\\hashes.zip"), g_tszTempPath);
+ mir_sntprintf(pFileUrl.tszDownloadURL, _T("%s/hashes.zip"), baseUrl);
+ mir_sntprintf(pFileUrl.tszDiskPath, _T("%s\\hashes.zip"), g_tszTempPath);
pFileUrl.CRCsum = 0;
HANDLE nlc;
@@ -176,7 +176,7 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) DeleteFile(pFileUrl.tszDiskPath);
TCHAR tszTmpIni[MAX_PATH] = {0};
- mir_sntprintf(tszTmpIni, _countof(tszTmpIni), _T("%s\\hashes.txt"), g_tszTempPath);
+ mir_sntprintf(tszTmpIni, _T("%s\\hashes.txt"), g_tszTempPath);
FILE *fp = _tfopen(tszTmpIni, _T("r"));
if (!fp) {
Netlib_LogfT(hNetlibUser,_T("Opening %s failed"), g_tszTempPath);
@@ -284,7 +284,7 @@ bool DownloadFile(FILEURL *pFileURL, HANDLE &nlc) else {
// try to write it via PU stub
TCHAR tszTempFile[MAX_PATH];
- mir_sntprintf(tszTempFile, _countof(tszTempFile), _T("%s\\pulocal.tmp"), g_tszTempPath);
+ mir_sntprintf(tszTempFile, _T("%s\\pulocal.tmp"), g_tszTempPath);
hFile = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwBytes;
@@ -510,7 +510,7 @@ bool PrepareEscalation() else {
// Elevate the process. Create a pipe for a stub first
TCHAR tszPipeName[MAX_PATH];
- mir_sntprintf(tszPipeName, _countof(tszPipeName), _T("\\\\.\\pipe\\Miranda_Pu_%d"), GetCurrentProcessId());
+ mir_sntprintf(tszPipeName, _T("\\\\.\\pipe\\Miranda_Pu_%d"), GetCurrentProcessId());
hPipe = CreateNamedPipe(tszPipeName, PIPE_ACCESS_DUPLEX, PIPE_READMODE_BYTE | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL);
if (hPipe == INVALID_HANDLE_VALUE) {
hPipe = NULL;
@@ -520,7 +520,7 @@ bool PrepareEscalation() GetModuleFileName(NULL, szPath, ARRAYSIZE(szPath));
if ((p = _tcsrchr(szPath, '\\')) != 0)
_tcscpy(p+1, _T("pu_stub.exe"));
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("%d"), GetCurrentProcessId());
+ mir_sntprintf(cmdLine, _T("%d"), GetCurrentProcessId());
// Launch a stub
SHELLEXECUTEINFO sei = { sizeof(sei) };
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 2cd803f1f0..9a256efe23 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -40,28 +40,28 @@ void InitFonts() mir_tstrncpy(fid.deffontsettings.szFace, _T("Tahoma"), _countof(fid.deffontsettings.szFace));
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
FontRegisterT(&fid);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
- mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
+ mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
FontRegisterT(&fid);
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index ebdc53219e..be9c78a595 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -186,7 +186,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) FontID fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, _countof(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -194,17 +194,17 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) fontid.deffontsettings.size = -11;
mir_strncpy(fontid.deffontsettings.szFace, "MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
- mir_snprintf(fontid.name, _countof(fontid.name), "%s (colors only)", notification->lpzName);
- mir_snprintf(fontid.prefix, _countof(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(fontid.name, "%s (colors only)", notification->lpzName);
+ mir_snprintf(fontid.prefix, "{%s/%s}text", notification->lpzGroup, notification->lpzName);
fontid.deffontsettings.style = 0;
FontRegister(&fontid);
ColourID colourid = { 0 };
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, _countof(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(colourid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(colourid.dbSettingsGroup, "PopupNotifications");
- mir_snprintf(colourid.name, _countof(colourid.name), "%s (colors only)", notification->lpzName);
- mir_snprintf(colourid.setting, _countof(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(colourid.name, "%s (colors only)", notification->lpzName);
+ mir_snprintf(colourid.setting, "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
colourid.defcolour = ptd->notification.colorBack;
ColourRegister(&colourid);
@@ -237,14 +237,14 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen) LOGFONTA lf; // dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
FontID fontid = { 0 }; // use ansi version of fontID coz POPUPNOTIFICATION use char
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, _countof(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
- mir_snprintf(fontid.name, _countof(fontid.name), "%s (colors only)", ptd->notification.lpzName);
+ mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(fontid.name, "%s (colors only)", ptd->notification.lpzName);
ppd->colorText = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fontid, (LPARAM)&lf);
ColourID colourid = { 0 }; // use ansi version of ColourID coz POPUPNOTIFICATION use char
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, _countof(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
- mir_snprintf(colourid.name, _countof(colourid.name), "%s (colors only)", ptd->notification.lpzName);
+ mir_snprintf(colourid.group, PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(colourid.name, "%s (colors only)", ptd->notification.lpzName);
ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
ppd->lchIcon = IcoLib_GetIconByHandle(ptd->hIcoLib);
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index b5fa1f5d20..d4adb4adb7 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -161,7 +161,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopupOptions.Alpha);
mir_subclassWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), AlphaTrackBarWndProc);
- mir_sntprintf(tstr, _countof(tstr), _T("%d%%"), Byte2Percentile(PopupOptions.Alpha));
+ mir_sntprintf(tstr, _T("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopupOptions.OpaqueOnHover ? BST_CHECKED : BST_UNCHECKED);
{
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_TRANS_SLIDER:
PopupOptions.Alpha = (BYTE)SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_GETPOS, 0, 0);
- mir_sntprintf(tstr, _countof(tstr), TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
+ mir_sntprintf(tstr, TranslateT("%d%%"), Byte2Percentile(PopupOptions.Alpha));
SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr);
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index 25a1f78d6f..558dfcd321 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -191,11 +191,11 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (p->typ == 1) { // Treeview part for typ 1 (notification)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, IcoLib_GetIconByHandle(p->hIcoLib));
- mir_sntprintf(itemName, _countof(itemName), _T("%s/%s"), p->pszTreeRoot, p->pszDescription);
+ mir_sntprintf(itemName, _T("%s/%s"), p->pszTreeRoot, p->pszDescription);
}
else { // Treeview part typ 2 (popup class api)
iconIndex = ImageList_ReplaceIcon(hImgLst, -1, p->pupClass.hIcon);
- mir_sntprintf(itemName, _countof(itemName), _T("%s/%s"), LPGENT("CLASS Plugins"), p->pszDescription);
+ mir_sntprintf(itemName, _T("%s/%s"), LPGENT("CLASS Plugins"), p->pszDescription);
}
OptTree_AddItem(hwndTree, itemName, (LPARAM)p, iconIndex);
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 476699e0f0..fe126a1cfc 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -225,7 +225,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM continue;
TCHAR prefix[128];
- mir_sntprintf(prefix, _countof(prefix), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(prefix, LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
pos = AddStatusModes(statusOptions, pos, prefix, protoFlags);
}
}
@@ -240,10 +240,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM continue;
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
+ mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, _countof(pszSettingName), LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(pszSettingName, LPGENT("Protocol Status")_T("/%s"), protocols[i]->tszAccountName);
OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName);
}
}
@@ -526,10 +526,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM for (int i = 0; i < protocolCount; ++i) {
if (!protocols[i]->bIsVirtual) {
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "Protocol Status/%s", protocols[i]->szModuleName);
+ mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName);
TCHAR pszSettingName[256];
- mir_sntprintf(pszSettingName, _countof(pszSettingName), _T("Protocol Status/%s"), protocols[i]->tszAccountName);
+ mir_sntprintf(pszSettingName, _T("Protocol Status/%s"), protocols[i]->tszAccountName);
db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName));
}
}
@@ -581,7 +581,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void ErrorMSG(int minValue, int maxValue)
{
TCHAR str[128];
- mir_sntprintf(str, _countof(str), TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
+ mir_sntprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue);
MSGERROR(str);
}
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 9a0986a33e..1fd334b1e7 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -48,7 +48,7 @@ void RegisterOptPrevBox() err = GetLastError();
if (!g_wndClass.cPopupPreviewBoxWndclass) {
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -62,7 +62,7 @@ void RegisterOptPrevBox() err = GetLastError();
if (!g_wndClass.cPopupPlusDlgBox) {
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
}
@@ -280,7 +280,7 @@ bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwn // check "Skin options" state
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), "skin.%S", PopupOptions.SkinPack);
+ mir_snprintf(prefix, "skin.%S", PopupOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 50db5f8580..af86019a3a 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -222,7 +222,7 @@ static unsigned __stdcall PopupThread(void *) err = GetLastError();
if (!g_wndClass.cPopupThreadManagerWnd) {
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index efd5aa0086..2013df3330 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -65,7 +65,7 @@ bool LoadPopupWnd2() if (!g_wndClass.cPopupWnd2) {
res = false;
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MessageBox(NULL, msg, _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK);
}
@@ -80,7 +80,7 @@ bool LoadPopupWnd2() err = GetLastError();
if (!g_wndClass.cPopupEditBox) {
TCHAR msg[2048];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
+ mir_sntprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
wclw.cbSize, // UINT cbSize;
wclw.style, // UINT style;
wclw.lpfnWndProc, // WNDPROC lpfnWndProc;
@@ -116,7 +116,7 @@ bool LoadPopupWnd2() if (!g_wndClass.cPopupMenuHostWnd) {
res = false;
TCHAR msg[1024];
- mir_sntprintf(msg, _countof(msg), TranslateT("Failed to register %s class."), wcl.lpszClassName);
+ mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName);
MSGERROR(msg);
}
@@ -350,7 +350,7 @@ void PopupWnd2::show() if (*PopupOptions.Effect) {
char vfxService[128];
- mir_snprintf(vfxService, _countof(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
+ mir_snprintf(vfxService, "Popup/Vfx/%S", PopupOptions.Effect);
if (ServiceExists(vfxService))
if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0)) {
effect->beginEffect(m_bmp->getWidth(), m_bmp->getHeight(), m_btAlpha0, m_btAlpha1, dwTime1 - dwTime0);
@@ -437,7 +437,7 @@ void PopupWnd2::hide() if (*PopupOptions.Effect) {
char vfxService[128];
- mir_snprintf(vfxService, _countof(vfxService), "Popup/Vfx/%S", PopupOptions.Effect);
+ mir_snprintf(vfxService, "Popup/Vfx/%S", PopupOptions.Effect);
if (ServiceExists(vfxService))
if (effect = (IPopupPlusEffect *)CallService(vfxService, 0, 0)) {
effect->beginEffect(m_bmp->getWidth(), m_bmp->getHeight(), m_btAlpha0, m_btAlpha1, dwTime1 - dwTime0);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 5d994d9311..7741604aaa 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -146,7 +146,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (proto) {
char prefix[128];
- mir_snprintf(prefix, _countof(prefix), LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
+ mir_snprintf(prefix, LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
if (db_get_dw(NULL, MODULNAME, prefix, 0) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
return -1;
if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
@@ -381,7 +381,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontIDT fid = { 0 };
fid.cbSize = sizeof(FontIDT);
- mir_sntprintf(fid.group, _countof(fid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
+ mir_sntprintf(fid.group, _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup) - 1);
fid.flags = FIDF_DEFAULTVALID;
fid.deffontsettings.charset = DEFAULT_CHARSET;
@@ -389,7 +389,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_tstrncpy(fid.deffontsettings.szFace, _T("Verdana"), _countof(fid.deffontsettings.szFace) - 1);
mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name) - 1);
mir_strncpy(fid.prefix, setting, _countof(fid.prefix));
- mir_snprintf(fid.prefix, _countof(fid.prefix), "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
+ mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
FontRegisterT(&fid);
@@ -399,10 +399,10 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourIDT cid = { 0 };
cid.cbSize = sizeof(ColourIDT);
- mir_sntprintf(cid.group, _countof(cid.group), _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
+ mir_sntprintf(cid.group, _T(PU_FNT_AND_COLOR)_T("/%S"), ptd->pupClass.pszName);
mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup));
mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
- mir_snprintf(cid.setting, _countof(cid.setting), "%s/BgCol", ptd->pupClass.pszName);
+ mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
ColourRegisterT(&cid);
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 55a686a5db..14f5ff10fc 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -71,7 +71,7 @@ static INT_PTR CheckDb(WPARAM, LPARAM) STARTUPINFO si = { 0 };
si.cb = sizeof(si);
GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId());
+ mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 0f0000857d..635d111cf4 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -248,7 +248,7 @@ TCHAR *GetListName(c_struct *cs) {
if (opts.group_append && cs->szgroup[0] != _T('\0'))
{
- mir_sntprintf(tmp_list_name, _countof(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
+ mir_sntprintf(tmp_list_name, _T("%s (%s)"), cs->szname, cs->szgroup);
return tmp_list_name;
}
else
@@ -715,7 +715,7 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(tmp, _T("%s (%s)"), TranslateTS(name), key);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_TCHAR);
@@ -731,7 +731,7 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key) if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(tmp, _T("%s (%s)"), TranslateTS(name), key);
SetDlgItemText(hwndDlg, dlgItem, full);
}
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 074c7c3f30..7878317d5c 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -21,90 +21,87 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ListData* ButtonsList[100]; -SortedList* QuickList=NULL; +SortedList* QuickList = NULL; -typedef void (*ItemDestuctor)(void*); +typedef void(*ItemDestuctor)(void*); int sstSortButtons(const void * vmtbi1, const void * vmtbi2) { - ButtonData * mtbi1=(ButtonData *)*((ButtonData ** )vmtbi1); - ButtonData * mtbi2=(ButtonData *)*((ButtonData ** )vmtbi2); - if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2); - return mtbi1->dwPos-mtbi2->dwPos; + ButtonData * mtbi1 = (ButtonData *)*((ButtonData **)vmtbi1); + ButtonData * mtbi2 = (ButtonData *)*((ButtonData **)vmtbi2); + if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + return mtbi1->dwPos - mtbi2->dwPos; } int sstQuickSortButtons(const void * vmtbi1, const void * vmtbi2) { - QuickData * mtbi1=(QuickData *)*((QuickData ** )vmtbi1); - QuickData * mtbi2=(QuickData *)*((QuickData ** )vmtbi2); - if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2); - return mtbi1->dwPos-mtbi2->dwPos; + QuickData * mtbi1 = (QuickData *)*((QuickData **)vmtbi1); + QuickData * mtbi2 = (QuickData *)*((QuickData **)vmtbi2); + if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + return mtbi1->dwPos - mtbi2->dwPos; } int sstOpSortButtons(const void * vmtbi1, const void * vmtbi2) { - ButtonData * mtbi1=(ButtonData *)*((ButtonData ** )vmtbi1); - ButtonData * mtbi2=(ButtonData *)*((ButtonData ** )vmtbi2); - if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2); - return mtbi1->dwOPPos-mtbi2->dwOPPos; + ButtonData * mtbi1 = (ButtonData *)*((ButtonData **)vmtbi1); + ButtonData * mtbi2 = (ButtonData *)*((ButtonData **)vmtbi2); + if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1 - mtbi2); + return mtbi1->dwOPPos - mtbi2->dwOPPos; } void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor) -{ - int i=0; +{ + int i = 0; if (!pList) return; - for (i=0; i<pList->realCount; i++) - pItemDestructor(pList->items[i]); - List_Destroy(pList); + for (i = 0; i < pList->realCount; i++) + pItemDestructor(pList->items[i]); + List_Destroy(pList); mir_free(pList); } void li_RemoveDestruct(SortedList *pList, int index, ItemDestuctor pItemDestructor) -{ - if (index>=0 && index<pList->realCount) - { +{ + if (index >= 0 && index < pList->realCount) { pItemDestructor(pList->items[index]); List_Remove(pList, index); } } void li_RemovePtrDestruct(SortedList *pList, void * ptr, ItemDestuctor pItemDestructor) -{ +{ if (List_RemovePtr(pList, ptr)) pItemDestructor(ptr); } void li_SortList(SortedList *pList, FSortFunc pSortFunct) { - FSortFunc pOldSort=pList->sortFunc; + FSortFunc pOldSort = pList->sortFunc; int i; - if (!pSortFunct) pSortFunct=pOldSort; - pList->sortFunc=NULL; - for (i=0; i<pList->realCount-1; i++) - if (pOldSort(pList->items[i],pList->items[i+1])<0) - { - void * temp=pList->items[i]; - pList->items[i]=pList->items[i+1]; - pList->items[i+1]=temp; + if (!pSortFunct) pSortFunct = pOldSort; + pList->sortFunc = NULL; + for (i = 0; i < pList->realCount - 1; i++) + if (pOldSort(pList->items[i], pList->items[i + 1]) < 0) { + void * temp = pList->items[i]; + pList->items[i] = pList->items[i + 1]; + pList->items[i + 1] = temp; i--; - if (i>0) i--; + if (i > 0) i--; } - pList->sortFunc=pOldSort; + pList->sortFunc = pOldSort; } void li_ZeroQuickList(SortedList *pList) { int i; - for (i=0; i<pList->realCount; i++) - { - QuickData * qd=(QuickData *)pList->items[i]; - qd->dwPos=0; - qd->bIsService=0; - qd->ptszValue=NULL; - qd->ptszValueName=NULL; + for (i = 0; i < pList->realCount; i++) { + QuickData * qd = (QuickData *)pList->items[i]; + qd->dwPos = 0; + qd->bIsService = 0; + qd->ptszValue = NULL; + qd->ptszValueName = NULL; List_Remove(pList, i); i--; } @@ -114,11 +111,11 @@ static void listdestructor(void * input) { ButtonData * cbdi = (ButtonData *)input; - if(cbdi->pszName != cbdi->pszOpName) + if (cbdi->pszName != cbdi->pszOpName) mir_free(cbdi->pszOpName); mir_free(cbdi->pszName); - if(cbdi->pszValue != cbdi->pszOpValue) + if (cbdi->pszValue != cbdi->pszOpValue) mir_free(cbdi->pszOpValue); mir_free(cbdi->pszValue); @@ -127,104 +124,102 @@ static void listdestructor(void * input) void RemoveMenuEntryNode(SortedList *pList, int index) { - li_RemoveDestruct(pList,index,listdestructor); + li_RemoveDestruct(pList, index, listdestructor); } void DestroyButton(int listnum) { - int i=listnum; - ListData* ld=ButtonsList[listnum]; + int i = listnum; + ListData* ld = ButtonsList[listnum]; mir_free(ld->ptszButtonName); - if(ld->ptszOPQValue != ld->ptszQValue) + if (ld->ptszOPQValue != ld->ptszQValue) mir_free(ld->ptszOPQValue); mir_free(ld->ptszQValue); - li_ListDestruct((SortedList*)ld->sl,listdestructor); + li_ListDestruct((SortedList*)ld->sl, listdestructor); mir_free(ld); - ButtonsList[i]=NULL; - while(ButtonsList[i+1]) - { - ButtonsList[i]=ButtonsList[i+1]; - ButtonsList[i+1]=NULL; + ButtonsList[i] = NULL; + while (ButtonsList[i + 1]) { + ButtonsList[i] = ButtonsList[i + 1]; + ButtonsList[i + 1] = NULL; i++; } } - -void SaveModuleSettings(int buttonnum,ButtonData* bd) +void SaveModuleSettings(int buttonnum, ButtonData* bd) { - char szMEntry[256]={'\0'}; + char szMEntry[256] = { '\0' }; - mir_snprintf(szMEntry,_countof(szMEntry),"EntryName_%u_%u",buttonnum,bd->dwPos); - db_set_ts(NULL, PLGNAME,szMEntry,bd->pszName ); + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, bd->dwPos); + db_set_ts(NULL, PLGNAME, szMEntry, bd->pszName); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryValue_%u_%u",buttonnum,bd->dwPos); - if(bd->pszValue) - db_set_ts(NULL, PLGNAME,szMEntry,bd->pszValue ); + mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, bd->dwPos); + if (bd->pszValue) + db_set_ts(NULL, PLGNAME, szMEntry, bd->pszValue); else - db_unset(NULL, PLGNAME,szMEntry); + db_unset(NULL, PLGNAME, szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryRel_%u_%u",buttonnum,bd->dwPos); - db_set_b(NULL, PLGNAME,szMEntry,bd->fEntryType ); + mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, bd->dwPos); + db_set_b(NULL, PLGNAME, szMEntry, bd->fEntryType); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryToQMenu_%u_%u",buttonnum,bd->dwPos); - db_set_b(NULL, PLGNAME,szMEntry,bd->bInQMenu); + mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, bd->dwPos); + db_set_b(NULL, PLGNAME, szMEntry, bd->bInQMenu); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,bd->dwPos); - db_set_b(NULL, PLGNAME,szMEntry,bd->bIsServName); + mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, bd->dwPos); + db_set_b(NULL, PLGNAME, szMEntry, bd->bIsServName); } -void CleanSettings(int buttonnum,int from) +void CleanSettings(int buttonnum, int from) { - char szMEntry[256]={'\0'}; - DBVARIANT dbv = {0}; - if(from==-1){ - mir_snprintf(szMEntry,_countof(szMEntry),"ButtonName_%u",buttonnum); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"ButtonValue_%u",buttonnum); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"RCEntryIsServiceName_%u",buttonnum); - db_unset(NULL, PLGNAME,szMEntry); + char szMEntry[256] = { '\0' }; + DBVARIANT dbv = { 0 }; + if (from == -1) { + mir_snprintf(szMEntry, "ButtonName_%u", buttonnum); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "ButtonValue_%u", buttonnum); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", buttonnum); + db_unset(NULL, PLGNAME, szMEntry); } - mir_snprintf(szMEntry,_countof(szMEntry),"EntryName_%u_%u",buttonnum,from); - while(!db_get_ts(NULL, PLGNAME,szMEntry,&dbv)) { - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryValue_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryRel_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryToQMenu_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - mir_snprintf(szMEntry,_countof(szMEntry),"EntryIsServiceName_%u_%u",buttonnum,from); - db_unset(NULL, PLGNAME,szMEntry); - - mir_snprintf(szMEntry,_countof(szMEntry),"EntryName_%u_%u",buttonnum,++from); + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, from); + while (!db_get_ts(NULL, PLGNAME, szMEntry, &dbv)) { + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, from); + db_unset(NULL, PLGNAME, szMEntry); + + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, ++from); } db_free(&dbv); } -BYTE getEntryByte(int buttonnum,int entrynum,BOOL mode) -{ - char szMEntry[256] = {'\0'}; +BYTE getEntryByte(int buttonnum, int entrynum, BOOL mode) +{ + char szMEntry[256] = { '\0' }; switch (mode) { case 0: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryToQMenu_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryToQMenu_%u_%u", buttonnum, entrynum); break; case 1: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryRel_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryRel_%u_%u", buttonnum, entrynum); break; case 2: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryIsServiceName_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryIsServiceName_%u_%u", buttonnum, entrynum); break; case 3: - mir_snprintf(szMEntry, _countof(szMEntry), "RCEntryIsServiceName_%u", buttonnum); + mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", buttonnum); break; } - return db_get_b(NULL, PLGNAME, szMEntry, 0); + return db_get_b(NULL, PLGNAME, szMEntry, 0); } static HANDLE AddIcon(char* szIcoName) @@ -244,22 +239,22 @@ static HANDLE AddIcon(char* szIcoName) DWORD BalanceButtons(int buttonsWas, int buttonsNow) { - if ( !ServiceExists(MS_BB_ADDBUTTON)) { + if (!ServiceExists(MS_BB_ADDBUTTON)) { BBButton bb = { sizeof(bb) }; bb.pszModuleName = PLGNAME; while (buttonsWas > buttonsNow) { bb.dwButtonID = --buttonsWas; CallService(MS_BB_REMOVEBUTTON, 0, (LPARAM)&bb); - } - + } + while (buttonsWas < buttonsNow) { - if (ServiceExists(MS_BB_ADDBUTTON)) { + if (ServiceExists(MS_BB_ADDBUTTON)) { char iconname[40]; - mir_snprintf(iconname, _countof(iconname), LPGEN("Quick Messages Button %u"), buttonsWas); + mir_snprintf(iconname, LPGEN("Quick Messages Button %u"), buttonsWas); bb.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON; bb.dwButtonID = buttonsWas++; - bb.dwDefPos = 300+buttonsWas; + bb.dwDefPos = 300 + buttonsWas; bb.hIcon = AddIcon(iconname); CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bb); } @@ -270,93 +265,90 @@ DWORD BalanceButtons(int buttonsWas, int buttonsNow) void InitButtonsList() -{ - int i,j,k=0; - QuickList=List_Create(0,1); - for(i=0;i<g_iButtonsCount;i++) - { - TCHAR* pszBName=NULL; - ListData* ld=NULL; - if (!(pszBName=getMenuEntry(i,0,3))) { - g_iButtonsCount=i; - db_set_b(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount); - break;} +{ + int i, j, k = 0; + QuickList = List_Create(0, 1); + for (i = 0; i < g_iButtonsCount; i++) { + TCHAR* pszBName = NULL; + ListData* ld = NULL; + if (!(pszBName = getMenuEntry(i, 0, 3))) { + g_iButtonsCount = i; + db_set_b(NULL, PLGNAME, "ButtonsCount", (BYTE)g_iButtonsCount); + break; + } ld = (ListData *)mir_alloc(sizeof(ListData)); - ButtonsList[i]=ld; - ld->sl=List_Create(0,1); - ld->ptszQValue=ld->ptszOPQValue=getMenuEntry(i,0,2); - ld->ptszButtonName=pszBName; - ld->dwPos=ld->dwOPPos=i; - ld->dwOPFlags=0; - ld->bIsServName=ld->bIsOpServName=getEntryByte(i,0,3); - for(j=0;;j++) - { - TCHAR* pszEntry=NULL; - ButtonData *bd=NULL; - - if (!(pszEntry=getMenuEntry(i,j,0))) + ButtonsList[i] = ld; + ld->sl = List_Create(0, 1); + ld->ptszQValue = ld->ptszOPQValue = getMenuEntry(i, 0, 2); + ld->ptszButtonName = pszBName; + ld->dwPos = ld->dwOPPos = i; + ld->dwOPFlags = 0; + ld->bIsServName = ld->bIsOpServName = getEntryByte(i, 0, 3); + for (j = 0;; j++) { + TCHAR* pszEntry = NULL; + ButtonData *bd = NULL; + + if (!(pszEntry = getMenuEntry(i, j, 0))) break; bd = (ButtonData *)mir_alloc(sizeof(ButtonData)); - memset(bd,0,sizeof(ButtonData)); - - bd->dwPos=bd->dwOPPos=j; - bd->pszName=bd->pszOpName=pszEntry; - bd->pszValue=bd->pszOpValue=getMenuEntry(i,j,1); - bd->fEntryType=bd->fEntryOpType=getEntryByte(i,j,1); - bd->bInQMenu=bd->bOpInQMenu=getEntryByte(i,j,0); - bd->bIsServName=bd->bIsOpServName=getEntryByte(i,j,2); - if(bd->bInQMenu){ + memset(bd, 0, sizeof(ButtonData)); + + bd->dwPos = bd->dwOPPos = j; + bd->pszName = bd->pszOpName = pszEntry; + bd->pszValue = bd->pszOpValue = getMenuEntry(i, j, 1); + bd->fEntryType = bd->fEntryOpType = getEntryByte(i, j, 1); + bd->bInQMenu = bd->bOpInQMenu = getEntryByte(i, j, 0); + bd->bIsServName = bd->bIsOpServName = getEntryByte(i, j, 2); + if (bd->bInQMenu) { QuickData* qd = (QuickData *)mir_alloc(sizeof(QuickData)); - qd->dwPos=k++; - qd->ptszValue=bd->pszValue; - qd->ptszValueName=bd->pszName; - List_InsertPtr(QuickList,qd); + qd->dwPos = k++; + qd->ptszValue = bd->pszValue; + qd->ptszValueName = bd->pszName; + List_InsertPtr(QuickList, qd); } - List_InsertPtr((SortedList*)ld->sl,bd); + List_InsertPtr((SortedList*)ld->sl, bd); } } } void DestructButtonsList() { - int i=0; + int i = 0; // for ( i=0; i < g_iButtonsCount; i++ ) - while(ButtonsList[i]) - { - li_ListDestruct(ButtonsList[i]->sl,listdestructor); + while (ButtonsList[i]) { + li_ListDestruct(ButtonsList[i]->sl, listdestructor); mir_free(ButtonsList[i]->ptszButtonName); - if(ButtonsList[i]->ptszOPQValue!=ButtonsList[i]->ptszQValue) + if (ButtonsList[i]->ptszOPQValue != ButtonsList[i]->ptszQValue) if (ButtonsList[i]->ptszOPQValue) mir_free(ButtonsList[i]->ptszOPQValue); if (ButtonsList[i]->ptszQValue) mir_free(ButtonsList[i]->ptszQValue); - i++; + i++; } - if(QuickList) - { + if (QuickList) { li_ZeroQuickList(QuickList); List_Destroy(QuickList); } } -TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) -{ +TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) +{ TCHAR* buffer = NULL; char szMEntry[256]; DBVARIANT dbv; switch (mode) { case 0: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryName_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryName_%u_%u", buttonnum, entrynum); break; case 1: - mir_snprintf(szMEntry, _countof(szMEntry), "EntryValue_%u_%u", buttonnum, entrynum); + mir_snprintf(szMEntry, "EntryValue_%u_%u", buttonnum, entrynum); break; case 2: - mir_snprintf(szMEntry, _countof(szMEntry), "ButtonValue_%u", buttonnum); + mir_snprintf(szMEntry, "ButtonValue_%u", buttonnum); break; case 3: - mir_snprintf(szMEntry, _countof(szMEntry), "ButtonName_%u", buttonnum); + mir_snprintf(szMEntry, "ButtonName_%u", buttonnum); break; default: szMEntry[0] = 0; @@ -369,24 +361,24 @@ TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode) db_free(&dbv); } - return buffer; + return buffer; } int RegisterCustomButton(WPARAM, LPARAM) { - if ( !ServiceExists(MS_BB_ADDBUTTON)) + if (!ServiceExists(MS_BB_ADDBUTTON)) return 1; - for (int i=0; i < g_iButtonsCount; i++) { + for (int i = 0; i < g_iButtonsCount; i++) { ListData* ld = ButtonsList[i]; char iconname[40]; - mir_snprintf(iconname, _countof(iconname), LPGEN("Quick Messages Button %u"), i); + mir_snprintf(iconname, LPGEN("Quick Messages Button %u"), i); BBButton bbd = { sizeof(bbd) }; bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON; bbd.dwButtonID = i; - bbd.dwDefPos = 320+i; + bbd.dwDefPos = 320 + i; bbd.hIcon = AddIcon(iconname); bbd.pszModuleName = PLGNAME; bbd.ptszTooltip = ld->ptszButtonName; @@ -395,7 +387,7 @@ int RegisterCustomButton(WPARAM, LPARAM) return 0; } -TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* ptszClip,int QVSize,int TextSize ,int ClipSize) +TCHAR* ParseString(MCONTACT hContact, TCHAR* ptszQValIn, TCHAR* ptszText, TCHAR* ptszClip, int QVSize, int TextSize, int ClipSize) { int i = 0, iOffset = 0; TCHAR* tempPointer = NULL; @@ -407,13 +399,13 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt TCHAR* ptszName = NULL; CONTACTINFO ci; - if (!_tcschr(ptszQValue,varstr)) + if (!_tcschr(ptszQValue, varstr)) return ptszQValue; - if(TextSize && ptszText[TextSize - 1] == '\0') - TextSize --; - if(ClipSize && ptszClip[ClipSize - 1] == '\0') - ClipSize --; + if (TextSize && ptszText[TextSize - 1] == '\0') + TextSize--; + if (ClipSize && ptszClip[ClipSize - 1] == '\0') + ClipSize--; while (ptszQValue[i]) { if (ptszQValue[i] != '%') @@ -563,7 +555,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt mir_free(ptszName); ptszQValue[QVSize] = '\0'; - if (!_tcschr(ptszQValue,varstr)) + if (!_tcschr(ptszQValue, varstr)) return ptszQValue; ptszQValue = tempPointer; @@ -572,8 +564,8 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt break; } move_next: - iOffset ++; - i ++; + iOffset++; + i++; } return ptszQValue; } diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index e3d2abfa1e..63570bb4a3 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -247,7 +247,7 @@ void SaveMenuTree() ld->ptszButtonName = mir_tstrdup(tvi.pszText);
if (ld->ptszQValue) {
- mir_snprintf(szMEntry, _countof(szMEntry), "ButtonValue_%u", iBl);
+ mir_snprintf(szMEntry, "ButtonValue_%u", iBl);
db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszQValue);
}
@@ -262,13 +262,13 @@ void SaveMenuTree() }
- mir_snprintf(szMEntry, _countof(szMEntry), "ButtonName_%u", iBl);
+ mir_snprintf(szMEntry, "ButtonName_%u", iBl);
db_set_ts(NULL, PLGNAME, szMEntry, ld->ptszButtonName);
ld->dwOPFlags = 0;
ld->dwPos = iBl;
ld->bIsServName = ld->bIsOpServName;
- mir_snprintf(szMEntry, _countof(szMEntry), "RCEntryIsServiceName_%u", iBl);
+ mir_snprintf(szMEntry, "RCEntryIsServiceName_%u", iBl);
db_set_b(NULL, PLGNAME, szMEntry, ld->bIsServName);
bDeleted = FALSE;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 6cddb3322f..2935b52655 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -52,8 +52,8 @@ int OnModulesLoaded(WPARAM, LPARAM) Icon_Register(hInstance, "TabSRMM/Quick Replies", &icon, 1);
char buttonNameTranslated[32], buttonName[32];
- mir_snprintf(buttonNameTranslated, _countof(buttonNameTranslated), "%s %x", Translate("Button"), iNumber + 1);
- mir_snprintf(buttonName, _countof(buttonName), MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonNameTranslated, "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
BBButton bbd = {0};
bbd.cbSize = sizeof(BBButton);
@@ -80,20 +80,20 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) LIST<wchar_t> replyList(1);
CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
- mir_snprintf(buttonName, _countof(buttonName), MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
if (mir_strcmp(cbcd->pszModule, buttonName))
return 0;
if (cbcd->dwButtonId != iNumber)
return 1;
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
count = db_get_w(NULL, MODULE, key, 0);
{
if (count == 0 || cbcd->flags & BBCF_RIGHTBUTTON)
{
- mir_snprintf(buttonName, _countof(buttonName), "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(buttonName, "%s %x", Translate("Button"), iNumber + 1);
OPENOPTIONSDIALOG ood = {0};
ood.cbSize = sizeof(ood);
@@ -108,7 +108,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) for (int i = 0; i < count; i++)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, i);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, i);
wchar_t *value = db_get_wsa(NULL, MODULE, key);
if (!value)
@@ -136,7 +136,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) SendMessage(hEdit, EM_REPLACESEL, TRUE, (LPARAM)replyList[index - 1]);
- mir_snprintf(key, _countof(key), "ImmediatelySend_%x", iNumber);
+ mir_snprintf(key, "ImmediatelySend_%x", iNumber);
if ((BYTE)db_get_b(NULL, MODULE, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED)
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
@@ -155,7 +155,7 @@ int OnPreShutdown(WPARAM, LPARAM) if (ServiceExists(MS_BB_REMOVEBUTTON))
{
char buttonName[32];
- mir_snprintf(buttonName, _countof(buttonName), MODULE" %x", iNumber + 1);
+ mir_snprintf(buttonName, MODULE" %x", iNumber + 1);
BBButton bbd = {0};
bbd.cbSize = sizeof(BBButton);
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index 6a6f9d9417..a12a86ea19 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -71,15 +71,15 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR mir_subclassWindow(GetDlgItem(hwndDlg, IDC_REPLIES), MessageEditSubclassProc);
- mir_snprintf(key, _countof(key), "ImmediatelySend_%x", iNumber);
+ mir_snprintf(key, "ImmediatelySend_%x", iNumber);
CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, db_get_w(NULL, MODULE, key, 1) ? BST_CHECKED : BST_UNCHECKED);
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
count = db_get_w(NULL, MODULE, key, 0);
for (int i = 0; i < count; i++)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, i);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, i);
wchar_t *value = db_get_wsa(NULL, MODULE, key);
if (value)
{
@@ -117,12 +117,12 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int count = 0;
wchar_t *tszReplies;
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
count = db_get_b(NULL, MODULE, key, 0);
for (int i = 0; i < count; i++)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, i);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, i);
db_unset(NULL, MODULE, key);
}
@@ -139,17 +139,17 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int pos = -1, prev = 0;
while ((pos = replies.Find(_T("\r\n"), prev)) != -1)
{
- mir_snprintf(key, _countof(key), "Reply_%x_%x", iNumber, count++);
+ mir_snprintf(key, "Reply_%x_%x", iNumber, count++);
db_set_ws(NULL, MODULE, key, replies.Mid(prev, pos - prev).GetBuffer());
prev = pos + 2;
}
}
mir_free(tszReplies);
- mir_snprintf(key, _countof(key), "RepliesCount_%x", iNumber);
+ mir_snprintf(key, "RepliesCount_%x", iNumber);
db_set_w(NULL, MODULE, key, count);
- mir_snprintf(key, _countof(key), "ImmediatelySend_%x", iNumber);
+ mir_snprintf(key, "ImmediatelySend_%x", iNumber);
db_set_b(NULL, MODULE, key, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY));
return TRUE;
@@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int OnOptInitialized(WPARAM wParam, LPARAM)
{
char tabName[32];
- mir_snprintf(tabName, _countof(tabName), "%s %x", Translate("Button"), iNumber + 1);
+ mir_snprintf(tabName, "%s %x", Translate("Button"), iNumber + 1);
OPTIONSDIALOGPAGE odp = { 0 };
odp.pszGroup = LPGEN("Message sessions");
diff --git a/plugins/Quotes/src/IconLib.cpp b/plugins/Quotes/src/IconLib.cpp index 6976612005..70f88882cb 100644 --- a/plugins/Quotes/src/IconLib.cpp +++ b/plugins/Quotes/src/IconLib.cpp @@ -24,8 +24,6 @@ void Quotes_IconsInit() std::string Quotes_MakeIconName(const char* name)
{
assert(name);
- //char szSettingName[100];
- //mir_snprintf(szSettingName,_countof(szSettingName),"%s_%s",QUOTES_PROTOCOL_NAME,name);
std::string sName(QUOTES_PROTOCOL_NAME);
sName += "_";
sName += name;
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index e4202c77f0..0cdea80df5 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -278,7 +278,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM GetWindowPlacement(hDlg, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", dbLastUC_WindowPosPrefix);
+ mir_snprintf(szSettingName, "%swidth", dbLastUC_WindowPosPrefix);
int width = db_get_dw(NULL, dbLastUC_ModuleName, szSettingName, -1);
int right = rect.left - 6;
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 4a82bef678..b135fe2445 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -272,7 +272,7 @@ void RemoveProtocolSettings(const char * protocolName) // Delete it
if (name[0] != '\0') {
- mir_snprintf(moduleName, _countof(moduleName), "%s%s", protocolName, name);
+ mir_snprintf(moduleName, "%s%s", protocolName, name);
DeleteSettingEx(moduleName, NULL);
}
@@ -410,7 +410,7 @@ void RemoveDirectories() if (accounts[i]->szModuleName == NULL || accounts[i]->szModuleName[0] == '\0')
continue;
- mir_snprintf(dir, _countof(dir), "%s%s", gMirandaDir, accounts[i]->szModuleName);
+ mir_snprintf(dir, "%s%s", gMirandaDir, accounts[i]->szModuleName);
DeleteFileOrFolder(dir);
}
}
@@ -434,7 +434,7 @@ void RemoveDirectories() // Delete it
if (name[0] != '\0') {
- mir_snprintf(dir, _countof(dir), "%s%s", gMirandaDir, name);
+ mir_snprintf(dir, "%s%s", gMirandaDir, name);
DeleteFileOrFolder(dir);
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 474a9194d4..2e19ef232f 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -2,16 +2,15 @@ int LoadServices(void)
{
- char szServiceFunction[MAX_PATH],*pszServiceFunctionName;
+ char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
- memcpy(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
- pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN;
+ memcpy(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
+ pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
// Service creation
- for (size_t i=0;i<_countof(siPluginServices);i++)
- {
- memcpy(pszServiceFunctionName,siPluginServices[i].lpszName,(mir_strlen(siPluginServices[i].lpszName)+1));
- CreateServiceFunction(szServiceFunction,(MIRANDASERVICE)siPluginServices[i].lpFunc);
+ for (size_t i = 0; i < _countof(siPluginServices); i++) {
+ memcpy(pszServiceFunctionName, siPluginServices[i].lpszName, (mir_strlen(siPluginServices[i].lpszName) + 1));
+ CreateServiceFunction(szServiceFunction, (MIRANDASERVICE)siPluginServices[i].lpFunc);
}
return 0;
}
@@ -19,14 +18,14 @@ int LoadServices(void) int LoadModules(void)
{
- HookEvent(ME_OPT_INITIALISE,OptInitialise);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU,SmsRebuildContactMenu);
- HookEvent(ME_PROTO_ACK,handleAckSMS);
- HookEvent(ME_DB_EVENT_ADDED,handleNewMessage);
- HookEvent(ME_PROTO_ACCLISTCHANGED,RefreshAccountList);
+ HookEvent(ME_OPT_INITIALISE, OptInitialise);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SmsRebuildContactMenu);
+ HookEvent(ME_PROTO_ACK, handleAckSMS);
+ HookEvent(ME_DB_EVENT_ADDED, handleNewMessage);
+ HookEvent(ME_PROTO_ACCLISTCHANGED, RefreshAccountList);
char szServiceFunction[MAX_PATH];
- mir_snprintf(szServiceFunction,_countof(szServiceFunction),"%s%s",PROTOCOL_NAMEA,SMS_SEND);
+ mir_snprintf(szServiceFunction, "%s%s", PROTOCOL_NAMEA, SMS_SEND);
CMenuItem mi;
mi.position = 300050000;
@@ -40,13 +39,13 @@ int LoadModules(void) mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
mi.name.t = SMS_SEND_CM_STR;
mi.pszService = szServiceFunction;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_TCHAR;
ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
- SkinAddNewSoundEx("RecvSMSMsg",PROTOCOL_NAMEA,LPGEN("Incoming SMS Message"));
- SkinAddNewSoundEx("RecvSMSConfirmation",PROTOCOL_NAMEA,LPGEN("Incoming SMS Confirmation"));
+ SkinAddNewSoundEx("RecvSMSMsg", PROTOCOL_NAMEA, LPGEN("Incoming SMS Message"));
+ SkinAddNewSoundEx("RecvSMSConfirmation", PROTOCOL_NAMEA, LPGEN("Incoming SMS Confirmation"));
- RefreshAccountList(NULL,NULL);
+ RefreshAccountList(NULL, NULL);
RestoreUnreadMessageAlerts();
return 0;
@@ -72,23 +71,22 @@ int SendSMSMenuCommand(WPARAM wParam, LPARAM) hwndSendSms = SendSMSWindowAdd(wParam);
}
// user clicked on the "SMS Send" in the Main Menu
- else{
+ else {
hwndSendSms = SendSMSWindowAdd(NULL);
- EnableWindow(GetDlgItem(hwndSendSms,IDC_NAME),TRUE);
- EnableWindow(GetDlgItem(hwndSendSms,IDC_SAVENUMBER),FALSE);
+ EnableWindow(GetDlgItem(hwndSendSms, IDC_NAME), TRUE);
+ EnableWindow(GetDlgItem(hwndSendSms, IDC_SAVENUMBER), FALSE);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (GetContactPhonesCount(hContact)) {
SendDlgItemMessage(hwndSendSms, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetContactDisplayName(hContact, 0));
- SendSMSWindowSMSContactAdd(hwndSendSms,hContact);
+ SendSMSWindowSMSContactAdd(hwndSendSms, hContact);
}
}
}
return 0;
}
-
-//This function used to popup a read SMS window after the user clicked on the received SMS message.
+// This function used to popup a read SMS window after the user clicked on the received SMS message.
int ReadMsgSMS(WPARAM, LPARAM lParam)
{
CLISTEVENT *cle = (CLISTEVENT*)lParam;
@@ -99,17 +97,17 @@ int ReadMsgSMS(WPARAM, LPARAM lParam) dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
if (db_event_get(cle->hDbEvent, &dbei) == 0)
- if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
- if (RecvSMSWindowAdd(cle->hContact,ICQEVENTTYPE_SMS,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob)) {
- db_event_markRead(cle->hContact, cle->hDbEvent);
- return 0;
- }
- }
+ if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
+ if (RecvSMSWindowAdd(cle->hContact, ICQEVENTTYPE_SMS, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
+ db_event_markRead(cle->hContact, cle->hDbEvent);
+ return 0;
+ }
+ }
return 1;
}
-//This function used to popup a read SMS window after the user clicked on the received SMS confirmation.
+// This function used to popup a read SMS window after the user clicked on the received SMS confirmation.
int ReadAckSMS(WPARAM, LPARAM lParam)
{
CLISTEVENT *cle = (CLISTEVENT*)lParam;
@@ -138,16 +136,16 @@ void RestoreUnreadMessageAlerts(void) for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
- if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
- if (dbei.cbBlob>MIN_SMS_DBEVENT_LEN)
- handleNewMessage(hContact,(LPARAM)hDbEvent);
+ if ((dbei.flags & (DBEF_SENT | DBEF_READ)) == 0 && ((dbei.eventType == ICQEVENTTYPE_SMS) || (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)))
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN)
+ handleNewMessage(hContact, (LPARAM)hDbEvent);
}
for (MEVENT hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
- if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN)
- handleNewMessage(NULL, (LPARAM)hDbEvent);
+ if ((dbei.flags & (DBEF_SENT | DBEF_READ)) == 0 && ((dbei.eventType == ICQEVENTTYPE_SMS) || (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)))
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN)
+ handleNewMessage(NULL, (LPARAM)hDbEvent);
}
}
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index a38af8be70..7c42dc769c 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -1,27 +1,27 @@ #include "stdafx.h"
-BOOL DB_GetStaticStringW(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszRetBuff,size_t dwRetBuffSize,size_t *pdwRetBuffSize)
+BOOL DB_GetStaticStringW(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
{// sizes in wchars
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
size_t dwReadedStringLen;
- DBVARIANT dbv={0};
- if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv)==0)
- {
- dwReadedStringLen=mir_wstrlen(dbv.pwszVal);
- if (lpwszRetBuff && (dwRetBuffSize>dwReadedStringLen))
- {
- memcpy(lpwszRetBuff,dbv.pszVal,(dwReadedStringLen*sizeof(WCHAR)));//include null terminated
- (*((WCHAR*)(lpwszRetBuff+dwReadedStringLen)))=0;
- bRet=TRUE;
- }else{
- if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
+ DBVARIANT dbv = { 0 };
+ if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) {
+ dwReadedStringLen = mir_wstrlen(dbv.pwszVal);
+ if (lpwszRetBuff && (dwRetBuffSize > dwReadedStringLen)) {
+ memcpy(lpwszRetBuff, dbv.pszVal, (dwReadedStringLen*sizeof(WCHAR)));//include null terminated
+ (*((WCHAR*)(lpwszRetBuff + dwReadedStringLen))) = 0;
+ bRet = TRUE;
+ }
+ else {
+ if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
}
- if (pdwRetBuffSize) (*pdwRetBuffSize)=dwReadedStringLen;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = dwReadedStringLen;
db_free(&dbv);
- }else{
- if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
- if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
+ }
+ else {
+ if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
+ if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
}
return(bRet);
}
@@ -40,73 +40,71 @@ LPSTR GetModuleName(MCONTACT hContact) return lpszRet;
}
-void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,size_t dwControlsListCount,BOOL bEnabled)
+void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled)
{
- for(size_t i=0;i<dwControlsListCount;i++) EnableWindow(GetDlgItem(hWndDlg,pwControlsList[i]),bEnabled);
+ for (size_t i = 0; i < dwControlsListCount; i++) EnableWindow(GetDlgItem(hWndDlg, pwControlsList[i]), bEnabled);
}
//This function gets a Cellular string szPhone and clean it from symbools.
-size_t CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,size_t dwLen)
+size_t CopyNumberA(LPSTR lpszOutBuff, LPSTR lpszBuff, size_t dwLen)
{
BYTE btChar;
- LPBYTE lpbOutBuff=(LPBYTE)lpszOutBuff,lpbInBuff=(LPBYTE)lpszBuff;
+ LPBYTE lpbOutBuff = (LPBYTE)lpszOutBuff, lpbInBuff = (LPBYTE)lpszBuff;
- for(size_t i=0;i<dwLen;i++)
- {
- btChar=(*lpbInBuff++);
- if (btChar>='0' && btChar<='9') (*lpbOutBuff++)=btChar;
+ for (size_t i = 0; i < dwLen; i++) {
+ btChar = (*lpbInBuff++);
+ if (btChar >= '0' && btChar <= '9') (*lpbOutBuff++) = btChar;
}
- (*lpbOutBuff)=0;
+ (*lpbOutBuff) = 0;
- return((lpbOutBuff-(LPBYTE)lpszOutBuff));
+ return((lpbOutBuff - (LPBYTE)lpszOutBuff));
}
-size_t CopyNumberW(LPWSTR lpcOutBuff,LPWSTR lpcBuff,size_t dwLen)
+size_t CopyNumberW(LPWSTR lpcOutBuff, LPWSTR lpcBuff, size_t dwLen)
{
WCHAR wChar;
- LPWSTR lpwszOutBuff=lpcOutBuff,lpwszInBuff=lpcBuff;
+ LPWSTR lpwszOutBuff = lpcOutBuff, lpwszInBuff = lpcBuff;
- for(size_t i=0;i<dwLen;i++)
- {
- wChar=(*lpwszInBuff++);
- if (wChar>='0' && wChar<='9') (*lpwszOutBuff++)=wChar;
+ for (size_t i = 0; i < dwLen; i++) {
+ wChar = (*lpwszInBuff++);
+ if (wChar >= '0' && wChar <= '9') (*lpwszOutBuff++) = wChar;
}
- (*lpwszOutBuff)=0;
+ (*lpwszOutBuff) = 0;
- return((lpwszOutBuff-lpcOutBuff));
+ return((lpwszOutBuff - lpcOutBuff));
}
-bool IsPhoneW(LPWSTR lpwszString,size_t dwStringLen)
+bool IsPhoneW(LPWSTR lpwszString, size_t dwStringLen)
{
if (dwStringLen <= 1)
return false;
- for(size_t i=0; i < dwStringLen; i++) {
- WCHAR wChar=(*lpwszString++);
+ for (size_t i = 0; i < dwStringLen; i++) {
+ WCHAR wChar = (*lpwszString++);
if (wChar<'0' || wChar>'9')
- if (wChar!='+' && wChar!='S' && wChar!='M' && wChar!=' ' && wChar!='(' && wChar!=')')
+ if (wChar != '+' && wChar != 'S' && wChar != 'M' && wChar != ' ' && wChar != '(' && wChar != ')')
return false;
}
return true;
}
-DWORD GetContactPhonesCountParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName)
+DWORD GetContactPhonesCountParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName)
{
- DWORD dwRet=0;
+ DWORD dwRet = 0;
char szBuff[MAX_PATH];
WCHAR wszPhone[MAX_PHONE_LEN];
- size_t i,dwPhoneSize;
+ size_t i, dwPhoneSize;
- if ( DB_GetStaticStringW(hContact,lpszModule,lpszValueName,wszPhone,_countof(wszPhone),&dwPhoneSize))
- if ( IsPhoneW(wszPhone,dwPhoneSize))
+ if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, wszPhone, _countof(wszPhone), &dwPhoneSize))
+ if (IsPhoneW(wszPhone, dwPhoneSize))
dwRet++;
- for (i=0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff,_countof(szBuff),"%s%ld",lpszValueName,i);
- if ( DB_GetStaticStringW(hContact,lpszModule,szBuff,wszPhone,_countof(wszPhone),&dwPhoneSize))
- if ( IsPhoneW(wszPhone,dwPhoneSize))
+ for (i = 0; i <= PHONES_MIN_COUNT; i++) {
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
+ if (DB_GetStaticStringW(hContact, lpszModule, szBuff, wszPhone, _countof(wszPhone), &dwPhoneSize))
+ if (IsPhoneW(wszPhone, dwPhoneSize))
dwRet++;
}
return dwRet;
@@ -118,61 +116,61 @@ DWORD GetContactPhonesCount(MCONTACT hContact) DWORD dwRet = 0;
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
- dwRet += GetContactPhonesCountParam(hContact,lpszProto,"Phone");
- dwRet += GetContactPhonesCountParam(hContact,lpszProto,"Cellular");
- dwRet += GetContactPhonesCountParam(hContact,lpszProto,"Fax");
+ dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Phone");
+ dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Cellular");
+ dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Fax");
}
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","MyPhone");
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","Phone");
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","Cellular");
- dwRet += GetContactPhonesCountParam(hContact,"UserInfo","Fax");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "MyPhone");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Phone");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Cellular");
+ dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Fax");
return dwRet;
}
-BOOL IsContactPhoneParam(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszPhone,size_t dwPhoneSize)
+BOOL IsContactPhoneParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, LPWSTR lpwszPhone, size_t dwPhoneSize)
{
char szBuff[MAX_PATH];
WCHAR wszPhoneLocal[MAX_PHONE_LEN];
- size_t i,dwPhoneSizeLocal;
+ size_t i, dwPhoneSizeLocal;
- if ( DB_GetStaticStringW(hContact,lpszModule,lpszValueName,wszPhoneLocal,_countof(wszPhoneLocal),&dwPhoneSizeLocal))
- if ( IsPhoneW(wszPhoneLocal,dwPhoneSizeLocal)) {
- dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal,wszPhoneLocal,dwPhoneSizeLocal);
- if (MemoryCompare(wszPhoneLocal,dwPhoneSizeLocal,lpwszPhone,dwPhoneSize)==CSTR_EQUAL)
+ if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, wszPhoneLocal, _countof(wszPhoneLocal), &dwPhoneSizeLocal))
+ if (IsPhoneW(wszPhoneLocal, dwPhoneSizeLocal)) {
+ dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, wszPhoneLocal, dwPhoneSizeLocal);
+ if (MemoryCompare(wszPhoneLocal, dwPhoneSizeLocal, lpwszPhone, dwPhoneSize) == CSTR_EQUAL)
return TRUE;
}
- for (i=0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff,_countof(szBuff),"%s%ld",lpszValueName,i);
- if ( DB_GetStaticStringW(hContact,lpszModule,szBuff,wszPhoneLocal,_countof(wszPhoneLocal),&dwPhoneSizeLocal)) {
- if (IsPhoneW(wszPhoneLocal,dwPhoneSizeLocal)) {
- dwPhoneSizeLocal=CopyNumberW(wszPhoneLocal,wszPhoneLocal,dwPhoneSizeLocal);
- if (MemoryCompare(wszPhoneLocal,dwPhoneSizeLocal,lpwszPhone,dwPhoneSize) == CSTR_EQUAL)
- return TRUE;
- }
+ for (i = 0; i <= PHONES_MIN_COUNT; i++) {
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
+ if (DB_GetStaticStringW(hContact, lpszModule, szBuff, wszPhoneLocal, _countof(wszPhoneLocal), &dwPhoneSizeLocal)) {
+ if (IsPhoneW(wszPhoneLocal, dwPhoneSizeLocal)) {
+ dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, wszPhoneLocal, dwPhoneSizeLocal);
+ if (MemoryCompare(wszPhoneLocal, dwPhoneSizeLocal, lpwszPhone, dwPhoneSize) == CSTR_EQUAL)
+ return TRUE;
}
}
- return FALSE;
+ }
+ return FALSE;
}
-BOOL IsContactPhone(MCONTACT hContact,LPWSTR lpwszPhone,size_t dwPhoneSize)
+BOOL IsContactPhone(MCONTACT hContact, LPWSTR lpwszPhone, size_t dwPhoneSize)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
WCHAR wszPhoneLocal[MAX_PHONE_LEN];
- size_t dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal,lpwszPhone,dwPhoneSize);
+ size_t dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, lpwszPhone, dwPhoneSize);
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Phone",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Cellular",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,lpszProto,"Fax",wszPhoneLocal,dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Phone", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Fax", wszPhoneLocal, dwPhoneSizeLocal);
}
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","MyPhone",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Phone",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Cellular",wszPhoneLocal,dwPhoneSizeLocal);
- if (bRet==FALSE) bRet=IsContactPhoneParam(hContact,"UserInfo","Fax",wszPhoneLocal,dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "MyPhone", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Phone", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
+ if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Fax", wszPhoneLocal, dwPhoneSizeLocal);
return bRet;
}
@@ -181,12 +179,12 @@ BOOL IsContactPhone(MCONTACT hContact,LPWSTR lpwszPhone,size_t dwPhoneSize) //This function get a string cellular number and return the HANDLE of the contact that has this
//number in the miranda phonebook (and marked as an SMS able) at the User Details.
//If no one has this number function returns NULL.
-MCONTACT HContactFromPhone(LPWSTR lpwszPhone,size_t dwPhoneSize)
+MCONTACT HContactFromPhone(LPWSTR lpwszPhone, size_t dwPhoneSize)
{
if (lpwszPhone && dwPhoneSize) {
//check not already on list
for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- if (IsContactPhone(hContact,lpwszPhone,dwPhoneSize))
+ if (IsContactPhone(hContact, lpwszPhone, dwPhoneSize))
return hContact;
}
@@ -194,20 +192,20 @@ MCONTACT HContactFromPhone(LPWSTR lpwszPhone,size_t dwPhoneSize) }
-BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventType,LPWSTR lpwszPhone,size_t dwPhoneSize,size_t *pdwPhoneSizeRet,UINT *piIcon)
+BOOL GetDataFromMessage(LPSTR lpszMessage, size_t dwMessageSize, DWORD *pdwEventType, LPWSTR lpwszPhone, size_t dwPhoneSize, size_t *pdwPhoneSizeRet, UINT *piIcon)
{
- BOOL bRet=FALSE;
+ BOOL bRet = FALSE;
- DWORD dwEventTypeRet=0;
- size_t dwPhoneSizeRet=0;
- UINT iIconRet=0;
+ DWORD dwEventTypeRet = 0;
+ size_t dwPhoneSizeRet = 0;
+ UINT iIconRet = 0;
if (lpszMessage && dwMessageSize) {
- if ( MemoryCompare(lpszMessage,10,"SMS From: ",10) == CSTR_EQUAL) {
- LPSTR lpsz = (LPSTR)strstr(lpszMessage+10, "\r\n");
+ if (MemoryCompare(lpszMessage, 10, "SMS From: ", 10) == CSTR_EQUAL) {
+ LPSTR lpsz = (LPSTR)strstr(lpszMessage + 10, "\r\n");
if (lpsz) {
if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+10),(int)min((size_t)(lpsz-(lpszMessage+10)),dwPhoneSize),lpwszPhone,(int)dwPhoneSize);
+ dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8, 0, (lpszMessage + 10), (int)min((size_t)(lpsz - (lpszMessage + 10)), dwPhoneSize), lpwszPhone, (int)dwPhoneSize);
dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
}
}
@@ -215,16 +213,16 @@ BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventTy dwEventTypeRet = ICQEVENTTYPE_SMS;
bRet = TRUE;
}
- else if (MemoryCompare(lpszMessage,23,"SMS Confirmation From: ",23) == CSTR_EQUAL) {
- LPSTR lpsz = (LPSTR)strstr(lpszMessage+23, "\r\n");
+ else if (MemoryCompare(lpszMessage, 23, "SMS Confirmation From: ", 23) == CSTR_EQUAL) {
+ LPSTR lpsz = (LPSTR)strstr(lpszMessage + 23, "\r\n");
if (lpsz) {
if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8,0,(lpszMessage+23),(int)min((size_t)(lpsz-(lpszMessage+23)),dwPhoneSize),lpwszPhone,(int)dwPhoneSize);
+ dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8, 0, (lpszMessage + 23), (int)min((size_t)(lpsz - (lpszMessage + 23)), dwPhoneSize), lpwszPhone, (int)dwPhoneSize);
dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
}
lpsz += 2;
- if (MemoryCompare(lpsz,24,"SMS was sent succesfully",24)==CSTR_EQUAL)
+ if (MemoryCompare(lpsz, 24, "SMS was sent succesfully", 24) == CSTR_EQUAL)
iIconRet = IDI_SMSSENT;
else
iIconRet = IDI_SMSNOTSENT;
@@ -241,20 +239,20 @@ BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventTy return bRet;
}
-BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDataSize,const char *tag1,...)
+BOOL GetXMLFieldEx(LPSTR lpszXML, size_t dwXMLSize, LPSTR *plpszData, size_t *pdwDataSize, const char *tag1, ...)
{
BOOL bRet = FALSE;
int thisLevel = 0;
LPSTR lpszFindTag = (LPSTR)tag1, lpszTagEnd = lpszXML, lpszDataStart = NULL;
va_list va;
- va_start(va,tag1);
+ va_start(va, tag1);
while (TRUE) {
- LPSTR lpszTagStart = (LPSTR)MemoryFindByte(lpszTagEnd-lpszXML, lpszXML, dwXMLSize, '<');
+ LPSTR lpszTagStart = (LPSTR)MemoryFindByte(lpszTagEnd - lpszXML, lpszXML, dwXMLSize, '<');
if (!lpszTagStart)
break;
- lpszTagEnd = (LPSTR)MemoryFindByte(lpszTagStart-lpszXML, lpszXML, dwXMLSize, '>');
+ lpszTagEnd = (LPSTR)MemoryFindByte(lpszTagStart - lpszXML, lpszXML, dwXMLSize, '>');
if (!lpszTagEnd)
break;
@@ -263,19 +261,19 @@ BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDa if ((*((BYTE*)lpszTagStart)) == '/') {
if (--thisLevel < 0) {
if (lpszDataStart) {
- if (plpszData) (*plpszData)=lpszDataStart;
- if (pdwDataSize) (*pdwDataSize)=((lpszTagStart-1)-lpszDataStart);
- bRet=TRUE;
+ if (plpszData) (*plpszData) = lpszDataStart;
+ if (pdwDataSize) (*pdwDataSize) = ((lpszTagStart - 1) - lpszDataStart);
+ bRet = TRUE;
}
break;
}
}
else {
- if (++thisLevel==1)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszFindTag,-1,lpszTagStart,((lpszTagEnd+1)-lpszTagStart))==CSTR_EQUAL) {
- lpszFindTag=va_arg(va,LPSTR);
- if (lpszFindTag==NULL) lpszDataStart=(lpszTagEnd+2);
- thisLevel=0;
+ if (++thisLevel == 1)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszFindTag, -1, lpszTagStart, ((lpszTagEnd + 1) - lpszTagStart)) == CSTR_EQUAL) {
+ lpszFindTag = va_arg(va, LPSTR);
+ if (lpszFindTag == NULL) lpszDataStart = (lpszTagEnd + 2);
+ thisLevel = 0;
}
}
}
@@ -284,150 +282,145 @@ BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDa }
-BOOL GetXMLFieldExBuff(LPSTR lpszXML,size_t dwXMLSize,LPSTR lpszBuff,size_t dwBuffSize,size_t *pdwBuffSizeRet,const char *tag1,...)
+BOOL GetXMLFieldExBuff(LPSTR lpszXML, size_t dwXMLSize, LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet, const char *tag1, ...)
{
- BOOL bRet=FALSE;
- int thisLevel=0;
- LPSTR lpszFindTag=(LPSTR)tag1,lpszTagStart,lpszTagEnd=lpszXML,lpszDataStart=NULL;
+ BOOL bRet = FALSE;
+ int thisLevel = 0;
+ LPSTR lpszFindTag = (LPSTR)tag1, lpszTagStart, lpszTagEnd = lpszXML, lpszDataStart = NULL;
va_list va;
- va_start(va,tag1);
- while (TRUE)
- {
- lpszTagStart=(LPSTR)MemoryFindByte((lpszTagEnd-lpszXML),lpszXML,dwXMLSize,'<');
- if (lpszTagStart)
- {
- lpszTagEnd=(LPSTR)MemoryFindByte((lpszTagStart-lpszXML),lpszXML,dwXMLSize,'>');
- if (lpszTagEnd)
- {
+ va_start(va, tag1);
+ while (TRUE) {
+ lpszTagStart = (LPSTR)MemoryFindByte((lpszTagEnd - lpszXML), lpszXML, dwXMLSize, '<');
+ if (lpszTagStart) {
+ lpszTagEnd = (LPSTR)MemoryFindByte((lpszTagStart - lpszXML), lpszXML, dwXMLSize, '>');
+ if (lpszTagEnd) {
lpszTagStart++;
lpszTagEnd--;
- if ((*((BYTE*)lpszTagStart))=='/')
- {
- if (--thisLevel<0)
- {
- if (lpszDataStart)
- {
- size_t dwBuffSizeRet=min((dwBuffSize-2),(size_t)((lpszTagStart-1)-lpszDataStart));
- if (lpszBuff && dwBuffSize) memcpy(lpszBuff,lpszDataStart,dwBuffSizeRet);(*((WORD*)(lpszBuff+dwBuffSizeRet)))=0;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet)=dwBuffSizeRet;
- bRet=TRUE;
+ if ((*((BYTE*)lpszTagStart)) == '/') {
+ if (--thisLevel < 0) {
+ if (lpszDataStart) {
+ size_t dwBuffSizeRet = min((dwBuffSize - 2), (size_t)((lpszTagStart - 1) - lpszDataStart));
+ if (lpszBuff && dwBuffSize) memcpy(lpszBuff, lpszDataStart, dwBuffSizeRet); (*((WORD*)(lpszBuff + dwBuffSizeRet))) = 0;
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet) = dwBuffSizeRet;
+ bRet = TRUE;
}
break;
}
- }else{
- if (++thisLevel==1)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszFindTag,-1,lpszTagStart,((lpszTagEnd+1)-lpszTagStart))==CSTR_EQUAL)
- {
- lpszFindTag=va_arg(va,LPSTR);
- if (lpszFindTag==NULL) lpszDataStart=(lpszTagEnd+2);
- thisLevel=0;
+ }
+ else {
+ if (++thisLevel == 1)
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszFindTag, -1, lpszTagStart, ((lpszTagEnd + 1) - lpszTagStart)) == CSTR_EQUAL) {
+ lpszFindTag = va_arg(va, LPSTR);
+ if (lpszFindTag == NULL) lpszDataStart = (lpszTagEnd + 2);
+ thisLevel = 0;
}
}
- }else{
+ }
+ else {
break;
}
- }else{
+ }
+ else {
break;
}
}
va_end(va);
- if (bRet==FALSE)
- {
- if (lpszBuff) (*((WORD*)lpszBuff))=0;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet)=0;
+ if (bRet == FALSE) {
+ if (lpszBuff) (*((WORD*)lpszBuff)) = 0;
+ if (pdwBuffSizeRet) (*pdwBuffSizeRet) = 0;
}
return(bRet);
}
-DWORD ReplaceInBuff(LPVOID lpInBuff,size_t dwInBuffSize,size_t dwReplaceItemsCount,LPVOID *plpInReplaceItems,size_t *pdwInReplaceItemsCounts,LPVOID *plpOutReplaceItems,size_t *pdwOutReplaceItemsCounts,LPVOID lpOutBuff,size_t dwOutBuffSize,size_t *pdwOutBuffSize)
+DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplaceItemsCount, LPVOID *plpInReplaceItems, size_t *pdwInReplaceItemsCounts, LPVOID *plpOutReplaceItems, size_t *pdwOutReplaceItemsCounts, LPVOID lpOutBuff, size_t dwOutBuffSize, size_t *pdwOutBuffSize)
{
- DWORD dwRetErrorCode=NO_ERROR;
- LPBYTE *plpszFound,lpszMessageConvertedCur,lpszMessageCur,lpszMessageCurPrev,lpszMessageConvertedMax;
- size_t i,dwFirstFoundedIndex=0,dwFoundedCount=0,dwMemPartToCopy;
+ DWORD dwRetErrorCode = NO_ERROR;
+ LPBYTE *plpszFound, lpszMessageConvertedCur, lpszMessageCur, lpszMessageCurPrev, lpszMessageConvertedMax;
+ size_t i, dwFirstFoundedIndex = 0, dwFoundedCount = 0, dwMemPartToCopy;
- plpszFound=(LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
+ plpszFound = (LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
- lpszMessageCurPrev=(LPBYTE)lpInBuff;
- lpszMessageConvertedCur=(LPBYTE)lpOutBuff;
- lpszMessageConvertedMax=(((LPBYTE)lpOutBuff)+dwOutBuffSize);
+ lpszMessageCurPrev = (LPBYTE)lpInBuff;
+ lpszMessageConvertedCur = (LPBYTE)lpOutBuff;
+ lpszMessageConvertedMax = (((LPBYTE)lpOutBuff) + dwOutBuffSize);
// looking for in first time
- for (i=0; i < dwReplaceItemsCount; i++) {
- plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev-(LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
+ for (i = 0; i < dwReplaceItemsCount; i++) {
+ plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev - (LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
if (plpszFound[i])
dwFoundedCount++;
}
while (dwFoundedCount) {
// looking for first to replace
- for(i=0; i < dwReplaceItemsCount; i++)
+ for (i = 0; i < dwReplaceItemsCount; i++)
if (plpszFound[i] && (plpszFound[i] < plpszFound[dwFirstFoundedIndex] || plpszFound[dwFirstFoundedIndex] == NULL))
dwFirstFoundedIndex = i;
// in founded
if (plpszFound[dwFirstFoundedIndex]) {
- dwMemPartToCopy=(plpszFound[dwFirstFoundedIndex]-lpszMessageCurPrev);
- if (lpszMessageConvertedMax > (lpszMessageConvertedCur+(dwMemPartToCopy+pdwInReplaceItemsCounts[dwFirstFoundedIndex]))) {
- memcpy(lpszMessageConvertedCur,lpszMessageCurPrev,dwMemPartToCopy);lpszMessageConvertedCur+=dwMemPartToCopy;
- memcpy(lpszMessageConvertedCur,plpOutReplaceItems[dwFirstFoundedIndex],pdwOutReplaceItemsCounts[dwFirstFoundedIndex]);lpszMessageConvertedCur+=pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
- lpszMessageCurPrev=(plpszFound[dwFirstFoundedIndex]+pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
-
- for(i=0;i<dwReplaceItemsCount;i++)
- {// loking for in next time
- if (plpszFound[i] && plpszFound[i]<lpszMessageCurPrev)
- {
+ dwMemPartToCopy = (plpszFound[dwFirstFoundedIndex] - lpszMessageCurPrev);
+ if (lpszMessageConvertedMax > (lpszMessageConvertedCur + (dwMemPartToCopy + pdwInReplaceItemsCounts[dwFirstFoundedIndex]))) {
+ memcpy(lpszMessageConvertedCur, lpszMessageCurPrev, dwMemPartToCopy); lpszMessageConvertedCur += dwMemPartToCopy;
+ memcpy(lpszMessageConvertedCur, plpOutReplaceItems[dwFirstFoundedIndex], pdwOutReplaceItemsCounts[dwFirstFoundedIndex]); lpszMessageConvertedCur += pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
+ lpszMessageCurPrev = (plpszFound[dwFirstFoundedIndex] + pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
+
+ for (i = 0; i < dwReplaceItemsCount; i++) {// loking for in next time
+ if (plpszFound[i] && plpszFound[i] < lpszMessageCurPrev) {
dwFoundedCount--;
- plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev-(LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
+ plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev - (LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
if (plpszFound[i]) dwFoundedCount++;
}
}
- }else{
- dwRetErrorCode=ERROR_BUFFER_OVERFLOW;
+ }
+ else {
+ dwRetErrorCode = ERROR_BUFFER_OVERFLOW;
DebugBreak();
break;
}
- }else{// ñþäà ïî èäåå íèêîãäà íå ïîïàä¸ì, íà âñÿêèé ñëó÷àé.
+ }
+ else {// ñþäà ïî èäåå íèêîãäà íå ïîïàä¸ì, íà âñÿêèé ñëó÷àé.
DebugBreak();
break;
}
}
- lpszMessageCur=(((LPBYTE)lpInBuff)+dwInBuffSize);
- memcpy(lpszMessageConvertedCur,lpszMessageCurPrev,(lpszMessageCur-lpszMessageCurPrev));lpszMessageConvertedCur+=(lpszMessageCur-lpszMessageCurPrev);
- (*((WORD*)lpszMessageConvertedCur))=0;
+ lpszMessageCur = (((LPBYTE)lpInBuff) + dwInBuffSize);
+ memcpy(lpszMessageConvertedCur, lpszMessageCurPrev, (lpszMessageCur - lpszMessageCurPrev)); lpszMessageConvertedCur += (lpszMessageCur - lpszMessageCurPrev);
+ (*((WORD*)lpszMessageConvertedCur)) = 0;
MEMFREE(plpszFound);
- if (pdwOutBuffSize) (*pdwOutBuffSize)=(lpszMessageConvertedCur-((LPBYTE)lpOutBuff));
+ if (pdwOutBuffSize) (*pdwOutBuffSize) = (lpszMessageConvertedCur - ((LPBYTE)lpOutBuff));
return(dwRetErrorCode);
}
-static const LPTSTR lpszXMLTags[] ={TEXT("'"), TEXT("""), TEXT("&"), TEXT("<"), TEXT(">")};
-static const size_t dwXMLTagsCount[] ={(6*sizeof(TCHAR)), (6*sizeof(TCHAR)), (5*sizeof(TCHAR)), (4*sizeof(TCHAR)), (4*sizeof(TCHAR))};
-static const LPTSTR lpszXMLSymbols[] ={TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">")};
-static const size_t dwXMLSymbolsCount[] ={sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR)};
+static const LPTSTR lpszXMLTags[] = { TEXT("'"), TEXT("""), TEXT("&"), TEXT("<"), TEXT(">") };
+static const size_t dwXMLTagsCount[] = { (6 * sizeof(TCHAR)), (6 * sizeof(TCHAR)), (5 * sizeof(TCHAR)), (4 * sizeof(TCHAR)), (4 * sizeof(TCHAR)) };
+static const LPTSTR lpszXMLSymbols[] = { TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">") };
+static const size_t dwXMLSymbolsCount[] = { sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR), sizeof(TCHAR) };
//Decode XML coded string. The function translate special xml code into standard characters.
-DWORD DecodeXML(LPTSTR lptszMessage,size_t dwMessageSize,LPTSTR lptszMessageConverted,size_t dwMessageConvertedBuffSize,size_t *pdwMessageConvertedSize)
+DWORD DecodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),_countof(lpszXMLTags),(LPVOID*)lpszXMLTags,(size_t*)dwXMLTagsCount,(LPVOID*)lpszXMLSymbols,(size_t*)dwXMLSymbolsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
return(dwRet);
}
//Encode XML coded string. The function translate special saved xml characters into special characters.
-DWORD EncodeXML(LPTSTR lptszMessage,size_t dwMessageSize,LPTSTR lptszMessageConverted,size_t dwMessageConvertedBuffSize,size_t *pdwMessageConvertedSize)
+DWORD EncodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
{
- DWORD dwRet=ReplaceInBuff(lptszMessage,(dwMessageSize*sizeof(TCHAR)),_countof(lpszXMLTags),(LPVOID*)lpszXMLSymbols,(size_t*)dwXMLSymbolsCount,(LPVOID*)lpszXMLTags,(size_t*)dwXMLTagsCount,lptszMessageConverted,(dwMessageConvertedBuffSize*sizeof(TCHAR)),pdwMessageConvertedSize);
+ DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(TCHAR)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(TCHAR)), pdwMessageConvertedSize);
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize)/=sizeof(TCHAR);
+ if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(TCHAR);
return(dwRet);
}
@@ -439,53 +432,51 @@ BYTE MsgDlgGetFontDefaultCharset(const TCHAR*) }
-void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour)
+void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
{
int style;
char str[MAX_PATH];
DBVARIANT dbv;
- if (colour)
- {
- mir_snprintf(str,_countof(str),"Font%dCol",i);
- (*colour)=db_get_dw(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
+ if (colour) {
+ mir_snprintf(str, "Font%dCol", i);
+ (*colour) = db_get_dw(NULL, SRMMMOD, str, fontOptionsList[0].defColour);
}
- if (lf)
- {
- if (db_get(NULL,SRMMMOD,str,&dbv))
- {
- mir_tstrncpy(lf->lfFaceName,fontOptionsList[0].szDefFace,_countof(lf->lfFaceName));
- }else{
- mir_tstrncpy(lf->lfFaceName,dbv.ptszVal,_countof(lf->lfFaceName));
+ if (lf) {
+ if (db_get(NULL, SRMMMOD, str, &dbv)) {
+ mir_tstrncpy(lf->lfFaceName, fontOptionsList[0].szDefFace, _countof(lf->lfFaceName));
+ }
+ else {
+ mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, _countof(lf->lfFaceName));
db_free(&dbv);
}
- mir_snprintf(str,_countof(str),"Font%dSize",i);
- lf->lfHeight=(char)db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
- lf->lfWidth=0;
- lf->lfEscapement=0;
- lf->lfOrientation=0;
- mir_snprintf(str,_countof(str),"Font%dSty",i);
- style=db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
- lf->lfWeight=style&FONTF_BOLD?FW_BOLD:FW_NORMAL;
- lf->lfItalic=style&FONTF_ITALIC?1:0;
- lf->lfUnderline=0;
- lf->lfStrikeOut=0;
- mir_snprintf(str,_countof(str),"Font%dSet",i);
- lf->lfCharSet=db_get_b(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
- lf->lfOutPrecision=OUT_DEFAULT_PRECIS;
- lf->lfClipPrecision=CLIP_DEFAULT_PRECIS;
- lf->lfQuality=DEFAULT_QUALITY;
- lf->lfPitchAndFamily=DEFAULT_PITCH|FF_DONTCARE;
- mir_snprintf(str,_countof(str),"Font%d",i);
+ mir_snprintf(str, "Font%dSize", i);
+ lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, fontOptionsList[0].defSize);
+ lf->lfWidth = 0;
+ lf->lfEscapement = 0;
+ lf->lfOrientation = 0;
+ mir_snprintf(str, "Font%dSty", i);
+ style = db_get_b(NULL, SRMMMOD, str, fontOptionsList[0].defStyle);
+ lf->lfWeight = style&FONTF_BOLD ? FW_BOLD : FW_NORMAL;
+ lf->lfItalic = style&FONTF_ITALIC ? 1 : 0;
+ lf->lfUnderline = 0;
+ lf->lfStrikeOut = 0;
+ mir_snprintf(str, "Font%dSet", i);
+ lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, MsgDlgGetFontDefaultCharset(lf->lfFaceName));
+ lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
+ lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ lf->lfQuality = DEFAULT_QUALITY;
+ lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+ mir_snprintf(str, "Font%d", i);
}
}
-LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)
+LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch(message) {
- case WM_CHAR:
+ switch (message) {
+ case WM_CHAR:
if (wParam == '\n' && GetKeyState(VK_CONTROL) & 0x8000) {
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
@@ -499,17 +490,17 @@ LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM //It called when SMS plugin loaded and upon change in the account list.
int RefreshAccountList(WPARAM, LPARAM)
{
- int dwAccCount=0,dwSMSAccountsCount=0;
+ int dwAccCount = 0, dwSMSAccountsCount = 0;
PROTOACCOUNT **ppaAccounts;
- Proto_EnumAccounts((int*)&dwAccCount,&ppaAccounts);
+ Proto_EnumAccounts((int*)&dwAccCount, &ppaAccounts);
FreeAccountList();
- ssSMSSettings.ppaSMSAccounts=(PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
+ ssSMSSettings.ppaSMSAccounts = (PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
if (ssSMSSettings.ppaSMSAccounts)
- for (int i=0; i < dwAccCount; i++)
- if ( Proto_IsAccountEnabled(ppaAccounts[i]))
- if ( ProtoServiceExists(ppaAccounts[i]->szModuleName,MS_ICQ_SENDSMS))
+ for (int i = 0; i < dwAccCount; i++)
+ if (Proto_IsAccountEnabled(ppaAccounts[i]))
+ if (ProtoServiceExists(ppaAccounts[i]->szModuleName, MS_ICQ_SENDSMS))
ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++] = ppaAccounts[i];
ssSMSSettings.dwSMSAccountsCount = dwSMSAccountsCount;
@@ -523,5 +514,5 @@ int RefreshAccountList(WPARAM, LPARAM) void FreeAccountList()
{
MEMFREE(ssSMSSettings.ppaSMSAccounts);
- ssSMSSettings.dwSMSAccountsCount=0;
+ ssSMSSettings.dwSMSAccountsCount = 0;
}
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index f43a8c9fd9..775ad114a1 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -27,10 +27,10 @@ Enjoy the code and use it smartly! #include "stdafx.h"
-//This function handles the ACK received from that hooked.
+// This function handles the ACK received from that hooked.
int handleAckSMS(WPARAM wParam, LPARAM lParam)
{
- if ( !lParam)
+ if (!lParam)
return 0;
if (((ACKDATA*)lParam)->type != ICQACKTYPE_SMS)
return 0;
@@ -44,39 +44,36 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) if (lpszXML)
dwXMLSize = mir_strlen(lpszXML);
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_message", "text", NULL))
- {
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszPhone,&dwPhoneSize,"sms_message","sender",NULL))
- {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_message", "text", NULL)) {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszPhone, &dwPhoneSize, "sms_message", "sender", NULL)) {
LPSTR lpszMessageUTF;
- size_t dwBuffLen,dwMessageXMLEncodedSize,dwMessageXMLDecodedSize;
+ size_t dwBuffLen, dwMessageXMLEncodedSize, dwMessageXMLDecodedSize;
DBEVENTINFO dbei = { sizeof(dbei) };
- dwBuffLen=(dwDataSize+MAX_PATH);
- dbei.pBlob=(LPBYTE)MEMALLOC((dwBuffLen+dwPhoneSize));
- LPWSTR lpwszMessageXMLEncoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- LPWSTR lpwszMessageXMLDecoded=(LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- if (dbei.pBlob && lpwszMessageXMLEncoded && lpwszMessageXMLDecoded)
- {
- dwMessageXMLEncodedSize=MultiByteToWideChar(CP_UTF8,0,lpszData,(int)dwDataSize,lpwszMessageXMLEncoded,(int)dwBuffLen);
- DecodeXML(lpwszMessageXMLEncoded,dwMessageXMLEncodedSize,lpwszMessageXMLDecoded,dwBuffLen,&dwMessageXMLDecodedSize);
- lpszMessageUTF=(LPSTR)lpwszMessageXMLEncoded;
- WideCharToMultiByte(CP_UTF8,0,lpwszMessageXMLDecoded,(int)dwMessageXMLDecodedSize,lpszMessageUTF,(int)dwBuffLen,NULL,NULL);
+ dwBuffLen = (dwDataSize + MAX_PATH);
+ dbei.pBlob = (LPBYTE)MEMALLOC((dwBuffLen + dwPhoneSize));
+ LPWSTR lpwszMessageXMLEncoded = (LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ LPWSTR lpwszMessageXMLDecoded = (LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
+ if (dbei.pBlob && lpwszMessageXMLEncoded && lpwszMessageXMLDecoded) {
+ dwMessageXMLEncodedSize = MultiByteToWideChar(CP_UTF8, 0, lpszData, (int)dwDataSize, lpwszMessageXMLEncoded, (int)dwBuffLen);
+ DecodeXML(lpwszMessageXMLEncoded, dwMessageXMLEncodedSize, lpwszMessageXMLDecoded, dwBuffLen, &dwMessageXMLDecodedSize);
+ lpszMessageUTF = (LPSTR)lpwszMessageXMLEncoded;
+ WideCharToMultiByte(CP_UTF8, 0, lpwszMessageXMLDecoded, (int)dwMessageXMLDecodedSize, lpszMessageUTF, (int)dwBuffLen, NULL, NULL);
- dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
- dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,(int)dwPhoneSize,tszPhone,MAX_PHONE_LEN);
- MCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
+ dwPhoneSize = CopyNumberA(szPhone, lpszPhone, dwPhoneSize);
+ dwPhoneSize = MultiByteToWideChar(CP_UTF8, 0, szPhone, (int)dwPhoneSize, tszPhone, MAX_PHONE_LEN);
+ MCONTACT hContact = HContactFromPhone(tszPhone, dwPhoneSize);
- dbei.szModule=GetModuleName(hContact);
- dbei.timestamp=time(NULL);
+ dbei.szModule = GetModuleName(hContact);
+ dbei.timestamp = time(NULL);
dbei.flags = DBEF_UTF;
dbei.eventType = ICQEVENTTYPE_SMS;
- dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,((dwBuffLen+dwPhoneSize)),"SMS From: +%s\r\n%s",szPhone,lpszMessageUTF)+sizeof(DWORD));
+ dbei.cbBlob = (mir_snprintf((LPSTR)dbei.pBlob, ((dwBuffLen + dwPhoneSize)), "SMS From: +%s\r\n%s", szPhone, lpszMessageUTF) + sizeof(DWORD));
//dbei.pBlob=(LPBYTE)lpszBuff;
- (*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
+ (*((DWORD*)(dbei.pBlob + (dbei.cbBlob - sizeof(DWORD))))) = 0;
MEVENT hResult = db_event_add(hContact, &dbei);
- if (hContact==NULL) {
- if ( RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMS,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob)) {
+ if (hContact == NULL) {
+ if (RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMS, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
db_event_markRead(hContact, hResult);
SkinPlaySound("RecvSMSMsg");
}
@@ -86,128 +83,125 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) MEMFREE(lpwszMessageXMLEncoded);
MEMFREE(dbei.pBlob);
}
- }else
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_delivery_receipt","delivered",NULL))
- {
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszPhone,&dwPhoneSize,"sms_delivery_receipt","destination",NULL))
- {
- dwPhoneSize=CopyNumberA(szPhone,lpszPhone,dwPhoneSize);
- dwPhoneSize=MultiByteToWideChar(CP_UTF8,0,szPhone,(int)dwPhoneSize,tszPhone,MAX_PHONE_LEN);
- MCONTACT hContact=HContactFromPhone(tszPhone,dwPhoneSize);
+ }
+ else
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_delivery_receipt", "delivered", NULL)) {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszPhone, &dwPhoneSize, "sms_delivery_receipt", "destination", NULL)) {
+ dwPhoneSize = CopyNumberA(szPhone, lpszPhone, dwPhoneSize);
+ dwPhoneSize = MultiByteToWideChar(CP_UTF8, 0, szPhone, (int)dwPhoneSize, tszPhone, MAX_PHONE_LEN);
+ MCONTACT hContact = HContactFromPhone(tszPhone, dwPhoneSize);
- DBEVENTINFO dbei={0};
- dbei.cbSize=sizeof(dbei);
- dbei.szModule=GetModuleName(hContact);
- dbei.timestamp=time(NULL);
- dbei.flags = DBEF_UTF;
- dbei.eventType = ICQEVENTTYPE_SMSCONFIRMATION;
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL)
- {
- dbei.cbBlob=(MAX_PHONE_LEN+MAX_PATH);
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob) dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,dbei.cbBlob,"SMS Confirmation From: +%s\r\nSMS was sent succesfully",szPhone)+4);
- }else{
- if (GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_delivery_receipt","error","params","param",NULL)==FALSE)
- {
- lpszData="";
- dwDataSize=0;
+ DBEVENTINFO dbei = { 0 };
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = GetModuleName(hContact);
+ dbei.timestamp = time(NULL);
+ dbei.flags = DBEF_UTF;
+ dbei.eventType = ICQEVENTTYPE_SMSCONFIRMATION;
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL) {
+ dbei.cbBlob = (MAX_PHONE_LEN + MAX_PATH);
+ dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob) dbei.cbBlob = (mir_snprintf((LPSTR)dbei.pBlob, dbei.cbBlob, "SMS Confirmation From: +%s\r\nSMS was sent succesfully", szPhone) + 4);
}
- dbei.cbBlob=(int)(MAX_PHONE_LEN+MAX_PATH+dwDataSize);
- dbei.pBlob=(PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob)
- {
- dbei.cbBlob=mir_snprintf((LPSTR)dbei.pBlob,dbei.cbBlob,"SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ",szPhone);
- memcpy((dbei.pBlob+dbei.cbBlob),lpszData,dwDataSize);
- dbei.cbBlob += (int)(dwDataSize+sizeof(DWORD));
- (*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
+ else {
+ if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_delivery_receipt", "error", "params", "param", NULL) == FALSE) {
+ lpszData = "";
+ dwDataSize = 0;
+ }
+ dbei.cbBlob = (int)(MAX_PHONE_LEN + MAX_PATH + dwDataSize);
+ dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
+ if (dbei.pBlob) {
+ dbei.cbBlob = mir_snprintf((LPSTR)dbei.pBlob, dbei.cbBlob, "SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ", szPhone);
+ memcpy((dbei.pBlob + dbei.cbBlob), lpszData, dwDataSize);
+ dbei.cbBlob += (int)(dwDataSize + sizeof(DWORD));
+ (*((DWORD*)(dbei.pBlob + (dbei.cbBlob - sizeof(DWORD))))) = 0;
+ }
}
- }
- if (dbei.pBlob) {
- if (hContact)
- db_event_add(hContact, &dbei);
- else
- RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMSCONFIRMATION,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob);
+ if (dbei.pBlob) {
+ if (hContact)
+ db_event_add(hContact, &dbei);
+ else
+ RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMSCONFIRMATION, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob);
- MEMFREE(dbei.pBlob);
+ MEMFREE(dbei.pBlob);
+ }
}
}
- }else
- if ((ack->result == ACKRESULT_FAILED) || GetXMLFieldEx(lpszXML,dwXMLSize,&lpszData,&dwDataSize,"sms_response","deliverable",NULL))
- {
- HWND hWndDlg = SendSMSWindowHwndByHProcessGet(ack->hProcess);
- if (hWndDlg) {
- char szNetwork[MAX_PATH];
+ else
+ if ((ack->result == ACKRESULT_FAILED) || GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_response", "deliverable", NULL)) {
+ HWND hWndDlg = SendSMSWindowHwndByHProcessGet(ack->hProcess);
+ if (hWndDlg) {
+ char szNetwork[MAX_PATH];
- KillTimer(hWndDlg, wParam);
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szNetwork,sizeof(szNetwork),NULL,"sms_response","network",NULL);
+ KillTimer(hWndDlg, wParam);
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szNetwork, sizeof(szNetwork), NULL, "sms_response", "network", NULL);
- if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"no",2)==CSTR_EQUAL) {
- char szBuff[1024];
- TCHAR tszErrorMessage[1028];
- LPSTR lpszErrorDescription;
+ if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "no", 2) == CSTR_EQUAL) {
+ char szBuff[1024];
+ TCHAR tszErrorMessage[1028];
+ LPSTR lpszErrorDescription;
- if (SendSMSWindowMultipleGet(hWndDlg)) {
- TVITEM tvi;
- tvi.mask=TVIF_TEXT;
- tvi.hItem=SendSMSWindowHItemSendGet(hWndDlg);
- tvi.pszText=tszPhone;
- tvi.cchTextMax=_countof(tszPhone);
- TreeView_GetItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),&tvi);
- }
- else GetDlgItemText(hWndDlg,IDC_ADDRESS,tszPhone,_countof(szPhone));
+ if (SendSMSWindowMultipleGet(hWndDlg)) {
+ TVITEM tvi;
+ tvi.mask = TVIF_TEXT;
+ tvi.hItem = SendSMSWindowHItemSendGet(hWndDlg);
+ tvi.pszText = tszPhone;
+ tvi.cchTextMax = _countof(tszPhone);
+ TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
+ }
+ else GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(szPhone));
- if (ack->result == ACKRESULT_FAILED)
- lpszErrorDescription=lpszXML;
- else {
- lpszErrorDescription=szBuff;
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szBuff,sizeof(szBuff),NULL,"sms_response","error","params","param",NULL);
- }
+ if (ack->result == ACKRESULT_FAILED)
+ lpszErrorDescription = lpszXML;
+ else {
+ lpszErrorDescription = szBuff;
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szBuff, sizeof(szBuff), NULL, "sms_response", "error", "params", "param", NULL);
+ }
- mir_sntprintf(tszErrorMessage,_countof(tszErrorMessage),TranslateT("SMS message didn't send by %S to %s because: %S"),szNetwork,tszPhone,lpszErrorDescription);
- ShowWindow(hWndDlg,SW_SHOWNORMAL);
- EnableWindow(hWndDlg,FALSE);
- HWND hwndTimeOut=CreateDialog(ssSMSSettings.hInstance,MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT),hWndDlg,SMSTimedOutDlgProc);
- SetDlgItemText(hwndTimeOut,IDC_STATUS,tszErrorMessage);
- }
- else {
- SendSMSWindowDBAdd(hWndDlg);
- if ( SendSMSWindowMultipleGet(hWndDlg)) {
- if ( SendSMSWindowNextHItemGet(hWndDlg,SendSMSWindowHItemSendGet(hWndDlg))) {
- SendSMSWindowAsSentSet(hWndDlg);
- SendSMSWindowHItemSendSet(hWndDlg,SendSMSWindowNextHItemGet(hWndDlg,SendSMSWindowHItemSendGet(hWndDlg)));
- SendSMSWindowNext(hWndDlg);
+ mir_sntprintf(tszErrorMessage, TranslateT("SMS message didn't send by %S to %s because: %S"), szNetwork, tszPhone, lpszErrorDescription);
+ ShowWindow(hWndDlg, SW_SHOWNORMAL);
+ EnableWindow(hWndDlg, FALSE);
+ HWND hwndTimeOut = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT), hWndDlg, SMSTimedOutDlgProc);
+ SetDlgItemText(hwndTimeOut, IDC_STATUS, tszErrorMessage);
}
- else SendSMSWindowRemove(hWndDlg);
- }
- else {
- if ( CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL ||
- CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"smtp",4)==CSTR_EQUAL) {
- char szSource[MAX_PATH],szMessageID[MAX_PATH];
-
- if (DB_SMS_GetByte(NULL,"ShowACK",SMS_DEFAULT_SHOWACK)) {
- HWND hwndAccepted=CreateDialog(ssSMSSettings.hInstance,MAKEINTRESOURCE(IDD_SENDSMSACCEPT),hWndDlg,SMSAcceptedDlgProc);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),NORM_IGNORECASE,lpszData,(int)dwDataSize,"yes",3)==CSTR_EQUAL) {
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szSource,sizeof(szSource),NULL,"sms_response","source",NULL);
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szMessageID,sizeof(szMessageID),NULL,"sms_response","message_id",NULL);
+ else {
+ SendSMSWindowDBAdd(hWndDlg);
+ if (SendSMSWindowMultipleGet(hWndDlg)) {
+ if (SendSMSWindowNextHItemGet(hWndDlg, SendSMSWindowHItemSendGet(hWndDlg))) {
+ SendSMSWindowAsSentSet(hWndDlg);
+ SendSMSWindowHItemSendSet(hWndDlg, SendSMSWindowNextHItemGet(hWndDlg, SendSMSWindowHItemSendGet(hWndDlg)));
+ SendSMSWindowNext(hWndDlg);
}
- else {
- SetDlgItemText(hwndAccepted,IDC_ST_SOURCE,TranslateT("From:"));
- SetDlgItemText(hwndAccepted,IDC_ST_MESSAGEID,TranslateT("To:"));
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szSource,sizeof(szSource),NULL,"sms_response","from",NULL);
- GetXMLFieldExBuff(lpszXML,dwXMLSize,szMessageID,sizeof(szMessageID),NULL,"sms_response","to",NULL);
+ else SendSMSWindowRemove(hWndDlg);
+ }
+ else {
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL ||
+ CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "smtp", 4) == CSTR_EQUAL) {
+ char szSource[MAX_PATH], szMessageID[MAX_PATH];
+
+ if (DB_SMS_GetByte(NULL, "ShowACK", SMS_DEFAULT_SHOWACK)) {
+ HWND hwndAccepted = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSACCEPT), hWndDlg, SMSAcceptedDlgProc);
+ if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL) {
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szSource, sizeof(szSource), NULL, "sms_response", "source", NULL);
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szMessageID, sizeof(szMessageID), NULL, "sms_response", "message_id", NULL);
+ }
+ else {
+ SetDlgItemText(hwndAccepted, IDC_ST_SOURCE, TranslateT("From:"));
+ SetDlgItemText(hwndAccepted, IDC_ST_MESSAGEID, TranslateT("To:"));
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szSource, sizeof(szSource), NULL, "sms_response", "from", NULL);
+ GetXMLFieldExBuff(lpszXML, dwXMLSize, szMessageID, sizeof(szMessageID), NULL, "sms_response", "to", NULL);
+ }
+ SetDlgItemTextA(hwndAccepted, IDC_NETWORK, szNetwork);
+ SetDlgItemTextA(hwndAccepted, IDC_SOURCE, szSource);
+ SetDlgItemTextA(hwndAccepted, IDC_MESSAGEID, szMessageID);
+ }
+ else SendSMSWindowRemove(hWndDlg);
}
- SetDlgItemTextA(hwndAccepted,IDC_NETWORK,szNetwork);
- SetDlgItemTextA(hwndAccepted,IDC_SOURCE,szSource);
- SetDlgItemTextA(hwndAccepted,IDC_MESSAGEID,szMessageID);
+ else SendSMSWindowRemove(hWndDlg);
}
- else SendSMSWindowRemove(hWndDlg);
}
- else SendSMSWindowRemove(hWndDlg);
}
}
- }
- }
return 0;
}
@@ -217,28 +211,28 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
TCHAR szToolTip[MAX_PATH];
DBEVENTINFO dbei = { sizeof(dbei) };
-
+
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
return 0;
dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
- if ( !dbei.pBlob)
+ if (!dbei.pBlob)
return 0;
- memcpy(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE);
+ memcpy(szServiceFunction, PROTOCOL_NAMEA, PROTOCOL_NAME_SIZE);
pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
if (db_event_get(hDbEvent, &dbei) == 0)
if ((dbei.flags & DBEF_SENT) == 0)
if (dbei.eventType == ICQEVENTTYPE_SMS) {
- if (dbei.cbBlob>MIN_SMS_DBEVENT_LEN) {
+ if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
SkinPlaySound("RecvSMSMsg");
- if (DB_SMS_GetByte(NULL,"AutoPopup",0)) {
- if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMS,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob))
+ if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
+ if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMS, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
db_event_markRead(hContact, hDbEvent);
}
else {
- memcpy(pszServiceFunctionName,SMS_READ,sizeof(SMS_READ));
- mir_sntprintf(szToolTip,_countof(szToolTip),TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ memcpy(pszServiceFunctionName, SMS_READ, sizeof(SMS_READ));
+ mir_sntprintf(szToolTip, TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
@@ -247,30 +241,30 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
cle.pszService = szServiceFunction;
cle.ptszTooltip = szToolTip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
}
else if (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION) {
SkinPlaySound("RecvSMSConfirmation");
if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
- if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMSCONFIRMATION,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob))
+ if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMSCONFIRMATION, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
db_event_delete(hContact, hDbEvent);
}
else {
UINT iIcon;
if (GetDataFromMessage((LPSTR)dbei.pBlob, dbei.cbBlob, NULL, NULL, 0, NULL, &iIcon)) {
- memcpy(pszServiceFunctionName,SMS_READ_ACK,sizeof(SMS_READ_ACK));
- mir_sntprintf(szToolTip,_countof(szToolTip),TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ memcpy(pszServiceFunctionName, SMS_READ_ACK, sizeof(SMS_READ_ACK));
+ mir_sntprintf(szToolTip, TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
- cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance,MAKEINTRESOURCE(iIcon),IMAGE_ICON,0,0,LR_SHARED);
+ cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(iIcon), IMAGE_ICON, 0, 0, LR_SHARED);
cle.pszService = szServiceFunction;
cle.ptszTooltip = szToolTip;
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
}
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index 6cec77af40..af6cb3ae07 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -210,7 +210,7 @@ HWND RecvSMSWindowAdd(MCONTACT hContact, DWORD dwEventType, LPWSTR lpwszPhone, s }
lpwszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(wszTitle, _countof(wszTitle), _T("%s - %s"), lpwszContactDisplayName, lpwszTitlepart);
+ mir_sntprintf(wszTitle, _T("%s - %s"), lpwszContactDisplayName, lpwszTitlepart);
MultiByteToWideChar(CP_UTF8, 0, lpszMessage, (int)dwMessageSize, lpwszMessage, (int)dwMessageSize + MAX_PATH);
SetWindowText(prswdWindowData->hWnd, wszTitle);
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 8af23dd8d3..0f9a499655 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -154,7 +154,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA EnableWindow(GetDlgItem(hWndDlg, IDOK), dwSignLen != 0);
}
- mir_sntprintf(tszSign, _countof(tszSign), _T("%d/%d"), dwSignLen, GetSMSMessageLenMax(hWndDlg));
+ mir_sntprintf(tszSign, _T("%d/%d"), dwSignLen, GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg, IDC_COUNT, tszSign);
}
@@ -222,7 +222,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA else {
GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
}
- mir_sntprintf(tszMessage, _countof(tszMessage), TranslateT("The SMS message send to %s timed out."), tszPhone);
+ mir_sntprintf(tszMessage, TranslateT("The SMS message send to %s timed out."), tszPhone);
KillTimer(hWndDlg, wParam);
ShowWindow(hWndDlg, SW_SHOWNORMAL);
EnableWindow(hWndDlg, FALSE);
@@ -386,7 +386,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize != 0);
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%d/%d"), dwMessageSize, GetSMSMessageLenMax(hWndDlg));
+ mir_sntprintf(tszBuff, _T("%d/%d"), dwMessageSize, GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg, IDC_COUNT, tszBuff);
}
break;
@@ -402,7 +402,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARA if (IsContactPhone(psswdWindowData->hMyContact, tszPhone, dwPhoneSize) == FALSE) {
mir_tstrcat(tszPhone, _T(" SMS"));
for (DWORD i = 0; bCont; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "MyPhone%d", i);
+ mir_snprintf(szBuff, "MyPhone%d", i);
if (db_get(psswdWindowData->hMyContact, "UserInfo", szBuff, &dbv)) bCont = FALSE;
db_free(&dbv);
}
@@ -559,7 +559,7 @@ HWND SendSMSWindowAdd(MCONTACT hContact) LPTSTR lptszContactDisplayName = pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR tszTitle[MAX_PATH];
- mir_sntprintf(tszTitle, _countof(tszTitle), _T("%s - %s"), lptszContactDisplayName, TranslateT("Send SMS"));
+ mir_sntprintf(tszTitle, _T("%s - %s"), lptszContactDisplayName, TranslateT("Send SMS"));
SetWindowText(psswdWindowData->hWnd, tszTitle);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)lptszContactDisplayName);
SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_SETCURSEL, 0, 0);
@@ -964,7 +964,7 @@ void AddContactPhonesToComboToListParam(MCONTACT hContact, LPSTR lpszModule, LPS }
for (i = 0; TRUE; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "%s%ld", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
if (DB_GetStaticStringW(hContact, lpszModule, szBuff, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
tszPhone[0] = '+';
dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
@@ -1026,7 +1026,7 @@ void AddContactPhonesToTreeViewParam(MCONTACT hContact, LPSTR lpszModule, LPSTR }
for (i = 0; TRUE; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "%s%ld", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
if (DB_GetStaticStringW(hContact, lpszModule, szBuff, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
tszPhone[0] = '+';
dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 254fb28675..f922a731f2 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa TCHAR tszTooltipText[2048];
RECT rect;
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText),
+ mir_sntprintf(tszTooltipText,
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 1eb9907c3a..1fab1ef1f8 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -53,7 +53,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index b8923a07ec..b67205598c 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -799,7 +799,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p }
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -1432,7 +1432,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
static TCHAR ptszBuf[128];
- mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%c%s"), szIndicator, ui->pszNick);
+ mir_sntprintf(ptszBuf, _T("%c%s"), szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick);
@@ -1641,7 +1641,7 @@ LABEL_SHOWWINDOW: USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
static TCHAR ptszBuf[1024];
- mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(ptszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 5801cbbdd5..563c2803da 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -293,8 +293,8 @@ void RegisterKeyBindings() desc.pszName = strName;
desc.pszDescription = strDesc;
for (int i = 0; i < 9; i++) {
- mir_snprintf(strName, _countof(strName), "Scriver/Nav/Tab %d", i + 1);
- mir_snprintf(strDesc, _countof(strDesc), Translate("Navigate: tab %d"), i + 1);
+ mir_snprintf(strName, "Scriver/Nav/Tab %d", i + 1);
+ mir_snprintf(strDesc, Translate("Navigate: tab %d"), i + 1);
desc.lParam = KB_TAB1 + i;
desc.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, '1' + i);
Hotkey_Register(&desc);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 0637424ddf..68e31b3ec1 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -302,7 +302,7 @@ static LRESULT CALLBACK LogEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, ptrT pszWord(GetRichTextWord(hwnd, &ptl));
if (pszWord && pszWord[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWord);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWord);
ModifyMenu(hSubMenu, 5, MF_STRING | MF_BYPOSITION, 5, szMenuText);
SetSearchEngineIcons(hMenu, g_dat.hSearchEngineIconList);
}
@@ -1266,7 +1266,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rcLog);
GetClientRect(hwndDlg, &rc);
- POINT pt = { 0, wParam };
+ POINT pt = { 0, (int)wParam };
ScreenToClient(hwndDlg, &pt);
dat->splitterPos = rc.bottom - pt.y;
SendMessage(hwndDlg, WM_SIZE, 0, 0);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 32e98e5996..5915bf2acd 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -379,7 +379,7 @@ static char* SetToStyle(int style) static char szStyle[128];
LOGFONT lf;
LoadMsgDlgFont(style, &lf, NULL);
- mir_snprintf(szStyle, _countof(szStyle), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
+ mir_snprintf(szStyle, "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
return szStyle;
}
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index aefb07949f..701733a6bc 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -129,7 +129,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hDbEvent = hDbEvent;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), contactName);
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
@@ -208,7 +208,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) else if (lParam && (g_dat.flags2 & SMF2_SHOWTYPINGTRAY)) {
TCHAR szTip[256];
- mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if ( ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags2 & SMF2_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
@@ -282,7 +282,7 @@ static void RestoreUnreadMessageAlerts(void) else {
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -629,7 +629,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), nextStgId++);
+ mir_sntprintf(sztName, _T("s%u"), nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index eb48aeb5e7..37cf89bcee 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -1133,14 +1133,14 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char *szNamePrefix = (!savePerContact && dat->isChat) ? "chat" : "";
if (!dat->windowWasCascaded) {
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.top);
}
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(hContact, SRMMMOD, SRMSGSET_TOPMOST, (BYTE)dat->bTopmost);
if (g_dat.lastParent == dat)
@@ -1510,9 +1510,9 @@ int ScriverRestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szMod GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
int x = db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
int y = db_get_dw(hContact, szModule, szSettingName, -1);
if (x == -1)
return 1;
@@ -1522,9 +1522,9 @@ int ScriverRestoreWindowPosition(HWND hwnd, MCONTACT hContact, const char *szMod else {
wp.rcNormalPosition.left = x;
wp.rcNormalPosition.top = y;
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
wp.rcNormalPosition.right = wp.rcNormalPosition.left + db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
wp.rcNormalPosition.bottom = wp.rcNormalPosition.top + db_get_dw(hContact, szModule, szSettingName, -1);
}
wp.flags = 0;
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index cea74321c6..f9fac518df 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -375,29 +375,29 @@ void SearchWord(TCHAR * word, int engine) ptrA wordURL(mir_urlEncode(wordUTF));
switch (engine) {
case SEARCHENGINE_WIKIPEDIA:
- mir_snprintf(szURL, _countof(szURL), "http://en.wikipedia.org/wiki/%s", wordURL);
+ mir_snprintf(szURL, "http://en.wikipedia.org/wiki/%s", wordURL);
break;
case SEARCHENGINE_YAHOO:
- mir_snprintf(szURL, _countof(szURL), "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL);
+ mir_snprintf(szURL, "http://search.yahoo.com/search?p=%s&ei=UTF-8", wordURL);
break;
case SEARCHENGINE_FOODNETWORK:
- mir_snprintf(szURL, _countof(szURL), "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL);
+ mir_snprintf(szURL, "http://search.foodnetwork.com/search/delegate.do?fnSearchString=%s", wordURL);
break;
case SEARCHENGINE_BING:
- mir_snprintf(szURL, _countof(szURL), "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL);
+ mir_snprintf(szURL, "http://www.bing.com/search?q=%s&form=OSDSRC", wordURL);
break;
case SEARCHENGINE_GOOGLE_MAPS:
- mir_snprintf(szURL, _countof(szURL), "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, "http://maps.google.com/maps?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
case SEARCHENGINE_GOOGLE_TRANSLATE:
- mir_snprintf(szURL, _countof(szURL), "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, "http://translate.google.com/?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
case SEARCHENGINE_YANDEX:
- mir_snprintf(szURL, _countof(szURL), "http://yandex.ru/yandsearch?text=%s", wordURL);
+ mir_snprintf(szURL, "http://yandex.ru/yandsearch?text=%s", wordURL);
break;
case SEARCHENGINE_GOOGLE:
default:
- mir_snprintf(szURL, _countof(szURL), "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL);
+ mir_snprintf(szURL, "http://www.google.com/search?q=%s&ie=utf-8&oe=utf-8", wordURL);
break;
}
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index c1769cbd80..cef386ddbf 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -806,7 +806,7 @@ INT_PTR CALLBACK DlgProcOptionsGPG(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l GetDlgItemText(hDlg, IDC_GPGEXECUTABLE_EDIT, gpgexe, _countof(gpgexe));
// filter zusammensetzen
- mir_snprintf(filter, _countof(filter), _T("%s (*.exe)%c*.exe%c%c"), Translate("Executable Files"), 0, 0, 0);
+ mir_snprintf(filter, _T("%s (*.exe)%c*.exe%c%c"), Translate("Executable Files"), 0, 0, 0);
// OPENFILENAME initialisieren
OPENFILENAME ofn = { sizeof(ofn) };
@@ -1042,7 +1042,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) if (bPGPloaded && ver) {
char pgpVerStr[64];
- mir_snprintf(pgpVerStr, _countof(pgpVerStr), Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
+ mir_snprintf(pgpVerStr, Translate(sim218), ver >> 24, (ver >> 16) & 255, (ver >> 8) & 255);
SetDlgItemText(hDlg, IDC_PGP_SDK, pgpVerStr);
}
else SetDlgItemText(hDlg, IDC_PGP_SDK, Translate(sim219));
@@ -1548,14 +1548,14 @@ void ListView_Sort(HWND hLV, LPARAM lParamSort) {
// restore sort column
char t[32];
- mir_snprintf(t, _countof(t), "os%02x", (UINT)lParamSort & 0xF0);
+ mir_snprintf(t, "os%02x", (UINT)lParamSort & 0xF0);
if ((lParamSort & 0x0F) == 0)
lParamSort = (int)db_get_b(0, MODULENAME, t, lParamSort + 1);
db_set_b(0, MODULENAME, t, (BYTE)lParamSort);
// restore sort order
- mir_snprintf(t, _countof(t), "os%02x", (UINT)lParamSort);
+ mir_snprintf(t, "os%02x", (UINT)lParamSort);
int m = db_get_b(0, MODULENAME, t, 0);
if (bChangeSortOrder) { m = !m; db_set_b(0, MODULENAME, t, m); }
@@ -1571,7 +1571,7 @@ BOOL ShowSelectKeyDlg(HWND hParent, LPSTR KeyPath) ofn.lpstrFile = KeyPath;
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrTitle = TranslateT("Open Key File");
if (!GetOpenFileName(&ofn)) return FALSE;
@@ -1628,7 +1628,7 @@ BOOL SaveExportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) OPENFILENAME ofn = { sizeof(ofn) };
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.hwndOwner = hParent;
ofn.nMaxFile = MAX_PATH;
@@ -1661,7 +1661,7 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) ofn.Flags = OFN_EXPLORER | OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN;
ofn.lpstrFile = szFile;
char temp[MAX_PATH];
- mir_snprintf(temp, _countof(temp), _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
+ mir_snprintf(temp, _T("%s (*.asc)%c*.asc%c%s (*.*)%c*.*%c%c"), Translate("ASC files"), 0, 0, Translate("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrTitle = (priv) ? TranslateT("Load Private Key File") : TranslateT("Load Public Key File");
if (!GetOpenFileName(&ofn))
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 2aaea47284..2f22076d5d 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -174,7 +174,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA TranslateDialogDefault(hwndDlg);
hContact = (MCONTACT)lparam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lparam);
- mir_sntprintf(sztemp, _countof(sztemp), _T("%s: %s"),
+ mir_sntprintf(sztemp, _T("%s: %s"),
pcli->pfnGetContactDisplayName(hContact, 0),
TranslateT("last seen history"));
SetWindowText(hwndDlg, sztemp);
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp index d407c5e24d..5b1a2574cd 100644 --- a/plugins/SeenPlugin/src/missed.cpp +++ b/plugins/SeenPlugin/src/missed.cpp @@ -109,7 +109,7 @@ int ShowMissed(void) for (int loop = 0; loop < mcs.count; loop++) {
mir_tstrncat(sztemp, (TCHAR*)pcli->pfnGetContactDisplayName(mcs.wpcontact[loop], 0), _countof(sztemp) - mir_tstrlen(sztemp));
if (db_get_b(NULL, S_MOD, "MissedOnes_Count", 0)) {
- mir_sntprintf(szcount, _countof(szcount), _T(" [%i]"), mcs.times[loop]);
+ mir_sntprintf(szcount, _T(" [%i]"), mcs.times[loop]);
mir_tstrcat(sztemp, szcount);
}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 89aeb04247..adc23838ba 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -276,7 +276,7 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM if (LOWORD(wparam) == IDC_VARIABLES) {
char szout[2048];
- mir_snprintf(szout, _countof(szout), VARIABLE_LIST);
+ mir_snprintf(szout, VARIABLE_LIST);
MessageBoxA(hdlg, szout, Translate("Last Seen Variables"), MB_OK | MB_TOPMOST);
}
break; //case WM_COMMAND
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index 24a2f3de56..a002707251 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -399,7 +399,7 @@ void CSend::Error(LPCTSTR pszFormat, ...) { TCHAR tszMsg[MAX_SECONDLINE]; - mir_sntprintf(tszMsg, _countof(tszMsg), _T("%s - %s"), _T(SZ_SENDSS), TranslateT("Error")); + mir_sntprintf(tszMsg, _T("%s - %s"), _T(SZ_SENDSS), TranslateT("Error")); mir_free(m_ErrorTitle), m_ErrorTitle = mir_tstrdup(tszMsg); va_list vl; diff --git a/plugins/SendScreenshotPlus/src/UAboutForm.cpp b/plugins/SendScreenshotPlus/src/UAboutForm.cpp index d21b8deaeb..dbf260860e 100644 --- a/plugins/SendScreenshotPlus/src/UAboutForm.cpp +++ b/plugins/SendScreenshotPlus/src/UAboutForm.cpp @@ -206,7 +206,7 @@ void TfrmAbout::btnPageClick() TCHAR newTitle[128]; TCHAR* pszPlug = mir_a2t(__PLUGIN_NAME); TCHAR* pszVer = mir_a2t(__VERSION_STRING_DOTS); - mir_sntprintf(newTitle, _countof(newTitle), _T("%s - %s\nv%s"), pszPlug, title, pszVer); + mir_sntprintf(newTitle, _T("%s - %s\nv%s"), pszPlug, title, pszVer); mir_free(pszPlug); mir_free(pszVer); SetDlgItemText(m_hWnd, IDC_HEADERBAR, newTitle); diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index de58878414..b0dba2015a 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -240,7 +240,7 @@ void TfrmMain::wmInitdialog(WPARAM, LPARAM) if (m_MonitorCount > 1) { TCHAR tszTemp[120]; for (size_t mon = 0; mon < m_MonitorCount; ++mon) { /// @todo : fix format for non MSVC compilers - mir_sntprintf(tszTemp, _countof(tszTemp), _T("%Iu. %s%s"), + mir_sntprintf(tszTemp, _T("%Iu. %s%s"), mon + 1, TranslateT("Monitor"), (m_Monitors[mon].dwFlags & MONITORINFOF_PRIMARY) ? TranslateT(" (primary)") : _T("") ); diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 6f1653590c..bd43096a93 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -700,11 +700,11 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...) { TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE]; - mir_sntprintf(tszTitle, _countof(tszMsg), _T("%s - %s"), _T(MODNAME), TranslateT("Error")); + mir_sntprintf(tszTitle, _T("%s - %s"), _T(MODNAME), TranslateT("Error")); va_list vl; va_start(vl, pszFormat); - mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl); + mir_vsntprintf(tszMsg, TranslateTS(pszFormat), vl); va_end(vl); MSGBOX mb = { 0 }; diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index d0a9924980..9aa921b2de 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -602,17 +602,17 @@ int DelUserDefSession(int ses_count) }
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "UserSessionDsc", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", ses_count);
db_unset(NULL, MODNAME, szSessionName);
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
db_unset(NULL, MODNAME, szSessionName);
for (int i = ses_count + 1;; i++) {
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "UserSessionDsc", i);
+ mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i);
ptrT szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "UserSessionDsc", i - 1);
+ mir_snprintf(szSessionName, "%s_%u", "UserSessionDsc", i - 1);
if (szSessionNameBuf) {
MarkUserDefSession(i - 1, IsMarkedUserDefSession(i));
db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
@@ -620,7 +620,7 @@ int DelUserDefSession(int ses_count) else {
db_unset(NULL, MODNAME, szSessionName);
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", i - 1);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", i - 1);
db_unset(NULL, MODNAME, szSessionName);
break;
}
@@ -638,14 +638,14 @@ int DeleteAutoSession(int ses_count) }
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "SessionDate", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "SessionDate", ses_count);
db_unset(NULL, MODNAME, szSessionName);
for (int i = ses_count + 1;; i++) {
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "SessionDate", i);
+ mir_snprintf(szSessionName, "%s_%u", "SessionDate", i);
ptrT szSessionNameBuf(db_get_tsa(NULL, MODNAME, szSessionName));
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "SessionDate", i - 1);
+ mir_snprintf(szSessionName, "%s_%u", "SessionDate", i - 1);
if (szSessionNameBuf)
db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
else {
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index 8bc54180a4..1672a81dda 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -127,7 +127,7 @@ bool LoadContactsFromMask(MCONTACT hContact, int mode, int count) void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode)
{
char szFormNumBuf[100];
- mir_snprintf(szFormNumBuf, _countof(szFormNumBuf), "%02u", ordernum);
+ mir_snprintf(szFormNumBuf, "%02u", ordernum);
if (mode == 0) {
ptrA szValue(db_get_sa(hContact, MODNAME, "LastSessionsMarks"));
@@ -149,7 +149,7 @@ void AddInSessionOrder(MCONTACT hContact, int mode, int ordernum, int writemode) db_set_s(hContact, MODNAME, "LastSessionsOrder", temp);
}
else if (writemode == 1) {
- mir_snprintf(szFormNumBuf, _countof(szFormNumBuf), "%02u%s", ordernum, "000000000000000000");
+ mir_snprintf(szFormNumBuf, "%02u%s", ordernum, "000000000000000000");
db_set_s(hContact, MODNAME, "LastSessionsOrder", szFormNumBuf);
}
}
@@ -229,7 +229,7 @@ BOOL ResaveSettings(char *szName, int iFirst, int iLimit, TCHAR *szBuffer) break;
char szNameBuf[256];
- mir_snprintf(szNameBuf, _countof(szNameBuf), "%s_%u", szName, i);
+ mir_snprintf(szNameBuf, "%s_%u", szName, i);
TCHAR *ptszTemp = db_get_tsa(NULL, MODNAME, szNameBuf);
db_set_ts(NULL, MODNAME, szNameBuf, szBuffer);
@@ -297,7 +297,7 @@ int LoadSessionToCombobox(HWND hdlg, BOOL mode, int iLimit, char* pszSetting, in }
for (int i = 0; i < iLimit; i++) {
- mir_snprintf(szBuffer, _countof(szBuffer), "%s_%u", pszSetting, i);
+ mir_snprintf(szBuffer, "%s_%u", pszSetting, i);
TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
if (!IsMarkedUserDefSession(i + iFirstNum) || mode == 1) {
@@ -326,7 +326,7 @@ int FillFavoritesMenu(HMENU hMenu, int iLimit) for (int i = 0; i < iLimit; i++) {
if (IsMarkedUserDefSession(i)) {
char szBuffer[256];
- mir_snprintf(szBuffer, _countof(szBuffer), "%s_%u", "UserSessionDsc", i);
+ mir_snprintf(szBuffer, "%s_%u", "UserSessionDsc", i);
TCHAR *pszBuffer = db_get_tsa(NULL, MODNAME, szBuffer);
if (pszBuffer) {
AppendMenu(hMenu, MF_STRING, i + 1, pszBuffer);
@@ -361,14 +361,14 @@ int CheckContactVisibility(MCONTACT hContact) void RenameUserDefSession(int ses_count, TCHAR* ptszNewName)
{
char szSession[256];
- mir_snprintf(szSession, _countof(szSession), "%s_%u", "UserSessionDsc", ses_count);
+ mir_snprintf(szSession, "%s_%u", "UserSessionDsc", ses_count);
db_set_ts(NULL, MODNAME, szSession, ptszNewName);
}
int MarkUserDefSession(int ses_count, BYTE bCheck)
{
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
db_set_b(NULL, MODNAME, szSessionName, bCheck);
return 0;
}
@@ -376,7 +376,7 @@ int MarkUserDefSession(int ses_count, BYTE bCheck) BYTE IsMarkedUserDefSession(int ses_count)
{
char szSessionName[256];
- mir_snprintf(szSessionName, _countof(szSessionName), "%s_%u", "FavUserSession", ses_count);
+ mir_snprintf(szSessionName, "%s_%u", "FavUserSession", ses_count);
return db_get_b(NULL, MODNAME, szSessionName, 0);
}
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index e57194bf68..9fdb3d2204 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -30,7 +30,7 @@ static void InitControls(HWND hwndDlg) int comReg = IsCOMRegistered();
TCHAR szBuf[MAX_PATH];
- mir_sntprintf(szBuf, _countof(szBuf), _T("%s (%s)"),
+ mir_sntprintf(szBuf, _T("%s (%s)"),
TranslateTS(COM_OKSTR[(comReg & COMREG_OK) != 0]),
TranslateTS(COM_APPROVEDSTR[(comReg & COMREG_APPROVED) != 0]));
SetDlgItemText(hwndDlg, IDC_STATUS, szBuf);
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index a1ecc1c505..07b74efd20 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -23,23 +23,23 @@ struct TCMInvokeCommandInfo int IsCOMRegistered()
{
- HKEY hRegKey;
- int res = 0;
-
- // these arent the BEST checks in the world
- if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRegKey)) {
- res += COMREG_OK;
- RegCloseKey(hRegKey);
- }
-
- if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_READ, &hRegKey)) {
- DWORD lpType = REG_SZ;
- if (!RegQueryValueEx(hRegKey, _T("{72013A26-A94C-11d6-8540-A5E62932711D}"), NULL, &lpType, 0, 0))
- res += COMREG_APPROVED;
+ HKEY hRegKey;
+ int res = 0;
+
+ // these arent the BEST checks in the world
+ if (!RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("miranda.shlext"), 0, KEY_READ, &hRegKey)) {
+ res += COMREG_OK;
+ RegCloseKey(hRegKey);
+ }
+
+ if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"), 0, KEY_READ, &hRegKey)) {
+ DWORD lpType = REG_SZ;
+ if (!RegQueryValueEx(hRegKey, _T("{72013A26-A94C-11d6-8540-A5E62932711D}"), NULL, &lpType, 0, 0))
+ res += COMREG_APPROVED;
RegCloseKey(hRegKey);
- }
+ }
- return res;
+ return res;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -90,7 +90,7 @@ BOOL AddToList(TAddArgList& args) HANDLE hFind = FindFirstFileA(szBuf, &fd);
while (true) {
if (fd.cFileName[0] != '.') {
- mir_snprintf(szBuf, _countof(szBuf),"%s\\%s", args.szFile, fd.cFileName);
+ mir_snprintf(szBuf, "%s\\%s", args.szFile, fd.cFileName);
// keep a copy of the current thing being processed
szThis = args.szFile;
args.szFile = szBuf;
@@ -105,7 +105,7 @@ BOOL AddToList(TAddArgList& args) FindClose(hFind);
return true;
}
- }
+ }
if (!FindNextFileA(hFind, &fd))
break;
}
@@ -142,7 +142,7 @@ void __cdecl IssueTransferThread(void *param) TSlotIPC *pct = pipch->DataPtr;
BOOL bQuit = false;
while (pct != NULL) {
- if (pct->cbSize != sizeof(TSlotIPC))
+ if (pct->cbSize != sizeof(TSlotIPC))
break;
args.szFile = LPSTR(UINT_PTR(pct) + sizeof(TSlotIPC));
args.hContact = pct->hContact;
@@ -193,7 +193,7 @@ void ipcGetSkinIcons(THeaderIPC *ipch) int protoCount;
PROTOACCOUNT **pp;
- Proto_EnumAccounts(&protoCount,&pp);
+ Proto_EnumAccounts(&protoCount, &pp);
if (protoCount != 0) {
spi.pid = GetCurrentProcessId();
while (protoCount > 0) {
@@ -274,8 +274,8 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) if (BST_UNCHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseHITContacts, BST_UNCHECKED)) {
// don't show people who are "Hidden" "NotOnList" or Ignored
if (db_get_b(hContact, "CList", "Hidden", 0) == 1 ||
- db_get_b(hContact, "CList", "NotOnList", 0) == 1 ||
- CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_URL | IGNOREEVENT_FILE) != 0)
+ db_get_b(hContact, "CList", "NotOnList", 0) == 1 ||
+ CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_MESSAGE | IGNOREEVENT_URL | IGNOREEVENT_FILE) != 0)
continue;
}
// is HIT2 off?
@@ -298,9 +298,9 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) dwContacts = i;
qsort(pContacts, dwContacts, sizeof(TSlotInfo), SortContact);
-
+
// create an IPC slot for each contact and store display name, etc
- for (i=0; i < dwContacts; i++) {
+ for (i = 0; i < dwContacts; i++) {
ptrA szContact(mir_t2a(pcli->pfnGetContactDisplayName(pContacts[i].hContact, 0)));
if (szContact != NULL) {
ptrA szGroup;
@@ -343,7 +343,7 @@ bool ipcGetSortedContacts(THeaderIPC *ipch, int *pSlot, bool bGroupMode) void __cdecl ClearMRUThread(void*)
{
for (MCONTACT hContact = db_find_first(); hContact != 0; hContact = db_find_next(hContact))
- if ( db_get_b(hContact, SHLExt_Name, SHLExt_MRU, 0) > 0)
+ if (db_get_b(hContact, SHLExt_Name, SHLExt_MRU, 0) > 0)
db_set_b(hContact, SHLExt_Name, SHLExt_MRU, 0);
}
@@ -414,7 +414,7 @@ void __stdcall ipcService(ULONG_PTR) // if the group mode is on, check if they want the CList setting
bool bGroupMode = (BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseGroups, BST_UNCHECKED));
- if (bGroupMode && BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseCListSetting, BST_UNCHECKED))
+ if (bGroupMode && BST_CHECKED == db_get_b(0, SHLExt_Name, SHLExt_UseCListSetting, BST_UNCHECKED))
bGroupMode = db_get_b(0, "CList", "UseGroups", true) != 0;
TSlotIPC *pct = NULL;
@@ -435,7 +435,7 @@ void __stdcall ipcService(ULONG_PTR) // return contact's grouping if it's present
while (bGroupMode) {
_itoa(iSlot, szGroupStr, 10);
- if ( db_get_s(0, "CListGroups", szGroupStr, &dbv) != 0)
+ if (db_get_s(0, "CListGroups", szGroupStr, &dbv) != 0)
break;
pct = ipcAlloc(pMMT, lstrlenA(dbv.pszVal + 1) + 1);
// first byte has flags, need null term
@@ -552,13 +552,13 @@ void CheckUnregisterServer() // launches regsvr to remove the dll under admin.
TCHAR szFileName[MAX_PATH], szBuf[MAX_PATH * 2];
GetModuleFileName(hInst, szFileName, _countof(szFileName));
- mir_sntprintf(szBuf, _countof(szBuf), _T("/s /u \"%s\""), szFileName);
+ mir_sntprintf(szBuf, _T("/s /u \"%s\""), szFileName);
SHELLEXECUTEINFO sei = { sizeof(sei) };
sei.lpVerb = _T("runas");
sei.lpFile = _T("regsvr32");
sei.lpParameters = szBuf;
- if ( ShellExecuteEx(&sei) == TRUE)
+ if (ShellExecuteEx(&sei) == TRUE)
return;
Sleep(1000);
@@ -581,7 +581,7 @@ void CheckRegisterServer() TranslateT("Miranda NG - Shell context menus (shellext.dll)"), MB_OK | MB_ICONINFORMATION);
// /s = silent
GetModuleFileName(hInst, szFileName, _countof(szFileName));
- mir_sntprintf(szBuf, _countof(szBuf), _T("/s \"%s\""), szFileName);
+ mir_sntprintf(szBuf, _T("/s \"%s\""), szFileName);
SHELLEXECUTEINFO sei = { sizeof(sei) };
sei.lpVerb = _T("runas");
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 6ef08d12dd..c45b123906 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -108,7 +108,7 @@ INT CheckDefaults(WPARAM, LPARAM) db_free(&dbv);
for (int c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- mir_snprintf(szStatus, _countof(szStatus), "%d", c);
+ mir_snprintf(szStatus, "%d", c);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
else {
@@ -178,7 +178,7 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) if (isQun)
return FALSE;
- mir_snprintf(szStatus, _countof(szStatus), "%d", status);
+ mir_snprintf(szStatus, "%d", status);
if (!db_get_ts(NULL, protocolname, szStatus, &dbv)) {
if (*dbv.ptszVal) {
DBVARIANT dbvHead = { 0 }, dbvNick = { 0 };
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 75516552a2..038988fe43 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -21,7 +21,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) {
- mir_snprintf(tszStatus, _countof(tszStatus), "%d", c);
+ mir_snprintf(tszStatus, "%d", c);
TCHAR *pszStatus = pcli->pfnGetStatusModeDescription(c, 0);
if (c == ID_STATUS_ONLINE || c == ID_STATUS_FREECHAT || c == ID_STATUS_INVISIBLE)
continue;
@@ -103,7 +103,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara continue;
else {
char szStatus[6] = { 0 };
- mir_snprintf(szStatus, _countof(szStatus), "%d", c);
+ mir_snprintf(szStatus, "%d", c);
if (c<ID_STATUS_FREECHAT && ptszMessage[c - ID_STATUS_ONLINE - 1])
db_set_ts(NULL, protocolname, szStatus, ptszMessage[c - ID_STATUS_ONLINE - 1]);
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 20c14a01d6..4060d798f9 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -86,14 +86,14 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status, contactName);
+ mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
if (dat->hSeq) {
GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status);
+ mir_sntprintf(str, format, status);
}
else {
- mir_sntprintf(str, _countof(str), TranslateT("Failed to retrieve %s message."), status);
+ mir_sntprintf(str, TranslateT("Failed to retrieve %s message."), status);
SetDlgItemText(hwndDlg, IDOK, TranslateT("&Close"));
}
SetDlgItemText(hwndDlg, IDC_RETRIEVING, str);
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK CopyAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP WindowList_Add(hWindowList2, hwndDlg, dat->hContact);
contactName = (TCHAR *)pcli->pfnGetContactDisplayName(dat->hContact, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, contactName);
+ mir_sntprintf(str, format, contactName);
SetWindowText(hwndDlg, str);
if (!dat->hSeq)
DestroyWindow(hwndDlg);
@@ -348,7 +348,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
- mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
IcoLib_ReleaseIcon(hIcon);
}
@@ -359,13 +359,13 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
if (!iHidden && szMsg != NULL) {
- mir_sntprintf(str, _countof(str), TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("Copy %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hCopyMsgMenuItem, str);
}
else Menu_ShowItem(hCopyMsgMenuItem, false);
if (!iHidden && szMsg != NULL && StrFindURL(szMsg) != NULL) {
- mir_sntprintf(str, _countof(str), TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
+ mir_sntprintf(str, TranslateT("&Go to URL in %s message"), pcli->pfnGetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hGoToURLMenuItem, str);
}
else Menu_ShowItem(hGoToURLMenuItem, false);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index d164f846bd..3032ecf36c 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -258,7 +258,7 @@ TCHAR* InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int) if (ran_to > ran_from)
{
- mir_sntprintf(substituteStr, _countof(substituteStr), _T("%d"), GetRandom(ran_from, ran_to));
+ mir_sntprintf(substituteStr, _T("%d"), GetRandom(ran_from, ran_to));
for (k = i + 1; msg[k]; k++) if (msg[k] == '%') { k++; break; }
if (mir_tstrlen(substituteStr) > k - i)
@@ -1360,14 +1360,14 @@ VOID CALLBACK UpdateMsgTimerProc(HWND, UINT, UINT_PTR, DWORD) if (iCurrentStatus < ID_STATUS_ONLINE)
continue;
- mir_snprintf(szBuffer, _countof(szBuffer), "FCur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szBuffer, "FCur%sMsg", accounts->pa[i]->szModuleName);
if (db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
continue;
tszMsg = InsertVarsIntoMsg(dbv.ptszVal, accounts->pa[i]->szModuleName, iCurrentStatus, NULL);
db_free(&dbv);
- mir_snprintf(szBuffer, _countof(szBuffer), "Cur%sMsg", accounts->pa[i]->szModuleName);
+ mir_snprintf(szBuffer, "Cur%sMsg", accounts->pa[i]->szModuleName);
if (!db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
{
if (tszMsg && dbv.ptszVal && !mir_tstrcmp(tszMsg, dbv.ptszVal) || !tszMsg && !dbv.ptszVal)
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index b767cd4a9d..5c448a8195 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -643,7 +643,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) char text[16], buff2[80]; for (i = 1; i <= data->max_hist_msgs; i++) { - mir_snprintf(text, _countof(text), "SMsg%d", i); + mir_snprintf(text, "SMsg%d", i); db_set_ts(NULL, "SimpleStatusMsg", text, _T("")); } db_set_s(NULL, "SimpleStatusMsg", "LastMsg", ""); @@ -657,7 +657,7 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)) continue; - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", accounts->pa[i]->szModuleName); + mir_snprintf(buff2, "Last%sMsg", accounts->pa[i]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", buff2, ""); } db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs); @@ -696,7 +696,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) lines++; } } - mir_sntprintf(status_text, _countof(status_text), TranslateT("OK (%d)"), len - (lines - 1)); + mir_sntprintf(status_text, TranslateT("OK (%d)"), len - (lines - 1)); SetDlgItemText(hwndDlg, IDC_OK, status_text); } @@ -780,7 +780,7 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) TCHAR szTitle[256], szProtoName[128]; BOOL bDisabled = msgbox_data->m_szProto && !(CallProtoService(msgbox_data->m_szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND); - mir_sntprintf(szProtoName, _countof(szProtoName), msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, msgbox_data->m_szProto ? Proto_GetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); if (iStatus == ID_STATUS_CURRENT) { if (msgbox_data->m_bOnStartup) mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); @@ -905,7 +905,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg); init_data = (struct MsgBoxInitData *)lParam; GetWindowText(hwndDlg, szFormat, _countof(szFormat)); - mir_sntprintf(szProtoName, _countof(szProtoName), init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); + mir_sntprintf(szProtoName, init_data->m_szProto ? Proto_GetAccount(init_data->m_szProto)->tszAccountName : TranslateT("global")); if (init_data->m_iStatus == ID_STATUS_CURRENT) { if (init_data->m_bOnStartup) @@ -1099,7 +1099,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA } else { TCHAR str[64]; - mir_sntprintf(str, _countof(str), TranslateT("Closing in %d"), msgbox_data->m_iCountdown); + mir_sntprintf(str, TranslateT("Closing in %d"), msgbox_data->m_iCountdown); SetDlgItemText(hwndDlg, IDC_OK, str); } msgbox_data->m_iCountdown--; @@ -1179,10 +1179,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!mir_tstrcmp(dbv.ptszVal, tszMsg)) { found = TRUE; if (msgbox_data->m_szProto) { - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); } else { @@ -1200,10 +1200,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(buff2, _countof(buff2), "Last%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "Last%sMsg", accounts->pa[j]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "%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, buff2), tszMsg); } @@ -1227,10 +1227,10 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg); if (msgbox_data->m_szProto) { - mir_snprintf(buff2, _countof(buff2), "Last%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "Last%sMsg", msgbox_data->m_szProto); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", msgbox_data->m_szProto); + mir_snprintf(buff2, "%sMsg", msgbox_data->m_szProto); db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg); } else { @@ -1248,10 +1248,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(buff2, _countof(buff2), "Last%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "Last%sMsg", accounts->pa[j]->szModuleName); db_set_s(NULL, "SimpleStatusMsg", buff2, buff); - mir_snprintf(buff2, _countof(buff2), "%sMsg", accounts->pa[j]->szModuleName); + mir_snprintf(buff2, "%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, buff2), tszMsg); } diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 5e40cd08c5..de55dcabb2 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -1346,7 +1346,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (i = 1; i <= max_hist_msgs; i++) {
- mir_snprintf(text, _countof(text), "SMsg%d", i);
+ mir_snprintf(text, "SMsg%d", i);
db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index 81770581a9..d27b1ad5ae 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -42,7 +42,7 @@ void IconsInit(void) HICON LoadIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, "SimpleStatusMsg_%s", name);
return IcoLib_GetIcon(szSettingName);
}
@@ -58,14 +58,14 @@ HANDLE GetIconHandle(int iconId) void ReleaseIconEx(const char *name)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "SimpleStatusMsg_%s", name);
+ mir_snprintf(szSettingName, "SimpleStatusMsg_%s", name);
IcoLib_Release(szSettingName);
}
HANDLE HookProtoEvent(const char *szModule, const char *szEvent, MIRANDAHOOKPARAM hookProc)
{
char szProtoEvent[MAXMODULELABELLENGTH];
- mir_snprintf(szProtoEvent, _countof(szProtoEvent), "%s%s", szModule, szEvent);
+ mir_snprintf(szProtoEvent, "%s%s", szModule, szEvent);
HANDLE res = HookEventParam(szProtoEvent, hookProc, (LPARAM)szModule);
arProtoHooks.insert(res);
return res;
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 698e6195a6..740f359df6 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -303,7 +303,7 @@ bool SmileyPackType::LoadSmileyFile(const CMString& filename, const CMString& pa if (!noerr) {
static const TCHAR errmsg[] = LPGENT("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys.");
TCHAR msgtxt[1024];
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), modpath.c_str(), packname);
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), modpath.c_str(), packname);
ReportError(msgtxt);
}
@@ -463,7 +463,7 @@ bool SmileyPackType::LoadSmileyFileMSL(CMString &tbuf, bool onlyInfo, CMString & if (!noerr) {
static const TCHAR errmsg[] = LPGENT("Smiley #%u in file %s for smiley pack %s not found.");
TCHAR msgtxt[1024];
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), smnum, resname.c_str(), modpath.c_str());
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, _T2A(msgtxt));
errorFound = true;
}
@@ -838,7 +838,7 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr packnam = "MSN";
char path[MAX_PATH];
- mir_snprintf(path, _countof(path), "Smileys\\nova\\%s.msl", packnam);
+ mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
paths = A2T_SM(path);
CMString patha;
@@ -865,7 +865,7 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString& defau packnam = "MSN";
char path[MAX_PATH];
- mir_snprintf(path, _countof(path), "Smileys\\nova\\%s.msl", packnam);
+ mir_snprintf(path, "Smileys\\nova\\%s.msl", packnam);
CMString paths = A2T_SM(path), patha;
pathToAbsolute(paths, patha);
@@ -936,7 +936,7 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co CMString displayName = dbv.ptszVal;
if (packname != NULL) {
char path[MAX_PATH];
- mir_snprintf(path, _countof(path), "Smileys\\nova\\%s.msl", packname);
+ mir_snprintf(path, "Smileys\\nova\\%s.msl", packname);
CMString paths = A2T_SM(path), patha;
pathToAbsolute(paths, patha);
@@ -1014,13 +1014,13 @@ SmileyLookup::SmileyLookup(const CMString& str, const bool regexs, const int ind matcher->getStartingIndex() != matcher->getEndingIndex());
if (!m_valid) {
static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" could produce \"empty matches\".");
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
delete matcher;
}
else {
static const TCHAR errmsg[] = LPGENT("Regular expression \"%s\" in smiley pack \"%s\" malformed.");
- mir_sntprintf(msgtxt, _countof(msgtxt), TranslateTS(errmsg), str.c_str(), smpt.c_str());
+ mir_sntprintf(msgtxt, TranslateTS(errmsg), str.c_str(), smpt.c_str());
}
if (!m_valid)
diff --git a/plugins/Spamotron/src/bayes.cpp b/plugins/Spamotron/src/bayes.cpp index a9587ee991..d6d582a59b 100644 --- a/plugins/Spamotron/src/bayes.cpp +++ b/plugins/Spamotron/src/bayes.cpp @@ -17,7 +17,7 @@ int CheckBayes() char* tmp = Utils_ReplaceVars("%miranda_userdata%");
if (tmp[mir_strlen(tmp)-1] == '\\')
tmp[mir_strlen(tmp)-1] = 0;
- mir_snprintf(bayesdb_tmp, _countof(bayesdb_tmp), "%s\\%s", tmp, BAYESDB_PATH);
+ mir_snprintf(bayesdb_tmp, "%s\\%s", tmp, BAYESDB_PATH);
mir_free(tmp);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
@@ -82,7 +82,7 @@ int OpenBayes() tmp = Utils_ReplaceVars("%miranda_userdata%");
if (tmp[mir_strlen(tmp)-1] == '\\')
tmp[mir_strlen(tmp)-1] = 0;
- mir_snprintf(bayesdb_fullpath, _countof(bayesdb_fullpath), "%s\\%s\\%s", tmp, BAYESDB_PATH, BAYESDBG_FILENAME);
+ mir_snprintf(bayesdb_fullpath, "%s\\%s\\%s", tmp, BAYESDB_PATH, BAYESDBG_FILENAME);
mir_free(tmp);
bayesdb_fullpath_utf8 = mir_utf8encode(bayesdb_fullpath);
if (sqlite3_open(bayesdb_fullpath_utf8, &bayesdbg) == SQLITE_OK)
@@ -110,7 +110,7 @@ int get_token_count(int type) if (bayesdb == NULL)
return 0;
- mir_snprintf(q, _countof(q), "SELECT COUNT(1) FROM %s", type == SPAM ? "spam" : "ham");
+ mir_snprintf(q, "SELECT COUNT(1) FROM %s", type == SPAM ? "spam" : "ham");
sqlite3_prepare_v2(bayesdb, q, -1, &stmt, NULL);
if (sqlite3_step(stmt) == SQLITE_ROW) {
count = sqlite3_column_int(stmt, 0);
@@ -165,7 +165,7 @@ int get_token_score(int type, char *token) if (bayesdb == NULL)
return 0;
- mir_snprintf(sql, _countof(sql), "SELECT num FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
+ mir_snprintf(sql, "SELECT num FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
tokenhash(token, digest);
sqlite3_prepare_v2(bayesdb, sql, -1, &stmt, NULL);
sqlite3_bind_blob(stmt, 1, digest, 16, NULL);
@@ -323,10 +323,10 @@ void learn(int type, TCHAR *msg) message = mir_u2a(msg);
tok = strtok(message, DELIMS);
- mir_snprintf(sql_counter, _countof(sql_counter), "UPDATE stats SET value=value+1 WHERE key='%s'", type == SPAM ? "spam_msgcount" : "ham_msgcount");
- mir_snprintf(sql_select, _countof(sql_select), "SELECT 1 FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
- mir_snprintf(sql_update, _countof(sql_update), "UPDATE %s SET num=num+1 WHERE token=?", type ? "spam" : "ham");
- mir_snprintf(sql_insert, _countof(sql_insert), "INSERT INTO %s VALUES(?, 1)", type ? "spam" : "ham");
+ mir_snprintf(sql_counter, "UPDATE stats SET value=value+1 WHERE key='%s'", type == SPAM ? "spam_msgcount" : "ham_msgcount");
+ mir_snprintf(sql_select, "SELECT 1 FROM %s WHERE token=?", type == SPAM ? "spam" : "ham");
+ mir_snprintf(sql_update, "UPDATE %s SET num=num+1 WHERE token=?", type ? "spam" : "ham");
+ mir_snprintf(sql_insert, "INSERT INTO %s VALUES(?, 1)", type ? "spam" : "ham");
#ifdef _DEBUG
sqlite3_exec(bayesdbg, "BEGIN", NULL, NULL, NULL);
#endif
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index ff8863bd3b..6c65d556c4 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -519,7 +519,7 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA if (!dbuf)
return FALSE;
GetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, dbuf, len);
- mir_snprintf(cbuf, _countof(cbuf), "%0.04f", get_msg_score(dbuf));
+ mir_snprintf(cbuf, "%0.04f", get_msg_score(dbuf));
SetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, _T(""));
MessageBoxA(NULL, cbuf, Translate("Message score"), MB_OK);
free(dbuf);
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 29d76e78a3..6ce5f16438 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -388,7 +388,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) case SPAMOTRON_MODE_MATH:
a = (rand() % 10) + 1;
b = (rand() % 10) + 1;
- mir_sntprintf(mexpr, _countof(mexpr), _T("%d + %d"), a, b);
+ mir_sntprintf(mexpr, _T("%d + %d"), a, b);
if (dbei->eventType == EVENTTYPE_AUTHREQUEST)
_getOptS(challengeW, maxmsglen, "AuthChallengeMath", defaultAuthChallengeMath);
else
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index aa6bb0df29..20d0b0bd2e 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -427,7 +427,7 @@ int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage) { char *tmp, *tmporig; TCHAR msg[MAX_BUFFER_LENGTH]; - mir_sntprintf(msg, _countof(msg), message, pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(msg, message, pcli->pfnGetContactDisplayName(hContact, 0)); if (_getOptB("LogActions", defaultLogActions)) { tmp = mir_u2a(msg); @@ -467,9 +467,9 @@ int LogToSystemHistory(char *message, char *origmessage) dbei.szModule = PLUGIN_NAME; dbei.pBlob = (PBYTE)msg; if (origmessage) - dbei.cbBlob = (1 + mir_snprintf(msg, _countof(msg), "%s: %s%s %s: %s", PLUGIN_NAME, message, DOT(message), Translate("Their message was"), origmessage)); + dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s %s: %s", PLUGIN_NAME, message, DOT(message), Translate("Their message was"), origmessage)); else - dbei.cbBlob = (1 + mir_snprintf(msg, _countof(msg), "%s: %s%s", PLUGIN_NAME, message, DOT(message))); + dbei.cbBlob = (1 + mir_snprintf(msg, "%s: %s%s", PLUGIN_NAME, message, DOT(message))); dbei.eventType = EVENTTYPE_MESSAGE; dbei.flags = DBEF_READ; db_event_add(NULL, &dbei); diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index bbdb192c89..c21507ac6d 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -521,8 +521,8 @@ public: char aff[1024]; - mir_snprintf(dic, _countof(dic), "%S.dic", fileWithoutExtension); - mir_snprintf(aff, _countof(aff), "%S.aff", fileWithoutExtension); + mir_snprintf(dic, "%S.dic", fileWithoutExtension); + mir_snprintf(aff, "%S.aff", fileWithoutExtension); hunspell = new Hunspell(aff, dic); @@ -761,7 +761,7 @@ BOOL CALLBACK EnumLocalesProc(LPTSTR lpLocaleString) } if (dict->localized_name[0] != 0) { - mir_sntprintf(dict->full_name, _countof(dict->full_name), _T("%s [%s]"), dict->localized_name, dict->language); + mir_sntprintf(dict->full_name, _T("%s [%s]"), dict->localized_name, dict->language); } break; } diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 832379eab5..ace5053d15 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -150,7 +150,7 @@ static int ModulesLoaded(WPARAM, LPARAM) sid.description.t = p->full_name; char lang[32]; - mir_snprintf(lang, _countof(lang), "spell_lang_%d", i); + mir_snprintf(lang, "spell_lang_%d", i); sid.pszName = lang; HICON hFlag = NULL, hFlagIcoLib = NULL; diff --git a/plugins/SplashScreen/src/debug.h b/plugins/SplashScreen/src/debug.h index c9afe39df8..5a475e9286 100644 --- a/plugins/SplashScreen/src/debug.h +++ b/plugins/SplashScreen/src/debug.h @@ -17,7 +17,7 @@ int inline _DebugPopup(MCONTACT hContact, TCHAR *fmt, ...) TCHAR debug[1024];
va_start(va, fmt);
- mir_sntprintf(debug, _countof(debug), fmt, va);
+ mir_sntprintf(debug, fmt, va);
if(CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) {
POPUPDATAT ppd = { 0 };
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 88dd563466..608416ab05 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -65,11 +65,11 @@ void SplashMain() if (bstartup) {
// Retrive path to exe of current running Miranda is located
szMirDir = Utils_ReplaceVarsT(_T("%miranda_path%"));
- mir_sntprintf(szhAdvaimgPath, _countof(szhAdvaimgPath), _T("%s\\plugins\\advaimg.dll"), szMirDir);
+ mir_sntprintf(szhAdvaimgPath, _T("%s\\plugins\\advaimg.dll"), szMirDir);
CallService(MS_SYSTEM_GETVERSIONTEXT, MAX_PATH, (LPARAM)szVersion);
#ifdef _DEBUG
- mir_sntprintf(szLogFile, _countof(szLogFile), _T("%s\\%s.log"), szMirDir, _T(__PLUGIN_NAME));
+ mir_sntprintf(szLogFile, _T("%s\\%s.log"), szMirDir, _T(__PLUGIN_NAME));
initLog();
TCHAR *mirandaVerString = mir_a2t(szVersion);
logMessage(_T("Miranda version"), mirandaVerString);
@@ -104,7 +104,7 @@ void SplashMain() TCHAR *pos3 = 0;
pos3 = _tcsrchr(inBuf, _T(':'));
if (pos3 == NULL)
- mir_sntprintf(szSplashFile, _countof(szSplashFile), _T("%s\\%s"), szMirDir, inBuf);
+ mir_sntprintf(szSplashFile, _T("%s\\%s"), szMirDir, inBuf);
else
mir_tstrcpy(szSplashFile, inBuf);
@@ -122,7 +122,7 @@ void SplashMain() TCHAR *pos2;
pos2 = _tcschr(inBuf, _T(':'));
if (pos2 == NULL)
- mir_sntprintf(szSoundFile, _countof(szSoundFile), _T("%s\\%s"), szMirDir, inBuf);
+ mir_sntprintf(szSoundFile, _T("%s\\%s"), szMirDir, inBuf);
else
mir_tstrcpy(szSoundFile, inBuf);
@@ -145,7 +145,7 @@ void SplashMain() p = _tcsrchr(szSplashDir, _T('\\'));
if (p) *p = 0;
// create the search filter
- mir_sntprintf(szSearch, _countof(szSearch), _T("%s\\*.*"), szSplashDir);
+ mir_sntprintf(szSearch, _T("%s\\*.*"), szSplashDir);
// FFFN will return filenames
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA ffd;
@@ -179,7 +179,7 @@ void SplashMain() int r = 0;
if (filescount) r = (rand() % filescount) + 1;
- mir_sntprintf(szSplashFile, _countof(szSplashFile), _T("%s\\%s"), szSplashDir, files[r - 1]);
+ mir_sntprintf(szSplashFile, _T("%s\\%s"), szSplashDir, files[r - 1]);
#ifdef _DEBUG
logMessage(_T("final file"), szSplashFile);
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 70f0b2bb3e..536af1505a 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.png, *.bmp)%c*.png;*.bmp%c%c"), TranslateT("Graphic files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.png, *.bmp)%c*.png;*.bmp%c%c"), TranslateT("Graphic files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -239,7 +239,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
TCHAR tmp[MAX_PATH];
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c"), TranslateT("Sound Files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav, *.mp3)%c*.wav;*.mp3%c%c"), TranslateT("Sound Files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = szTempPath;
diff --git a/plugins/SplashScreen/src/services.cpp b/plugins/SplashScreen/src/services.cpp index 6e3497cb6d..b89daaa23d 100644 --- a/plugins/SplashScreen/src/services.cpp +++ b/plugins/SplashScreen/src/services.cpp @@ -31,7 +31,7 @@ INT_PTR ShowSplashService(WPARAM wparam, LPARAM lparam) TCHAR *pos = _tcsrchr(filename, _T(':'));
if (pos == NULL)
- mir_sntprintf(szSplashFile, _countof(szSplashFile), _T("%s\\%s"), szMirDir, filename);
+ mir_sntprintf(szSplashFile, _T("%s\\%s"), szMirDir, filename);
else
mir_tstrcpy(szSplashFile, filename);
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp index 6550f5fda0..cab40ef640 100644 --- a/plugins/SplashScreen/src/splash.cpp +++ b/plugins/SplashScreen/src/splash.cpp @@ -42,9 +42,9 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM #ifdef _DEBUG
TCHAR b[40];
- mir_sntprintf(b, _countof(b), _T("%d"), wParam);
+ mir_sntprintf(b, _T("%d"), wParam);
logMessage(_T("Timer ID"), b);
- mir_sntprintf(b, _countof(b), _T("%d"), options.showtime);
+ mir_sntprintf(b, _T("%d"), options.showtime);
logMessage(_T("ShowTime value"), b);
#endif
@@ -229,7 +229,7 @@ void __cdecl SplashThread(void *arg) TCHAR verString[256] = { 0 };
TCHAR *mirandaVerString = mir_a2t(szVersion);
- mir_sntprintf(verString, _countof(verString), _T("%s%s"), szPrefix, mirandaVerString);
+ mir_sntprintf(verString, _T("%s%s"), szPrefix, mirandaVerString);
mir_free(mirandaVerString);
LOGFONT lf = { 0 };
lf.lfHeight = 14;
@@ -327,7 +327,7 @@ BOOL ShowSplash(BOOL bpreview) timeout = options.showtime;
#ifdef _DEBUG
TCHAR b[40];
- mir_sntprintf(b, _countof(b), _T("%d"), options.showtime);
+ mir_sntprintf(b, _T("%d"), options.showtime);
logMessage(_T("Timeout"), b);
#endif
}
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 0cc5698791..767fb8bfc7 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -160,16 +160,16 @@ void EnablePopupModule() void InitSettings()
{
if(gethostname(hostname, _countof(hostname)) == 0){
- mir_snprintf(EnabledComp, _countof(EnabledComp), "%s_Enabled", hostname);
- mir_snprintf(DelayComp, _countof(DelayComp), "%s_Delay", hostname);
- mir_snprintf(PopUpComp, _countof(PopUpComp), "%s_PopUp", hostname);
- mir_snprintf(PopUpTimeComp, _countof(PopUpTimeComp), "%s_PopUpTime", hostname);
- mir_snprintf(MenuitemComp, _countof(MenuitemComp), "%s_MenuItem", hostname);
- mir_snprintf(TTBButtonsComp, _countof(TTBButtonsComp), "%s_TTBButtons", hostname);
- mir_snprintf(DefSoundComp, _countof(DefSoundComp), "%s_DefSound", hostname);
- mir_snprintf(DefPopupComp, _countof(DefPopupComp), "%s_DefPopup", hostname);
- mir_snprintf(DefEnabledComp, _countof(DefEnabledComp), "%s_DefEnabled", hostname);
- mir_snprintf(NonStatusAllowComp, _countof(NonStatusAllowComp), "%s_NonStatusAllow", hostname);
+ mir_snprintf(EnabledComp, "%s_Enabled", hostname);
+ mir_snprintf(DelayComp, "%s_Delay", hostname);
+ mir_snprintf(PopUpComp, "%s_PopUp", hostname);
+ mir_snprintf(PopUpTimeComp, "%s_PopUpTime", hostname);
+ mir_snprintf(MenuitemComp, "%s_MenuItem", hostname);
+ mir_snprintf(TTBButtonsComp, "%s_TTBButtons", hostname);
+ mir_snprintf(DefSoundComp, "%s_DefSound", hostname);
+ mir_snprintf(DefPopupComp, "%s_DefPopup", hostname);
+ mir_snprintf(DefEnabledComp, "%s_DefEnabled", hostname);
+ mir_snprintf(NonStatusAllowComp, "%s_NonStatusAllow", hostname);
}
//first run on the host, initial setting
if (!(delay = db_get_dw(NULL, MODULE_NAME, DelayComp, 0)))
@@ -340,7 +340,7 @@ void RemoveTTButtons() HANDLE GetIconHandle(char *szIcon)
{
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MENU_NAME, szIcon);
+ mir_snprintf(szSettingName, "%s_%s", MENU_NAME, szIcon);
return IcoLib_GetIconHandle(szSettingName);
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 36e379aa59..c72083e891 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -213,7 +213,7 @@ static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, TCH mir_cslock lck(GenStatusCS); char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", cs->szName); + mir_snprintf(dbSetting, "%s_enabled", cs->szName); cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus; if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) cs->status = ID_STATUS_DISABLED; @@ -521,7 +521,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) return 0; char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", ack->szModule); + mir_snprintf(dbSetting, "%s_enabled", ack->szModule); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return 0; @@ -934,7 +934,7 @@ static int ProcessPopup(int reason, LPARAM lParam) for (int i = 0; i < connectionSettings.getCount(); i++) { if (mir_tstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_sntprintf(protoInfoLine, _countof(protoInfoLine), TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); + mir_sntprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); mir_tstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_tstrlen(protoInfo) - 1); } } @@ -1052,7 +1052,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) return -1; char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled return -1; @@ -1078,7 +1078,7 @@ INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) char *szProto = (char *)lParam; char dbSetting[128]; - mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", szProto); + mir_snprintf(dbSetting, "%s_enabled", szProto); if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) return FALSE; diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index 5cafcaadbf..effa88cf8a 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -72,7 +72,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam ListView_InsertItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE));
lvItem.iItem++;
}
@@ -153,7 +153,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam ListView_GetItem(hList, &lvItem);
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
+ mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam);
db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index f5920c333b..eb9573b0ac 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -165,7 +165,7 @@ HRESULT CreateLink(TSettingsList& protoSettings) if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
_tcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_tstrlen(savePath));
else
- mir_sntprintf(savePath, _countof(savePath), _T(".\\%s"), SHORTCUT_FILENAME);
+ mir_sntprintf(savePath, _T(".\\%s"), SHORTCUT_FILENAME);
// Get a pointer to the IShellLink interface.
IShellLink *psl;
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 0742c34198..da6db98855 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -107,7 +107,7 @@ static int CreateMainMenuItems(WPARAM, LPARAM) mi.name.t = profilename; mi.position = 2000100000 + mcount; - mir_snprintf(servicename, _countof(servicename), "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); + mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); switch(mcount) { case 0: hProfileServices[mcount] = CreateServiceFunction(servicename, profileService0); @@ -190,7 +190,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) for ( int i=0; i < pceCount; i++ ) { if ( (pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { - mir_snprintf(dbSetting, _countof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(mir_tstrlen(dbv.ptszVal)+1)); if (pce[i].msg != NULL) { @@ -214,7 +214,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) pce[pceCount].profile = profile; pce[pceCount].szProto = _strdup(szProto); pce[pceCount].msg = NULL; - mir_snprintf(dbSetting, _countof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { pce[pceCount].msg = _tcsdup(dbv.ptszVal); db_free(&dbv); @@ -339,7 +339,7 @@ static int RegisterHotKeys() return -1; char atomname[255]; - mir_snprintf(atomname, _countof(atomname), "StatusProfile_%d", i); + mir_snprintf(atomname, "StatusProfile_%d", i); hkInfo[hkiCount].id = GlobalAddAtomA(atomname); if (hkInfo[hkiCount].id == 0) continue; diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index 7f0afc3e37..9da5d6ccf5 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -168,7 +168,7 @@ static void SetLastStatusMessages(TSettingsList &ps) continue;
char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
+ mir_snprintf(dbSetting, "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
if (ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
@@ -301,9 +301,9 @@ static int OnOkToExit(WPARAM, LPARAM) continue;
char lastName[128], lastMsg[128];
- mir_snprintf(lastName, _countof(lastName), "%s%s", PREFIX_LAST, pa->szModuleName);
+ mir_snprintf(lastName, "%s%s", PREFIX_LAST, pa->szModuleName);
db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0));
- mir_snprintf(lastMsg, _countof(lastMsg), "%s%s", PREFIX_LASTMSG, pa->szModuleName);
+ mir_snprintf(lastMsg, "%s%s", PREFIX_LASTMSG, pa->szModuleName);
db_unset(NULL, MODULENAME, lastMsg);
if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG))
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 5b5ecca46d..e652dc004e 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -269,7 +269,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // LAST STATUS
if (proto->status == ID_STATUS_LAST) {
TCHAR last[80];
- mir_sntprintf(last, _countof(last), _T("%s (%s)"), TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_sntprintf(last, _T("%s (%s)"), TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last);
actualStatus = proto->lastStatus;
}
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else if (proto->status == ID_STATUS_CURRENT) {
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
TCHAR current[80];
- mir_sntprintf(current, _countof(current), _T("%s (%s)"), TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_sntprintf(current, _T("%s (%s)"), TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current);
actualStatus = currentStatus;
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index f5dba28146..db8b222025 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -72,7 +72,7 @@ static void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd) //modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden - mir_snprintf(SettingName, _countof(SettingName), "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); + mir_snprintf(SettingName, "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) { token = strtok(dbv.pszVal, "_"); @@ -830,8 +830,8 @@ void CB_WriteButtonSettings(MCONTACT hContact, CustomButtonData *cbd) //modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden - mir_snprintf(SettingName, _countof(SettingName), "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); - mir_snprintf(SettingParameter, _countof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->m_dwPosition, cbd->m_bIMButton, cbd->m_bChatButton, cbd->m_bLSided, cbd->m_bRSided, cbd->m_bCanBeHidden); + mir_snprintf(SettingName, "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID); + mir_snprintf(SettingParameter, "%d_%u_%u_%u_%u_%u", cbd->m_dwPosition, cbd->m_bIMButton, cbd->m_bChatButton, cbd->m_bLSided, cbd->m_bRSided, cbd->m_bCanBeHidden); if (!(cbd->m_opFlags & BBSF_NTBDESTRUCT)) db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter); else diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 19e37c2676..f44bea11fc 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -537,7 +537,7 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
- mir_sntprintf(szTemp2, _countof(szTemp2), _T("~~++#%s#++~~"), szTemp);
+ mir_sntprintf(szTemp2, _T("~~++#%s#++~~"), szTemp);
else
_tcsncpy_s(szTemp2, szTemp, _TRUNCATE);
@@ -723,7 +723,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) if (streamData->dat->dwFlags & MWF_DIVIDERWANTED || lin->dwFlags & MWF_DIVIDERWANTED) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
lin->dwFlags |= MWF_DIVIDERWANTED;
if (lin->prev || !streamData->bRedraw)
@@ -750,13 +750,13 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) int iii;
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY);
str.Append(szStyle);
}
else {
iii = lin->bIsHighlighted ? 16 : EventToIndex(lin);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY);
str.Append(szStyle);
}
@@ -982,7 +982,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra // this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
TCHAR szPattern[50];
- mir_sntprintf(szPattern, _countof(szPattern), _T("~-+%d+-~"), si->pLogEnd);
+ mir_sntprintf(szPattern, _T("~-+%d+-~"), si->pLogEnd);
FINDTEXTEX fi;
fi.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 9ac88e10b5..3ae21bda9e 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -184,7 +184,7 @@ static void OnLoadSettings() for (int i = 0; i < 5; i++) {
char szBuf[40];
- mir_snprintf(szBuf, _countof(szBuf), "NickColor%d", i);
+ mir_snprintf(szBuf, "NickColor%d", i);
g_Settings.nickColors[i] = M.GetDword(CHAT_MODULE, szBuf, g_Settings.UserListColors[0]);
}
g_Settings.nickColors[5] = M.GetDword(CHAT_MODULE, "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index cba62770ff..8b857c7eb2 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM TCHAR tszTooltipText[2048];
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText),
+ mir_sntprintf(tszTooltipText,
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
@@ -757,12 +757,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM *p1 = 0;
TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
- mir_sntprintf(tszInitialDir, _countof(tszInitialDir), _T("%s%s"), M.getChatLogPath(), p);
+ mir_sntprintf(tszInitialDir, _T("%s%s"), M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
_tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
- mir_sntprintf(tszTemp, _countof(tszTemp), _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0);
+ mir_sntprintf(tszTemp, _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrInitialDir = tszInitialDir;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index d33f093eba..5b82f8b8e4 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -113,10 +113,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_sntprintf(pd.lptzContactName, _countof(pd.lptzContactName), _T("%s - %s"),
- (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
- pcli->pfnGetContactDisplayName(hContact, 0));
-
+ mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
_tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
@@ -536,7 +533,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up"));
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 56cc362ab0..a7490efb38 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1323,7 +1323,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"), + mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"), TranslateT("Nickname"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1671,7 +1671,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } } if (tszBuf[0] == 0) - mir_sntprintf(tszBuf, _countof(tszBuf), _T("<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s"), + mir_sntprintf(tszBuf, _T("<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s"), TranslateT("Nick"), ui1->pszNick, TranslateT("Unique ID"), ui1->pszUID, TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status)); @@ -1976,17 +1976,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar else if (diff > 59) { DWORD hours = diff / 60; DWORD minutes = diff % 60; - mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? + mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ? TranslateT("hours") : TranslateT("hour"), minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute")); } - else mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); + else mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute")); } - mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); + mir_sntprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg); } else { if (si->ptszStatusbarText) - mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); + mir_sntprintf(szFinalStatusBarText, _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); else _tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE); } @@ -3165,7 +3165,7 @@ LABEL_SHOWWINDOW: DBVARIANT dbv = { 0 }; char szIndex[10]; char *szKey = "TAB_ContainersW"; - mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU); + mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU); if (iSelection - IDM_CONTAINERMENU >= 0) { if (!db_get_ts(NULL, szKey, szIndex, &dbv)) { SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal); diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 0787ab83e0..e6e829119b 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -190,7 +190,7 @@ bool CContactCache::updateUIN() mir_free(ci.pszVal); break; case CNFT_DWORD: - mir_sntprintf(m_szUIN, _countof(m_szUIN), _T("%u"), ci.dVal); + mir_sntprintf(m_szUIN, _T("%u"), ci.dVal); break; } } diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 8eb2bcea84..e8bb310e01 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, }
else {
char szCName[CONTAINER_NAMELEN + 20];
- mir_snprintf(szCName, _countof(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) {
if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName))
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
@@ -1334,14 +1334,14 @@ panel_found: pContainer->settings = &PluginConfig.globalContainerSettings;
pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
- mir_snprintf(szCname, _countof(szCname), "%s_theme", CONTAINER_PREFIX);
+ mir_snprintf(szCname, "%s_theme", CONTAINER_PREFIX);
if (!db_get_ts(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == NULL) {
- mir_snprintf(szCname, _countof(szCname), "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (!db_get_ts(NULL, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
@@ -1713,13 +1713,13 @@ panel_found: }
else {
char szCName[40];
- mir_snprintf(szCName, _countof(szCName), "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
- mir_snprintf(szCName, _countof(szCName), "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
- mir_snprintf(szCName, _countof(szCName), "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szCName, _countof(szCName), "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(0, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
@@ -1737,7 +1737,7 @@ panel_found: SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
char szCName[40];
- mir_snprintf(szCName, _countof(szCName), "%s_theme", CONTAINER_PREFIX);
+ mir_snprintf(szCName, "%s_theme", CONTAINER_PREFIX);
if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
@@ -1900,7 +1900,7 @@ int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size _tcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
TCHAR fmt[30];
- mir_sntprintf(fmt, _countof(fmt), _T("%%%d.%ds..."), cutMax, cutMax);
+ mir_sntprintf(fmt, _T("%%%d.%ds..."), cutMax, cutMax);
mir_sntprintf(newname, size, fmt, oldname);
}
return 0;
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp index 61d55a1718..efae584b93 100644 --- a/plugins/TabSRMM/src/containeroptions.cpp +++ b/plugins/TabSRMM/src/containeroptions.cpp @@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, TranslateDialogDefault(hwndDlg);
SetWindowText(hwndDlg, TranslateT("Container options"));
TCHAR szNewTitle[128];
- mir_sntprintf(szNewTitle, _countof(szNewTitle), _T("%s"), !mir_tstrcmp(pContainer->szName, _T("default")) ?
+ mir_sntprintf(szNewTitle, _T("%s"), !mir_tstrcmp(pContainer->szName, _T("default")) ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
Utils::enableDlgControl(hwndDlg, IDC_O_HIDETITLE, !CSkin::m_frameSkins);
@@ -258,7 +258,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam, else {
if (pContainer->settings != &PluginConfig.globalContainerSettings) {
char szCname[40];
- mir_snprintf(szCname, _countof(szCname), "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
pContainer->settings->fPrivate = false;
db_set_blob(0, SRMSGMOD_T, szCname, pContainer->settings, sizeof(TContainerSettings));
mir_free(pContainer->settings);
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index dc6f9fc897..2b756b52f0 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -966,12 +966,12 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR if (!mir_strcmp(sid->szModule, MSG_ICON_MODULE)) {
if (sid->dwId == MSG_ICON_SOUND)
- mir_sntprintf(wBuf, _countof(wBuf), TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
+ mir_sntprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && dat && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) {
int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
- mir_sntprintf(wBuf, _countof(wBuf), TranslateT("Sending typing notifications is %s."),
+ mir_sntprintf(wBuf, TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
@@ -997,7 +997,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
- mir_sntprintf(wBuf, _countof(wBuf), szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
+ mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 68a3918fbb..83c12082e3 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -500,7 +500,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) TCHAR szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(szHeader, _countof(szHeader), _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1);
+ mir_sntprintf(szHeader, _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1);
else
szHeader[0] = 0;
@@ -513,7 +513,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) TCHAR timestamp[MAX_DATASIZE];
_tcsftime(timestamp, MAX_DATASIZE, _T("%Y.%m.%d %H:%M"), _localtime32((__time32_t *)&dbe.timestamp));
- mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, _countof(pdata->eventData[pdata->nrMerged].tszText), _T("\n\n%s\n"), timestamp);
+ mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, _T("\n\n%s\n"), timestamp);
TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
@@ -672,7 +672,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
TCHAR szMenuEntry[80];
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszProto,
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : _T("(undef)"), mii.dwItemData & 0x0000ffff);
if (!bForced)
@@ -717,7 +717,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (fromEvent == 2) // from chat...
mii.dwItemData |= 0x10000000;
DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND);
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
PluginConfig.m_UnreadInTray++;
if (PluginConfig.m_UnreadInTray)
@@ -727,7 +727,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro else {
szNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (CheckMenuItem(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == -1) {
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
mii.dwItemData = fromEvent ? 1 : 0;
PluginConfig.m_UnreadInTray += (mii.dwItemData & 0x0000ffff);
@@ -745,7 +745,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro mii.fMask |= MIIM_STRING;
if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index adcc0acbe8..8e7ad1bcdd 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -45,12 +45,12 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) else if (dat) { TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH]; mir_sntprintf(szFilter, _T("%s%c*.rtf%c%c"), TranslateT("Rich Edit file"), 0, 0, 0); - mir_sntprintf(szFilename, _countof(szFilename), _T("%s.rtf"), dat->cache->getNick()); + mir_sntprintf(szFilename, _T("%s.rtf"), dat->cache->getNick()); Utils::sanitizeFilename(szFilename); TCHAR szInitialDir[MAX_PATH + 2]; - mir_sntprintf(szInitialDir, _countof(szInitialDir), _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs")); + mir_sntprintf(szInitialDir, _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs")); CreateDirectoryTreeT(szInitialDir); OPENFILENAME ofn = { 0 }; @@ -613,7 +613,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); TCHAR tStr[80]; - mir_sntprintf(tStr, _countof(tStr), _T("%s %d.%d.%d.%d [build %d]"), + mir_sntprintf(tStr, _T("%s %d.%d.%d.%d [build %d]"), TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]); SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr); } @@ -1002,7 +1002,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat) if (!PluginConfig.m_bDontUseDefaultKbd) { TCHAR szBuf[20]; GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20); - mir_sntprintf(szKLName, _countof(szKLName), _T("0000%s"), szBuf); + mir_sntprintf(szKLName, _T("0000%s"), szBuf); db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName); } else { @@ -1040,7 +1040,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) TCHAR szBuf[100]; if (dat->bShowTyping) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]); - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s is typing a message..."), dat->cache->getNick()); + mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick()); } else if (dat->sbCustom) { SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)dat->sbCustom->hIcon); @@ -1051,14 +1051,14 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR) - mir_sntprintf(szBuf, _countof(szBuf), _T("UID: %s"), dat->cache->getUIN()); + mir_sntprintf(szBuf, _T("UID: %s"), dat->cache->getUIN()); else if (dat->lastMessage) { TCHAR date[64], time[64]; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0); if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6) date[mir_tstrlen(date) - 5] = 0; TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0); - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Last received: %s at %s"), date, time); + mir_sntprintf(szBuf, TranslateT("Last received: %s at %s"), date, time); } else szBuf[0] = 0; } @@ -1378,7 +1378,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) dat->bShowTyping = 2; dat->nTypeSecs = 86400; - mir_sntprintf(dat->szStatusBar, _countof(dat->szStatusBar), TranslateT("%s has entered text."), dat->cache->getNick()); + mir_sntprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick()); if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)dat->szStatusBar); } @@ -1403,7 +1403,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff) UpdateStatusBar(dat); } else if (dat->nTypeSecs > 0) { - mir_sntprintf(dat->szStatusBar, _countof(dat->szStatusBar), TranslateT("%s is typing a message"), dat->cache->getNick()); + mir_sntprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick()); dat->nTypeSecs--; if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) { @@ -1596,7 +1596,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; TCHAR szBuf[100]; - mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), + mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"), dat->iNextQueuedEvent); SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE); @@ -1748,7 +1748,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) if (mir_tstrlen(newcontactname) != 0) { if (PluginConfig.m_bStatusOnTabs) - mir_sntprintf(newtitle, _countof(newtitle), _T("%s (%s)"), newcontactname, dat->szStatus); + mir_sntprintf(newtitle, _T("%s (%s)"), newcontactname, dat->szStatus); else _tcsncpy_s(newtitle, newcontactname, _TRUNCATE); } @@ -1760,13 +1760,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam) TCHAR fulluin[256]; if (dat->bIsMeta) - mir_sntprintf(fulluin, _countof(fulluin), - TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), - bHasName ? dat->cache->getUIN() : TranslateT("No UID")); + mir_sntprintf(fulluin, + TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), + bHasName ? dat->cache->getUIN() : TranslateT("No UID")); else - mir_sntprintf(fulluin, _countof(fulluin), - TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), - bHasName ? dat->cache->getUIN() : TranslateT("No UID")); + mir_sntprintf(fulluin, + TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), + bHasName ? dat->cache->getUIN() : TranslateT("No UID")); SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); } diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 71caabbe25..de11658856 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -545,7 +545,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) cle.hDbEvent = hDbEvent;
TCHAR toolTip[256];
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 2cf7ed0abc..5b2cccb984 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -496,7 +496,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) time_t diff = time(NULL) - m_dat->idle;
int i_hrs = diff / 3600;
int i_mins = (diff - i_hrs * 3600) / 60;
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
+ mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
else _tcscpy_s(szBuf, 256, tszUin);
@@ -613,7 +613,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) if (m_height < DEGRADE_THRESHOLD) {
TCHAR tszText[2048];
- mir_sntprintf(tszText, _countof(tszText), TranslateT("Topic is: %s"),
+ mir_sntprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -670,7 +670,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) SIZE szTitle;
TCHAR szPrefix[100];
- mir_sntprintf(szPrefix, _countof(szPrefix), TranslateT("Topic is: %s"), _T(""));
+ mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), _T(""));
::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
@@ -1061,11 +1061,11 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
{
TCHAR tszTitle[100];
- mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("Set panel visibility for this %s"),
+ mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
- mir_sntprintf(tszTitle, _countof(tszTitle), m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
+ mir_sntprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
TranslateT("Do not synchronize the panel height with group chat windows"));
::SetDlgItemText(hwnd, IDC_NOSYNC, tszTitle);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 9d71be195b..0672bb15f9 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -149,7 +149,7 @@ void CMimAPI::InitPaths() { const TCHAR *szUserdataDir = getUserDir(); - mir_sntprintf(m_szProfilePath, _countof(m_szProfilePath), _T("%stabSRMM"), szUserdataDir); + mir_sntprintf(m_szProfilePath, _T("%stabSRMM"), szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { _tcsncpy_s(m_szChatLogsPath, _T("%miranda_logpath%"), _TRUNCATE); _tcsncpy_s(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE); @@ -164,7 +164,7 @@ void CMimAPI::InitPaths() Utils::ensureTralingBackslash(m_szSkinsPath); - mir_sntprintf(m_szSavedAvatarsPath, _countof(m_szSavedAvatarsPath), _T("%s\\Saved Contact Pictures"), m_szProfilePath); + mir_sntprintf(m_szSavedAvatarsPath, _T("%s\\Saved Contact Pictures"), m_szProfilePath); } bool CMimAPI::getAeroState() @@ -299,7 +299,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) if (mode) { TCHAR szTip[256]; - mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0)); if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) { MIRANDASYSTRAYNOTIFY tn; tn.szProto = NULL; @@ -550,7 +550,7 @@ nowindowcreate: cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = "SRMsg/ReadMessage"; contactName = pcli->pfnGetContactDisplayName(hContact, 0); - mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), contactName); + mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName); cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 04b8cea8dd..42c2c16eb1 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -43,7 +43,7 @@ static TCHAR* getMenuEntry(int i)
{
char MEntry[256];
- mir_snprintf(MEntry, _countof(MEntry), "MenuEntry_%u", i);
+ mir_snprintf(MEntry, "MenuEntry_%u", i);
return db_get_tsa(NULL, "tabmodplus", MEntry);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 2684e40073..e5b790f142 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2326,8 +2326,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer
SendJob *job = sendQueue->getJobByIndex(iIndex);
KillTimer(hwndDlg, wParam);
- mir_sntprintf(job->szErrorMsg, _countof(job->szErrorMsg), TranslateT("Delivery failure: %s"),
- TranslateT("The message send timed out"));
+ mir_sntprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
job->iStatus = SendQueue::SQ_ERROR;
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
@@ -2544,7 +2543,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l char szIndex[10];
char *szKey = "TAB_ContainersW";
- mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU);
+ mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
ptrT val(db_get_tsa(NULL, szKey, szIndex));
if (val)
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 8bbf9a2ede..2bae8fe5e1 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -135,12 +135,12 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) DWORD setView = 1;
TCHAR szTimestamp[100];
- mir_sntprintf(szTimestamp, _countof(szTimestamp), _T("%04u %02u %02u_%02u%02u"), lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
+ mir_sntprintf(szTimestamp, _T("%04u %02u %02u_%02u%02u"), lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
TCHAR *szProto = mir_a2t(dat->cache->getActiveProto());
TCHAR szFinalPath[MAX_PATH];
- mir_sntprintf(szFinalPath, _countof(szFinalPath), _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
+ mir_sntprintf(szFinalPath, _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
mir_free(szProto);
if (CreateDirectory(szFinalPath, 0) == 0) {
@@ -153,17 +153,17 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic) TCHAR szBaseName[MAX_PATH];
if (isOwnPic)
- mir_sntprintf(szBaseName, _countof(szBaseName), _T("My Avatar_%s"), szTimestamp);
+ mir_sntprintf(szBaseName, _T("My Avatar_%s"), szTimestamp);
else
- mir_sntprintf(szBaseName, _countof(szBaseName), _T("%s_%s"), dat->cache->getNick(), szTimestamp);
+ mir_sntprintf(szBaseName, _T("%s_%s"), dat->cache->getNick(), szTimestamp);
- mir_sntprintf(szFinalFilename, _countof(szFinalFilename), _T("%s.png"), szBaseName);
+ mir_sntprintf(szFinalFilename, _T("%s.png"), szBaseName);
// do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.bmp;*.png;*.jpg;*.gif%c%c"), TranslateT("Image files"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.bmp;*.png;*.jpg;*.gif%c%c"), TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrDefExt = _T("png");
@@ -1048,7 +1048,7 @@ void TSAPI GetMYUIN(TWindowData *dat) mir_free((void*)ci.pszVal);
break;
case CNFT_DWORD:
- mir_sntprintf(dat->myUin, _countof(dat->myUin), _T("%u"), ci.dVal);
+ mir_sntprintf(dat->myUin, _T("%u"), ci.dVal);
break;
default:
dat->myUin[0] = 0;
@@ -1285,7 +1285,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) TCHAR szKey[20];
DWORD dwLID = _tcstoul(szKLName, &stopped, 16);
- mir_sntprintf(szKey, _countof(szKey), _T("%04.04x"), LOWORD(dwLID));
+ mir_sntprintf(szKey, _T("%04.04x"), LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("MIME\\Database\\Rfc1766"), 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
@@ -1305,7 +1305,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName) _tcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
- mir_sntprintf(dat->lcID, _countof(dat->lcID), szLI);
+ mir_sntprintf(dat->lcID, szLI);
GetStringTypeA(dat->lcid, CT_CTYPE2, (char*)szTest, 3, wCtype2);
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
@@ -1956,7 +1956,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp) if (filename[0] == 0) { // prompting to save
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.jpg%c%c"), TranslateT("JPEG-compressed images"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.jpg%c%c"), TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
dlg.lStructSize = sizeof(dlg);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 3bcf1b8a56..a02cbf2f66 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -129,9 +129,9 @@ void TSAPI CacheLogFonts() memset(logfonts, 0, (sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2)));
for (int i = 0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
- mir_snprintf(rtfFontsGlobal[i], _countof(rtfFontsGlobal[i]), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
+ mir_snprintf(rtfFontsGlobal[i], "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
}
- mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], _countof(rtfFontsGlobal[MSGDLGFONTCOUNT]), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
+ mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
_tcsncpy(szToday, TranslateT("Today"), 20);
_tcsncpy(szYesterday, TranslateT("Yesterday"), 20);
@@ -460,7 +460,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (dwEffectiveFlags & MWF_DIVIDERWANTED) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
str.AppendFormat("\\sl-1\\slmult0\\highlight%d\\cf%d\\-\\par\\sl0", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS);
dat->dwFlags &= ~MWF_DIVIDERWANTED;
@@ -1029,7 +1029,7 @@ static void SetupLogFormatting(TWindowData *dat) if (dat->hHistoryEvents)
strncpy_s(dat->szMicroLf, "\\v\\cf%d \\ ~-+%d+-~\\v0 ", _TRUNCATE);
else
- mir_snprintf(dat->szMicroLf, _countof(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
+ mir_snprintf(dat->szMicroLf, "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
}
static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
@@ -1139,7 +1139,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe if (dat->hHistoryEvents && dat->curHistory == dat->maxHistory) {
char szPattern[50];
- mir_snprintf(szPattern, _countof(szPattern), "~-+%d+-~", (INT_PTR)dat->hHistoryEvents[0]);
+ mir_snprintf(szPattern, "~-+%d+-~", (INT_PTR)dat->hHistoryEvents[0]);
FINDTEXTEXA ft;
ft.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index e73b29fc00..d1930bc4da 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -75,7 +75,7 @@ void TSAPI LoadLogfont(int i, LOGFONTA * lf, COLORREF * colour, char *szModule) lf->lfClipPrecision = lfResult.lfClipPrecision;
lf->lfQuality = lfResult.lfQuality;
lf->lfPitchAndFamily = lfResult.lfPitchAndFamily;
- mir_snprintf(lf->lfFaceName, _countof(lf->lfFaceName), "%S", lfResult.lfFaceName);
+ mir_snprintf(lf->lfFaceName, "%S", lfResult.lfFaceName);
}
}
@@ -97,7 +97,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) {
bool fValid = false;
TCHAR tszMask[MAX_PATH];
- mir_sntprintf(tszMask, _countof(tszMask), _T("%s*.*"), tszFolder);
+ mir_sntprintf(tszMask, _T("%s*.*"), tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
@@ -117,7 +117,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) LRESULT lr;
TCHAR szBuf[255];
- mir_sntprintf(tszFinalName, _countof(tszFinalName), _T("%s%s"), tszFolder, fd.cFileName);
+ mir_sntprintf(tszFinalName, _T("%s%s"), tszFolder, fd.cFileName);
GetPrivateProfileString(_T("Global"), _T("Name"), _T("None"), szBuf, _countof(szBuf), tszFinalName);
if (!mir_tstrcmp(szBuf, _T("None"))) {
@@ -153,7 +153,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) _tcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
- mir_sntprintf(tszFindMask, _countof(tszFindMask), _T("%s*.*"), tszSkinRoot);
+ mir_sntprintf(tszFindMask, _T("%s*.*"), tszSkinRoot);
SendMessage(hwndCombobox, CB_RESETCONTENT, 0, 0);
SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)TranslateT("<no skin>"));
@@ -163,7 +163,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
TCHAR tszSubDir[MAX_PATH];
- mir_sntprintf(tszSubDir, _countof(tszSubDir), _T("%s%s\\"), tszSkinRoot, fd.cFileName);
+ mir_sntprintf(tszSubDir, _T("%s%s\\"), tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
if (FindNextFile(h, &fd) == 0)
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 5f7569d711..fc987b266e 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -484,9 +484,9 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
- mir_sntprintf(tabtitle, _countof(tabtitle), _T("%s (%s) "), newcontactname, szStatus);
+ mir_sntprintf(tabtitle, _T("%s (%s) "), newcontactname, szStatus);
else
- mir_sntprintf(tabtitle, _countof(tabtitle), _T("%s "), newcontactname);
+ mir_sntprintf(tabtitle, _T("%s "), newcontactname);
newData.item.pszText = tabtitle;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -1046,7 +1046,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), nextStgId++);
+ mir_sntprintf(sztName, _T("s%u"), nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 37d0646153..c45e048f00 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -47,7 +47,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (lParam) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (dat) {
- mir_sntprintf(szNewTitle, _countof(szNewTitle), TranslateT("Select container for %s"), dat->cache->getNick());
+ mir_sntprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
SetWindowText(hwndDlg, szNewTitle);
}
}
@@ -178,7 +178,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L char szValue[10];
TContainerData *pContainer = 0;
do {
- mir_snprintf(szValue, _countof(szValue), "%d", iCounter);
+ mir_snprintf(szValue, "%d", iCounter);
if (db_get_ts(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 161431984b..508d2b7aa8 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -73,7 +73,7 @@ void CSendLaterJob::cleanDB() db_set_dw(hContact, "SendLater", "count", iCount);
// delete flags
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
db_unset(hContact, "SendLater", szKey);
}
}
@@ -87,7 +87,7 @@ void CSendLaterJob::readFlags() char szKey[100];
DWORD localFlags;
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
localFlags = db_get_dw(hContact, "SendLater", szKey, 0);
if (localFlags & SLF_SUSPEND)
@@ -104,7 +104,7 @@ void CSendLaterJob::writeFlags() DWORD localFlags = (bCode == JOB_HOLD ? SLF_SUSPEND : 0);
char szKey[100];
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
db_set_dw(hContact, "SendLater", szKey, localFlags);
}
}
@@ -130,12 +130,12 @@ CSendLaterJob::~CSendLaterJob() _tcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("A send later job completed successfully.\nThe original message: %s"),
+ mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
else if (fFailed) {
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("A send later job failed to complete.\nThe original message: %s"),
+ mir_sntprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
@@ -538,7 +538,7 @@ void CSendLater::qMgrFillList(bool fClear) lvItem.mask = LVIF_TEXT | LVIF_PARAM;
TCHAR tszBuf[255];
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s [%s]"), tszNick, c->getRealAccount());
+ mir_sntprintf(tszBuf, _T("%s [%s]"), tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
lvItem.iItem = uIndex++;
@@ -590,7 +590,7 @@ void CSendLater::qMgrFillList(bool fClear) bCode = p->bCode;
TCHAR tszStatus[20];
- mir_sntprintf(tszStatus, _countof(tszStatus), _T("X/%s[%c] (%d)"), tszStatusText, bCode, p->iSendCount);
+ mir_sntprintf(tszStatus, _T("X/%s[%c] (%d)"), tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
lvItem.iSubItem = 3;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 9824a8f5a8..dc6407bf1d 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -215,7 +215,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) if (iSendLength >= iMinLength) { TCHAR tszError[256]; - mir_sntprintf(tszError, _countof(tszError), TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); + mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength); ::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); sendQueue->clearJob(iEntry); return 0; @@ -270,7 +270,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry) size_t iSendLength = getSendLength(iEntry); if (iSendLength >= dat->nMax) { - mir_sntprintf(tszError, _countof(tszError), TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax); + mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax); SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError)); clearJob(iEntry); return 0; @@ -540,7 +540,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam) SkinPlaySound("SendError"); TCHAR *szAckMsg = mir_a2t((char *)ack->lParam); - mir_sntprintf(job.szErrorMsg, _countof(job.szErrorMsg), TranslateT("Delivery failure: %s"), szAckMsg); + mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg); job.iStatus = SQ_ERROR; mir_free(szAckMsg); KillTimer(dat->hwnd, TIMERID_MSGSEND + iFound); @@ -679,10 +679,10 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b time_t now = time(0); TCHAR tszTimestamp[30]; _tcsftime(tszTimestamp, _countof(tszTimestamp), _T("%Y.%m.%d - %H:%M"), _localtime32((__time32_t *)&now)); - mir_snprintf(szKeyName, _countof(szKeyName), "S%d", now); - mir_sntprintf(tszHeader, _countof(tszHeader), TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); + mir_snprintf(szKeyName, "S%d", now); + mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp); } - else mir_sntprintf(tszHeader, _countof(tszHeader), _T("M%d|"), time(0)); + else mir_sntprintf(tszHeader, _T("M%d|"), time(0)); T2Utf utf_header(tszHeader); size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10; diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index da2f462594..9f06fa6957 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -108,7 +108,7 @@ int _DebugTraceW(const wchar_t *fmt, ...) GetLocalTime(&st); - mir_snprintf(tszTime, _countof(tszTime), "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); + mir_snprintf(tszTime, "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); mir_vsntprintf(debug, ibsize - 10, fmt, va); @@ -120,7 +120,7 @@ int _DebugTraceW(const wchar_t *fmt, ...) FILE *f; CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szDataPath); - mir_snprintf(szLogFileName, _countof(szLogFileName), "%s\\%s", szDataPath, "tabsrmm_debug.log"); + mir_snprintf(szLogFileName, "%s\\%s", szDataPath, "tabsrmm_debug.log"); f = fopen(szLogFileName, "a+"); if (f) { fputs(tszTime, f); diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 16eb8bcf4f..9021ba569c 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -686,7 +686,7 @@ void CThumbBase::renderBase() wchar_t tszTemp[30];
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(tszTemp, _countof(tszTemp), TranslateT("%d unread"), m_dat->dwUnread);
+ mir_sntprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, tszTemp, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
}
m_rcIcon = m_rcTop;
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 38e246a13c..0177193eb7 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -363,7 +363,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->dwFlags = MWF_LOG_ALL; dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL); dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE; - mir_sntprintf(dat->szMyNickname, _countof(dat->szMyNickname), _T("My Nickname")); + mir_sntprintf(dat->szMyNickname, _T("My Nickname")); StreamInEvents(hwndDlg, 0, 1, 0, &dbei); SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1); if (teInfo->changed) diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 62c9f2db30..05fb1ee579 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -193,7 +193,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat) WritePrivateProfileStringA(fontBlocks[n].szBLockname, "Valid", "1", szIniFilename);
for (i = 0; i < fontBlocks[n].iCount; i++) {
mir_snprintf(szTemp, "Font%d", firstIndex + i);
- mir_snprintf(szAppname, _countof(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
+ mir_snprintf(szAppname, fontBlocks[n].szIniTemp, firstIndex + i);
if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
db_free(&dbv);
@@ -274,7 +274,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in }
for (i = 0; i < fontBlocks[n].iCount; i++) {
mir_snprintf(szTemp, "Font%d", firstIndex + i);
- mir_snprintf(szAppname, _countof(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
+ mir_snprintf(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)
strncpy_s(szBuf, "Arial", _TRUNCATE);
@@ -425,7 +425,7 @@ const TCHAR* TSAPI GetThemeFileName(int iMode) szFilename[0] = 0;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.tabsrmm%c%c"), TranslateT("TabSRMM themes"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.tabsrmm%c%c"), TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 5179006977..a45aaa2923 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1212,7 +1212,7 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon) TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
_tsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
- mir_sntprintf(szImagePath, _countof(szImagePath), _T("%s\\%s\\%s"), szDrive, szDir, buffer);
+ mir_sntprintf(szImagePath, _T("%s\\%s\\%s"), szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
else hIcon = NULL;
@@ -1241,12 +1241,12 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem) this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_sntprintf(def_color, _countof(def_color), _T("%6.6x"), clr);
+ mir_sntprintf(def_color, _T("%6.6x"), clr);
GetPrivateProfileString(szItem, _T("Color1"), def_color, buffer, 400, m_tszFileName);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_sntprintf(def_color, _countof(def_color), _T("%6.6x"), clr);
+ mir_sntprintf(def_color, _T("%6.6x"), clr);
GetPrivateProfileString(szItem, _T("Color2"), def_color, buffer, 400, m_tszFileName);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -1316,7 +1316,7 @@ void CSkin::ReadImageItem(const TCHAR *itemname) // handle the assignments of image items to skin items
for (int n = 0;; n++) {
- mir_sntprintf(szItemNr, _countof(szItemNr), _T("Item%d"), n);
+ mir_sntprintf(szItemNr, _T("Item%d"), n);
GetPrivateProfileString(itemname, szItemNr, _T("None"), buffer, 500, m_tszFileName);
if (!mir_tstrcmp(buffer, _T("None")))
break;
@@ -1481,7 +1481,7 @@ void CSkin::Load(void) GetPrivateProfileString(_T("Theme"), _T("File"), _T("None"), buffer, MAX_PATH, m_tszFileName);
_tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, _countof(szFinalName), _T("%s\\%s\\%s"), szDrive, szPath, buffer);
+ mir_sntprintf(szFinalName, _T("%s\\%s\\%s"), szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h index be8986039b..8f58735147 100644 --- a/plugins/TabSRMM/src/themes.h +++ b/plugins/TabSRMM/src/themes.h @@ -151,7 +151,7 @@ public: CImageItem(const TCHAR *szName)
{
memset(this, 0, sizeof(CImageItem));
- mir_sntprintf(m_szName, _countof(m_szName), szName);
+ mir_sntprintf(m_szName, szName);
m_szName[39] = 0;
}
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index a0954e031b..9db2c36379 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -90,7 +90,7 @@ static void TrayAnimThread(LPVOID) void TSAPI CreateTrayMenus(int mode)
{
if (mode) {
- mir_sntprintf(g_eventName, _countof(g_eventName), _T("tsr_evt_%d"), GetCurrentThreadId());
+ mir_sntprintf(g_eventName, _T("tsr_evt_%d"), GetCurrentThreadId());
g_hEvent = CreateEvent(NULL, FALSE, FALSE, g_eventName);
isAnimThreadRunning = TRUE;
hTrayAnimThread = mir_forkthread(TrayAnimThread, NULL);
@@ -217,7 +217,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con if (acc && acc->tszAccountName) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
if (hMenu == PluginConfig.g_hMenuRecent) {
if (CheckMenuItem(hMenu, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == 0) {
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 6cbc66c579..083d35f76e 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -530,8 +530,8 @@ int TN_ModuleInit() for (i = 0; i < _countof(colorPicker); i++)
colorPicker[i].color = M.GetDword(Module, colorPicker[i].desc, 0);
- mir_sntprintf(szStart, _countof(szStart), TranslateT("...is typing a message."));
- mir_sntprintf(szStop, _countof(szStop), TranslateT("...has stopped typing."));
+ mir_sntprintf(szStart, TranslateT("...is typing a message."));
+ mir_sntprintf(szStop, TranslateT("...has stopped typing."));
if (PluginConfig.g_bPopupAvail && ShowMenu) {
hTypingNotify = CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 1892993c53..403622be5e 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -152,7 +152,7 @@ search_again: clr_found = true;
if (was_added) {
TCHAR wszTemp[100];
- mir_sntprintf(wszTemp, _countof(wszTemp), _T("##col##%06u:%04u"), endmark - closing, ii);
+ mir_sntprintf(wszTemp, _T("##col##%06u:%04u"), endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
}
@@ -645,7 +645,7 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce char szCname[50];
TContainerSettings csTemp = { 0 };
- mir_snprintf(szCname, _countof(szCname), "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
Utils::ReadContainerSettingsFromDB(0, &csTemp, szCname);
if (csTemp.fPrivate || fForce) {
if (pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
@@ -662,10 +662,10 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
if (pContainer->settings->fPrivate) {
- mir_snprintf(szCName, _countof(szCName), "%s%d_Blob", szSetting, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d_Blob", szSetting, pContainer->iContainerIndex);
WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
- mir_snprintf(szCName, _countof(szCName), "%s%d_theme", szSetting, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d_theme", szSetting, pContainer->iContainerIndex);
if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
@@ -897,7 +897,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
TCHAR szFilename[MAX_PATH];
- mir_sntprintf(szFilename, _countof(szFilename), _T("%s%s"), tszPath, tszFilename);
+ mir_sntprintf(szFilename, _T("%s%s"), tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
return true;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 8907f068b1..55c00e03bc 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -79,7 +79,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN); if (Proto_IsAccountLocked(pa)) - mir_sntprintf(pwd->swzTitle, _countof(pwd->swzTitle), TranslateT("%s (locked)"), pwd->swzTitle); + mir_sntprintf(pwd->swzTitle, TranslateT("%s (locked)"), pwd->swzTitle); // protocol status WORD wStatus = (WORD)CallProtoService(pwd->clcit.szProto, PS_GETSTATUS, 0, 0); @@ -107,7 +107,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa TCHAR swzLogon[64]; if (TimestampToTimeDifference(NULL, pwd->clcit.szProto, "LogonTS", swzLogon, 59)) { TCHAR ago[96]; - mir_sntprintf(ago, _countof(ago), TranslateT("%s ago"), swzLogon); + mir_sntprintf(ago, TranslateT("%s ago"), swzLogon); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } @@ -1492,7 +1492,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa mir_tstrcpy(swzProto, pa->tszAccountName); if (dwItems & TRAYTIP_LOCKSTATUS) if (Proto_IsAccountLocked(pa)) - mir_sntprintf(swzProto, _countof(swzProto), TranslateT("%s (locked)"), pa->tszAccountName); + mir_sntprintf(swzProto, TranslateT("%s (locked)"), pa->tszAccountName); AddRow(pwd, swzProto, buff, NULL, false, false, !bFirstItem, true, Skin_LoadProtoIcon(pa->szModuleName, wStatus)); bFirstItem = false; @@ -1500,7 +1500,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (dwItems & TRAYTIP_LOGON) { if (TimestampToTimeDifference(NULL, pa->szModuleName, "LogonTS", buff, 59)) { TCHAR ago[96]; - mir_sntprintf(ago, _countof(ago), TranslateT("%s ago"), buff); + mir_sntprintf(ago, TranslateT("%s ago"), buff); AddRow(pwd, TranslateT("Log on:"), ago, NULL, false, false, false); } } @@ -1621,7 +1621,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa TCHAR *swzNick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0); if (opt.iFavoriteContFlags & FAVCONT_APPEND_PROTO) { TCHAR *swzProto = a2t(proto); - mir_sntprintf(swzName, _countof(swzName), _T("%s (%s)"), swzNick, swzProto); + mir_sntprintf(swzName, _T("%s (%s)"), swzNick, swzProto); mir_free(swzProto); } else mir_tstrcpy(swzName, swzNick); diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 7921a184fd..5b0624a520 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -88,7 +88,7 @@ void ParseAboutPart(FILE *fp, TCHAR *buff, TCHAR *szSkinName) else if (_tcsstr(buff, _T("preview")))
{
TCHAR szImgPath[1024];
- mir_sntprintf(szImgPath, _countof(szImgPath), _T("%s\\%s\\%s"), SKIN_FOLDER, szSkinName, pch);
+ mir_sntprintf(szImgPath, _T("%s\\%s\\%s"), SKIN_FOLDER, szSkinName, pch);
if (FileExists(szImgPath))
mir_tstrcpy(opt.szPreviewFile, szImgPath);
}
@@ -126,7 +126,7 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart) if (_tcsstr(buff, _T("image")))
{
TCHAR szImgPath[1024];
- mir_sntprintf(szImgPath, _countof(szImgPath), _T("%s\\%s\\%s"), SKIN_FOLDER, opt.szSkinName, pch);
+ mir_sntprintf(szImgPath, _T("%s\\%s\\%s"), SKIN_FOLDER, opt.szSkinName, pch);
opt.szImgFile[iPart] = mir_tstrdup(szImgPath);
}
else if (_tcsstr(buff, _T("tm")))
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index 7fe285ac0f..c20915147e 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -233,21 +233,21 @@ TCHAR *DayMonthYearToDate(MCONTACT hContact, const char *szModuleName, const cha {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", prefix);
+ mir_snprintf(szSettingName, "%sDay", prefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", prefix);
+ mir_snprintf(szSettingName, "%sMonth", prefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", prefix);
+ mir_snprintf(szSettingName, "%sYear", prefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -281,21 +281,21 @@ TCHAR *DayMonthYearToAge(MCONTACT hContact, const char *szModuleName, const char {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", szPrefix);
+ mir_snprintf(szSettingName, "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -330,21 +330,21 @@ TCHAR *HoursMinutesSecondsToTime(MCONTACT hContact, const char *szModuleName, co {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -374,14 +374,14 @@ TCHAR *HoursMinutesToTime(MCONTACT hContact, const char *szModuleName, const cha {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -410,42 +410,42 @@ TCHAR *DmyToTimeDifference(MCONTACT hContact, const char *szModuleName, const ch {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sYear", szPrefix);
+ mir_snprintf(szSettingName, "%sYear", szPrefix);
int year = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sHours", szPrefix);
+ mir_snprintf(szSettingName, "%sHours", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMinutes", szPrefix);
+ mir_snprintf(szSettingName, "%sMinutes", szPrefix);
int minutes = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sSeconds", szPrefix);
+ mir_snprintf(szSettingName, "%sSeconds", szPrefix);
int seconds = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
@@ -512,14 +512,14 @@ TCHAR *DayMonthToDaysToNextBirthday(MCONTACT hContact, const char *szModuleName, {
DBVARIANT dbv;
char szSettingName[256];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sDay", szPrefix);
+ mir_snprintf(szSettingName, "%sDay", szPrefix);
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
db_free(&dbv);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sMonth", szPrefix);
+ mir_snprintf(szSettingName, "%sMonth", szPrefix);
int month = 0;
if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 65eedd0467..80dbb319f8 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -537,7 +537,7 @@ BOOL CTooltipNotify::OptionsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l case WM_VSCROLL:
case WM_HSCROLL:
TCHAR str[10];
- mir_sntprintf(str, _countof(str), _T("%d%%"), 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
+ mir_sntprintf(str, _T("%d%%"), 100 * SendDlgItemMessage(hDlg, IDC_TRANSPARENCY_SLIDER, TBM_GETPOS, 0, 0) / 255);
SetDlgItemText(hDlg, IDC_TRANSPERC, str);
if (wParam != 0x12345678)
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 788bf0b63e..446358af3a 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -1075,10 +1075,7 @@ void NotifyOnSend(void) ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
_tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
- //
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d kilobytes sent"),
- notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
- //
+ mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes sent"), notify_send_size = OverallInfo.CurrentSentTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
ppd.PluginWindowProc = NULL;
@@ -1094,10 +1091,7 @@ void NotifyOnRecv(void) ppd.lchContact = NULL;
ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
_tcsncpy(ppd.lptzContactName, TranslateT("Traffic counter notification"), MAX_CONTACTNAME);
- //
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d kilobytes received"),
- notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
- //
+ mir_sntprintf(ppd.lptzText, TranslateT("%d kilobytes received"), notify_recv_size = OverallInfo.CurrentRecvTraffic >> 10);
ppd.colorBack = Traffic_PopupBkColor;
ppd.colorText = Traffic_PopupFontColor;
ppd.PluginWindowProc = NULL;
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp index c4e43379dc..ef54ae6ed1 100644 --- a/plugins/TrafficCounter/src/misc.cpp +++ b/plugins/TrafficCounter/src/misc.cpp @@ -148,7 +148,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size) return 0;
}
- mir_sntprintf(Str1, _countof(Str1), _T("%d.%d"), Value / Divider, Value % Divider);
+ mir_sntprintf(Str1, _T("%d.%d"), Value / Divider, Value % Divider);
size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
l += mir_tstrlen(szUnit) + 1;
@@ -199,37 +199,37 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, size_t S // ×òî ïîëó÷èëè â àêêóìóëÿòîðå?
if (!mir_tstrcmp(Token, _T("d"))) {
q = Duration / (60 * 60 * 24);
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q * 60 * 60 * 24;
}
else if (!mir_tstrcmp(Token, _T("h"))) {
q = Duration / (60 * 60);
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q * 60 * 60;
}
else if (!mir_tstrcmp(Token, _T("hh"))) {
q = Duration / (60 * 60);
- mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _T("%02d"), q);
Duration -= q * 60 * 60;
}
else if (!mir_tstrcmp(Token, _T("m"))) {
q = Duration / 60;
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q * 60;
}
else if (!mir_tstrcmp(Token, _T("mm"))) {
q = Duration / 60;
- mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _T("%02d"), q);
Duration -= q * 60;
}
else if (!mir_tstrcmp(Token, _T("s"))) {
q = Duration;
- mir_sntprintf(Token, _countof(Token), _T("%d"), q);
+ mir_sntprintf(Token, _T("%d"), q);
Duration -= q;
}
else if (!mir_tstrcmp(Token, _T("ss"))) {
q = Duration;
- mir_sntprintf(Token, _countof(Token), _T("%02d"), q);
+ mir_sntprintf(Token, _T("%02d"), q);
Duration -= q;
}
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index 4f40588061..6baaf37d9b 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -302,7 +302,7 @@ void Stat_ReadFile(BYTE n) pszPath = Utils_ReplaceVarsT(_T("%miranda_userdata%\\statistics"));
CreateDirectoryTreeT(pszPath);
- mir_sntprintf(FileName, _countof(FileName), _T("%s\\%S.stat"), pszPath, ProtoList[n].name);
+ mir_sntprintf(FileName, _T("%s\\%S.stat"), pszPath, ProtoList[n].name);
mir_free(pszPath);
GetLocalTime(&stNow);
ProtoList[n].hFile = CreateFile(FileName, GENERIC_READ | GENERIC_WRITE,
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index d52a7dd44f..caa4bc5a95 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -219,7 +219,7 @@ void SvcFlagsLoadModule() langid = 1;
char szId[20];
- mir_snprintf(szId, _countof(szId), (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */
+ mir_snprintf(szId, (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */
hExtraIconSvc = ExtraIcon_RegisterIcolib("Flags", LPGEN("Flags (uinfoex)"), szId);
}
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 3468fcb749..63de971663 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -133,7 +133,7 @@ HICON LoadFlag(int countryNumber) szCountry = (char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber=0xFFFF,0);
char szId[20];
- mir_snprintf(szId, _countof(szId), (countryNumber == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", countryNumber); /* buffer safe */
+ mir_snprintf(szId, (countryNumber == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", countryNumber); /* buffer safe */
return IcoLib_GetIcon(szId);
}
@@ -349,7 +349,7 @@ void InitIcons() for (int i=0; i < nCountriesCount; i++) {
sid.description.t = mir_a2t(LPGEN(countries[i].szName));
/* create identifier */
- mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
+ mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
int index = CountryNumberToBitmapIndex(countries[i].id);
/* create icon */
sid.hDefaultIcon = ImageList_ExtractIcon(NULL, himl, index);
@@ -374,7 +374,7 @@ void UninitIcons() for(int i=0;i<nCountriesCount;++i) {
// create identifier
char szId[20];
- mir_snprintf(szId, _countof(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
+ mir_snprintf(szId, (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */
IcoLib_RemoveIcon(szId);
}
mir_free(phIconHandles); // does NULL check
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 9aa6ba77f0..9567506ab3 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -271,10 +271,10 @@ int MAnnivDate::DBGetReminderOpts(MCONTACT hContact) char pszSetting[MAXSETTING];
// read reminder option
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dReminder", _wID);
+ mir_snprintf(pszSetting, "Anniv%dReminder", _wID);
_bRemind = db_get_b(hContact, Module(), pszSetting, BST_INDETERMINATE);
// read offset
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dOffset", _wID);
+ mir_snprintf(pszSetting, "Anniv%dOffset", _wID);
_wDaysEarlier = db_get_w(hContact, Module(), pszSetting, (WORD)-1);
}
else {
@@ -310,14 +310,14 @@ int MAnnivDate::DBWriteReminderOpts(MCONTACT hContact) else if (_wID <= ANID_LAST) {
char pszSetting[MAXSETTING];
// read reminder option
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dReminder", _wID);
+ mir_snprintf(pszSetting, "Anniv%dReminder", _wID);
if (_bRemind == BST_INDETERMINATE)
db_unset(hContact, USERINFO, pszSetting);
else
db_set_b(hContact, USERINFO, pszSetting, _bRemind);
// read offset
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dOffset", _wID);
+ mir_snprintf(pszSetting, "Anniv%dOffset", _wID);
if (_wDaysEarlier == (WORD)-1)
db_unset(hContact, USERINFO, pszSetting);
else
@@ -627,7 +627,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) // read date and convert older versions
CHAR szStamp[MAXSETTING];
- mir_snprintf(szStamp, _countof(szStamp), "Anniv%dDate", iIndex);
+ mir_snprintf(szStamp, "Anniv%dDate", iIndex);
int rc = DBGetDateStamp(hContact, USERINFO, szStamp);
if (!rc) {
_strModule = USERINFO;
@@ -635,7 +635,7 @@ int MAnnivDate::DBGetAnniversaryDate(MCONTACT hContact, WORD iIndex) _wID = iIndex;
// read description
- mir_snprintf(szStamp, _countof(szStamp), "Anniv%dDesc", iIndex);
+ mir_snprintf(szStamp, "Anniv%dDesc", iIndex);
DBVARIANT dbv;
if (!DB::Setting::GetTString(hContact, USERINFO, szStamp, &dbv)) {
_strDesc = dbv.ptszVal;
@@ -660,10 +660,10 @@ int MAnnivDate::DBWriteAnniversaryDate(MCONTACT hContact, WORD wIndex) _wID = wIndex;
CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dDate", wIndex);
+ mir_snprintf(pszSetting, "Anniv%dDate", wIndex);
if (!DBWriteDateStamp(hContact, USERINFO, pszSetting)) {
// write description
- mir_snprintf(pszSetting, _countof(pszSetting), "Anniv%dDesc", wIndex);
+ mir_snprintf(pszSetting, "Anniv%dDesc", wIndex);
db_set_ts(hContact, USERINFO, pszSetting, (LPTSTR)Description());
return 0;
}
@@ -687,7 +687,7 @@ static WORD AskUser(MCONTACT hContact, MAnnivDate *pOldCustomDate, MAnnivDate *p pOldCustomDate->DateFormat(szoldDate, _countof(szoldDate));
pNewProtoDate->DateFormat(szDate, _countof(szDate));
- mir_sntprintf(szMsg, _countof(szMsg),
+ mir_sntprintf(szMsg,
TranslateT("%s provides a new birthday via protocol.\nIt is %s. The old one was %s.\n\nDo you want to use this as the new birthday for this contact?"),
DB::Contact::DisplayName(hContact), szDate, szoldDate);
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 331c672567..57c488a0a1 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -88,7 +88,7 @@ CPsTreeItem::~CPsTreeItem() LPCSTR CPsTreeItem::PropertyKey(LPCSTR pszProperty)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "{%s\\%s}_%s", _pszPrefix, _pszName, pszProperty);
+ mir_snprintf(pszSetting, "{%s\\%s}_%s", _pszPrefix, _pszName, pszProperty);
return pszSetting;
}
@@ -121,7 +121,7 @@ LPCSTR CPsTreeItem::GlobalName() LPCSTR CPsTreeItem::GlobalPropertyKey(LPCSTR pszProperty)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "{Global\\%s}_%s", GlobalName(), pszProperty);
+ mir_snprintf(pszSetting, "{Global\\%s}_%s", GlobalName(), pszProperty);
return pszSetting;
}
@@ -138,7 +138,7 @@ LPCSTR CPsTreeItem::IconKey() if (pszIconName)
{
static CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), MODNAME"_{%s}", pszIconName);
+ mir_snprintf(pszSetting, MODNAME"_{%s}", pszIconName);
return pszSetting;
}
return NULL;
@@ -283,7 +283,7 @@ HICON CPsTreeItem::ProtoIcon() for (int i = 0; i < ProtoCount; i++) {
if (!mir_tstrncmpi(pa[i]->tszAccountName, _A2T(_pszName), mir_tstrlen(pa[i]->tszAccountName))) {
CHAR szIconID[MAX_PATH];
- mir_snprintf(szIconID, _countof(szIconID), "core_status_%s1", pa[i]->szModuleName);
+ mir_snprintf(szIconID, "core_status_%s1", pa[i]->szModuleName);
HICON hIco = IcoLib_GetIcon(szIconID);
if (!hIco)
hIco = (HICON)CallProtoService(pa[i]->szModuleName, PS_LOADICON, PLI_PROTOCOL, NULL);
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index ec8361576f..18e1bda0e6 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -364,7 +364,7 @@ INT_PTR CAnnivEditCtrl::DBWriteAnniversaries(MCONTACT hContact) }
// delete reluctant items
do {
- ofs = mir_snprintf(szSet0, _countof(szSet0), "Anniv%d", wIndex);
+ ofs = mir_snprintf(szSet0, "Anniv%d", wIndex);
ret = 1;
for (i = 0; i < _countof(szPrefix); i++) {
mir_strncpy(szSet0 + ofs, szPrefix[i], _countof(szSet0) - ofs);
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index bbfa76552a..262a180124 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam GetDlgItemText(hDlg, EDIT_AREA, szArea, _countof(szArea));
GetDlgItemText(hDlg, EDIT_NUMBER, szData, _countof(szData));
- mir_sntprintf(szPhone, _countof(szPhone), _T("+%u (%s) %s"), nCountry, szArea, szData);
+ mir_sntprintf(szPhone, _T("+%u (%s) %s"), nCountry, szArea, szData);
noRecursion = 1;
SetDlgItemText(hDlg, EDIT_PHONE, szPhone);
noRecursion = 0;
@@ -780,7 +780,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L !cbex->pItems ||
cbex->iSelectedItem < 0 ||
cbex->iSelectedItem >= cbex->numItems ||
- FAILED(mir_sntprintf(szMsg, _countof(szMsg), TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
+ FAILED(mir_sntprintf(szMsg, TranslateT("Do you really want to delete the current selected item?\n\t%s\n\t%s"),
cbex->pItems[cbex->iSelectedItem].szCat, cbex->pItems[cbex->iSelectedItem].pszVal))
)
{
@@ -946,7 +946,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L // set category string
if (!pItem->pszCat || !pItem->pszCat[0] || !mir_tstrncpy(cbex->pItems[cbex->numItems].szCat, pItem->pszCat, MAX_CAT)) {
- mir_sntprintf(cbex->pItems[cbex->numItems].szCat, _countof(cbex->pItems[cbex->numItems].szCat), _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
+ mir_sntprintf(cbex->pItems[cbex->numItems].szCat, _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
}
// set value string
@@ -986,7 +986,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (pItem->wMask & CBEXIM_CAT) {
// set category string
if (!pItem->pszCat || !pItem->pszCat[0] || !mir_tstrncpy(cbex->pItems[pItem->iItem].szCat, pItem->pszCat, _countof(cbex->pItems[pItem->iItem].szCat)))
- mir_sntprintf(cbex->pItems[pItem->iItem].szCat, _countof(cbex->pItems[pItem->iItem].szCat), _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
+ mir_sntprintf(cbex->pItems[pItem->iItem].szCat, _T("%s %d"), TranslateT("Other"), ++cbex->numOther);
if (pItem->iItem == cbex->iSelectedItem)
SetWindowText(cbex->hBtnEdit, cbex->pItems[pItem->iItem].szCat);
}
@@ -1349,7 +1349,7 @@ int CtrlContactAddMyItemsFromDB( cbi.pszIcon = szIcon;
for (i = 0;
- SUCCEEDED(mir_snprintf(pszSetting, _countof(pszSetting), szFormatVal, i)) &&
+ SUCCEEDED(mir_snprintf(pszSetting, szFormatVal, i)) &&
(cbi.wFlags = DB::Setting::GetTStringCtrl(hContact, pszModule, pszModule, pszProto, pszSetting, &dbv));
i++)
{
@@ -1360,7 +1360,7 @@ int CtrlContactAddMyItemsFromDB( dbv.ptszVal = NULL;
// read category
- if (SUCCEEDED(mir_snprintf(pszSetting, _countof(pszSetting), szFormatCat, i))) {
+ if (SUCCEEDED(mir_snprintf(pszSetting, szFormatCat, i))) {
if (cbi.wFlags & CTRLF_HASCUSTOM) {
if (DB::Setting::GetTString(hContact, pszModule, pszSetting, &dbv))
dbv.type = DBVT_DELETED;
@@ -1480,13 +1480,13 @@ int CtrlContactWriteMyItemsToDB( if (cbi.wFlags & CBEXIF_SMS) {
mir_tstrncat(szVal, _T(" SMS"), _countof(szVal) - mir_tstrlen(szVal));
}
- mir_snprintf(pszSetting, _countof(pszSetting), szFormatCat, i);
+ mir_snprintf(pszSetting, szFormatCat, i);
if (*szCat && _tcsncmp(szCat, pszOther, ccOther)) {
if (db_set_ts(hContact, pszModule, pszSetting, szCat)) return 1;
}
else
db_unset(hContact, pszModule, pszSetting);
- mir_snprintf(pszSetting, _countof(pszSetting), szFormatVal, i);
+ mir_snprintf(pszSetting, szFormatVal, i);
if (db_set_ts(hContact, pszModule, pszSetting, szVal)) return 1;
cbi.wFlags &= ~CTRLF_CHANGED;
cbi.wMask = CBEXIM_FLAGS;
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index f12f53c485..1e9ad4ca9b 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -597,7 +597,7 @@ class CAnnivList LVCOLUMN lvc;
CHAR pszSetting[MAXSETTING];
- mir_snprintf(pszSetting, _countof(pszSetting), "AnnivDlg_Col%d", iSubItem);
+ mir_snprintf(pszSetting, "AnnivDlg_Col%d", iSubItem);
lvc.cx = db_get_w(NULL, MODNAME, pszSetting, defaultWidth);
lvc.mask = LVCF_WIDTH | LVCF_TEXT;
lvc.iSubItem = iSubItem;
@@ -876,7 +876,7 @@ public: int c, cc = Header_GetItemCount(ListView_GetHeader(_hList));
for (c = 0; c < cc; c++) {
- mir_snprintf(pszSetting, _countof(pszSetting), "AnnivDlg_Col%d", c);
+ mir_snprintf(pszSetting, "AnnivDlg_Col%d", c);
db_set_w(NULL, MODNAME, pszSetting, (WORD)ListView_GetColumnWidth(_hList, c));
}
DeleteAllItems();
diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 8022802c2f..4704750254 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -688,11 +688,11 @@ INT_PTR CALLBACK MsgBox(HWND hParent, UINT uType, LPCTSTR pszTitle, LPCTSTR pszI INT_PTR CALLBACK MsgErr(HWND hParent, LPCTSTR pszFormat, ...)
{
TCHAR tszTitle[MAX_SECONDLINE], tszMsg[MAX_SECONDLINE];
- mir_sntprintf(tszTitle, _countof(tszMsg), _T("%s - %s"), _T(MODNAME), TranslateT("Error"));
+ mir_sntprintf(tszTitle, _T("%s - %s"), _T(MODNAME), TranslateT("Error"));
va_list vl;
va_start(vl, pszFormat);
- mir_vsntprintf(tszMsg, _countof(tszMsg), TranslateTS(pszFormat), vl);
+ mir_vsntprintf(tszMsg, TranslateTS(pszFormat), vl);
va_end(vl);
MSGBOX mb = {0};
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 4cb4dc7abc..ff76ea1994 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -137,7 +137,7 @@ private: EnableWindow(GetDlgItem(_pPs->hDlg, IDOK), FALSE);
EnableWindow(GetDlgItem(_pPs->hDlg, IDAPPLY), FALSE);
- mir_snprintf(_pPs->szUpdating, _countof(_pPs->szUpdating), "%s (%s)", Translate("Uploading"), (*_pPd)->szModuleName);
+ mir_snprintf(_pPs->szUpdating, "%s (%s)", Translate("Uploading"), (*_pPd)->szModuleName);
ShowWindow(GetDlgItem(_pPs->hDlg, TXT_UPDATING), SW_SHOW);
SetTimer(_pPs->hDlg, TIMERID_UPDATING, 100, NULL);
return 0;
@@ -1541,7 +1541,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (pPs->hContact != NULL) {
ResetUpdateInfo(pPs);
- mir_snprintf(pPs->szUpdating, _countof(pPs->szUpdating), "%s (%s)", Translate("updating"), pPs->pszProto);
+ mir_snprintf(pPs->szUpdating, "%s (%s)", Translate("updating"), pPs->pszProto);
// need meta contact's subcontact information
if (DB::Module::IsMetaAndScan(pPs->pszProto)) {
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 2041202d80..ab19dba570 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -221,7 +221,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
TranslateDialogDefault(hDlg); //to translate oldTitle
GetWindowText(hDlg, oldTitle, _countof(oldTitle));
- mir_sntprintf(newTitle, _countof(newTitle), _T("%s - %s"), name, oldTitle);
+ mir_sntprintf(newTitle, _T("%s - %s"), name, oldTitle);
SetWindowText(hDlg, newTitle);
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index 36383cf771..67e46fc06d 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -281,7 +281,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM) if (SendMessage(hClist,CLM_GETITEMTYPE, (WPARAM)hItem, 0) == CLCIT_GROUP) {
SendMessage(hClist,CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)ptszItem);
LPTSTR temp = mir_tstrdup(ptszGroup);
- mir_sntprintf(tszGroup, _countof(tszGroup),_T("%s%s%s"), ptszItem, mir_tstrlen(temp)? _T("\\"):_T(""), temp);
+ mir_sntprintf(tszGroup, _T("%s%s%s"), ptszItem, mir_tstrlen(temp)? _T("\\"):_T(""), temp);
mir_free (temp);
}
hParent = SendMessage(hClist,CLM_GETNEXTITEM, (WPARAM)CLGN_PARENT, (LPARAM)hItem);
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index 7b5ed883ec..6bf79fc8e7 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -362,7 +362,7 @@ void DeleteArray(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszFormat, int iSta {
char pszSetting[MAXSETTING];
do {
- mir_snprintf(pszSetting, _countof(pszSetting), pszFormat, iStart++);
+ mir_snprintf(pszSetting, pszFormat, iStart++);
}
while (!db_unset(hContact, pszModule, pszSetting));
}
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp index d08b8ec07b..da26528cb9 100644 --- a/plugins/UserInfoEx/src/psp_contact.cpp +++ b/plugins/UserInfoEx/src/psp_contact.cpp @@ -46,7 +46,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM PSGetBoldFont(hDlg, hBoldFont);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
- mir_sntprintf(szAddr, _countof(szAddr), _T("%s (%s)"), TranslateT("Address"), TranslateT("home"));
+ mir_sntprintf(szAddr, _T("%s (%s)"), TranslateT("Address"), TranslateT("home"));
SetDlgItemText(hDlg, IDC_PAGETITLE, szAddr);
SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
@@ -192,7 +192,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM PSGetBoldFont(hDlg, hBoldFont);
SendDlgItemMessage(hDlg, IDC_PAGETITLE, WM_SETFONT, (WPARAM)hBoldFont, 0);
- mir_sntprintf(szAddr, _countof(szAddr), _T("%s (%s)"), TranslateT("Address and contact"), TranslateT("company"));
+ mir_sntprintf(szAddr, _T("%s (%s)"), TranslateT("Address and contact"), TranslateT("company"));
SetDlgItemText(hDlg, IDC_PAGETITLE, szAddr);
SendDlgItemMessage(hDlg, BTN_GOTO, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Open in browser"), MBBF_TCHAR);
TranslateDialogDefault(hDlg);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index c81ad03f01..67bbeb3249 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -487,12 +487,12 @@ static int ProfileList_AddItemlistFromDB( for (i = 0, lvi.iItem = iItem; ; i++) {
// read the setting from db
- mir_snprintf(pszSetting, _countof(pszSetting), szValFormat, i);
+ mir_snprintf(pszSetting, szValFormat, i);
if (DB::Setting::GetTString(hContact, pszModule, pszSetting, &dbvVal))
break;
if (dbvVal.type != DBVT_TCHAR)
continue;
- mir_snprintf(pszSetting, _countof(pszSetting), szCatFormat, i);
+ mir_snprintf(pszSetting, szCatFormat, i);
DB::Setting::GetAString(hContact, pszModule, pszSetting, &dbvCat);
// create the itemobject
if (!(pItem = (LPLCITEM)mir_alloc(sizeof(LCITEM)))) {
@@ -1218,10 +1218,10 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR if (!pItem->pszText[1] || !*pItem->pszText[1])
continue;
if (!(pItem->wFlags & (CTRLF_HASPROTO|CTRLF_HASMETA))) {
- mir_snprintf(pszSetting, _countof(pszSetting), pFmt[iFmt].szValFmt, iItem);
+ mir_snprintf(pszSetting, pFmt[iFmt].szValFmt, iItem);
db_set_ts(hContact, pszModule, pszSetting, pItem->pszText[1]);
// save category
- mir_snprintf(pszSetting, _countof(pszSetting), pFmt[iFmt].szCatFmt, iItem);
+ mir_snprintf(pszSetting, pFmt[iFmt].szCatFmt, iItem);
if (pItem->idstrList && pItem->iListItem > 0 && pItem->iListItem < pItem->idstrListCount)
db_set_s(hContact, pszModule, pszSetting, (LPSTR)pItem->idstrList[pItem->iListItem].pszText);
else if (pItem->pszText[0] && *pItem->pszText[0])
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index f30b9ba1a4..44467f2fac 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -148,7 +148,7 @@ static HICON GetAnnivIcon(const CEvent &evt) if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTBX);
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dtb%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
break;
@@ -157,7 +157,7 @@ static HICON GetAnnivIcon(const CEvent &evt) if (evt._wDaysLeft > 9)
hIcon = IcoLib_GetIcon(ICO_RMD_DTAX);
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dta%u", evt._wDaysLeft);
hIcon = IcoLib_GetIcon(szIcon);
}
}
@@ -183,7 +183,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt) if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dtb%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dtb%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -192,7 +192,7 @@ static void NotifyWithExtraIcon(MCONTACT hContact, const CEvent &evt) if (evt._wDaysLeft > 9)
icoName = ICO_RMD_DTAX;
else {
- mir_snprintf(szIcon, _countof(szIcon), MODNAME"_rmd_dta%u", evt._wDaysLeft);
+ mir_snprintf(szIcon, MODNAME"_rmd_dta%u", evt._wDaysLeft);
icoName = szIcon;
}
break;
@@ -255,8 +255,7 @@ static int NotifyWithPopup(MCONTACT hContact, CEvent::EType eventType, int DaysT if (hContact) {
ppd.lchContact = hContact;
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName),
- _T("%s - %s"), TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
+ mir_sntprintf(ppd.lptzContactName, _T("%s - %s"), TranslateTS(pszDesc), DB::Contact::DisplayName(hContact));
}
else mir_tstrncpy(ppd.lptzContactName, TranslateT("Reminder"), _countof(ppd.lptzContactName));
@@ -318,12 +317,12 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) switch (evt._eType) {
case CEvent::BIRTHDAY:
- mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
+ mir_sntprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("Birthday"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_BIRTHDAY);
break;
case CEvent::ANNIVERSARY:
- mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
+ mir_sntprintf(szMsg, TranslateT("%s has %s today."), DB::Contact::DisplayName(hContact), TranslateT("an anniversary"));
cle.hIcon = IcoLib_GetIcon(ICO_COMMON_ANNIVERSARY);
break;
@@ -483,13 +482,13 @@ static bool CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti switch (Diff) {
case 0:
- cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday today."), DB::Contact::DisplayName(hContact));
break;
case 1:
- cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
+ cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday tomorrow."), DB::Contact::DisplayName(hContact));
break;
default:
- cchMsg = mir_sntprintf(szMsg, _countof(szMsg), TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
+ cchMsg = mir_sntprintf(szMsg, TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
}
int age = mtb.Age(&Now);
if (age > 0)
diff --git a/plugins/Variables/src/dbhelpers.h b/plugins/Variables/src/dbhelpers.h index b6fe9f7c42..4531bf397f 100644 --- a/plugins/Variables/src/dbhelpers.h +++ b/plugins/Variables/src/dbhelpers.h @@ -26,7 +26,7 @@ static int __inline DBWriteIthSettingByte(DWORD i, MCONTACT hContact,const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_b(hContact, szModule, dbSetting, val);
}
@@ -34,7 +34,7 @@ static int __inline DBWriteIthSettingWord(DWORD i, MCONTACT hContact,const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_w(hContact, szModule, dbSetting, val);
}
@@ -42,7 +42,7 @@ static int __inline DBWriteIthSettingDword(DWORD i, MCONTACT hContact,const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_dw(hContact, szModule, dbSetting, val);
}
@@ -50,7 +50,7 @@ static int __inline DBWriteIthSettingString(DWORD i, MCONTACT hContact,const cha char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_set_s(hContact, szModule, dbSetting, val);
}
@@ -59,7 +59,7 @@ static int __inline DBGetIthSettingByte(DWORD i, MCONTACT hContact, const char * char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_b(hContact, szModule, dbSetting, errorValue);
}
@@ -68,7 +68,7 @@ static WORD __inline DBGetIthSettingWord(DWORD i, MCONTACT hContact, const char char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_w(hContact, szModule, dbSetting, errorValue);
}
@@ -77,7 +77,7 @@ static DWORD __inline DBGetIthSettingDword(DWORD i, MCONTACT hContact, const cha char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get_dw(hContact, szModule, dbSetting, errorValue);
}
@@ -86,7 +86,7 @@ static int __inline DBGetIthSetting(DWORD i, MCONTACT hContact, const char *szMo char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_get(hContact, szModule, dbSetting, dbv);
}
@@ -94,7 +94,7 @@ static int __inline DBDeleteIthSetting(DWORD i, MCONTACT hContact,const char *sz char dbSetting[128];
- mir_snprintf(dbSetting, _countof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
+ mir_snprintf(dbSetting, "%s%u_%s", PREFIX_ITH, i, szSetting);
return db_unset(hContact, szModule, dbSetting);
}
diff --git a/plugins/Variables/src/parse_inet.cpp b/plugins/Variables/src/parse_inet.cpp index ff3e07c943..59d3cc4ce8 100644 --- a/plugins/Variables/src/parse_inet.cpp +++ b/plugins/Variables/src/parse_inet.cpp @@ -40,7 +40,7 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) char hex[8];
memmove(res + cur + 3, res + cur + 1, mir_strlen(res + cur + 1) + 1);
- mir_snprintf(hex, _countof(hex), "%%%x", *(res + cur));
+ mir_snprintf(hex, "%%%x", *(res + cur));
strncpy(res + cur, hex, mir_strlen(hex));
cur += mir_strlen(hex);
}
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp index 1308f805e2..d71296a93d 100644 --- a/plugins/Variables/src/parse_math.cpp +++ b/plugins/Variables/src/parse_math.cpp @@ -54,7 +54,7 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai) int val = ttoi(ai->targv[1]);
int padding = ttoi(ai->targv[2]);
- mir_sntprintf(szVal, _countof(szVal), _T("%x"), val);
+ mir_sntprintf(szVal, _T("%x"), val);
unsigned int zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(TCHAR));
if (res == NULL)
diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index f8a965b81c..bbe87a9506 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -51,7 +51,7 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
TCHAR tszID[40];
- mir_sntprintf(tszID, _countof(tszID), _T("%p"), hContact);
+ mir_sntprintf(tszID, _T("%p"), hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -91,7 +91,7 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
TCHAR tszID[40];
- mir_sntprintf(tszID, _countof(tszID), _T("%p"), hContact);
+ mir_sntprintf(tszID, _T("%p"), hContact);
szUniqueID = mir_tstrdup(tszID);
}
@@ -131,7 +131,7 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) if (szUniqueID == NULL) {
szProto = PROTOID_HANDLE;
TCHAR tszID[40];
- mir_sntprintf(tszID, _countof(tszID), _T("%p"), hContact);
+ mir_sntprintf(tszID, _T("%p"), hContact);
szUniqueID = mir_tstrdup(tszID);
}
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 1877bfcf3f..598fc4dd6d 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -723,7 +723,7 @@ static TCHAR *parseMirandaCoreVar(ARGUMENTSINFO *ai) ai->flags |= AIF_DONTPARSE;
TCHAR corevar[MAX_PATH];
- mir_sntprintf(corevar, _countof(corevar), _T("%%%s%%"), ai->targv[0]);
+ mir_sntprintf(corevar, _T("%%%s%%"), ai->targv[0]);
return Utils_ReplaceVarsT(corevar);
}
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index df01089e48..9e92647542 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -105,7 +105,7 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai) pdhStatus = PdhCloseQuery(hQuery);
return NULL;
}
- mir_sntprintf(szVal, _countof(szVal), _T("%.0f"), cValue.doubleValue);
+ mir_sntprintf(szVal, _T("%.0f"), cValue.doubleValue);
//PdhRemoveCounter(*hCounter);
PdhCloseQuery(hQuery);
mir_free(szCounter);
@@ -282,7 +282,7 @@ static TCHAR *parseDiffTime(ARGUMENTSINFO *ai) return NULL;
diff = difftime(mktime(&t1), mktime(&t0));
- mir_sntprintf(szTime, _countof(szTime), _T("%.0f"), diff);
+ mir_sntprintf(szTime, _T("%.0f"), diff);
return mir_tstrdup(szTime);
}
@@ -819,7 +819,7 @@ static TCHAR *parseUpTime(ARGUMENTSINFO *ai) }
TCHAR szVal[32];
- mir_sntprintf(szVal, _countof(szVal), _T("%u"), cValue.largeValue);
+ mir_sntprintf(szVal, _T("%u"), cValue.largeValue);
PdhRemoveCounter(hCounter);
PdhCloseQuery(hQuery);
return mir_tstrdup(szVal);
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index fdd4596d19..0e52a477e0 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -231,7 +231,7 @@ extern "C" int __declspec(dllexport) Load(void) // window needed for popup commands
TCHAR SvcFunc[100];
- mir_sntprintf(SvcFunc, _countof(SvcFunc), _T("%s__PopupWindow"), _T(WEATHERPROTONAME));
+ mir_sntprintf(SvcFunc, _T("%s__PopupWindow"), _T(WEATHERPROTONAME));
hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), SvcFunc, 0, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, hInst, NULL);
SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc);
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index bda1bd95b7..2e2eeca1a7 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -90,7 +90,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) AvatarDownloaded(hContact);
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("Current weather information for %s."), psr->nick.t);
+ mir_sntprintf(str, TranslateT("Current weather information for %s."), psr->nick.t);
db_set_ts(hContact, WEATHERPROTONAME, "About", str);
// make the last update tags to something invalid
@@ -109,7 +109,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam) opt.DefStn = hContact;
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
// notification message box
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -234,7 +234,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, TCHAR *szData = NULL;
// load the page
- mir_snprintf(loc, _countof(loc), sData->SearchURL, sID);
+ mir_snprintf(loc, sData->SearchURL, sID);
BOOL bFound = (InternetDownloadFile(loc, NULL, NULL, &szData) == 0);
if (bFound) {
TCHAR* szInfo = szData;
@@ -251,7 +251,7 @@ int IDSearchProc(TCHAR *sID, const int searchId, WIIDSEARCH *sData, TCHAR *svc, // give no station name but only ID if the search is unavailable
else _tcsncpy(str, TranslateT("<Enter station name here>"), MAX_DATA_LEN - 1);
- mir_sntprintf(newID, _countof(newID), _T("%s/%s"), svc, sID);
+ mir_sntprintf(newID, _T("%s/%s"), svc, sID);
// set the search result and broadcast it
PROTOSEARCHRESULT psr = { sizeof(psr) };
@@ -311,7 +311,7 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // replace spaces with %20
char loc[256];
T2Utf szSearchName(name);
- mir_snprintf(loc, _countof(loc), sData->SearchURL, ptrA(mir_urlEncode(szSearchName)));
+ mir_snprintf(loc, sData->SearchURL, ptrA(mir_urlEncode(szSearchName)));
if (InternetDownloadFile(loc, NULL, NULL, &szData) == 0) {
TCHAR* szInfo = szData;
search = _tcsstr(szInfo, sData->NotFoundStr); // determine if data is available
@@ -324,14 +324,14 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if station ID appears first in the downloaded data
if (!mir_tstrcmpi(sData->Single.First, _T("ID"))) {
GetDataValue(&sData->Single.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
GetDataValue(&sData->Single.Name, Name, &szInfo);
}
// if station name appears first in the downloaded data
else if (!mir_tstrcmpi(sData->Single.First, _T("NAME"))) {
GetDataValue(&sData->Single.Name, Name, &szInfo);
GetDataValue(&sData->Single.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
}
else
str[0] = 0;
@@ -365,14 +365,14 @@ int NameSearchProc(TCHAR *name, const int searchId, WINAMESEARCH *sData, TCHAR * // if station ID appears first in the downloaded data
if (!mir_tstrcmpi(sData->Multiple.First, _T("ID"))) {
GetDataValue(&sData->Multiple.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
GetDataValue(&sData->Multiple.Name, Name, &szInfo);
}
// if station name appears first in the downloaded data
else if (!mir_tstrcmpi(sData->Multiple.First, _T("NAME"))) {
GetDataValue(&sData->Multiple.Name, Name, &szInfo);
GetDataValue(&sData->Multiple.ID, str, &szInfo);
- mir_sntprintf(sID, _countof(sID), _T("%s/%s"), svc, str);
+ mir_sntprintf(sID, _T("%s/%s"), svc, str);
}
else
break;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp index 3ce506d66a..ae74ad7973 100644 --- a/plugins/Weather/src/weather_contacts.cpp +++ b/plugins/Weather/src/weather_contacts.cpp @@ -29,7 +29,7 @@ static void OpenUrl(TCHAR* format, TCHAR* id) {
TCHAR loc[512];
GetID(id);
- mir_sntprintf(loc, _countof(loc), format, id);
+ mir_sntprintf(loc, format, id);
Utils_OpenUrlT(loc);
}
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa // if ID search is available, do it
if (sData->IDSearch.Available) {
// load the page
- mir_snprintf(loc, _countof(loc), sData->IDSearch.SearchURL, str);
+ mir_snprintf(loc, sData->IDSearch.SearchURL, str);
str[0] = 0;
TCHAR *pData = NULL;
if (InternetDownloadFile(loc, NULL, sData->UserAgent, &pData) == 0) {
@@ -371,7 +371,7 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa }
GetDlgItemText(hwndDlg, IDC_NAME, city, _countof(city));
db_set_ts(hContact, WEATHERPROTONAME, "Nick", city);
- mir_sntprintf(str2, _countof(str2), TranslateT("Current weather information for %s."), city);
+ mir_sntprintf(str2, TranslateT("Current weather information for %s."), city);
if ((BYTE)IsDlgButtonChecked(hwndDlg, IDC_External)) {
GetDlgItemText(hwndDlg, IDC_LOG, str, _countof(str));
db_set_ts(hContact, WEATHERPROTONAME, "Log", str);
@@ -458,7 +458,7 @@ int ContactDeleted(WPARAM wParam, LPARAM) ptrT tszNick(db_get_tsa(hContact, WEATHERPROTONAME, "Nick"));
if (tszNick != NULL) {
TCHAR str[255];
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), (TCHAR*)tszNick);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), (TCHAR*)tszNick);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
db_set_ts(NULL, WEATHERPROTONAME, "Default", opt.Default);
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp index b77cb46500..e889d63e2d 100644 --- a/plugins/Weather/src/weather_conv.cpp +++ b/plugins/Weather/src/weather_conv.cpp @@ -390,7 +390,7 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data) do {
j++;
// using the format _T("# Weather <condition name> <counter> #"
- mir_sntprintf(LangPackStr, _countof(LangPackStr), _T("# Weather %s %i #"), statusStr[i], j);
+ mir_sntprintf(LangPackStr, _T("# Weather %s %i #"), statusStr[i], j);
_tcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1));
if (_tcsstr(cond, LangPackStr1) != NULL)
@@ -545,7 +545,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) name[0] = 0;
// read the entire variable name
while (dis[i] != ']' && i < mir_tstrlen(dis)) {
- mir_snprintf(temp, _countof(temp), "%c", dis[i++]);
+ mir_snprintf(temp, "%c", dis[i++]);
mir_strcat(name, temp);
}
// access the database to get its value
@@ -559,7 +559,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str) }
// if the character is not a variable, write the original character to the new string
else {
- mir_sntprintf(lpzDate, _countof(lpzDate), _T("%c"), dis[i]);
+ mir_sntprintf(lpzDate, _T("%c"), dis[i]);
mir_tstrcat(str, lpzDate);
}
}
@@ -632,7 +632,7 @@ TCHAR *GetError(int code) case 503: str = E503; break;
case 504: str = E504; break;
default:
- mir_sntprintf(str2, _countof(str2), TranslateT("HTTP Error %i"), code);
+ mir_sntprintf(str2, TranslateT("HTTP Error %i"), code);
str = str2;
break;
}
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp index c1c5a53168..c9303092ad 100644 --- a/plugins/Weather/src/weather_data.cpp +++ b/plugins/Weather/src/weather_data.cpp @@ -154,7 +154,7 @@ void EraseAllInfo() opt.DefStn = hContact;
if (!db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
@@ -181,7 +181,7 @@ void EraseAllInfo() }
opt.DefStn = LastContact;
if (!db_get_ts(LastContact, WEATHERPROTONAME, "Nick", &dbv)) {
- mir_sntprintf(str, _countof(str), TranslateT("%s is now the default weather station"), dbv.ptszVal);
+ mir_sntprintf(str, TranslateT("%s is now the default weather station"), dbv.ptszVal);
db_free(&dbv);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONINFORMATION);
}
diff --git a/plugins/Weather/src/weather_icons.cpp b/plugins/Weather/src/weather_icons.cpp index 8b69cffcd0..68d162e8fc 100644 --- a/plugins/Weather/src/weather_icons.cpp +++ b/plugins/Weather/src/weather_icons.cpp @@ -45,7 +45,7 @@ void InitIcons(void) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", WEATHERPROTONAME, name);
+ mir_snprintf(szSettingName, "%s_%s", WEATHERPROTONAME, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/plugins/Weather/src/weather_info.cpp b/plugins/Weather/src/weather_info.cpp index 590150dc36..b1eba54fea 100644 --- a/plugins/Weather/src/weather_info.cpp +++ b/plugins/Weather/src/weather_info.cpp @@ -147,12 +147,12 @@ void GetINIInfo(TCHAR *pszSvc) WIDATA *sData = GetWIData(pszSvc);
// if the service does not exist among the loaded INI's
if (sData == NULL) {
- mir_sntprintf(str2, _countof(str2), TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc);
+ mir_sntprintf(str2, TranslateT("The corresponding INI file for \"%s\" is not found."), pszSvc);
MessageBox(NULL, str2, TranslateT("Weather INI information"), MB_OK | MB_ICONINFORMATION);
}
// if exist, get the information
else {
- mir_sntprintf(str2, _countof(str2), TranslateT("Weather INI information for \"%s\":"), pszSvc);
+ mir_sntprintf(str2, TranslateT("Weather INI information for \"%s\":"), pszSvc);
mir_tstrncat(str2, _T("\n\n"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, TranslateT("Name:"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, _T("\t\t"), _countof(str2) - mir_tstrlen(str2));
@@ -187,9 +187,9 @@ void GetINIInfo(TCHAR *pszSvc) mir_tstrncat(str2, sData->ShortFileName, _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, _T("\n"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, TranslateT("Item Count:"), _countof(str2) - mir_tstrlen(str2));
- mir_sntprintf(str2, _countof(str2), _T("%s\t%i\n"), str2, sData->UpdateDataCount);
+ mir_sntprintf(str2, _T("%s\t%i\n"), str2, sData->UpdateDataCount);
mir_tstrncat(str2, TranslateT("Memory Used:"), _countof(str2) - mir_tstrlen(str2));
- mir_sntprintf(str2, _countof(str2), _T("%s\t%i "), str2, sData->MemUsed);
+ mir_sntprintf(str2, _T("%s\t%i "), str2, sData->MemUsed);
mir_tstrncat(str2, TranslateT("bytes"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, _T("\n\n"), _countof(str2) - mir_tstrlen(str2));
mir_tstrncat(str2, TranslateT("Description:"), _countof(str2) - mir_tstrlen(str2));
@@ -219,7 +219,7 @@ void MoreVarList(void) // the custom variable is defined as "%[<variable name>]"
// ignore the "hi" item and hidden items
if (mir_tstrcmp(WItem->Item.Name, _T("Ignore")) && WItem->Item.Name[0] != '#') {
- mir_sntprintf(tempstr, _countof(tempstr), _T("%c[%s]"), '%', WItem->Item.Name);
+ mir_sntprintf(tempstr, _T("%c[%s]"), '%', WItem->Item.Name);
TCHAR *find = _tcsstr(str, tempstr);
// if the custom variable does not exist in the list, add it to the list
if (find == NULL) {
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index e69bc56fda..0775fff823 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -268,7 +268,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data) Data->InternalVer = 7;
else {
TCHAR str[4096];
- mir_sntprintf(str, _countof(str), TranslateT("Invalid ini format for: %s"), pszFile);
+ mir_sntprintf(str, TranslateT("Invalid ini format for: %s"), pszFile);
MessageBox(NULL, str, TranslateT("Weather Protocol"), MB_OK | MB_ICONERROR);
fclose(pfile);
return;
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index b92291fa17..2dc78a8975 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -243,7 +243,7 @@ static void addWindow(MCONTACT hContact) db_get_ts(hContact, WEATHERPROTONAME, "Nick", &dbv);
TCHAR winname[512];
- mir_sntprintf(winname, _countof(winname), _T("Weather: %s"), dbv.ptszVal);
+ mir_sntprintf(winname, _T("Weather: %s"), dbv.ptszVal);
db_free(&dbv);
HWND hWnd = CreateWindow(_T("WeatherFrame"), _T(""), WS_CHILD | WS_VISIBLE,
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index f1a027ae19..d8dd8ccf8e 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -147,12 +147,12 @@ INT_PTR WeatherGetAvatarInfo(WPARAM, LPARAM lParam) return GAIR_NOAVATAR;
pai->format = PA_FORMAT_PNG;
- mir_sntprintf(pai->filename, _countof(pai->filename), _T("%s\\Plugins\\Weather\\%s.png"), szSearchPath, statusStr[i]);
+ mir_sntprintf(pai->filename, _T("%s\\Plugins\\Weather\\%s.png"), szSearchPath, statusStr[i]);
if (_taccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
pai->format = PA_FORMAT_GIF;
- mir_sntprintf(pai->filename, _countof(pai->filename), _T("%s\\Plugins\\Weather\\%s.gif"), szSearchPath, statusStr[i]);
+ mir_sntprintf(pai->filename, _T("%s\\Plugins\\Weather\\%s.gif"), szSearchPath, statusStr[i]);
if (_taccess(pai->filename, 4) == 0)
return GAIR_SUCCESS;
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index a213106160..a01a2d19fe 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -106,7 +106,7 @@ int UpdateWeather(MCONTACT hContact) if (!dbres && dbv.ptszVal[0] != 0) {
if (opt.AlertPopup && !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0) && Ch) {
// display alert popup
- mir_sntprintf(str, _countof(str), _T("Alert for %s%c%s"), winfo.city, 255, dbv.ptszVal);
+ mir_sntprintf(str, _T("Alert for %s%c%s"), winfo.city, 255, dbv.ptszVal);
WPShowMessage(str, SM_WEATHERALERT);
}
// alert issued, set display to italic
@@ -410,19 +410,19 @@ int GetWeatherData(MCONTACT hContact) // generate update URL
switch (i) {
case 0:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL, _T2A(id));
break;
case 1:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL2, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL2, _T2A(id));
break;
case 2:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL3, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL3, _T2A(id));
break;
case 3:
- mir_snprintf(loc, _countof(loc), Data->UpdateURL4, _T2A(id));
+ mir_snprintf(loc, Data->UpdateURL4, _T2A(id));
break;
default:
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index e0174d74a7..281b1aa8e9 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -145,7 +145,7 @@ extern "C" int __declspec(dllexport) Load() // register netlib handle
char tempNdesc[50];
- mir_snprintf(tempNdesc, _countof(tempNdesc), "%s connection settings", MODULENAME);
+ mir_snprintf(tempNdesc, "%s connection settings", MODULENAME);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
@@ -216,7 +216,7 @@ extern "C" int __declspec(dllexport) Load() CreateServiceFunction("Countdown", CountdownMenuCommand);
mi.flags |= CMIF_KEEPUNTRANSLATED;
TCHAR countername[100];
- mir_sntprintf(countername, _countof(countername), TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
mi.position = 600090099;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
mi.name.t = countername;
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index dc2adfdbf9..361afbba7c 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -64,7 +64,7 @@ void ChangeMenuItemCountdown() HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
TCHAR countername[100];
- mir_sntprintf(countername, _countof(countername), TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
+ mir_sntprintf(countername, TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED);
}
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index b790468edb..706c6b8627 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -126,9 +126,9 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) TCHAR *displaytext = (TCHAR*)lParam;
if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE))
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), displaytext);
+ mir_sntprintf(ppd.lptzText, displaytext);
else if (mir_tstrlen(displaytext) < MAX_SECONDLINE)
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), displaytext);
+ mir_sntprintf(ppd.lptzText, displaytext);
if ( db_get_b(NULL, MODULENAME, POP_USECUSTCLRS_KEY, 0)) {
ppd.colorBack = db_get_dw(NULL, MODULENAME, POP_BG_CLR_KEY, Def_color_bg);
@@ -169,7 +169,7 @@ int OSDAlert(WPARAM hContact, LPARAM lParam) strncpy_s(contactname, _countof(contactname), MODULENAME, _TRUNCATE);
char *displaytext = (char*)lParam;
- mir_snprintf(newdisplaytext, _countof(newdisplaytext), "%s: %s", contactname, Translate(displaytext));
+ mir_snprintf(newdisplaytext, "%s: %s", contactname, Translate(displaytext));
if (ServiceExists("OSD/Announce"))
CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
@@ -188,11 +188,11 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_sntprintf(newdisplaytext, _countof(newdisplaytext), _T("%s\n%s"), ptszContactName, displaytext);
+ mir_sntprintf(newdisplaytext, _T("%s\n%s"), ptszContactName, displaytext);
PUShowMessageT(newdisplaytext, SM_WARNING);
}
else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- mir_sntprintf(newdisplaytext, _countof(newdisplaytext), _T("%s: %s"), ptszContactName, TranslateTS(displaytext));
+ mir_sntprintf(newdisplaytext, _T("%s: %s"), ptszContactName, TranslateTS(displaytext));
CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
}
else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
@@ -237,10 +237,10 @@ void SaveToFile(MCONTACT hContact, char *truncated) time_t ftime = time(NULL);
struct tm *nTime = localtime(&ftime);
- mir_snprintf(timeprefix, _countof(timeprefix), " %s ", Translate("Last updated on"));
+ mir_snprintf(timeprefix, " %s ", Translate("Last updated on"));
strftime(temptime1, 32, " %a, %b %d, %Y ", nTime);
strftime(temptime2, 32, " %I:%M %p.", nTime);
- mir_snprintf(timestring, _countof(timestring), "(%s)%s\n%s,%s\n", MODULENAME, url, temptime1, temptime2);
+ mir_snprintf(timestring, "(%s)%s\n%s,%s\n", MODULENAME, url, temptime1, temptime2);
fputs(timestring, pfile);
fwrite(truncated, mir_strlen(truncated), 1, pfile);
@@ -357,7 +357,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn //
if ((!notpresent)) {
if (alertIndex == 0) { // popup
- mir_sntprintf(displaystring, _countof(displaystring), _T("%s \"%S\" %s."), Translate("The string"), alertstring, Translate("has been found on the web page"));
+ mir_sntprintf(displaystring, _T("%s \"%S\" %s."), Translate("The string"), alertstring, Translate("has been found on the web page"));
WAlertPopup(hContact, displaystring);
// contactlist name//
@@ -397,7 +397,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
}
else if (alertIndex == 3) {
- mir_sntprintf(displaystring, _countof(displaystring), _T("%s \"%s\" %s."), TranslateT("The string"), alertstring, TranslateT("has been found on the web page"));
+ mir_sntprintf(displaystring, _T("%s \"%s\" %s."), TranslateT("The string"), alertstring, TranslateT("has been found on the web page"));
WAlertOSD(hContact, displaystring);
// contactlist name//
@@ -426,9 +426,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
+ mir_sntprintf(cachedirectorypath, _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
+ mir_sntprintf(newcachepath, _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
if ( _taccess(newcachepath, 0) != -1) {
if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
@@ -638,9 +638,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn cacheend++;
*cacheend = '\0';
- mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
+ mir_sntprintf(cachedirectorypath, _T("%s%S%S"), cachepath, MODULENAME, "cache\\");
CreateDirectory(cachedirectorypath, NULL);
- mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
+ mir_sntprintf(newcachepath, _T("%s%S%S%S%S"), cachepath, MODULENAME, "cache\\", contactname, ".txt");
// file exists?
if ( _taccess(newcachepath, 0) != -1) {
if ((pcachefile = _tfopen(newcachepath, _T("r"))) == NULL)
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index ab59060515..a97f3c31e2 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -280,9 +280,9 @@ void GetData(void *param) strftime(temptime, 128, "(%b %d,%H:%M:%S)", nTime);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 1)
- mir_snprintf(tstr, _countof(tstr), "%s %s", temptime, dbv.pszVal);
+ mir_snprintf(tstr, "%s %s", temptime, dbv.pszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 0)
- mir_snprintf(tstr, _countof(tstr), "%s %s", dbv.pszVal, temptime);
+ mir_snprintf(tstr, "%s %s", dbv.pszVal, temptime);
db_free(&dbv);
}
else {
@@ -300,9 +300,9 @@ void GetData(void *param) db_set_ts(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.ptszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 1)
- mir_snprintf(tstr, _countof(tstr), "%s %s", temptime, dbv.pszVal);
+ mir_snprintf(tstr, "%s %s", temptime, dbv.pszVal);
if (db_get_b(hContact, MODULENAME, CONTACT_PREFIX_KEY, 1) == 0)
- mir_snprintf(tstr, _countof(tstr), "%s %s", dbv.pszVal, temptime);
+ mir_snprintf(tstr, "%s %s", dbv.pszVal, temptime);
db_free(&dbv);
}
@@ -313,7 +313,7 @@ void GetData(void *param) strncpy_s(timeat, _countof(timeat), Translate("at the time"), _TRUNCATE);
strftime(temptime1, 32, " %a, %b %d, %Y ", nTime);
strftime(temptime2, 32, " %I:%M %p.", nTime);
- mir_snprintf(timestring, _countof(timestring), " %s %s%s%s", timeprefix, temptime1, timeat, temptime2);
+ mir_snprintf(timestring, " %s %s%s%s", timeprefix, temptime1, timeat, temptime2);
} // end download success
if (DownloadSuccess) {
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index b4b45bd99e..1adf9ccb7c 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -64,7 +64,7 @@ TCHAR* FixButtonText(TCHAR *url, size_t len) int posafter = (stringafter - buttontext) + 1;
strdel(stringafter, 1);
_tcsncpy_s(stringbefore, pos, buttontext, _TRUNCATE);
- mir_sntprintf(newbuttontext, _countof(buttontext), _T("%s!!%s"), stringbefore, stringafter);
+ mir_sntprintf(newbuttontext, _T("%s!!%s"), stringbefore, stringafter);
posafter = 0;
posbefore = 0;
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index 80472ae058..6fd09544a1 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -85,12 +85,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) TCHAR *cacheend = _tcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); + mir_sntprintf(cachedirectorypath, _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); CreateDirectory(cachedirectorypath, NULL); TCHAR newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; - mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, oldName); - mir_sntprintf(renamedcachepath, _countof(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, nick); + mir_sntprintf(newcachepath, _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, oldName); + mir_sntprintf(renamedcachepath, _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, nick); // file exists? if ( _taccess(newcachepath, 0) != -1) { @@ -124,9 +124,9 @@ int SiteDeleted(WPARAM wParam, LPARAM) cacheend++; *cacheend = '\0'; - mir_sntprintf(cachedirectorypath, _countof(cachedirectorypath), _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); + mir_sntprintf(cachedirectorypath, _T("%s")_T(MODULENAME)_T("cache\\"), cachepath); CreateDirectory(cachedirectorypath, NULL); - mir_sntprintf(newcachepath, _countof(newcachepath), _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, contactName); + mir_sntprintf(newcachepath, _T("%s")_T(MODULENAME)_T("cache\\%s.txt"), cachepath, contactName); // file exists? if ( _taccess(newcachepath, 0) != -1) { FILE *pcachefile = _tfopen(newcachepath, _T("r")); diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 932ba2a47f..34b2f11524 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara SetDlgItemText(hWnd, IDC_DAYS_IN_ADVANCE, buffer);
_itot(commonData.checkInterval, buffer, 10);
SetDlgItemText(hWnd, IDC_CHECK_INTERVAL, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
+ mir_sntprintf(buffer, _T("%d|%d"), commonData.popupTimeout, commonData.popupTimeoutToday);
SetDlgItemText(hWnd, IDC_POPUP_TIMEOUT, buffer);
_itot(commonData.cSoundNearDays, buffer, 10);
SetDlgItemText(hWnd, IDC_SOUND_NEAR_DAYS_EDIT, buffer);
@@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l char *szProto = GetContactProto(hContact);
TCHAR buffer[2048];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(buffer, TranslateT("Set birthday for %s:"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hWnd, buffer);
HWND hDate = GetDlgItem(hWnd, IDC_DATE);
@@ -441,7 +441,7 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l case DOB_PROTOCOL:
DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
- mir_sntprintf(buffer, _countof(buffer), TranslateT("%S protocol"), szProto);
+ mir_sntprintf(buffer, TranslateT("%S protocol"), szProto);
szCurrentModuleTooltip = buffer;
break;
@@ -609,22 +609,22 @@ int UpdateBirthdayEntry(HWND hList, MCONTACT hContact, int entry, int bShowAll, TCHAR buffer[2048];
if ((dtb <= 366) && (dtb >= 0))
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), dtb);
+ mir_sntprintf(buffer, _T("%d"), dtb);
else
- mir_sntprintf(buffer, _countof(buffer), NA);
+ mir_sntprintf(buffer, NA);
ListView_SetItemText(hList, entry, 2, buffer);
if ((month != 0) && (day != 0))
- mir_sntprintf(buffer, _countof(buffer), _T("%04d-%02d-%02d"), year, month, day);
+ mir_sntprintf(buffer, _T("%04d-%02d-%02d"), year, month, day);
else
- mir_sntprintf(buffer, _countof(buffer), NA);
+ mir_sntprintf(buffer, NA);
ListView_SetItemText(hList, entry, 3, buffer);
if (age < 400 && age > 0) //hopefully noone lives longer than this :)
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), age);
+ mir_sntprintf(buffer, _T("%d"), age);
else
- mir_sntprintf(buffer, _countof(buffer), NA);
+ mir_sntprintf(buffer, NA);
ListView_SetItemText(hList, entry, 4, buffer);
ListView_SetItemText(hList, entry, 5, GetBirthdayModule(module, hContact));
@@ -694,7 +694,7 @@ void SetBirthdaysCount(HWND hWnd) {
int count = ListView_GetItemCount((GetDlgItem(hWnd, IDC_BIRTHDAYS_LIST)));
TCHAR title[512];
- mir_sntprintf(title, _countof(title), TranslateT("Birthday list (%d)"), count);
+ mir_sntprintf(title, TranslateT("Birthday list (%d)"), count);
SetWindowText(hWnd, title);
}
@@ -881,7 +881,7 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar const int MAX_SIZE = 512;
TCHAR buffer[MAX_SIZE];
timeout--;
- mir_sntprintf(buffer, _countof(buffer), (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
+ mir_sntprintf(buffer, (timeout != 2) ? TranslateT("Closing in %d seconds") : TranslateT("Closing in %d second"), timeout);
SetDlgItemText(hWnd, IDC_CLOSE, buffer);
if (timeout <= 0)
@@ -914,9 +914,9 @@ INT_PTR CALLBACK DlgProcUpcoming(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPar ListView_InsertItem(hList, &item);
TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->age);
+ mir_sntprintf(buffer, _T("%d"), data->age);
ListView_SetItemText(hList, index, 1, buffer);
- mir_sntprintf(buffer, _countof(buffer), _T("%d"), data->dtb);
+ mir_sntprintf(buffer, _T("%d"), data->dtb);
ListView_SetItemText(hList, index, 2, buffer);
BirthdaysSortParams params = { 0 };
diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 13a2e17350..131d97ed06 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -60,10 +60,10 @@ int AddIcons() hDTB[1] = AddIcon("DTB1", LPGEN("1 day to birthday"), tszPath, IDI_DTB1);
for (int i = 2; i < cDTB; i++) {
mir_snprintf(name, "DTB%d", i);
- mir_snprintf(description, _countof(description), Translate("%d days to birthday"), i);
+ mir_snprintf(description, Translate("%d days to birthday"), i);
hDTB[i] = AddIcon(name, description, tszPath, IDI_DTB0 + i);
}
- mir_snprintf(description, _countof(description), Translate("More than %d days to birthday"), cDTB - 1);
+ mir_snprintf(description, Translate("More than %d days to birthday"), cDTB - 1);
hDTBMore = AddIcon("DTBMore", description, tszPath, IDI_DTBMORE);
hWWIExtraIcons = ExtraIcon_RegisterIcolib("WhenWasIt", LPGEN("WhenWasIt birthday reminder"), "MenuCheck");
diff --git a/plugins/WhenWasIt/src/services.cpp b/plugins/WhenWasIt/src/services.cpp index 793364088e..e541836bbf 100644 --- a/plugins/WhenWasIt/src/services.cpp +++ b/plugins/WhenWasIt/src/services.cpp @@ -215,7 +215,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c"), TranslateT("Birthdays files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -224,7 +224,7 @@ INT_PTR ImportBirthdaysService(WPARAM, LPARAM) if (GetOpenFileName(&of)) {
TCHAR buffer[2048];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Importing birthdays from file: %s"), fileName);
+ mir_sntprintf(buffer, TranslateT("Importing birthdays from file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hImportBirthdays);
DoImport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done importing birthdays"), hImportBirthdays);
@@ -240,7 +240,7 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) of.lStructSize = sizeof(OPENFILENAME);
//of.hInstance = hInstance;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*") _T(BIRTHDAY_EXTENSION) _T(")%c*") _T(BIRTHDAY_EXTENSION) _T("%c%s (*.*)%c*.*%c"), TranslateT("Birthdays files"), 0, 0, TranslateT("All Files"), 0, 0);
of.lpstrFilter = filter;
of.lpstrFile = fileName;
of.nMaxFile = _countof(fileName);
@@ -252,7 +252,7 @@ INT_PTR ExportBirthdaysService(WPARAM, LPARAM) if (!_tcschr(fn, _T('.')))
mir_tstrcat(fileName, _T(BIRTHDAY_EXTENSION));
- mir_sntprintf(buffer, _countof(buffer), TranslateT("Exporting birthdays to file: %s"), fileName);
+ mir_sntprintf(buffer, TranslateT("Exporting birthdays to file: %s"), fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), buffer, hExportBirthdays);
DoExport(fileName);
ShowPopupMessage(TranslateT("WhenWasIt"), TranslateT("Done exporting birthdays"), hExportBirthdays);
diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 245394f1ef..8018101d68 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -155,17 +155,17 @@ TCHAR* GetContactID(MCONTACT hContact, char *szProto) TCHAR tmp[16];
switch (ctInfo.type) {
case CNFT_BYTE:
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.bVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.bVal);
buffer = _tcsdup(tmp);
break;
case CNFT_WORD:
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.wVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.wVal);
buffer = _tcsdup(tmp);
break;
case CNFT_DWORD:
- mir_sntprintf(tmp, _countof(tmp), _T("%ld"), ctInfo.dVal);
+ mir_sntprintf(tmp, _T("%ld"), ctInfo.dVal);
buffer = _tcsdup(tmp);
break;
diff --git a/plugins/WhoUsesMyFiles/src/list.cpp b/plugins/WhoUsesMyFiles/src/list.cpp index 25f1230b8f..b02d918ef1 100644 --- a/plugins/WhoUsesMyFiles/src/list.cpp +++ b/plugins/WhoUsesMyFiles/src/list.cpp @@ -24,7 +24,7 @@ PWumf new_wumf( DWORD dwID, case PERM_FILE_CREATE: mir_tstrcpy(w->szPerm, _T("Create"));break;
default: mir_tstrcpy(w->szPerm, _T("Execute"));
}
- mir_sntprintf(w->szID, _countof(w->szID), _T("%i"), dwID);
+ mir_sntprintf(w->szID, _T("%i"), dwID);
w->dwID = dwID;
w->dwSess = dwSess;
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp index 5cd34db33e..17e89fbc6b 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.cpp +++ b/plugins/WhoUsesMyFiles/src/wumf.cpp @@ -140,7 +140,7 @@ void LogWumf(PWumf w) hLogger = mir_createLog("wumf", _T("WhoIsUsingMyFiles log file"), WumfOptions.LogFile, 0);
if (hLogger == NULL) {
TCHAR str[256];
- mir_sntprintf(str, _countof(str), _T("Can't open log file %s"), WumfOptions.LogFile);
+ mir_sntprintf(str, _T("Can't open log file %s"), WumfOptions.LogFile);
MessageBox(NULL, str, TranslateT("Error opening file"), MB_OK | MB_ICONSTOP);
WumfOptions.LogToFile = FALSE;
return;
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index f2fb9c2ad7..e86b29d08e 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -119,7 +119,7 @@ void ShowWumfPopup(PWumf w) TCHAR text[512], title[512];
if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
- mir_sntprintf(title, _countof(title), _T("%s (%s)"), w->szComp, w->szUser);
+ mir_sntprintf(title, _T("%s (%s)"), w->szComp, w->szUser);
mir_sntprintf(text, _T("%s (%s)"), w->szPath, w->szPerm);
ShowThePopup(w, title, text);
}
@@ -274,7 +274,7 @@ void ChooseFile(HWND hwndDlg) }
else if (CommDlgExtendedError() != 0) {
TCHAR str[256];
- mir_sntprintf(str, _countof(str), TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
+ mir_sntprintf(str, TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
MessageBox(hwndDlg, str, TranslateT("Error"), MB_OK | MB_ICONSTOP);
}
}
diff --git a/plugins/XSoundNotify/src/dialog.cpp b/plugins/XSoundNotify/src/dialog.cpp index 6de7c5a28e..072e063b65 100644 --- a/plugins/XSoundNotify/src/dialog.cpp +++ b/plugins/XSoundNotify/src/dialog.cpp @@ -45,7 +45,7 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP TCHAR *nick = (TCHAR *)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR value[100];
- mir_sntprintf(value, _countof(value), TranslateT("Custom sound for %s (%s)"), nick, uid);
+ mir_sntprintf(value, TranslateT("Custom sound for %s (%s)"), nick, uid);
SetWindowText(hwndDlg, value);
db_free(&dbvuid);
}
@@ -100,9 +100,9 @@ static INT_PTR CALLBACK DlgProcContactsOptions(HWND hwndDlg, UINT msg, WPARAM wP ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index 0df84c1e80..45174298eb 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -122,9 +122,9 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ofn.lStructSize = sizeof(ofn);
TCHAR tmp[MAX_PATH];
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%c"), TranslateT("Sound files"), 0, 0, 0);
else
- mir_sntprintf(tmp, _countof(tmp), _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
+ mir_sntprintf(tmp, _T("%s (*.wav)%c*.wav%c%c"), TranslateT("WAV files"), 0, 0, 0);
ofn.lpstrFilter = tmp;
ofn.hwndOwner = 0;
ofn.lpstrFile = FileName;
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index baea4559fd..c1b6afc31f 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -74,10 +74,10 @@ void InitSelfSounds() for (int i = 0; i < protoCount; i++) {
for (int j = 0; j < _countof(selfSounds); j++) {
char namebuf[128];
- mir_snprintf(namebuf, _countof(namebuf), "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
+ mir_snprintf(namebuf, "%s%s", protos[i]->szModuleName, selfSounds[j].szName);
TCHAR infobuf[256];
- mir_sntprintf(infobuf, _countof(infobuf), _T("%s [%s]"), TranslateT("Self status"), protos[i]->tszAccountName);
+ mir_sntprintf(infobuf, _T("%s [%s]"), TranslateT("Self status"), protos[i]->tszAccountName);
SkinAddNewSoundExT(namebuf, infobuf, pcli->pfnGetStatusModeDescription(selfSounds[j].iStatus, 0));
}
}
diff --git a/plugins/YAMN/src/account.cpp b/plugins/YAMN/src/account.cpp index 230f9e089b..e9d3f715a4 100644 --- a/plugins/YAMN/src/account.cpp +++ b/plugins/YAMN/src/account.cpp @@ -227,7 +227,7 @@ DWORD ReadStringFromMemory(char **Parser,TCHAR *End,char **StoreTo,TCHAR *DebugS Finder=*Parser; while((*Finder != (TCHAR)0) && (Finder<=End)) Finder++; - mir_sntprintf(Debug, _countof(Debug), _T("%s: %s,length is %d, remaining %d chars"), DebugString, *Parser, Finder-*Parser, End-Finder); + mir_sntprintf(Debug, _T("%s: %s,length is %d, remaining %d chars"), DebugString, *Parser, Finder-*Parser, End-Finder); MessageBox(NULL,Debug,_T("debug"),MB_OK); if (Finder>=End) return EACC_FILECOMPATIBILITY; @@ -282,7 +282,7 @@ DWORD ReadStringFromMemoryW(WCHAR **Parser,TCHAR *End,WCHAR **StoreTo,WCHAR *Deb Finder=*Parser; while((*Finder != (WCHAR)0) && (Finder<=(WCHAR *)End)) Finder++; - mir_sntprintf(Debug, _countof(Debug), L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); + mir_sntprintf(Debug, L"%s: %s,length is %d, remaining %d chars", DebugString, *Parser, Finder-*Parser, (WCHAR *)End-Finder); MessageBoxW(NULL,Debug,L"debug",MB_OK); if (Finder>=(WCHAR *)End) return EACC_FILECOMPATIBILITY; @@ -338,7 +338,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("NFlags: %04x, remaining %d chars"), Which->Flags, End-*Parser); + mir_sntprintf(Debug, _T("NFlags: %04x, remaining %d chars"), Which->Flags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -347,7 +347,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PopupB: %04x, remaining %d chars"), Which->PopupB, End-*Parser); + mir_sntprintf(Debug, _T("PopupB: %04x, remaining %d chars"), Which->PopupB, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->PopupT = *(COLORREF *)(*Parser); @@ -355,7 +355,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PopupT: %04x, remaining %d chars"), Which->PopupT, End-*Parser); + mir_sntprintf(Debug, _T("PopupT: %04x, remaining %d chars"), Which->PopupT, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->PopupTime = *(DWORD *)(*Parser); @@ -363,7 +363,7 @@ static DWORD ReadNotificationFromMemory(char **Parser, char *End, YAMN_NOTIFICAT if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PopupTime: %04x, remaining %d chars"), Which->PopupTime, End-*Parser); + mir_sntprintf(Debug, _T("PopupTime: %04x, remaining %d chars"), Which->PopupTime, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -513,7 +513,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("Port: %d, remaining %d chars"), Which->Server->Port, End-*Parser); + mir_sntprintf(Debug, _T("Port: %d, remaining %d chars"), Which->Server->Port, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif #ifdef DEBUG_FILEREAD @@ -536,19 +536,19 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("Flags: %04x, remaining %d chars"), Which->Flags, End-*Parser); + mir_sntprintf(Debug, _T("Flags: %04x, remaining %d chars"), Which->Flags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->StatusFlags = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("STFlags: %04x, remaining %d chars"), Which->StatusFlags, End-*Parser); + mir_sntprintf(Debug, _T("STFlags: %04x, remaining %d chars"), Which->StatusFlags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->PluginFlags = *(DWORD *)(*Parser); (*Parser) += sizeof(DWORD); #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("PFlags: %04x, remaining %d chars"), Which->PluginFlags, End-*Parser); + mir_sntprintf(Debug, _T("PFlags: %04x, remaining %d chars"), Which->PluginFlags, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -559,7 +559,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("Interval: %d, remaining %d chars"), Which->Interval, End-*Parser); + mir_sntprintf(Debug, _T("Interval: %d, remaining %d chars"), Which->Interval, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif @@ -602,7 +602,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastChecked: %04x, remaining %d chars"), Which->LastChecked, End-*Parser); + mir_sntprintf(Debug, _T("LastChecked: %04x, remaining %d chars"), Which->LastChecked, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->LastSChecked = *(SYSTEMTIME *)(*Parser); @@ -610,7 +610,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastSChecked: %04x, remaining %d chars"), Which->LastSChecked, End-*Parser); + mir_sntprintf(Debug, _T("LastSChecked: %04x, remaining %d chars"), Which->LastSChecked, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->LastSynchronised = *(SYSTEMTIME *)(*Parser); @@ -618,7 +618,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End) return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastSynchronised: %04x, remaining %d chars"), Which->LastSynchronised, End-*Parser); + mir_sntprintf(Debug, _T("LastSynchronised: %04x, remaining %d chars"), Which->LastSynchronised, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif Which->LastMail = *(SYSTEMTIME *)(*Parser); @@ -626,7 +626,7 @@ DWORD ReadAccountFromMemory(HACCOUNT Which, char **Parser, char *End) if (*Parser > End) //WARNING! There's only > at the end of testing return EACC_FILECOMPATIBILITY; #ifdef DEBUG_FILEREAD - mir_sntprintf(Debug, _countof(Debug), _T("LastMail: %04x, remaining %d chars"), Which->LastMail, End-*Parser); + mir_sntprintf(Debug, _T("LastMail: %04x, remaining %d chars"), Which->LastMail, End-*Parser); MessageBox(NULL,Debug,_T("debug"),MB_OK); #endif if (*Parser == End) diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index c32601f70b..1b0d7f5cac 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -569,7 +569,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, DWORD nflags) SendMessageW(hListView, LVM_SETITEMTEXTW, (WPARAM)item.iItem, (LPARAM)&item); item.iSubItem = 2; - mir_sntprintf(SizeStr, _countof(SizeStr), L"%d kB", msgq->MailData->Size / 1024); + mir_sntprintf(SizeStr, L"%d kB", msgq->MailData->Size / 1024); item.pszText = SizeStr; SendMessageW(hListView, LVM_SETITEMTEXTW, (WPARAM)item.iItem, (LPARAM)&item); @@ -636,7 +636,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun)) { char sMsg[250]; - mir_snprintf(sMsg, _countof(sMsg), Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_snprintf(sMsg, Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); if (!(nflags & YAMN_ACC_CONTNOEVENT)) { CLISTEVENT cEvent; cEvent.cbSize = sizeof(CLISTEVENT); @@ -671,7 +671,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D NewMailPopup.PluginData = (void *)0; //multiple popups mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName)); - mir_sntprintf(NewMailPopup.lptzText, _countof(NewMailPopup.lptzText), TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); + mir_sntprintf(NewMailPopup.lptzText, TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); PUAddPopupT(&NewMailPopup); } @@ -767,7 +767,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D mir_tstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName)); if (MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC) - mir_sntprintf(NoNewMailPopup.lptzText, _countof(NoNewMailPopup.lptzText), TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC); + mir_sntprintf(NoNewMailPopup.lptzText, TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC); else mir_tstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText)); PUAddPopupT(&NoNewMailPopup); @@ -2045,7 +2045,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR if (Total) { TCHAR DeleteMsg[1024]; - mir_sntprintf(DeleteMsg, _countof(DeleteMsg), TranslateT("Do you really want to delete %d selected mails?"), Total); + mir_sntprintf(DeleteMsg, TranslateT("Do you really want to delete %d selected mails?"), Total); if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING)) { struct DeleteParam ParamToDeleteMails = { YAMN_DELETEVERSION, ThreadRunningEV, ActualAccount, NULL }; diff --git a/plugins/YAMN/src/debug.cpp b/plugins/YAMN/src/debug.cpp index 96d61131bc..e074390fac 100644 --- a/plugins/YAMN/src/debug.cpp +++ b/plugins/YAMN/src/debug.cpp @@ -43,21 +43,21 @@ void InitDebug() InitializeCriticalSection(&FileAccessCS);
#ifdef DEBUG_SYNCHRO
- mir_sntprintf(DebugFileName, _countof(DebugFileName), DebugSynchroFileName2, DebugUserDirectory);
+ mir_sntprintf(DebugFileName, DebugSynchroFileName2, DebugUserDirectory);
SynchroFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(SynchroFile,"Synchro debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_COMM
- mir_sntprintf(DebugFileName, _countof(DebugFileName), DebugCommFileName2, DebugUserDirectory);
+ mir_sntprintf(DebugFileName, DebugCommFileName2, DebugUserDirectory);
CommFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(CommFile,"Communication debug file created by %s\n",YAMN_VER);
#endif
#ifdef DEBUG_DECODE
- mir_sntprintf(DebugFileName, _countof(DebugFileName), DebugDecodeFileName2, DebugUserDirectory);
+ mir_sntprintf(DebugFileName, DebugDecodeFileName2, DebugUserDirectory);
DecodeFile=CreateFile(DebugFileName,GENERIC_WRITE,FILE_SHARE_WRITE|FILE_SHARE_READ,NULL,CREATE_ALWAYS,0,NULL);
DebugLog(DecodeFile,"Decoding kernel debug file created by %s\n",YAMN_VER);
@@ -92,7 +92,7 @@ void DebugLog(HANDLE File,const char *fmt,...) va_start(vararg,fmt);
str=(char *)malloc(strsize=65536);
- mir_snprintf(tids, _countof(tids), "[%x]",GetCurrentThreadId());
+ mir_snprintf(tids, "[%x]",GetCurrentThreadId());
while(mir_vsnprintf(str, strsize, fmt, vararg)==-1)
str=(char *)realloc(str,strsize+=65536);
va_end(vararg);
@@ -113,7 +113,7 @@ void DebugLogW(HANDLE File,const WCHAR *fmt,...) va_start(vararg,fmt);
str=(WCHAR *)malloc((strsize=65536)*sizeof(WCHAR));
- mir_snprintf(tids, _countof(tids), "[%x]",GetCurrentThreadId());
+ mir_snprintf(tids, "[%x]",GetCurrentThreadId());
while(mir_vsnwprintf(str, strsize, fmt, vararg)==-1)
str=(WCHAR *)realloc(str,(strsize+=65536)*sizeof(WCHAR));
va_end(vararg);
diff --git a/plugins/YAMN/src/mails/mime.cpp b/plugins/YAMN/src/mails/mime.cpp index 906d18d776..bb1c420657 100644 --- a/plugins/YAMN/src/mails/mime.cpp +++ b/plugins/YAMN/src/mails/mime.cpp @@ -661,7 +661,7 @@ FailBackRaw: for (i=0;i<numparts;i++) {
if (i) { // part before first boudary should not have headers
char infoline[1024]; size_t linesize = 0;
- mir_snprintf(infoline, _countof(infoline), "%s %d", Translate("Part"), i);
+ mir_snprintf(infoline, "%s %d", Translate("Part"), i);
linesize = mir_strlen(infoline);
if (partData[i].TransEnc) {
mir_snprintf(infoline + linesize, _countof(infoline) - linesize, "; %s", partData[i].TransEnc);
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index bfccb134d9..bfca36fa74 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -203,7 +203,7 @@ void WINAPI g_ReleaseIcon( HICON hIcon ) static void LoadPlugins() { TCHAR szSearchPath[MAX_PATH]; - mir_sntprintf(szSearchPath, _countof(szSearchPath), _T("%s\\Plugins\\YAMN\\*.dll"), szMirandaDir); + mir_sntprintf(szSearchPath, _T("%s\\Plugins\\YAMN\\*.dll"), szMirandaDir); hDllPlugins = NULL; @@ -225,7 +225,7 @@ static void LoadPlugins() continue; TCHAR szPluginPath[MAX_PATH]; - mir_sntprintf(szPluginPath, _countof(szPluginPath),_T("%s\\Plugins\\YAMN\\%s"), szMirandaDir, fd.cFileName); + mir_sntprintf(szPluginPath, _T("%s\\Plugins\\YAMN\\%s"), szMirandaDir, fd.cFileName); HINSTANCE hDll = LoadLibrary(szPluginPath); if (hDll == NULL) continue; diff --git a/plugins/YAMN/src/proto/netlib.cpp b/plugins/YAMN/src/proto/netlib.cpp index 1fe773732d..1bad6db026 100644 --- a/plugins/YAMN/src/proto/netlib.cpp +++ b/plugins/YAMN/src/proto/netlib.cpp @@ -6,72 +6,71 @@ #include "..\stdafx.h"
-//--------------------------------------------------------------------------------------------------
-//--------------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------------------
-BOOL SSLLoaded=FALSE;
-HANDLE hNetlibUser=NULL;
+BOOL SSLLoaded = FALSE;
+HANDLE hNetlibUser = NULL;
void __stdcall SSL_DebugLog(const char *fmt, ...)
{
char str[4096];
va_list vararg;
- va_start( vararg, fmt );
+ va_start(vararg, fmt);
int tBytes = mir_vsnprintf(str, _countof(str), fmt, vararg);
- if ( tBytes == 0 )
+ if (tBytes == 0)
return;
- if ( tBytes > 0 )
- str[ tBytes ] = 0;
+ if (tBytes > 0)
+ str[tBytes] = 0;
else
- str[ sizeof(str)-1 ] = 0;
+ str[sizeof(str) - 1] = 0;
CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)str);
- va_end( vararg );
+ va_end(vararg);
}
HANDLE RegisterNLClient(const char *name)
{
- static NETLIBUSER nlu={0};
+ static NETLIBUSER nlu = { 0 };
char desc[128];
mir_snprintf(desc, Translate("%s connection"), name);
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<Register PROXY support>");
-#endif
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<Register PROXY support>");
+ #endif
nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
- nlu.szDescriptiveName=desc;
- nlu.szSettingsModule=(char *)name;
- hNetlibUser=(HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
-
-#ifdef DEBUG_COMM
- if (NULL==hNetlibUser)
- DebugLog(CommFile,"<error></Register PROXY support>\n");
+ nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS;
+ nlu.szDescriptiveName = desc;
+ nlu.szSettingsModule = (char *)name;
+ hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
+
+ #ifdef DEBUG_COMM
+ if (NULL == hNetlibUser)
+ DebugLog(CommFile, "<error></Register PROXY support>\n");
else
- DebugLog(CommFile,"</Register PROXY support>\n");
-#endif
+ DebugLog(CommFile, "</Register PROXY support>\n");
+ #endif
return hNetlibUser;
}
//Move connection to SSL
-void CNLClient::SSLify() throw(DWORD) {
-#ifdef DEBUG_COMM
+void CNLClient::SSLify() throw(DWORD)
+{
+ #ifdef DEBUG_COMM
SSL_DebugLog("Staring SSL...");
-#endif
+ #endif
int socket = CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConnection, 0);
- if (socket != INVALID_SOCKET)
- {
-#ifdef DEBUG_COMM
- SSL_DebugLog("Staring netlib core SSL");
-#endif
- if (CallService(MS_NETLIB_STARTSSL, (WPARAM)hConnection, 0))
- {
-#ifdef DEBUG_COMM
+ if (socket != INVALID_SOCKET) {
+ #ifdef DEBUG_COMM
+ SSL_DebugLog("Staring netlib core SSL");
+ #endif
+ if (CallService(MS_NETLIB_STARTSSL, (WPARAM)hConnection, 0)) {
+ #ifdef DEBUG_COMM
SSL_DebugLog("Netlib core SSL started");
-#endif
+ #endif
isTLSed = true;
SSLLoaded = TRUE;
return;
@@ -84,82 +83,76 @@ void CNLClient::SSLify() throw(DWORD) { //Connects to the server through the sock
//if not success, exception is throwed
-void CNLClient::Connect(const char* servername,const int port) throw(DWORD)
+void CNLClient::Connect(const char* servername, const int port) throw(DWORD)
{
NETLIBOPENCONNECTION nloc;
- NetworkError=SystemError=0;
+ NetworkError = SystemError = 0;
isTLSed = false;
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<connect>\n");
-#endif
- try
- {
- nloc.cbSize=sizeof(NETLIBOPENCONNECTION);
- nloc.szHost=servername;
- nloc.wPort=port;
- nloc.flags=0;
- if (NULL==(hConnection=(HANDLE)CallService(MS_NETLIB_OPENCONNECTION,(WPARAM)hNetlibUser,(LPARAM)&nloc)))
- {
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_CONNECT;
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<connect>\n");
+ #endif
+ try {
+ nloc.cbSize = sizeof(NETLIBOPENCONNECTION);
+ nloc.szHost = servername;
+ nloc.wPort = port;
+ nloc.flags = 0;
+ if (NULL == (hConnection = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)hNetlibUser, (LPARAM)&nloc))) {
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_CONNECT;
}
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"</connect>\n");
-#endif
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "</connect>\n");
+ #endif
return;
}
- catch(...)
- {
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<error></connect>\n");
-#endif
+ catch (...) {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<error></connect>\n");
+ #endif
throw;
}
}
//Performs a simple query
// query- command to send
-int CNLClient::LocalNetlib_Send(HANDLE hConn,const char *buf,int len,int flags) {
- if (isTLSed)
- {
-#ifdef DEBUG_COMM
+int CNLClient::LocalNetlib_Send(HANDLE hConn, const char *buf, int len, int flags)
+{
+ if (isTLSed) {
+ #ifdef DEBUG_COMM
SSL_DebugLog("SSL send: %s", buf);
-#endif
- }
-
- NETLIBBUFFER nlb={(char*)buf,len,flags};
- return CallService(MS_NETLIB_SEND,(WPARAM)hConn,(LPARAM)&nlb);
+ #endif
+ }
+
+ NETLIBBUFFER nlb = { (char*)buf,len,flags };
+ return CallService(MS_NETLIB_SEND, (WPARAM)hConn, (LPARAM)&nlb);
}
void CNLClient::Send(const char *query) throw(DWORD)
{
unsigned int Sent;
- if (NULL==query)
+ if (NULL == query)
return;
- if (hConnection==NULL)
+ if (hConnection == NULL)
return;
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<send>%s",query);
-#endif
- try
- {
- if ((SOCKET_ERROR==(Sent=LocalNetlib_Send(hConnection,query,(int)mir_strlen(query),MSG_DUMPASTEXT))) || Sent != (unsigned int)mir_strlen(query))
- {
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_SEND;
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<send>%s", query);
+ #endif
+ try {
+ if ((SOCKET_ERROR == (Sent = LocalNetlib_Send(hConnection, query, (int)mir_strlen(query), MSG_DUMPASTEXT))) || Sent != (unsigned int)mir_strlen(query)) {
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_SEND;
}
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"</send>\n");
-#endif
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "</send>\n");
+ #endif
}
- catch(...)
- {
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<error></send>\n");
-#endif
+ catch (...) {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<error></send>\n");
+ #endif
throw;
}
}
@@ -171,75 +164,69 @@ void CNLClient::Send(const char *query) throw(DWORD) //You need free() returned buffer, which can be allocated in this function
//if not success, exception is throwed
-int CNLClient::LocalNetlib_Recv(HANDLE hConn,char *buf,int len,int flags) {
- NETLIBBUFFER nlb={buf,len,flags};
- int iReturn = CallService(MS_NETLIB_RECV,(WPARAM)hConn,(LPARAM)&nlb);
- if (isTLSed)
- {
-#ifdef DEBUG_COMM
+int CNLClient::LocalNetlib_Recv(HANDLE hConn, char *buf, int len, int flags)
+{
+ NETLIBBUFFER nlb = { buf,len,flags };
+ int iReturn = CallService(MS_NETLIB_RECV, (WPARAM)hConn, (LPARAM)&nlb);
+ if (isTLSed) {
+ #ifdef DEBUG_COMM
SSL_DebugLog("SSL recv: %s", buf);
-#endif
+ #endif
}
-
+
return iReturn;
}
-char* CNLClient::Recv(char *buf,int buflen) throw(DWORD)
+char* CNLClient::Recv(char *buf, int buflen) throw(DWORD)
{
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<reading>");
-#endif
- try
- {
- if (buf==NULL)
- buf=(char *)malloc(sizeof(char)*(buflen+1));
- if (buf==NULL)
- throw NetworkError=(DWORD)ENL_RECVALLOC;
-
- if (!isTLSed)
- {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<reading>");
+ #endif
+ try {
+ if (buf == NULL)
+ buf = (char *)malloc(sizeof(char)*(buflen + 1));
+ if (buf == NULL)
+ throw NetworkError = (DWORD)ENL_RECVALLOC;
+
+ if (!isTLSed) {
NETLIBSELECT nls;
memset(&nls, 0, sizeof(NETLIBSELECT));
nls.cbSize = sizeof(NETLIBSELECT);
nls.dwTimeout = 60000;
nls.hReadConns[0] = hConnection;
- switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM) &nls))
- {
- case SOCKET_ERROR:
+ switch (CallService(MS_NETLIB_SELECT, 0, (LPARAM)&nls)) {
+ case SOCKET_ERROR:
free(buf);
- SystemError=WSAGetLastError();
- throw NetworkError = (DWORD) ENL_RECV;
- case 0: // time out!
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_RECV;
+ case 0: // time out!
free(buf);
- throw NetworkError = (DWORD) ENL_TIMEOUT;
+ throw NetworkError = (DWORD)ENL_TIMEOUT;
}
- }
+ }
memset(buf, 0, buflen);
- if (SOCKET_ERROR==(Rcv=LocalNetlib_Recv(hConnection,buf,buflen,MSG_DUMPASTEXT)))
- {
+ if (SOCKET_ERROR == (Rcv = LocalNetlib_Recv(hConnection, buf, buflen, MSG_DUMPASTEXT))) {
free(buf);
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_RECV;
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_RECV;
}
- if (!Rcv)
- {
+ if (!Rcv) {
free(buf);
- SystemError=WSAGetLastError();
- throw NetworkError=(DWORD)ENL_RECV;
+ SystemError = WSAGetLastError();
+ throw NetworkError = (DWORD)ENL_RECV;
}
-#ifdef DEBUG_COMM
- *(buf+Rcv)=0; //end the buffer to write it to file
- DebugLog(CommFile,"%s",buf);
- DebugLog(CommFile,"</reading>\n");
-#endif
+ #ifdef DEBUG_COMM
+ *(buf + Rcv) = 0; //end the buffer to write it to file
+ DebugLog(CommFile, "%s", buf);
+ DebugLog(CommFile, "</reading>\n");
+ #endif
return(buf);
}
- catch(...)
- {
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<error></reading>\n");
-#endif
+ catch (...) {
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<error></reading>\n");
+ #endif
throw;
}
}
@@ -248,19 +235,19 @@ char* CNLClient::Recv(char *buf,int buflen) throw(DWORD) void CNLClient::Disconnect()
{
Netlib_CloseHandle(hConnection);
- hConnection=(HANDLE)NULL;
+ hConnection = (HANDLE)NULL;
}
//Uninitializes netlib library
void UnregisterNLClient()
{
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"<Unregister PROXY support>");
-#endif
-
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "<Unregister PROXY support>");
+ #endif
+
Netlib_CloseHandle(hNetlibUser);
- hNetlibUser=(HANDLE)NULL;
-#ifdef DEBUG_COMM
- DebugLog(CommFile,"</Unregister PROXY support>\n");
-#endif
+ hNetlibUser = (HANDLE)NULL;
+ #ifdef DEBUG_COMM
+ DebugLog(CommFile, "</Unregister PROXY support>\n");
+ #endif
}
diff --git a/plugins/YAMN/src/proto/pop3/pop3.cpp b/plugins/YAMN/src/proto/pop3/pop3.cpp index 1be2d83678..2006535eef 100644 --- a/plugins/YAMN/src/proto/pop3/pop3.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3.cpp @@ -201,7 +201,7 @@ char* CPop3Client::User(char* name) char query[128]; char *Result; - mir_snprintf(query, _countof(query), "USER %s\r\n", name); + mir_snprintf(query, "USER %s\r\n", name); NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); if (AckFlag==POP3_FERR) @@ -220,7 +220,7 @@ char* CPop3Client::Pass(char* pw) char query[128]; char *Result; - mir_snprintf(query, _countof(query), "PASS %s\r\n", pw); + mir_snprintf(query, "PASS %s\r\n", pw); NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); if (AckFlag==POP3_FERR) @@ -248,7 +248,7 @@ char* CPop3Client::APOP(char* name, char* pw, char* timestamp) mir_md5_finish(&ctx, digest); char hexdigest[40]; - mir_snprintf(query, _countof(query), "APOP %s %s\r\n", name, bin2hex(digest, sizeof(digest), hexdigest)); + mir_snprintf(query, "APOP %s %s\r\n", name, bin2hex(digest, sizeof(digest), hexdigest)); NetClient->Send(query); Result=RecvRest(NetClient->Recv(),POP3_SEARCHACK); @@ -302,7 +302,7 @@ char* CPop3Client::Top(int nr, int lines) char query[128]; - mir_snprintf(query, _countof(query), "TOP %d %d\r\n", nr, lines); + mir_snprintf(query, "TOP %d %d\r\n", nr, lines); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHDOT); } @@ -318,11 +318,11 @@ char* CPop3Client::Uidl(int nr) if (nr) { - mir_snprintf(query, _countof(query), "UIDL %d\r\n", nr); + mir_snprintf(query, "UIDL %d\r\n", nr); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHACK); } - mir_snprintf(query, _countof(query), "UIDL\r\n"); + mir_snprintf(query, "UIDL\r\n"); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHDOT); } @@ -336,7 +336,7 @@ char* CPop3Client::Dele(int nr) char query[128]; - mir_snprintf(query, _countof(query), "DELE %d\r\n", nr); + mir_snprintf(query, "DELE %d\r\n", nr); NetClient->Send(query); return RecvRest(NetClient->Recv(),POP3_SEARCHACK); } @@ -349,7 +349,7 @@ char* CPop3Client::Retr(int nr) char query[128]; - mir_snprintf(query, _countof(query), "RETR %d\r\n", nr); + mir_snprintf(query, "RETR %d\r\n", nr); NetClient->Send(query); RecvRest(NetClient->Recv(),POP3_SEARCHACK); return NetClient->Recv(); diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index febfae336b..b35c183093 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -380,7 +380,7 @@ DWORD WINAPI ReadPOP3Options(HACCOUNT Which, char **Parser, char *End) if (*Parser >= End)
return EACC_FILECOMPATIBILITY;
#ifdef DEBUG_FILEREAD
- mir_sntprintf(Debug, _countof(Debug), _T("CodePage: %d, remaining %d chars"), ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
+ mir_sntprintf(Debug, _T("CodePage: %d, remaining %d chars"), ((HPOP3ACCOUNT)Which)->CP, End-*Parser);
MessageBox(NULL,Debug,_T("debug"),MB_OK);
#endif
return 0;
@@ -713,7 +713,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) for (NewMsgsPtr = (HYAMNMAIL)NewMails; NewMsgsPtr != NULL; NewMsgsPtr = NewMsgsPtr->Next) {
if (!mir_strcmp(MsgQueuePtr->ID, NewMsgsPtr->ID)) {
TCHAR accstatus[512];
- mir_sntprintf(accstatus, _countof(accstatus), TranslateT("Reading body %s"), NewMsgsPtr->ID);
+ mir_sntprintf(accstatus, TranslateT("Reading body %s"), NewMsgsPtr->ID);
SetAccountStatus(ActualAccount, accstatus);
DataRX = MyClient->Top(MsgQueuePtr->Number, 100);
#ifdef DEBUG_DECODE
@@ -786,7 +786,7 @@ DWORD WINAPI SynchroPOP3(struct CheckParam * WhichTemp) {
BOOL autoretr = (ActualAccount->Flags & YAMN_ACC_BODY) != 0;
DataRX = MyClient->Top(MsgQueuePtr->Number, autoretr ? 100 : 0);
- mir_sntprintf(accstatus, _countof(accstatus), TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
+ mir_sntprintf(accstatus, TranslateT("Reading new mail messages (%d%% done)"), 100 * i / msgs);
SetAccountStatus(ActualAccount, accstatus);
#ifdef DEBUG_DECODE
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 73aa051d53..14c24847ea 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -8,59 +8,59 @@ //--------------------------------------------------------------------------------------------------
-static BOOL Check0,Check1,Check2,Check3,Check4,Check5,Check6,Check7,Check8,Check9;
+static BOOL Check0, Check1, Check2, Check3, Check4, Check5, Check6, Check7, Check8, Check9;
static char DlgInput[MAX_PATH];
void CheckMenuItems();
//--------------------------------------------------------------------------------------------------
-INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hDlg);
- CheckDlgButton(hDlg,IDC_CHECKTTB,db_get_b(NULL,YAMN_DBMODULE,YAMN_TTBFCHECK,1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_LONGDATE,(optDateTime&SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_SMARTDATE,(optDateTime&SHOWDATENOTODAY) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_NOSECONDS,(optDateTime&SHOWDATENOSECONDS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_MAINMENU,db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_YAMNASPROTO,db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CLOSEONDELETE,db_get_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKTTB, db_get_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_LONGDATE, (optDateTime&SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_SMARTDATE, (optDateTime&SHOWDATENOTODAY) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_NOSECONDS, (optDateTime&SHOWDATENOSECONDS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_MAINMENU, db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_YAMNASPROTO, db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CLOSEONDELETE, db_get_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0) ? BST_CHECKED : BST_UNCHECKED);
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDC_YAMNASPROTO:
- case IDC_MAINMENU:
- case IDC_CHECKTTB:
- case IDC_CLOSEONDELETE:
- case IDC_LONGDATE:
- case IDC_SMARTDATE:
- case IDC_NOSECONDS:
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
- break;
+ switch (LOWORD(wParam)) {
+ case IDC_YAMNASPROTO:
+ case IDC_MAINMENU:
+ case IDC_CHECKTTB:
+ case IDC_CLOSEONDELETE:
+ case IDC_LONGDATE:
+ case IDC_SMARTDATE:
+ case IDC_NOSECONDS:
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ break;
}
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
- switch(((LPNMHDR)lParam)->code) {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg,IDC_YAMNASPROTO));
- db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg,IDC_MAINMENU));
- db_set_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg,IDC_CLOSEONDELETE));
- db_set_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg,IDC_CHECKTTB));
-
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg, IDC_YAMNASPROTO));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg, IDC_MAINMENU));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg, IDC_CLOSEONDELETE));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg, IDC_CHECKTTB));
+
AddTopToolbarIcon(0, 0);
CheckMenuItems();
optDateTime = 0;
- if (IsDlgButtonChecked(hDlg,IDC_LONGDATE))optDateTime |= SHOWDATELONG;
- if (IsDlgButtonChecked(hDlg,IDC_SMARTDATE))optDateTime |= SHOWDATENOTODAY;
- if (IsDlgButtonChecked(hDlg,IDC_NOSECONDS))optDateTime |= SHOWDATENOSECONDS;
- db_set_b(NULL,YAMN_DBMODULE,YAMN_DBTIMEOPTIONS,optDateTime);
+ if (IsDlgButtonChecked(hDlg, IDC_LONGDATE))optDateTime |= SHOWDATELONG;
+ if (IsDlgButtonChecked(hDlg, IDC_SMARTDATE))optDateTime |= SHOWDATENOTODAY;
+ if (IsDlgButtonChecked(hDlg, IDC_NOSECONDS))optDateTime |= SHOWDATENOSECONDS;
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);
}
}
break;
@@ -71,87 +71,83 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam) INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
{
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hDlg);
break;
case WM_COMMAND:
- {
- WORD wNotifyCode = HIWORD(wParam);
- switch(LOWORD(wParam))
{
+ WORD wNotifyCode = HIWORD(wParam);
+ switch (LOWORD(wParam)) {
case IDC_COMBOPLUGINS:
- if (wNotifyCode==CBN_SELCHANGE)
- {
- HWND hCombo=GetDlgItem(hDlg,IDC_COMBOPLUGINS);
+ if (wNotifyCode == CBN_SELCHANGE) {
+ HWND hCombo = GetDlgItem(hDlg, IDC_COMBOPLUGINS);
PYAMN_PROTOPLUGINQUEUE PParser;
PYAMN_FILTERPLUGINQUEUE FParser;
- int index,id;
-
- if (CB_ERR==(index=SendMessage(hCombo,CB_GETCURSEL,0,0)))
+ int index, id;
+
+ if (CB_ERR == (index = SendMessage(hCombo, CB_GETCURSEL, 0, 0)))
break;
- id=SendMessage(hCombo,CB_GETITEMDATA,(WPARAM)index,0);
+ id = SendMessage(hCombo, CB_GETITEMDATA, (WPARAM)index, 0);
EnterCriticalSection(&PluginRegCS);
- for (PParser=FirstProtoPlugin;PParser != NULL;PParser=PParser->Next)
- if (id==(INT_PTR)PParser->Plugin)
- {
- SetDlgItemTextA(hDlg,IDC_STVER,PParser->Plugin->PluginInfo->Ver);
- SetDlgItemTextA(hDlg,IDC_STDESC,PParser->Plugin->PluginInfo->Description == NULL ? "" : PParser->Plugin->PluginInfo->Description);
- SetDlgItemTextA(hDlg,IDC_STCOPY,PParser->Plugin->PluginInfo->Copyright == NULL ? "" : PParser->Plugin->PluginInfo->Copyright);
- SetDlgItemTextA(hDlg,IDC_STMAIL,PParser->Plugin->PluginInfo->Email == NULL ? "" : PParser->Plugin->PluginInfo->Email);
- SetDlgItemTextA(hDlg,IDC_STWWW,PParser->Plugin->PluginInfo->WWW == NULL ? "" : PParser->Plugin->PluginInfo->WWW);
+ for (PParser = FirstProtoPlugin; PParser != NULL; PParser = PParser->Next)
+ if (id == (INT_PTR)PParser->Plugin) {
+ SetDlgItemTextA(hDlg, IDC_STVER, PParser->Plugin->PluginInfo->Ver);
+ SetDlgItemTextA(hDlg, IDC_STDESC, PParser->Plugin->PluginInfo->Description == NULL ? "" : PParser->Plugin->PluginInfo->Description);
+ SetDlgItemTextA(hDlg, IDC_STCOPY, PParser->Plugin->PluginInfo->Copyright == NULL ? "" : PParser->Plugin->PluginInfo->Copyright);
+ SetDlgItemTextA(hDlg, IDC_STMAIL, PParser->Plugin->PluginInfo->Email == NULL ? "" : PParser->Plugin->PluginInfo->Email);
+ SetDlgItemTextA(hDlg, IDC_STWWW, PParser->Plugin->PluginInfo->WWW == NULL ? "" : PParser->Plugin->PluginInfo->WWW);
break;
}
- for (FParser=FirstFilterPlugin;FParser != NULL;FParser=FParser->Next)
- if (id==(INT_PTR)FParser->Plugin)
- {
- SetDlgItemTextA(hDlg,IDC_STVER,FParser->Plugin->PluginInfo->Ver);
- SetDlgItemTextA(hDlg,IDC_STDESC,FParser->Plugin->PluginInfo->Description == NULL ? "" : FParser->Plugin->PluginInfo->Description);
- SetDlgItemTextA(hDlg,IDC_STCOPY,FParser->Plugin->PluginInfo->Copyright == NULL ? "" : FParser->Plugin->PluginInfo->Copyright);
- SetDlgItemTextA(hDlg,IDC_STMAIL,FParser->Plugin->PluginInfo->Email == NULL ? "" : FParser->Plugin->PluginInfo->Email);
- SetDlgItemTextA(hDlg,IDC_STWWW,FParser->Plugin->PluginInfo->WWW == NULL ? "" : FParser->Plugin->PluginInfo->WWW);
+ for (FParser = FirstFilterPlugin; FParser != NULL; FParser = FParser->Next)
+ if (id == (INT_PTR)FParser->Plugin) {
+ SetDlgItemTextA(hDlg, IDC_STVER, FParser->Plugin->PluginInfo->Ver);
+ SetDlgItemTextA(hDlg, IDC_STDESC, FParser->Plugin->PluginInfo->Description == NULL ? "" : FParser->Plugin->PluginInfo->Description);
+ SetDlgItemTextA(hDlg, IDC_STCOPY, FParser->Plugin->PluginInfo->Copyright == NULL ? "" : FParser->Plugin->PluginInfo->Copyright);
+ SetDlgItemTextA(hDlg, IDC_STMAIL, FParser->Plugin->PluginInfo->Email == NULL ? "" : FParser->Plugin->PluginInfo->Email);
+ SetDlgItemTextA(hDlg, IDC_STWWW, FParser->Plugin->PluginInfo->WWW == NULL ? "" : FParser->Plugin->PluginInfo->WWW);
break;
}
LeaveCriticalSection(&PluginRegCS);
}
break;
case IDC_STWWW:
- {
- char str[1024];
- GetDlgItemTextA(hDlg,IDC_STWWW,str,_countof(str));
- Utils_OpenUrl(str);
- break;
- }
+ {
+ char str[1024];
+ GetDlgItemTextA(hDlg, IDC_STWWW, str, _countof(str));
+ Utils_OpenUrl(str);
+ break;
+ }
+ }
+ break;
}
- break;
- }
case WM_SHOWWINDOW:
- if (TRUE==(BOOL)wParam) {
+ if (TRUE == (BOOL)wParam) {
PYAMN_PROTOPLUGINQUEUE PParser;
PYAMN_FILTERPLUGINQUEUE FParser;
int index;
-
+
EnterCriticalSection(&PluginRegCS);
for (PParser = FirstProtoPlugin; PParser != NULL; PParser = PParser->Next) {
- index = SendDlgItemMessageA(hDlg,IDC_COMBOPLUGINS,CB_ADDSTRING,0,(LPARAM)PParser->Plugin->PluginInfo->Name);
- index = SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_SETITEMDATA,(WPARAM)index,(LPARAM)PParser->Plugin);
+ index = SendDlgItemMessageA(hDlg, IDC_COMBOPLUGINS, CB_ADDSTRING, 0, (LPARAM)PParser->Plugin->PluginInfo->Name);
+ index = SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)PParser->Plugin);
}
for (FParser = FirstFilterPlugin; FParser != NULL; FParser = FParser->Next) {
- index = SendDlgItemMessageA(hDlg,IDC_COMBOPLUGINS,CB_ADDSTRING,0,(LPARAM)FParser->Plugin->PluginInfo->Name);
- index = SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_SETITEMDATA,(WPARAM)index,(LPARAM)FParser->Plugin);
+ index = SendDlgItemMessageA(hDlg, IDC_COMBOPLUGINS, CB_ADDSTRING, 0, (LPARAM)FParser->Plugin->PluginInfo->Name);
+ index = SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)FParser->Plugin);
}
LeaveCriticalSection(&PluginRegCS);
- SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_SETCURSEL,0,0);
- SendMessage(hDlg,WM_COMMAND,MAKELONG(IDC_COMBOPLUGINS,CBN_SELCHANGE),0);
+ SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_SETCURSEL, 0, 0);
+ SendMessage(hDlg, WM_COMMAND, MAKELONG(IDC_COMBOPLUGINS, CBN_SELCHANGE), 0);
break;
}
else { //delete all items in combobox
- int cbn=SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_GETCOUNT,0,0);
- for (int i=0;i<cbn;i++)
- SendDlgItemMessage(hDlg,IDC_COMBOPLUGINS,CB_DELETESTRING,0,0);
+ int cbn = SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_GETCOUNT, 0, 0);
+ for (int i = 0; i < cbn; i++)
+ SendDlgItemMessage(hDlg, IDC_COMBOPLUGINS, CB_DELETESTRING, 0, 0);
break;
}
}
@@ -183,7 +179,7 @@ int YAMNOptInitSvc(WPARAM wParam, LPARAM) odp.pfnDlgProc = DlgProcPluginOpt;
Options_AddPage(wParam, &odp);
- if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
odp.pszGroup = LPGEN("Popups");
odp.pszTab = LPGEN("YAMN");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POP3ACCOUNTPOPUP);
@@ -197,64 +193,64 @@ int YAMNOptInitSvc(WPARAM wParam, LPARAM) //--------------------------------------------------------------------------------------------------
BOOL DlgEnableAccountStatus(HWND hDlg, WPARAM wParam, LPARAM)
{
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST0),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST1),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST2),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST3),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST4),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST5),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST6),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST7),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST8),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST0), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST1), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST2), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST3), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST4), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST5), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST6), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST7), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST8), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST9), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKST9), (BOOL)wParam);
return TRUE;
}
BOOL DlgEnableAccountPopup(HWND hDlg, WPARAM wParam, LPARAM)
{
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKPOP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCOL),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPB),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPT),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOPN),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOP1),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNPOP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITNPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNCOL),(IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNB),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNT),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFPOP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITFPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFCOL),(IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFB),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFT),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKAPOP),(BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKPOP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCOL), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPB), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPT), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOPN), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOP1), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNPOP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITNPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNCOL), (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNB), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNT), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFPOP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITFPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFCOL), (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFB), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFT), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKAPOP), (BOOL)wParam);
return TRUE;
}
BOOL DlgEnableAccount(HWND hDlg, WPARAM wParam, LPARAM)
{
- EnableWindow(GetDlgItem(hDlg,IDC_CHECK),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITSERVER),wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITNAME),wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPORT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITLOGIN),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPASS),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITINTERVAL),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKSND),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKMSG),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKICO),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKAPP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKKBN),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNAPP),(IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPP),(IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPPPARAM),(IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNMSGP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFSND),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFMSG),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFICO),(BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECK), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITSERVER), wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITNAME), wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPORT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITLOGIN), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPASS), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITINTERVAL), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKSND), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKMSG), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKICO), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKAPP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKKBN), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNAPP), (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPP), (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPPPARAM), (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNMSGP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFSND), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFMSG), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFICO), (BOOL)wParam);
/*EnableWindow(GetDlgItem(hDlg,IDC_CHECKST0),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST1),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST2),(BOOL)wParam);
@@ -266,123 +262,119 @@ BOOL DlgEnableAccount(HWND hDlg, WPARAM wParam, LPARAM) EnableWindow(GetDlgItem(hDlg,IDC_CHECKST8),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);
EnableWindow(GetDlgItem(hDlg,IDC_CHECKST9),(BOOL)wParam);*/
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKSTART),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFORCE),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_COMBOCP),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_STTIMELEFT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNRESET),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEFAULT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNSTATUS),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKSSL),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNOTLS),(IsDlgButtonChecked(hDlg,IDC_CHECKSSL)==BST_UNCHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_AUTOBODY),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACT),(BOOL)wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNICK),(IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNOEVENT),(IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKSTART), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFORCE), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_COMBOCP), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_STTIMELEFT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNRESET), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEFAULT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNSTATUS), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKSSL), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNOTLS), (IsDlgButtonChecked(hDlg, IDC_CHECKSSL) == BST_UNCHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_AUTOBODY), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACT), (BOOL)wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNICK), (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNOEVENT), (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED) && wParam);
return TRUE;
}
-BOOL DlgShowAccountStatus(HWND hDlg,WPARAM wParam,LPARAM lParam)
+BOOL DlgShowAccountStatus(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
-
- if ((DWORD)wParam==M_SHOWACTUAL)
- {
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
+
+ if ((DWORD)wParam == M_SHOWACTUAL) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
#endif
- CheckDlgButton(hDlg,IDC_CHECKST0,ActualAccount->StatusFlags & YAMN_ACC_ST0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST1,ActualAccount->StatusFlags & YAMN_ACC_ST1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST2,ActualAccount->StatusFlags & YAMN_ACC_ST2 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST3,ActualAccount->StatusFlags & YAMN_ACC_ST3 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST4,ActualAccount->StatusFlags & YAMN_ACC_ST4 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST5,ActualAccount->StatusFlags & YAMN_ACC_ST5 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST6,ActualAccount->StatusFlags & YAMN_ACC_ST6 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST7,ActualAccount->StatusFlags & YAMN_ACC_ST7 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST8,ActualAccount->StatusFlags & YAMN_ACC_ST8 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST9,ActualAccount->StatusFlags & YAMN_ACC_ST9 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST0, ActualAccount->StatusFlags & YAMN_ACC_ST0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST1, ActualAccount->StatusFlags & YAMN_ACC_ST1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST2, ActualAccount->StatusFlags & YAMN_ACC_ST2 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST3, ActualAccount->StatusFlags & YAMN_ACC_ST3 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST4, ActualAccount->StatusFlags & YAMN_ACC_ST4 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST5, ActualAccount->StatusFlags & YAMN_ACC_ST5 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST6, ActualAccount->StatusFlags & YAMN_ACC_ST6 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST7, ActualAccount->StatusFlags & YAMN_ACC_ST7 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST8, ActualAccount->StatusFlags & YAMN_ACC_ST8 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST9, ActualAccount->StatusFlags & YAMN_ACC_ST9 ? BST_CHECKED : BST_UNCHECKED);
ReadDone(ActualAccount);
}
- else
- {
- CheckDlgButton(hDlg,IDC_CHECKST0,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST1,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST2,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST3,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST4,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST5,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST6,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST7,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST8,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST9,BST_CHECKED);
+ else {
+ CheckDlgButton(hDlg, IDC_CHECKST0, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST1, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST2, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST3, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST4, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST5, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST6, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST7, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST8, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST9, BST_CHECKED);
}
return TRUE;
}
-BOOL DlgShowAccountPopup(HWND hDlg,WPARAM wParam,LPARAM lParam)
+BOOL DlgShowAccountPopup(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
-
- if ((DWORD)wParam==M_SHOWACTUAL)
- {
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
+
+ if ((DWORD)wParam == M_SHOWACTUAL) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
#endif
- SetDlgItemInt(hDlg,IDC_EDITPOPS,ActualAccount->NewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,ActualAccount->NoNewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,ActualAccount->BadConnectN.PopupTime,FALSE);
-
-
- CheckDlgButton(hDlg,IDC_CHECKPOP,ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNPOP,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNCOL,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, ActualAccount->NewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, ActualAccount->NoNewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, ActualAccount->BadConnectN.PopupTime, FALSE);
+
+
+ CheckDlgButton(hDlg, IDC_CHECKPOP, ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNPOP, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNCOL, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read done\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read done\n");
#endif
ReadDone(ActualAccount);
- }
+ }
else //default
{
- SetDlgItemInt(hDlg,IDC_EDITPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,0,FALSE);
- CheckDlgButton(hDlg,IDC_CHECKPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,BST_CHECKED);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, 0, FALSE);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, BST_CHECKED);
}
return TRUE;
}
-BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam)
+BOOL DlgShowAccount(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
int i;
-
- if ((DWORD)wParam==M_SHOWACTUAL)
- {
+
+ if ((DWORD)wParam == M_SHOWACTUAL) {
TCHAR accstatus[256];
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read wait\n");
#endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read enter\n");
#endif
DlgSetItemText(hDlg, IDC_EDITSERVER, ActualAccount->Server->Name);
DlgSetItemText(hDlg, IDC_EDITNAME, ActualAccount->Name);
@@ -390,42 +382,41 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) DlgSetItemText(hDlg, IDC_EDITPASS, ActualAccount->Server->Passwd);
DlgSetItemTextW(hDlg, IDC_EDITAPP, ActualAccount->NewMailN.App);
DlgSetItemTextW(hDlg, IDC_EDITAPPPARAM, ActualAccount->NewMailN.AppParam);
- SetDlgItemInt(hDlg,IDC_EDITPORT,ActualAccount->Server->Port,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITINTERVAL,ActualAccount->Interval/60,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITPOPS,ActualAccount->NewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,ActualAccount->NoNewMailN.PopupTime,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,ActualAccount->BadConnectN.PopupTime,FALSE);
- for (i=0;i<=CPLENSUPP;i++)
- if ((i<CPLENSUPP) && (CodePageNamesSupp[i].CP==ActualAccount->CP))
- {
+ SetDlgItemInt(hDlg, IDC_EDITPORT, ActualAccount->Server->Port, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITINTERVAL, ActualAccount->Interval / 60, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, ActualAccount->NewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, ActualAccount->NoNewMailN.PopupTime, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, ActualAccount->BadConnectN.PopupTime, FALSE);
+ for (i = 0; i <= CPLENSUPP; i++)
+ if ((i < CPLENSUPP) && (CodePageNamesSupp[i].CP == ActualAccount->CP)) {
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)i, 0);
break;
}
- if (i==CPLENSUPP)
+ if (i == CPLENSUPP)
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- CheckDlgButton(hDlg,IDC_CHECK,ActualAccount->Flags & YAMN_ACC_ENA ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSND,ActualAccount->NewMailN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKMSG,ActualAccount->NewMailN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKICO,ActualAccount->NewMailN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKPOP,ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPP,ActualAccount->NewMailN.Flags & YAMN_ACC_APP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKKBN,ActualAccount->NewMailN.Flags & YAMN_ACC_KBN ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNPOP,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNCOL,ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNMSGP,ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFSND,ActualAccount->BadConnectN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFMSG,ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFICO,ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSSL,ActualAccount->Flags & YAMN_ACC_SSL23 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNOTLS,ActualAccount->Flags & YAMN_ACC_NOTLS ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPOP,ActualAccount->Flags & YAMN_ACC_APOP ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_AUTOBODY,ActualAccount->Flags & YAMN_ACC_BODY ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECK, ActualAccount->Flags & YAMN_ACC_ENA ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSND, ActualAccount->NewMailN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKMSG, ActualAccount->NewMailN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKICO, ActualAccount->NewMailN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, ActualAccount->NewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, ActualAccount->NewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPP, ActualAccount->NewMailN.Flags & YAMN_ACC_APP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKKBN, ActualAccount->NewMailN.Flags & YAMN_ACC_KBN ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNPOP, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNCOL, ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNMSGP, ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFSND, ActualAccount->BadConnectN.Flags & YAMN_ACC_SND ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFMSG, ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFICO, ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, ActualAccount->BadConnectN.Flags & YAMN_ACC_POP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, ActualAccount->Flags & YAMN_ACC_POPN ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, ActualAccount->Flags & YAMN_ACC_POPN ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSSL, ActualAccount->Flags & YAMN_ACC_SSL23 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNOTLS, ActualAccount->Flags & YAMN_ACC_NOTLS ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPOP, ActualAccount->Flags & YAMN_ACC_APOP ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_AUTOBODY, ActualAccount->Flags & YAMN_ACC_BODY ? BST_CHECKED : BST_UNCHECKED);
/*CheckDlgButton(hDlg,IDC_CHECKST0,ActualAccount->StatusFlags & YAMN_ACC_ST0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST1,ActualAccount->StatusFlags & YAMN_ACC_ST1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST2,ActualAccount->StatusFlags & YAMN_ACC_ST2 ? BST_CHECKED : BST_UNCHECKED);
@@ -436,57 +427,57 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) CheckDlgButton(hDlg,IDC_CHECKST7,ActualAccount->StatusFlags & YAMN_ACC_ST7 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST8,ActualAccount->StatusFlags & YAMN_ACC_ST8 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST9,ActualAccount->StatusFlags & YAMN_ACC_ST9 ? BST_CHECKED : BST_UNCHECKED);*/
- Check0=ActualAccount->StatusFlags & YAMN_ACC_ST0;
- Check1=ActualAccount->StatusFlags & YAMN_ACC_ST1;
- Check2=ActualAccount->StatusFlags & YAMN_ACC_ST2;
- Check3=ActualAccount->StatusFlags & YAMN_ACC_ST3;
- Check4=ActualAccount->StatusFlags & YAMN_ACC_ST4;
- Check5=ActualAccount->StatusFlags & YAMN_ACC_ST5;
- Check6=ActualAccount->StatusFlags & YAMN_ACC_ST6;
- Check7=ActualAccount->StatusFlags & YAMN_ACC_ST7;
- Check8=ActualAccount->StatusFlags & YAMN_ACC_ST8;
- Check9=ActualAccount->StatusFlags & YAMN_ACC_ST9;
- CheckDlgButton(hDlg,IDC_CHECKSTART,ActualAccount->StatusFlags & YAMN_ACC_STARTS ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFORCE,ActualAccount->StatusFlags & YAMN_ACC_FORCE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACT,ActualAccount->NewMailN.Flags & YAMN_ACC_CONT ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACTNICK,ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACTNOEVENT,ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT ? BST_CHECKED : BST_UNCHECKED);
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNT:ActualAccountSO-read done\n");
-#endif
- GetAccountStatus(ActualAccount,accstatus);
- SetDlgItemText(hDlg,IDC_STSTATUS,accstatus);
+ Check0 = ActualAccount->StatusFlags & YAMN_ACC_ST0;
+ Check1 = ActualAccount->StatusFlags & YAMN_ACC_ST1;
+ Check2 = ActualAccount->StatusFlags & YAMN_ACC_ST2;
+ Check3 = ActualAccount->StatusFlags & YAMN_ACC_ST3;
+ Check4 = ActualAccount->StatusFlags & YAMN_ACC_ST4;
+ Check5 = ActualAccount->StatusFlags & YAMN_ACC_ST5;
+ Check6 = ActualAccount->StatusFlags & YAMN_ACC_ST6;
+ Check7 = ActualAccount->StatusFlags & YAMN_ACC_ST7;
+ Check8 = ActualAccount->StatusFlags & YAMN_ACC_ST8;
+ Check9 = ActualAccount->StatusFlags & YAMN_ACC_ST9;
+ CheckDlgButton(hDlg, IDC_CHECKSTART, ActualAccount->StatusFlags & YAMN_ACC_STARTS ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFORCE, ActualAccount->StatusFlags & YAMN_ACC_FORCE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACT, ActualAccount->NewMailN.Flags & YAMN_ACC_CONT ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACTNICK, ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACTNOEVENT, ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT ? BST_CHECKED : BST_UNCHECKED);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNT:ActualAccountSO-read done\n");
+ #endif
+ GetAccountStatus(ActualAccount, accstatus);
+ SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
ReadDone(ActualAccount);
- }
+ }
else //default
{
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITSERVER,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITNAME,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITLOGIN,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITPASS,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITAPP,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_EDITAPPPARAM,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- SetDlgItemInt(hDlg,IDC_EDITPORT,110,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITINTERVAL,30,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITNPOPS,0,FALSE);
- SetDlgItemInt(hDlg,IDC_EDITFPOPS,0,FALSE);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITSERVER, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITNAME, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITLOGIN, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITPASS, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPP, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_EDITAPPPARAM, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ SetDlgItemInt(hDlg, IDC_EDITPORT, 110, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITINTERVAL, 30, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITNPOPS, 0, FALSE);
+ SetDlgItemInt(hDlg, IDC_EDITFPOPS, 0, FALSE);
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- CheckDlgButton(hDlg,IDC_CHECK,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSND,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKMSG,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKICO,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPP,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCOL,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFSND,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFMSG,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFICO,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFPOP,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFCOL,BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECK, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSND, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKMSG, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKICO, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPP, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCOL, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFSND, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFMSG, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFICO, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFPOP, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFCOL, BST_CHECKED);
/*CheckDlgButton(hDlg,IDC_CHECKST0,BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_CHECKST1,BST_CHECKED);
CheckDlgButton(hDlg,IDC_CHECKST2,BST_UNCHECKED);
@@ -497,69 +488,63 @@ BOOL DlgShowAccount(HWND hDlg,WPARAM wParam,LPARAM lParam) CheckDlgButton(hDlg,IDC_CHECKST7,BST_CHECKED);
CheckDlgButton(hDlg,IDC_CHECKST8,BST_CHECKED);
CheckDlgButton(hDlg,IDC_CHECKST9,BST_CHECKED);*/
- CheckDlgButton(hDlg,IDC_CHECKSTART,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKFORCE,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOPN,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_RADIOPOP1,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKSSL,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKNOTLS,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKAPOP,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_AUTOBODY,BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_CHECKCONTACT,BST_CHECKED);
-
- SetDlgItemText(hDlg,IDC_STSTATUS,TranslateT("No account selected"));
+ CheckDlgButton(hDlg, IDC_CHECKSTART, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKFORCE, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOPN, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_RADIOPOP1, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKSSL, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKNOTLS, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKAPOP, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_AUTOBODY, BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKCONTACT, BST_CHECKED);
+
+ SetDlgItemText(hDlg, IDC_STSTATUS, TranslateT("No account selected"));
}
return TRUE;
}
BOOL DlgShowAccountColors(HWND hDlg, WPARAM, LPARAM lParam)
{
- HPOP3ACCOUNT ActualAccount=(HPOP3ACCOUNT)lParam;
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNTCOLORS:ActualAccountSO-read wait\n");
-#endif
+ HPOP3ACCOUNT ActualAccount = (HPOP3ACCOUNT)lParam;
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNTCOLORS:ActualAccountSO-read wait\n");
+ #endif
WaitToRead(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNTCOLORS:ActualAccountSO-read enter\n");
-#endif
- if (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC)
- {
- SendDlgItemMessage(hDlg,IDC_CPB,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NewMailN.PopupB);
- SendDlgItemMessage(hDlg,IDC_CPT,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NewMailN.PopupT);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNTCOLORS:ActualAccountSO-read enter\n");
+ #endif
+ if (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC) {
+ SendDlgItemMessage(hDlg, IDC_CPB, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NewMailN.PopupB);
+ SendDlgItemMessage(hDlg, IDC_CPT, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NewMailN.PopupT);
}
- else
- {
- SendDlgItemMessage(hDlg,IDC_CPB,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hDlg,IDC_CPT,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_WINDOWTEXT));
+ else {
+ SendDlgItemMessage(hDlg, IDC_CPB, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));
+ SendDlgItemMessage(hDlg, IDC_CPT, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOWTEXT));
}
- if (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC)
- {
- SendDlgItemMessage(hDlg,IDC_CPFB,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->BadConnectN.PopupB);
- SendDlgItemMessage(hDlg,IDC_CPFT,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->BadConnectN.PopupT);
+ if (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC) {
+ SendDlgItemMessage(hDlg, IDC_CPFB, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->BadConnectN.PopupB);
+ SendDlgItemMessage(hDlg, IDC_CPFT, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->BadConnectN.PopupT);
}
- else
- {
- SendDlgItemMessage(hDlg,IDC_CPFB,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hDlg,IDC_CPFT,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_WINDOWTEXT));
+ else {
+ SendDlgItemMessage(hDlg, IDC_CPFB, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));
+ SendDlgItemMessage(hDlg, IDC_CPFT, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOWTEXT));
}
- if (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC)
- {
- SendDlgItemMessage(hDlg,IDC_CPNB,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NoNewMailN.PopupB);
- SendDlgItemMessage(hDlg,IDC_CPNT,CPM_SETCOLOUR,0,(LPARAM)ActualAccount->NoNewMailN.PopupT);
+ if (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC) {
+ SendDlgItemMessage(hDlg, IDC_CPNB, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NoNewMailN.PopupB);
+ SendDlgItemMessage(hDlg, IDC_CPNT, CPM_SETCOLOUR, 0, (LPARAM)ActualAccount->NoNewMailN.PopupT);
}
- else
- {
- SendDlgItemMessage(hDlg,IDC_CPNB,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hDlg,IDC_CPNT,CPM_SETCOLOUR,0,(LPARAM)GetSysColor(COLOR_WINDOWTEXT));
+ else {
+ SendDlgItemMessage(hDlg, IDC_CPNB, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_BTNFACE));
+ SendDlgItemMessage(hDlg, IDC_CPNT, CPM_SETCOLOUR, 0, (LPARAM)GetSysColor(COLOR_WINDOWTEXT));
}
-#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:SHOWACCOUNTCOLORS:ActualAccountSO-read done\n");
-#endif
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:SHOWACCOUNTCOLORS:ActualAccountSO-read done\n");
+ #endif
ReadDone(ActualAccount); //we do not need to check if account is deleted. It is not deleted, because only thread that can delete account is this thread
return TRUE;
}
-BOOL DlgSetItemText(HWND hDlg, WPARAM wParam,const char* str)
+BOOL DlgSetItemText(HWND hDlg, WPARAM wParam, const char* str)
{
if (str == NULL)
SetDlgItemTextA(hDlg, wParam, "");
@@ -568,7 +553,7 @@ BOOL DlgSetItemText(HWND hDlg, WPARAM wParam,const char* str) return TRUE;
}
-BOOL DlgSetItemTextW(HWND hDlg,WPARAM wParam,const WCHAR* str)
+BOOL DlgSetItemTextW(HWND hDlg, WPARAM wParam, const WCHAR* str)
{
if (str == NULL)
SetDlgItemTextW(hDlg, wParam, L"");
@@ -580,51 +565,49 @@ BOOL DlgSetItemTextW(HWND hDlg,WPARAM wParam,const WCHAR* str) INT_PTR CALLBACK DlgProcPOP3AccStatusOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM)
{
static HPOP3ACCOUNT ActualAccount;
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
- ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput);
- if (ActualAccount != NULL)
- {
- DlgShowAccountStatus(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgEnableAccountStatus(hDlg,TRUE,TRUE);
+ ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput);
+ if (ActualAccount != NULL) {
+ DlgShowAccountStatus(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgEnableAccountStatus(hDlg, TRUE, TRUE);
}
- else
- {
- CheckDlgButton(hDlg,IDC_CHECKST0,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST1,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST2,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST3,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST4,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST5,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST6,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST7,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST8,BST_CHECKED);
- CheckDlgButton(hDlg,IDC_CHECKST9,BST_CHECKED);
+ else {
+ CheckDlgButton(hDlg, IDC_CHECKST0, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST1, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST2, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST3, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST4, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST5, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST6, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST7, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST8, BST_CHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKST9, BST_CHECKED);
}
TranslateDialogDefault(hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDOK:
- Check0 = (IsDlgButtonChecked(hDlg,IDC_CHECKST0)==BST_CHECKED);
- Check1 = (IsDlgButtonChecked(hDlg,IDC_CHECKST1)==BST_CHECKED);
- Check2 = (IsDlgButtonChecked(hDlg,IDC_CHECKST2)==BST_CHECKED);
- Check3 = (IsDlgButtonChecked(hDlg,IDC_CHECKST3)==BST_CHECKED);
- Check4 = (IsDlgButtonChecked(hDlg,IDC_CHECKST4)==BST_CHECKED);
- Check5 = (IsDlgButtonChecked(hDlg,IDC_CHECKST5)==BST_CHECKED);
- Check6 = (IsDlgButtonChecked(hDlg,IDC_CHECKST6)==BST_CHECKED);
- Check7 = (IsDlgButtonChecked(hDlg,IDC_CHECKST7)==BST_CHECKED);
- Check8 = (IsDlgButtonChecked(hDlg,IDC_CHECKST8)==BST_CHECKED);
- Check9 = (IsDlgButtonChecked(hDlg,IDC_CHECKST9)==BST_CHECKED);
- WindowList_BroadcastAsync(YAMNVar.MessageWnds,WM_YAMN_CHANGESTATUSOPTION,0,0);
- EndDialog(hDlg,0);
+ Check0 = (IsDlgButtonChecked(hDlg, IDC_CHECKST0) == BST_CHECKED);
+ Check1 = (IsDlgButtonChecked(hDlg, IDC_CHECKST1) == BST_CHECKED);
+ Check2 = (IsDlgButtonChecked(hDlg, IDC_CHECKST2) == BST_CHECKED);
+ Check3 = (IsDlgButtonChecked(hDlg, IDC_CHECKST3) == BST_CHECKED);
+ Check4 = (IsDlgButtonChecked(hDlg, IDC_CHECKST4) == BST_CHECKED);
+ Check5 = (IsDlgButtonChecked(hDlg, IDC_CHECKST5) == BST_CHECKED);
+ Check6 = (IsDlgButtonChecked(hDlg, IDC_CHECKST6) == BST_CHECKED);
+ Check7 = (IsDlgButtonChecked(hDlg, IDC_CHECKST7) == BST_CHECKED);
+ Check8 = (IsDlgButtonChecked(hDlg, IDC_CHECKST8) == BST_CHECKED);
+ Check9 = (IsDlgButtonChecked(hDlg, IDC_CHECKST9) == BST_CHECKED);
+ WindowList_BroadcastAsync(YAMNVar.MessageWnds, WM_YAMN_CHANGESTATUSOPTION, 0, 0);
+ EndDialog(hDlg, 0);
DestroyWindow(hDlg);
break;
case IDCANCEL:
- EndDialog(hDlg,0);
+ EndDialog(hDlg, 0);
DestroyWindow(hDlg);
break;
}
@@ -632,905 +615,873 @@ INT_PTR CALLBACK DlgProcPOP3AccStatusOpt(HWND hDlg, UINT msg, WPARAM wParam, LPA return FALSE;
}
-INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcPOP3AccOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL Changed=FALSE;
+ BOOL Changed = FALSE;
INT_PTR Result;
- static BOOL InList=FALSE;
+ static BOOL InList = FALSE;
static HPOP3ACCOUNT ActualAccount;
static UCHAR ActualStatus;
-// static struct CPOP3Options POP3Options;
+ // static struct CPOP3Options POP3Options;
- switch(msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
int i;
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
- DlgEnableAccount(hDlg,FALSE,FALSE);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
+ DlgEnableAccount(hDlg, FALSE, FALSE);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read wait\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read wait\n");
#endif
WaitToReadSO(POP3Plugin->AccountBrowserSO);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read enter\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read done\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read done\n");
#endif
ReadDoneSO(POP3Plugin->AccountBrowserSO);
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)TranslateT("Default"));
- for (i=1; i < CPLENSUPP; i++) {
- CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP,0,&info);
- size_t len = mir_tstrlen(info.CodePageName+7);
- info.CodePageName[len+6]=0;
- SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_ADDSTRING,0,(LPARAM)(info.CodePageName+7));
+ for (i = 1; i < CPLENSUPP; i++) {
+ CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[i].CP, 0, &info);
+ size_t len = mir_tstrlen(info.CodePageName + 7);
+ info.CodePageName[len + 6] = 0;
+ SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_ADDSTRING, 0, (LPARAM)(info.CodePageName + 7));
}
SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_SETCURSEL, (WPARAM)CPDEFINDEX, 0);
- ActualAccount=NULL;
+ ActualAccount = NULL;
TranslateDialogDefault(hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
}
- case WM_SHOWWINDOW:
- if ( wParam == FALSE) {
- WindowList_Remove(pYAMNVar->MessageWnds,hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
- }
- else WindowList_Add(pYAMNVar->MessageWnds,hDlg,NULL);
- return TRUE;
+ case WM_SHOWWINDOW:
+ if (wParam == FALSE) {
+ WindowList_Remove(pYAMNVar->MessageWnds, hDlg);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
+ }
+ else WindowList_Add(pYAMNVar->MessageWnds, hDlg, NULL);
+ return TRUE;
- case WM_YAMN_CHANGESTATUS:
- if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR accstatus[256];
- GetAccountStatus(ActualAccount,accstatus);
- SetDlgItemText(hDlg,IDC_STSTATUS,accstatus);
- return TRUE;
- }
- break;
-
- case WM_YAMN_CHANGESTATUSOPTION:
- Changed=TRUE;
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
- return TRUE;
-
- case WM_YAMN_CHANGETIME:
- if ((HPOP3ACCOUNT)wParam == ActualAccount) {
- TCHAR Text[256];
- mir_sntprintf(Text,_countof(Text),TranslateT("Time left to next check [s]: %d"),(DWORD)lParam);
- SetDlgItemText(hDlg,IDC_STTIMELEFT,Text);
- }
+ case WM_YAMN_CHANGESTATUS:
+ if ((HPOP3ACCOUNT)wParam == ActualAccount) {
+ TCHAR accstatus[256];
+ GetAccountStatus(ActualAccount, accstatus);
+ SetDlgItemText(hDlg, IDC_STSTATUS, accstatus);
return TRUE;
+ }
+ break;
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDC_COMBOACCOUNT:
- switch( HIWORD(wParam)) {
- case CBN_EDITCHANGE :
- ActualAccount=NULL;
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
-
- if (GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput)))
- DlgEnableAccount(hDlg,TRUE,FALSE);
- else
- DlgEnableAccount(hDlg,FALSE,FALSE);
- break;
+ case WM_YAMN_CHANGESTATUSOPTION:
+ Changed = TRUE;
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
+ return TRUE;
- case CBN_KILLFOCUS:
- GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput));
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))) {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- if (mir_strlen(DlgInput))
- DlgEnableAccount(hDlg,TRUE,TRUE);
- else
- DlgEnableAccount(hDlg,FALSE,FALSE);
- }
- else {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgEnableAccount(hDlg,TRUE,TRUE);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),TRUE);
- }
- break;
+ case WM_YAMN_CHANGETIME:
+ if ((HPOP3ACCOUNT)wParam == ActualAccount) {
+ TCHAR Text[256];
+ mir_sntprintf(Text, TranslateT("Time left to next check [s]: %d"), (DWORD)lParam);
+ SetDlgItemText(hDlg, IDC_STTIMELEFT, Text);
+ }
+ return TRUE;
- case CBN_SELCHANGE:
- if (CB_ERR != (Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_GETLBTEXT,(WPARAM)Result,(LPARAM)DlgInput);
-
- if ((Result==CB_ERR) || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput)))) {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- }
- else {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgEnableAccount(hDlg,TRUE,FALSE);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),TRUE);
- }
- break;
- }
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_COMBOACCOUNT:
+ switch (HIWORD(wParam)) {
+ case CBN_EDITCHANGE:
+ ActualAccount = NULL;
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+
+ if (GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput)))
+ DlgEnableAccount(hDlg, TRUE, FALSE);
+ else
+ DlgEnableAccount(hDlg, FALSE, FALSE);
break;
- case IDC_COMBOCP:
- {
- int sel = SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_GETCURSEL,0,0);
- CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP,0,&info);
- DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ case CBN_KILLFOCUS:
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ if (mir_strlen(DlgInput))
+ DlgEnableAccount(hDlg, TRUE, TRUE);
+ else
+ DlgEnableAccount(hDlg, FALSE, FALSE);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgEnableAccount(hDlg, TRUE, TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
}
- case IDC_CHECK:
- case IDC_CHECKSND:
- case IDC_CHECKMSG:
- case IDC_CHECKICO:
- case IDC_CHECKFSND:
- case IDC_CHECKFMSG:
- case IDC_CHECKFICO:
- case IDC_CHECKST0:
- case IDC_CHECKST1:
- case IDC_CHECKST2:
- case IDC_CHECKST3:
- case IDC_CHECKST4:
- case IDC_CHECKST5:
- case IDC_CHECKST6:
- case IDC_CHECKST7:
- case IDC_CHECKST8:
- case IDC_CHECKST9:
- case IDC_CHECKSTART:
- case IDC_CHECKFORCE:
- case IDC_EDITAPPPARAM:
- case IDC_CHECKAPOP:
- case IDC_AUTOBODY:
- case IDC_CHECKCONTACTNICK:
- case IDC_CHECKCONTACTNOEVENT:
- case IDC_CHECKNOTLS:
- Changed=TRUE;
break;
- case IDC_CHECKCONTACT:
- Changed=IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNICK),Changed);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCONTACTNOEVENT),Changed);
- Changed=TRUE;
- break;
+ case CBN_SELCHANGE:
+ if (CB_ERR != (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_GETLBTEXT, (WPARAM)Result, (LPARAM)DlgInput);
- case IDC_CHECKSSL:
- {
- BOOL SSLC = (IsDlgButtonChecked(hDlg,IDC_CHECKSSL)==BST_CHECKED);
- SetDlgItemInt(hDlg,IDC_EDITPORT,SSLC ? 995 : 110,FALSE);
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNOTLS),SSLC?0:1);
+ if ((Result == CB_ERR) || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgEnableAccount(hDlg, TRUE, FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
}
- Changed=TRUE;
break;
+ }
+ break;
- case IDC_CPB:
- case IDC_CPT:
- case IDC_CPFB:
- case IDC_CPFT:
- case IDC_CPNB:
- case IDC_CPNT:
- if (HIWORD(wParam) != CPN_COLOURCHANGED)
- break;
+ case IDC_COMBOCP:
+ {
+ int sel = SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_GETCURSEL, 0, 0);
+ CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP, 0, &info);
+ DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ }
+ case IDC_CHECK:
+ case IDC_CHECKSND:
+ case IDC_CHECKMSG:
+ case IDC_CHECKICO:
+ case IDC_CHECKFSND:
+ case IDC_CHECKFMSG:
+ case IDC_CHECKFICO:
+ case IDC_CHECKST0:
+ case IDC_CHECKST1:
+ case IDC_CHECKST2:
+ case IDC_CHECKST3:
+ case IDC_CHECKST4:
+ case IDC_CHECKST5:
+ case IDC_CHECKST6:
+ case IDC_CHECKST7:
+ case IDC_CHECKST8:
+ case IDC_CHECKST9:
+ case IDC_CHECKSTART:
+ case IDC_CHECKFORCE:
+ case IDC_EDITAPPPARAM:
+ case IDC_CHECKAPOP:
+ case IDC_AUTOBODY:
+ case IDC_CHECKCONTACTNICK:
+ case IDC_CHECKCONTACTNOEVENT:
+ case IDC_CHECKNOTLS:
+ Changed = TRUE;
+ break;
- case IDC_CHECKKBN:
- Changed=TRUE;
- break;
+ case IDC_CHECKCONTACT:
+ Changed = IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNICK), Changed);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCONTACTNOEVENT), Changed);
+ Changed = TRUE;
+ break;
- case IDC_CHECKAPP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_BTNAPP),IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPP),IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITAPPPARAM),IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- break;
+ case IDC_CHECKSSL:
+ {
+ BOOL SSLC = (IsDlgButtonChecked(hDlg, IDC_CHECKSSL) == BST_CHECKED);
+ SetDlgItemInt(hDlg, IDC_EDITPORT, SSLC ? 995 : 110, FALSE);
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNOTLS), SSLC ? 0 : 1);
+ }
+ Changed = TRUE;
+ break;
- case IDC_BTNSTATUS:
- DialogBoxParamW(pYAMNVar->hInst,MAKEINTRESOURCEW(IDD_CHOOSESTATUSMODES),hDlg,DlgProcPOP3AccStatusOpt,NULL);
+ case IDC_CPB:
+ case IDC_CPT:
+ case IDC_CPFB:
+ case IDC_CPFT:
+ case IDC_CPNB:
+ case IDC_CPNT:
+ if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
- case IDC_BTNADD:
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- DlgEnableAccount(hDlg,TRUE,TRUE);
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- DlgSetItemTextT(hDlg, IDC_EDITNAME, TranslateT("New Account"));
- {
- int index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)TranslateT("New Account"));
- if ( index != CB_ERR && index != CB_ERRSPACE )
- SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, index, (LPARAM)TranslateT("New Account"));
- }
- break;
-
- case IDC_BTNAPP:
- {
- TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c"),
- TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
-
- OPENFILENAME OFNStruct = { 0 };
- OFNStruct.lStructSize = sizeof(OPENFILENAME);
- OFNStruct.hwndOwner = hDlg;
- OFNStruct.lpstrFilter= filter;
- OFNStruct.nFilterIndex=1;
- OFNStruct.nMaxFile=MAX_PATH;
- OFNStruct.lpstrFile=new TCHAR[MAX_PATH];
- OFNStruct.lpstrFile[0]=(TCHAR)0;
- OFNStruct.lpstrTitle=TranslateT("Select executable used for notification");
- OFNStruct.Flags=OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
- if (!GetOpenFileName(&OFNStruct))
- {
- if (CommDlgExtendedError())
- MessageBox(hDlg, TranslateT("Dialog box error"), TranslateT("Failed"), MB_OK);
- }
- else DlgSetItemTextT(hDlg, IDC_EDITAPP, OFNStruct.lpstrFile);
- delete[] OFNStruct.lpstrFile;
- }
- break;
+ case IDC_CHECKKBN:
+ Changed = TRUE;
+ break;
- case IDC_BTNDEFAULT:
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- break;
+ case IDC_CHECKAPP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNAPP), IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPP), IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITAPPPARAM), IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ break;
- case IDC_BTNDEL:
- GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput));
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),FALSE);
- if ((CB_ERR==(Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
- || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))))
- return TRUE;
+ case IDC_BTNSTATUS:
+ DialogBoxParamW(pYAMNVar->hInst, MAKEINTRESOURCEW(IDD_CHOOSESTATUSMODES), hDlg, DlgProcPOP3AccStatusOpt, NULL);
+ break;
- if (IDOK != MessageBox(hDlg,TranslateT("Do you really want to delete this account?"),TranslateT("Delete account confirmation"),MB_OKCANCEL | MB_ICONWARNING))
- return TRUE;
+ case IDC_BTNADD:
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
+ DlgEnableAccount(hDlg, TRUE, TRUE);
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ DlgSetItemTextT(hDlg, IDC_EDITNAME, TranslateT("New Account"));
+ {
+ int index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)TranslateT("New Account"));
+ if (index != CB_ERR && index != CB_ERRSPACE)
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, index, (LPARAM)TranslateT("New Account"));
+ }
+ break;
- DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+ case IDC_BTNAPP:
+ {
+ TCHAR filter[MAX_PATH];
+ mir_sntprintf(filter, _T("%s (*.exe;*.bat;*.cmd;*.com)%c*.exe;*.bat;*.cmd;*.com%c%s (*.*)%c*.*%c"),
+ TranslateT("Executables"), 0, 0, TranslateT("All Files"), 0, 0);
+
+ OPENFILENAME OFNStruct = { 0 };
+ OFNStruct.lStructSize = sizeof(OPENFILENAME);
+ OFNStruct.hwndOwner = hDlg;
+ OFNStruct.lpstrFilter = filter;
+ OFNStruct.nFilterIndex = 1;
+ OFNStruct.nMaxFile = MAX_PATH;
+ OFNStruct.lpstrFile = new TCHAR[MAX_PATH];
+ OFNStruct.lpstrFile[0] = (TCHAR)0;
+ OFNStruct.lpstrTitle = TranslateT("Select executable used for notification");
+ OFNStruct.Flags = OFN_FILEMUSTEXIST | OFN_NONETWORKBUTTON | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR;
+ if (!GetOpenFileName(&OFNStruct)) {
+ if (CommDlgExtendedError())
+ MessageBox(hDlg, TranslateT("Dialog box error"), TranslateT("Failed"), MB_OK);
+ }
+ else DlgSetItemTextT(hDlg, IDC_EDITAPP, OFNStruct.lpstrFile);
+ delete[] OFNStruct.lpstrFile;
+ }
+ break;
- if (ActualAccount->hContact != NULL)
- CallService(MS_DB_CONTACT_DELETE, ActualAccount->hContact, 0);
+ case IDC_BTNDEFAULT:
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
+ break;
- CallService(MS_YAMN_DELETEACCOUNT,(WPARAM)POP3Plugin,(LPARAM)ActualAccount);
-
- //We can consider our account as deleted.
+ case IDC_BTNDEL:
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), FALSE);
+ if ((CB_ERR == (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
+ || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))))
+ return TRUE;
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_DELETESTRING,(WPARAM)Result,0);
- DlgSetItemText(hDlg,(WPARAM)IDC_COMBOACCOUNT,0);
- DlgEnableAccount(hDlg,FALSE,0);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- break;
+ if (IDOK != MessageBox(hDlg, TranslateT("Do you really want to delete this account?"), TranslateT("Delete account confirmation"), MB_OKCANCEL | MB_ICONWARNING))
+ return TRUE;
- case IDC_BTNRESET:
- if (ActualAccount != NULL)
- ActualAccount->TimeLeft=ActualAccount->Interval;
- return 1;
- }
+ DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
- if (HIWORD(wParam) == EN_CHANGE)
- Changed = TRUE;
+ if (ActualAccount->hContact != NULL)
+ CallService(MS_DB_CONTACT_DELETE, ActualAccount->hContact, 0);
+
+ CallService(MS_YAMN_DELETEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)ActualAccount);
+
+ //We can consider our account as deleted.
+
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_DELETESTRING, (WPARAM)Result, 0);
+ DlgSetItemText(hDlg, (WPARAM)IDC_COMBOACCOUNT, 0);
+ DlgEnableAccount(hDlg, FALSE, 0);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
break;
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY ) {
- char Text[MAX_PATH];
- WCHAR TextW[MAX_PATH];
- BOOL Translated,NewAcc=FALSE,Check,CheckMsg,CheckSnd,CheckIco,CheckApp, CheckAPOP;
- BOOL CheckNMsgP,CheckFMsg,CheckFSnd,CheckFIco;
- BOOL CheckKBN, CheckContact,CheckContactNick,CheckContactNoEvent;
- BOOL CheckSSL, CheckABody, CheckNoTLS;
- //BOOL Check0,Check1,Check2,Check3,Check4,Check5,Check6,Check7,Check8,Check9,
- BOOL CheckStart,CheckForce;
- size_t Length,index;
- UINT Port,Interval;
-
- if ( GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT, Text, _countof(Text))) {
- Check = (IsDlgButtonChecked(hDlg,IDC_CHECK)==BST_CHECKED);
- CheckSSL = (IsDlgButtonChecked(hDlg,IDC_CHECKSSL)==BST_CHECKED);
- CheckNoTLS = (IsDlgButtonChecked(hDlg,IDC_CHECKNOTLS)==BST_CHECKED);
- CheckAPOP = (IsDlgButtonChecked(hDlg,IDC_CHECKAPOP)==BST_CHECKED);
-
- CheckABody = (IsDlgButtonChecked(hDlg,IDC_AUTOBODY)==BST_CHECKED);
- CheckMsg = (IsDlgButtonChecked(hDlg,IDC_CHECKMSG)==BST_CHECKED);
- CheckSnd = (IsDlgButtonChecked(hDlg,IDC_CHECKSND)==BST_CHECKED);
- CheckIco = (IsDlgButtonChecked(hDlg,IDC_CHECKICO)==BST_CHECKED);
-
- CheckApp = (IsDlgButtonChecked(hDlg,IDC_CHECKAPP)==BST_CHECKED);
- CheckKBN = (IsDlgButtonChecked(hDlg,IDC_CHECKKBN)==BST_CHECKED);
- CheckContact = (IsDlgButtonChecked(hDlg,IDC_CHECKCONTACT)==BST_CHECKED);
- CheckContactNick = (IsDlgButtonChecked(hDlg,IDC_CHECKCONTACTNICK)==BST_CHECKED);
- CheckContactNoEvent = (IsDlgButtonChecked(hDlg,IDC_CHECKCONTACTNOEVENT)==BST_CHECKED);
-
- CheckFSnd = (IsDlgButtonChecked(hDlg,IDC_CHECKFSND)==BST_CHECKED);
- CheckFMsg = (IsDlgButtonChecked(hDlg,IDC_CHECKFMSG)==BST_CHECKED);
- CheckFIco = (IsDlgButtonChecked(hDlg,IDC_CHECKFICO)==BST_CHECKED);
-
- CheckNMsgP = (IsDlgButtonChecked(hDlg,IDC_CHECKNMSGP)==BST_CHECKED);
-
- Port = GetDlgItemInt(hDlg, IDC_EDITPORT, &Translated, FALSE);
- if ( !Translated ) {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITPORT));
- break;
- }
- Interval = GetDlgItemInt(hDlg,IDC_EDITINTERVAL,&Translated,FALSE);
- if ( !Translated ) {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITINTERVAL));
- break;
- }
+ case IDC_BTNRESET:
+ if (ActualAccount != NULL)
+ ActualAccount->TimeLeft = ActualAccount->Interval;
+ return 1;
+ }
- GetDlgItemTextA(hDlg, IDC_EDITAPP, Text, _countof(Text));
- if (CheckApp && !(Length = mir_strlen(Text))) {
- MessageBox(hDlg,TranslateT("Please select application to run"),TranslateT("Input error"),MB_OK);
- break;
- }
+ if (HIWORD(wParam) == EN_CHANGE)
+ Changed = TRUE;
+ break;
- GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text));
- if ( !( Length = mir_strlen(Text))) {
- GetDlgItemTextA(hDlg,IDC_EDITNAME, Text, _countof(Text));
- if ( !(Length = mir_strlen( Text )))
- break;
- }
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
+ char Text[MAX_PATH];
+ WCHAR TextW[MAX_PATH];
+ BOOL Translated, NewAcc = FALSE, Check, CheckMsg, CheckSnd, CheckIco, CheckApp, CheckAPOP;
+ BOOL CheckNMsgP, CheckFMsg, CheckFSnd, CheckFIco;
+ BOOL CheckKBN, CheckContact, CheckContactNick, CheckContactNoEvent;
+ BOOL CheckSSL, CheckABody, CheckNoTLS;
+ //BOOL Check0,Check1,Check2,Check3,Check4,Check5,Check6,Check7,Check8,Check9,
+ BOOL CheckStart, CheckForce;
+ size_t Length, index;
+ UINT Port, Interval;
+
+ if (GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text))) {
+ Check = (IsDlgButtonChecked(hDlg, IDC_CHECK) == BST_CHECKED);
+ CheckSSL = (IsDlgButtonChecked(hDlg, IDC_CHECKSSL) == BST_CHECKED);
+ CheckNoTLS = (IsDlgButtonChecked(hDlg, IDC_CHECKNOTLS) == BST_CHECKED);
+ CheckAPOP = (IsDlgButtonChecked(hDlg, IDC_CHECKAPOP) == BST_CHECKED);
+
+ CheckABody = (IsDlgButtonChecked(hDlg, IDC_AUTOBODY) == BST_CHECKED);
+ CheckMsg = (IsDlgButtonChecked(hDlg, IDC_CHECKMSG) == BST_CHECKED);
+ CheckSnd = (IsDlgButtonChecked(hDlg, IDC_CHECKSND) == BST_CHECKED);
+ CheckIco = (IsDlgButtonChecked(hDlg, IDC_CHECKICO) == BST_CHECKED);
+
+ CheckApp = (IsDlgButtonChecked(hDlg, IDC_CHECKAPP) == BST_CHECKED);
+ CheckKBN = (IsDlgButtonChecked(hDlg, IDC_CHECKKBN) == BST_CHECKED);
+ CheckContact = (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACT) == BST_CHECKED);
+ CheckContactNick = (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACTNICK) == BST_CHECKED);
+ CheckContactNoEvent = (IsDlgButtonChecked(hDlg, IDC_CHECKCONTACTNOEVENT) == BST_CHECKED);
+
+ CheckFSnd = (IsDlgButtonChecked(hDlg, IDC_CHECKFSND) == BST_CHECKED);
+ CheckFMsg = (IsDlgButtonChecked(hDlg, IDC_CHECKFMSG) == BST_CHECKED);
+ CheckFIco = (IsDlgButtonChecked(hDlg, IDC_CHECKFICO) == BST_CHECKED);
+
+ CheckNMsgP = (IsDlgButtonChecked(hDlg, IDC_CHECKNMSGP) == BST_CHECKED);
+
+ Port = GetDlgItemInt(hDlg, IDC_EDITPORT, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITPORT));
+ break;
+ }
+ Interval = GetDlgItemInt(hDlg, IDC_EDITINTERVAL, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITINTERVAL));
+ break;
+ }
- DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+ GetDlgItemTextA(hDlg, IDC_EDITAPP, Text, _countof(Text));
+ if (CheckApp && !(Length = mir_strlen(Text))) {
+ MessageBox(hDlg, TranslateT("Please select application to run"), TranslateT("Input error"), MB_OK);
+ break;
+ }
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)Text))) {
- NewAcc=TRUE;
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write wait\n");
- #endif
- WaitToWriteSO(POP3Plugin->AccountBrowserSO);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write enter\n");
- #endif
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT,(WPARAM)POP3Plugin,(LPARAM)YAMN_ACCOUNTVERSION))) {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write done\n");
- #endif
- WriteDoneSO(POP3Plugin->AccountBrowserSO);
- MessageBox(hDlg,TranslateT("Cannot allocate memory space for new account"),TranslateT("Memory error"),MB_OK);
- break;
- }
- }
- else {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write wait\n");
- #endif
- //We have to get full access to AccountBrowser, so other iterating thrads cannot get new account until new account is right set
- WaitToWriteSO(POP3Plugin->AccountBrowserSO);
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text));
+ if (!(Length = mir_strlen(Text))) {
+ GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
+ if (!(Length = mir_strlen(Text)))
+ break;
+ }
+
+ DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)Text))) {
+ NewAcc = TRUE;
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write wait\n");
+ #endif
+ WaitToWriteSO(POP3Plugin->AccountBrowserSO);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write enter\n");
+ #endif
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_GETNEXTFREEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)YAMN_ACCOUNTVERSION))) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write enter\n");
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
#endif
- }
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write wait\n");
- #endif
- if (WAIT_OBJECT_0 != WaitToWrite(ActualAccount))
- {
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write wait failed\n");
- #endif
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualBrowserSO-write done\n");
- #endif
WriteDoneSO(POP3Plugin->AccountBrowserSO);
-
+ MessageBox(hDlg, TranslateT("Cannot allocate memory space for new account"), TranslateT("Memory error"), MB_OK);
+ break;
}
+ }
+ else {
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write wait\n");
+ #endif
+ //We have to get full access to AccountBrowser, so other iterating thrads cannot get new account until new account is right set
+ WaitToWriteSO(POP3Plugin->AccountBrowserSO);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write enter\n");
+ #endif
+ }
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write wait\n");
+ #endif
+ if (WAIT_OBJECT_0 != WaitToWrite(ActualAccount)) {
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write enter\n");
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write wait failed\n");
#endif
-
- GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
- if ( !(Length = mir_strlen( Text )))
- break;
- if (NULL != ActualAccount->Name)
- delete[] ActualAccount->Name;
- ActualAccount->Name = new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Name,Text);
-
- GetDlgItemTextA(hDlg,IDC_EDITSERVER,Text,_countof(Text));
- if (NULL != ActualAccount->Server->Name)
- delete[] ActualAccount->Server->Name;
- ActualAccount->Server->Name=new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Server->Name,Text);
-
- GetDlgItemTextA(hDlg,IDC_EDITLOGIN,Text,_countof(Text));
- if (NULL != ActualAccount->Server->Login)
- delete[] ActualAccount->Server->Login;
- ActualAccount->Server->Login=new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Server->Login,Text);
-
- GetDlgItemTextA(hDlg,IDC_EDITPASS,Text,_countof(Text));
- if (NULL != ActualAccount->Server->Passwd)
- delete[] ActualAccount->Server->Passwd;
- ActualAccount->Server->Passwd=new char[ mir_strlen(Text)+1];
- mir_strcpy(ActualAccount->Server->Passwd,Text);
-
- GetDlgItemTextW(hDlg,IDC_EDITAPP,TextW,_countof(TextW));
- if (NULL != ActualAccount->NewMailN.App)
- delete[] ActualAccount->NewMailN.App;
- ActualAccount->NewMailN.App=new WCHAR[mir_wstrlen(TextW)+1];
- mir_wstrcpy(ActualAccount->NewMailN.App,TextW);
-
- GetDlgItemTextW(hDlg,IDC_EDITAPPPARAM,TextW,_countof(TextW));
- if (NULL != ActualAccount->NewMailN.AppParam)
- delete[] ActualAccount->NewMailN.AppParam;
- ActualAccount->NewMailN.AppParam=new WCHAR[mir_wstrlen(TextW)+1];
- mir_wstrcpy(ActualAccount->NewMailN.AppParam,TextW);
-
- ActualAccount->Server->Port=Port;
- ActualAccount->Interval=Interval*60;
-
- if (CB_ERR==(index=SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_GETCURSEL,0,0)))
- index = CPDEFINDEX;
- ActualAccount->CP = CodePageNamesSupp[index].CP;
-
- if (NewAcc)
- ActualAccount->TimeLeft=Interval*60;
-
- CheckStart = (IsDlgButtonChecked(hDlg,IDC_CHECKSTART)==BST_CHECKED);
- CheckForce = (IsDlgButtonChecked(hDlg,IDC_CHECKFORCE)==BST_CHECKED);
-
- ActualAccount->Flags=
- (Check ? YAMN_ACC_ENA : 0) |
- (CheckSSL ? YAMN_ACC_SSL23 : 0) |
- (CheckNoTLS ? YAMN_ACC_NOTLS : 0) |
- (CheckAPOP ? YAMN_ACC_APOP : 0) |
- (CheckABody ? YAMN_ACC_BODY : 0) |
- (ActualAccount->Flags & YAMN_ACC_POPN);
-
- ActualAccount->StatusFlags=
- (Check0 ? YAMN_ACC_ST0 : 0) |
- (Check1 ? YAMN_ACC_ST1 : 0) |
- (Check2 ? YAMN_ACC_ST2 : 0) |
- (Check3 ? YAMN_ACC_ST3 : 0) |
- (Check4 ? YAMN_ACC_ST4 : 0) |
- (Check5 ? YAMN_ACC_ST5 : 0) |
- (Check6 ? YAMN_ACC_ST6 : 0) |
- (Check7 ? YAMN_ACC_ST7 : 0) |
- (Check8 ? YAMN_ACC_ST8 : 0) |
- (Check9 ? YAMN_ACC_ST9 : 0) |
- (CheckStart ? YAMN_ACC_STARTS : 0) |
- (CheckForce ? YAMN_ACC_FORCE : 0);
-
- ActualAccount->NewMailN.Flags=
- (CheckSnd ? YAMN_ACC_SND : 0) |
- (CheckMsg ? YAMN_ACC_MSG : 0) |
- (CheckIco ? YAMN_ACC_ICO : 0) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_POP) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC) |
- (CheckApp ? YAMN_ACC_APP : 0) |
- (CheckKBN ? YAMN_ACC_KBN : 0) |
- (CheckContact ? YAMN_ACC_CONT : 0) |
- (CheckContactNick ? YAMN_ACC_CONTNICK : 0) |
- (CheckContactNoEvent ? YAMN_ACC_CONTNOEVENT : 0) |
- YAMN_ACC_MSGP; //this is default: when new mail arrives and window was displayed, leave it displayed.
-
- ActualAccount->NoNewMailN.Flags=
- (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP) |
- (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC) |
- (CheckNMsgP ? YAMN_ACC_MSGP : 0);
-
- ActualAccount->BadConnectN.Flags=
- (CheckFSnd ? YAMN_ACC_SND : 0) |
- (CheckFMsg ? YAMN_ACC_MSG : 0) |
- (CheckFIco ? YAMN_ACC_ICO : 0) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_POP) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC);
-
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write done\n");
+ DebugLog(SynchroFile, "Options:APPLY:ActualBrowserSO-write done\n");
#endif
- WriteDone(ActualAccount);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write done\n");
- #endif
WriteDoneSO(POP3Plugin->AccountBrowserSO);
-
- EnableWindow(GetDlgItem(hDlg,IDC_BTNDEL),TRUE);
-
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
-
- index = SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0);
-
- HPOP3ACCOUNT temp = ActualAccount;
-
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_RESETCONTENT,0,0);
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
-
- ActualAccount = temp;
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_SETCURSEL,(WPARAM)index,(LPARAM)ActualAccount->Name);
-
- WritePOP3Accounts();
- RefreshContact();
- return TRUE;
+
}
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write enter\n");
+ #endif
+
+ GetDlgItemTextA(hDlg, IDC_EDITNAME, Text, _countof(Text));
+ if (!(Length = mir_strlen(Text)))
+ break;
+ if (NULL != ActualAccount->Name)
+ delete[] ActualAccount->Name;
+ ActualAccount->Name = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Name, Text);
+
+ GetDlgItemTextA(hDlg, IDC_EDITSERVER, Text, _countof(Text));
+ if (NULL != ActualAccount->Server->Name)
+ delete[] ActualAccount->Server->Name;
+ ActualAccount->Server->Name = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Server->Name, Text);
+
+ GetDlgItemTextA(hDlg, IDC_EDITLOGIN, Text, _countof(Text));
+ if (NULL != ActualAccount->Server->Login)
+ delete[] ActualAccount->Server->Login;
+ ActualAccount->Server->Login = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Server->Login, Text);
+
+ GetDlgItemTextA(hDlg, IDC_EDITPASS, Text, _countof(Text));
+ if (NULL != ActualAccount->Server->Passwd)
+ delete[] ActualAccount->Server->Passwd;
+ ActualAccount->Server->Passwd = new char[mir_strlen(Text) + 1];
+ mir_strcpy(ActualAccount->Server->Passwd, Text);
+
+ GetDlgItemTextW(hDlg, IDC_EDITAPP, TextW, _countof(TextW));
+ if (NULL != ActualAccount->NewMailN.App)
+ delete[] ActualAccount->NewMailN.App;
+ ActualAccount->NewMailN.App = new WCHAR[mir_wstrlen(TextW) + 1];
+ mir_wstrcpy(ActualAccount->NewMailN.App, TextW);
+
+ GetDlgItemTextW(hDlg, IDC_EDITAPPPARAM, TextW, _countof(TextW));
+ if (NULL != ActualAccount->NewMailN.AppParam)
+ delete[] ActualAccount->NewMailN.AppParam;
+ ActualAccount->NewMailN.AppParam = new WCHAR[mir_wstrlen(TextW) + 1];
+ mir_wstrcpy(ActualAccount->NewMailN.AppParam, TextW);
+
+ ActualAccount->Server->Port = Port;
+ ActualAccount->Interval = Interval * 60;
+
+ if (CB_ERR == (index = SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_GETCURSEL, 0, 0)))
+ index = CPDEFINDEX;
+ ActualAccount->CP = CodePageNamesSupp[index].CP;
+
+ if (NewAcc)
+ ActualAccount->TimeLeft = Interval * 60;
+
+ CheckStart = (IsDlgButtonChecked(hDlg, IDC_CHECKSTART) == BST_CHECKED);
+ CheckForce = (IsDlgButtonChecked(hDlg, IDC_CHECKFORCE) == BST_CHECKED);
+
+ ActualAccount->Flags =
+ (Check ? YAMN_ACC_ENA : 0) |
+ (CheckSSL ? YAMN_ACC_SSL23 : 0) |
+ (CheckNoTLS ? YAMN_ACC_NOTLS : 0) |
+ (CheckAPOP ? YAMN_ACC_APOP : 0) |
+ (CheckABody ? YAMN_ACC_BODY : 0) |
+ (ActualAccount->Flags & YAMN_ACC_POPN);
+
+ ActualAccount->StatusFlags =
+ (Check0 ? YAMN_ACC_ST0 : 0) |
+ (Check1 ? YAMN_ACC_ST1 : 0) |
+ (Check2 ? YAMN_ACC_ST2 : 0) |
+ (Check3 ? YAMN_ACC_ST3 : 0) |
+ (Check4 ? YAMN_ACC_ST4 : 0) |
+ (Check5 ? YAMN_ACC_ST5 : 0) |
+ (Check6 ? YAMN_ACC_ST6 : 0) |
+ (Check7 ? YAMN_ACC_ST7 : 0) |
+ (Check8 ? YAMN_ACC_ST8 : 0) |
+ (Check9 ? YAMN_ACC_ST9 : 0) |
+ (CheckStart ? YAMN_ACC_STARTS : 0) |
+ (CheckForce ? YAMN_ACC_FORCE : 0);
+
+ ActualAccount->NewMailN.Flags =
+ (CheckSnd ? YAMN_ACC_SND : 0) |
+ (CheckMsg ? YAMN_ACC_MSG : 0) |
+ (CheckIco ? YAMN_ACC_ICO : 0) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_POP) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_POPC) |
+ (CheckApp ? YAMN_ACC_APP : 0) |
+ (CheckKBN ? YAMN_ACC_KBN : 0) |
+ (CheckContact ? YAMN_ACC_CONT : 0) |
+ (CheckContactNick ? YAMN_ACC_CONTNICK : 0) |
+ (CheckContactNoEvent ? YAMN_ACC_CONTNOEVENT : 0) |
+ YAMN_ACC_MSGP; //this is default: when new mail arrives and window was displayed, leave it displayed.
+
+ ActualAccount->NoNewMailN.Flags =
+ (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POP) |
+ (ActualAccount->NoNewMailN.Flags & YAMN_ACC_POPC) |
+ (CheckNMsgP ? YAMN_ACC_MSGP : 0);
+
+ ActualAccount->BadConnectN.Flags =
+ (CheckFSnd ? YAMN_ACC_SND : 0) |
+ (CheckFMsg ? YAMN_ACC_MSG : 0) |
+ (CheckFIco ? YAMN_ACC_ICO : 0) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_POP) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_POPC);
+
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write done\n");
+ #endif
+ WriteDone(ActualAccount);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
+ #endif
+ WriteDoneSO(POP3Plugin->AccountBrowserSO);
+
+ EnableWindow(GetDlgItem(hDlg, IDC_BTNDEL), TRUE);
+
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+
+ index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0);
+
+ HPOP3ACCOUNT temp = ActualAccount;
+
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_RESETCONTENT, 0, 0);
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
+
+ ActualAccount = temp;
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, (WPARAM)index, (LPARAM)ActualAccount->Name);
+
+ WritePOP3Accounts();
+ RefreshContact();
+ return TRUE;
}
- break;
+ }
+ break;
}
if (Changed)
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
return FALSE;
}
-INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgProcPOP3AccPopup(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL Changed=FALSE;
- static BOOL InList=FALSE;
+ BOOL Changed = FALSE;
+ static BOOL InList = FALSE;
static HPOP3ACCOUNT ActualAccount;
static UCHAR ActualStatus;
-// static struct CPOP3Options POP3Options;
+ // static struct CPOP3Options POP3Options;
- switch(msg)
- {
- case WM_INITDIALOG:
+ switch (msg) {
+ case WM_INITDIALOG:
{
- DlgEnableAccountPopup(hDlg,FALSE,FALSE);
- DlgShowAccountPopup(hDlg,(WPARAM)M_SHOWDEFAULT,0);
+ DlgEnableAccountPopup(hDlg, FALSE, FALSE);
+ DlgShowAccountPopup(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
//DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read wait\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read wait\n");
#endif
WaitToReadSO(POP3Plugin->AccountBrowserSO);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read enter\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read enter\n");
#endif
if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
#ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:INITDIALOG:AccountBrowserSO-read done\n");
+ DebugLog(SynchroFile, "Options:INITDIALOG:AccountBrowserSO-read done\n");
#endif
ReadDoneSO(POP3Plugin->AccountBrowserSO);
- ActualAccount=NULL;
+ ActualAccount = NULL;
+
-
TranslateDialogDefault(hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
return TRUE;
}
- case WM_SHOWWINDOW:
- if ((BOOL)wParam==FALSE)
- {
- WindowList_Remove(pYAMNVar->MessageWnds,hDlg);
- SendMessage(GetParent(hDlg),PSM_UNCHANGED,(WPARAM)hDlg,0);
- }
- else
- {
- WindowList_Add(pYAMNVar->MessageWnds,hDlg,NULL);
+ case WM_SHOWWINDOW:
+ if ((BOOL)wParam == FALSE) {
+ WindowList_Remove(pYAMNVar->MessageWnds, hDlg);
+ SendMessage(GetParent(hDlg), PSM_UNCHANGED, (WPARAM)hDlg, 0);
+ }
+ else {
+ WindowList_Add(pYAMNVar->MessageWnds, hDlg, NULL);
- int index = SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0);
- HPOP3ACCOUNT temp = ActualAccount;
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_RESETCONTENT,0,0);
+ int index = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0);
+ HPOP3ACCOUNT temp = ActualAccount;
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_RESETCONTENT, 0, 0);
- if (POP3Plugin->FirstAccount != NULL)
- for (ActualAccount=(HPOP3ACCOUNT)POP3Plugin->FirstAccount;ActualAccount != NULL;ActualAccount=(HPOP3ACCOUNT)ActualAccount->Next)
- if (ActualAccount->Name != NULL)
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_ADDSTRING,0,(LPARAM)ActualAccount->Name);
-
- ActualAccount = temp;
-
- if (ActualAccount != NULL)
- {
- SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_SETCURSEL,(WPARAM)index,(LPARAM)ActualAccount->Name);
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
- DlgEnableAccountPopup(hDlg,TRUE,FALSE);
- }
- else
- {
- DlgShowAccountPopup(hDlg,(WPARAM)M_SHOWDEFAULT,0);
- DlgEnableAccountPopup(hDlg,FALSE,FALSE);
- }
+ if (POP3Plugin->FirstAccount != NULL)
+ for (ActualAccount = (HPOP3ACCOUNT)POP3Plugin->FirstAccount; ActualAccount != NULL; ActualAccount = (HPOP3ACCOUNT)ActualAccount->Next)
+ if (ActualAccount->Name != NULL)
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_ADDSTRING, 0, (LPARAM)ActualAccount->Name);
+
+ ActualAccount = temp;
+ if (ActualAccount != NULL) {
+ SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_SETCURSEL, (WPARAM)index, (LPARAM)ActualAccount->Name);
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
+ DlgEnableAccountPopup(hDlg, TRUE, FALSE);
}
- return TRUE;
-
- case WM_COMMAND:
+ else {
+ DlgShowAccountPopup(hDlg, (WPARAM)M_SHOWDEFAULT, 0);
+ DlgEnableAccountPopup(hDlg, FALSE, FALSE);
+ }
+
+ }
+ return TRUE;
+
+ case WM_COMMAND:
{
WORD wNotifyCode = HIWORD(wParam);
- switch(LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
LONG Result;
- case IDC_COMBOACCOUNT:
- switch(wNotifyCode)
- {
-
- case CBN_KILLFOCUS:
- GetDlgItemTextA(hDlg,IDC_COMBOACCOUNT,DlgInput,_countof(DlgInput));
- if (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput)))
- {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- if (mir_strlen(DlgInput))
- DlgEnableAccountPopup(hDlg,TRUE,TRUE);
- else
- DlgEnableAccountPopup(hDlg,FALSE,FALSE);
- }
- else
- {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
- DlgEnableAccountPopup(hDlg,TRUE,TRUE);
- }
- break;
- case CBN_SELCHANGE:
- if (CB_ERR != (Result=SendDlgItemMessage(hDlg,IDC_COMBOACCOUNT,CB_GETCURSEL,0,0)))
- SendDlgItemMessageA(hDlg,IDC_COMBOACCOUNT,CB_GETLBTEXT,(WPARAM)Result,(LPARAM)DlgInput);
- if ((Result==CB_ERR) || (NULL==(ActualAccount=(HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)DlgInput))))
- {
- DlgSetItemText(hDlg,(WPARAM)IDC_STTIMELEFT,0);
- }
- else
- {
- DlgShowAccount(hDlg,(WPARAM)M_SHOWACTUAL,(LPARAM)ActualAccount);
- DlgShowAccountColors(hDlg,0,(LPARAM)ActualAccount);
- DlgEnableAccountPopup(hDlg,TRUE,FALSE);
- }
- break;
+ case IDC_COMBOACCOUNT:
+ switch (wNotifyCode) {
+
+ case CBN_KILLFOCUS:
+ GetDlgItemTextA(hDlg, IDC_COMBOACCOUNT, DlgInput, _countof(DlgInput));
+ if (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ if (mir_strlen(DlgInput))
+ DlgEnableAccountPopup(hDlg, TRUE, TRUE);
+ else
+ DlgEnableAccountPopup(hDlg, FALSE, FALSE);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
+ DlgEnableAccountPopup(hDlg, TRUE, TRUE);
}
break;
- case IDC_COMBOCP:
- {
- int sel = SendDlgItemMessage(hDlg,IDC_COMBOCP,CB_GETCURSEL,0,0);
- CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP,0,&info);
- DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ case CBN_SELCHANGE:
+ if (CB_ERR != (Result = SendDlgItemMessage(hDlg, IDC_COMBOACCOUNT, CB_GETCURSEL, 0, 0)))
+ SendDlgItemMessageA(hDlg, IDC_COMBOACCOUNT, CB_GETLBTEXT, (WPARAM)Result, (LPARAM)DlgInput);
+ if ((Result == CB_ERR) || (NULL == (ActualAccount = (HPOP3ACCOUNT)CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)DlgInput)))) {
+ DlgSetItemText(hDlg, (WPARAM)IDC_STTIMELEFT, 0);
+ }
+ else {
+ DlgShowAccount(hDlg, (WPARAM)M_SHOWACTUAL, (LPARAM)ActualAccount);
+ DlgShowAccountColors(hDlg, 0, (LPARAM)ActualAccount);
+ DlgEnableAccountPopup(hDlg, TRUE, FALSE);
}
- case IDC_RADIOPOPN:
- case IDC_RADIOPOP1:
- Changed=TRUE;
break;
- case IDC_CPB:
- case IDC_CPT:
- case IDC_CPFB:
- case IDC_CPFT:
- case IDC_CPNB:
- case IDC_CPNT:
- if (HIWORD(wParam) != CPN_COLOURCHANGED)
- break;
- case IDC_CHECKCOL:
- case IDC_CHECKFCOL:
- case IDC_CHECKNCOL:
- EnableWindow(GetDlgItem(hDlg,IDC_CPB),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPT),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNB),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNT),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFB),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFT),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED) && wParam);
- Changed=TRUE;
+ }
+ break;
+ case IDC_COMBOCP:
+ {
+ int sel = SendDlgItemMessage(hDlg, IDC_COMBOCP, CB_GETCURSEL, 0, 0);
+ CPINFOEX info; GetCPInfoEx(CodePageNamesSupp[sel].CP, 0, &info);
+ DlgSetItemTextT(hDlg, IDC_STSTATUS, info.CodePageName);
+ }
+ case IDC_RADIOPOPN:
+ case IDC_RADIOPOP1:
+ Changed = TRUE;
+ break;
+ case IDC_CPB:
+ case IDC_CPT:
+ case IDC_CPFB:
+ case IDC_CPFT:
+ case IDC_CPNB:
+ case IDC_CPNT:
+ if (HIWORD(wParam) != CPN_COLOURCHANGED)
break;
-
- case IDC_PREVIEW:
+ case IDC_CHECKCOL:
+ case IDC_CHECKFCOL:
+ case IDC_CHECKNCOL:
+ EnableWindow(GetDlgItem(hDlg, IDC_CPB), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPT), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNB), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNT), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFB), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFT), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED) && wParam);
+ Changed = TRUE;
+ break;
+
+ case IDC_PREVIEW:
{
POPUPDATAT Tester;
POPUPDATAT TesterF;
POPUPDATAT TesterN;
- BOOL TesterC = (IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED);
- BOOL TesterFC = (IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED);
- BOOL TesterNC = (IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED);
-
+ BOOL TesterC = (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED);
+ BOOL TesterFC = (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED);
+ BOOL TesterNC = (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED);
+
memset(&Tester, 0, sizeof(Tester));
memset(&TesterF, 0, sizeof(TesterF));
memset(&TesterN, 0, sizeof(TesterN));
- Tester.lchIcon=g_LoadIconEx(2);
- TesterF.lchIcon=g_LoadIconEx(3);
- TesterN.lchIcon=g_LoadIconEx(1);
-
- mir_tstrncpy(Tester.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
- mir_tstrncpy(TesterF.lptzContactName,TranslateT("Account Test (failed)"),MAX_CONTACTNAME);
- mir_tstrncpy(TesterN.lptzContactName,TranslateT("Account Test"),MAX_CONTACTNAME);
- mir_tstrncpy(Tester.lptzText,TranslateT("You have N new mail messages"),MAX_SECONDLINE);
- mir_tstrncpy(TesterF.lptzText,TranslateT("Connection failed message"),MAX_SECONDLINE);
- mir_tstrncpy(TesterN.lptzText,TranslateT("No new mail message"),MAX_SECONDLINE);
- if (TesterC)
- {
- Tester.colorBack=SendDlgItemMessage(hDlg,IDC_CPB,CPM_GETCOLOUR,0,0);
- Tester.colorText=SendDlgItemMessage(hDlg,IDC_CPT,CPM_GETCOLOUR,0,0);
+ Tester.lchIcon = g_LoadIconEx(2);
+ TesterF.lchIcon = g_LoadIconEx(3);
+ TesterN.lchIcon = g_LoadIconEx(1);
+
+ mir_tstrncpy(Tester.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_tstrncpy(TesterF.lptzContactName, TranslateT("Account Test (failed)"), MAX_CONTACTNAME);
+ mir_tstrncpy(TesterN.lptzContactName, TranslateT("Account Test"), MAX_CONTACTNAME);
+ mir_tstrncpy(Tester.lptzText, TranslateT("You have N new mail messages"), MAX_SECONDLINE);
+ mir_tstrncpy(TesterF.lptzText, TranslateT("Connection failed message"), MAX_SECONDLINE);
+ mir_tstrncpy(TesterN.lptzText, TranslateT("No new mail message"), MAX_SECONDLINE);
+ if (TesterC) {
+ Tester.colorBack = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
+ Tester.colorText = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
}
- else
- {
- Tester.colorBack=GetSysColor(COLOR_BTNFACE);
- Tester.colorText=GetSysColor(COLOR_WINDOWTEXT);
+ else {
+ Tester.colorBack = GetSysColor(COLOR_BTNFACE);
+ Tester.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if (TesterFC)
- {
- TesterF.colorBack=SendDlgItemMessage(hDlg,IDC_CPFB,CPM_GETCOLOUR,0,0);
- TesterF.colorText=SendDlgItemMessage(hDlg,IDC_CPFT,CPM_GETCOLOUR,0,0);
+ if (TesterFC) {
+ TesterF.colorBack = SendDlgItemMessage(hDlg, IDC_CPFB, CPM_GETCOLOUR, 0, 0);
+ TesterF.colorText = SendDlgItemMessage(hDlg, IDC_CPFT, CPM_GETCOLOUR, 0, 0);
}
- else
- {
- TesterF.colorBack=GetSysColor(COLOR_BTNFACE);
- TesterF.colorText=GetSysColor(COLOR_WINDOWTEXT);
+ else {
+ TesterF.colorBack = GetSysColor(COLOR_BTNFACE);
+ TesterF.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- if (TesterNC)
- {
- TesterN.colorBack=SendDlgItemMessage(hDlg,IDC_CPNB,CPM_GETCOLOUR,0,0);
- TesterN.colorText=SendDlgItemMessage(hDlg,IDC_CPNT,CPM_GETCOLOUR,0,0);
+ if (TesterNC) {
+ TesterN.colorBack = SendDlgItemMessage(hDlg, IDC_CPNB, CPM_GETCOLOUR, 0, 0);
+ TesterN.colorText = SendDlgItemMessage(hDlg, IDC_CPNT, CPM_GETCOLOUR, 0, 0);
}
- else
- {
- TesterN.colorBack=GetSysColor(COLOR_BTNFACE);
- TesterN.colorText=GetSysColor(COLOR_WINDOWTEXT);
+ else {
+ TesterN.colorBack = GetSysColor(COLOR_BTNFACE);
+ TesterN.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- Tester.PluginWindowProc=NULL;
- TesterF.PluginWindowProc=NULL;
- TesterN.PluginWindowProc=NULL;
- Tester.PluginData=NULL;
- TesterF.PluginData=NULL;
- TesterN.PluginData=NULL;
-
- if (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED)
+ Tester.PluginWindowProc = NULL;
+ TesterF.PluginWindowProc = NULL;
+ TesterN.PluginWindowProc = NULL;
+ Tester.PluginData = NULL;
+ TesterF.PluginData = NULL;
+ TesterN.PluginData = NULL;
+
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED)
PUAddPopupT(&Tester);
- if (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED)
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED)
PUAddPopupT(&TesterF);
- if (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED)
+ if (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED)
PUAddPopupT(&TesterN);
- Changed=TRUE;
+ Changed = TRUE;
}
- break;
- case IDC_CHECKKBN:
- Changed=TRUE;
- break;
- case IDC_CHECKPOP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKCOL),IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPB),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPT),(IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOPN),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_RADIOPOP1),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED));
- EnableWindow(GetDlgItem(hDlg,IDC_EDITPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED));
- break;
- case IDC_CHECKFPOP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKFCOL),IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFB),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPFT),(IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITFPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED));
- break;
- case IDC_CHECKNPOP:
- Changed=TRUE;
- EnableWindow(GetDlgItem(hDlg,IDC_CHECKNCOL),IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNB),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_CPNT),(IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED) && IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- EnableWindow(GetDlgItem(hDlg,IDC_EDITNPOPS),(IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED));
- break;
-
- }
- if (HIWORD(wParam)==EN_CHANGE)
- Changed=TRUE;
+ break;
+ case IDC_CHECKKBN:
+ Changed = TRUE;
+ break;
+ case IDC_CHECKPOP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKCOL), IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPB), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPT), (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOPN), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_RADIOPOP1), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED));
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED));
+ break;
+ case IDC_CHECKFPOP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKFCOL), IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFB), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPFT), (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITFPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED));
+ break;
+ case IDC_CHECKNPOP:
+ Changed = TRUE;
+ EnableWindow(GetDlgItem(hDlg, IDC_CHECKNCOL), IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNB), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_CPNT), (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED) && IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hDlg, IDC_EDITNPOPS), (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED));
+ break;
+
+ }
+ if (HIWORD(wParam) == EN_CHANGE)
+ Changed = TRUE;
break;
}
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- switch(((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- TCHAR Text[MAX_PATH];
- BOOL Translated,CheckPopup,CheckPopupW;
- BOOL CheckNPopup,CheckNPopupW,CheckFPopup,CheckFPopupW;
- BOOL CheckPopN;
- UINT Time,TimeN,TimeF;
-
- if (GetDlgItemText(hDlg,IDC_COMBOACCOUNT,Text,_countof(Text)))
- {
- CheckPopup = (IsDlgButtonChecked(hDlg,IDC_CHECKPOP)==BST_CHECKED);
- CheckPopupW = (IsDlgButtonChecked(hDlg,IDC_CHECKCOL)==BST_CHECKED);
-
- CheckFPopup = (IsDlgButtonChecked(hDlg,IDC_CHECKFPOP)==BST_CHECKED);
- CheckFPopupW = (IsDlgButtonChecked(hDlg,IDC_CHECKFCOL)==BST_CHECKED);
-
- CheckNPopup = (IsDlgButtonChecked(hDlg,IDC_CHECKNPOP)==BST_CHECKED);
- CheckNPopupW = (IsDlgButtonChecked(hDlg,IDC_CHECKNCOL)==BST_CHECKED);
-
- CheckPopN = (IsDlgButtonChecked(hDlg,IDC_RADIOPOPN)==BST_CHECKED);
-
-
- Time=GetDlgItemInt(hDlg,IDC_EDITPOPS,&Translated,FALSE);
- if (!Translated)
- {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITPOPS));
- break;
- }
- TimeN=GetDlgItemInt(hDlg,IDC_EDITNPOPS,&Translated,FALSE);
- if (!Translated)
- {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITNPOPS));
- break;
- }
- TimeF=GetDlgItemInt(hDlg,IDC_EDITFPOPS,&Translated,FALSE);
- if (!Translated)
- {
- MessageBox(hDlg,TranslateT("This is not a valid number value"),TranslateT("Input error"),MB_OK);
- SetFocus(GetDlgItem(hDlg,IDC_EDITFPOPS));
- break;
- }
-
-
- DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
-
- ActualAccount->Flags=
- (ActualAccount->Flags & YAMN_ACC_ENA) |
- (ActualAccount->Flags & YAMN_ACC_SSL23) |
- (ActualAccount->Flags & YAMN_ACC_NOTLS) |
- (ActualAccount->Flags & YAMN_ACC_APOP) |
- (ActualAccount->Flags & YAMN_ACC_BODY) |
- (CheckPopN ? YAMN_ACC_POPN : 0);
-
- ActualAccount->NewMailN.Flags=
- (ActualAccount->NewMailN.Flags & YAMN_ACC_SND) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_MSG) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_ICO) |
- (CheckPopup ? YAMN_ACC_POP : 0) |
- (CheckPopupW ? YAMN_ACC_POPC : 0) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_APP) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_KBN) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_CONT) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK) |
- (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT) |
- YAMN_ACC_MSGP;
-
- ActualAccount->NoNewMailN.Flags=
- (CheckNPopup ? YAMN_ACC_POP : 0) |
- (CheckNPopupW ? YAMN_ACC_POPC : 0) |
- (ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP);
-
- ActualAccount->BadConnectN.Flags=
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG) |
- (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO) |
- (CheckFPopup ? YAMN_ACC_POP : 0) |
- (CheckFPopupW ? YAMN_ACC_POPC : 0);
-
- ActualAccount->NewMailN.PopupB=SendDlgItemMessage(hDlg,IDC_CPB,CPM_GETCOLOUR,0,0);
- ActualAccount->NewMailN.PopupT=SendDlgItemMessage(hDlg,IDC_CPT,CPM_GETCOLOUR,0,0);
- ActualAccount->NewMailN.PopupTime=Time;
-
- ActualAccount->NoNewMailN.PopupB=SendDlgItemMessage(hDlg,IDC_CPNB,CPM_GETCOLOUR,0,0);
- ActualAccount->NoNewMailN.PopupT=SendDlgItemMessage(hDlg,IDC_CPNT,CPM_GETCOLOUR,0,0);
- ActualAccount->NoNewMailN.PopupTime=TimeN;
-
- ActualAccount->BadConnectN.PopupB=SendDlgItemMessage(hDlg,IDC_CPFB,CPM_GETCOLOUR,0,0);
- ActualAccount->BadConnectN.PopupT=SendDlgItemMessage(hDlg,IDC_CPFT,CPM_GETCOLOUR,0,0);
- ActualAccount->BadConnectN.PopupTime=TimeF;
-
-
-
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:ActualAccountSO-write done\n");
- #endif
- WriteDone(ActualAccount);
- #ifdef DEBUG_SYNCHRO
- DebugLog(SynchroFile,"Options:APPLY:AccountBrowserSO-write done\n");
- #endif
- WriteDoneSO(POP3Plugin->AccountBrowserSO);
-
-// if (0==WritePOP3Accounts())
-// Beep(500,100);
- WritePOP3Accounts();
- RefreshContact();
- return TRUE;
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ {
+ TCHAR Text[MAX_PATH];
+ BOOL Translated, CheckPopup, CheckPopupW;
+ BOOL CheckNPopup, CheckNPopupW, CheckFPopup, CheckFPopupW;
+ BOOL CheckPopN;
+ UINT Time, TimeN, TimeF;
+
+ if (GetDlgItemText(hDlg, IDC_COMBOACCOUNT, Text, _countof(Text))) {
+ CheckPopup = (IsDlgButtonChecked(hDlg, IDC_CHECKPOP) == BST_CHECKED);
+ CheckPopupW = (IsDlgButtonChecked(hDlg, IDC_CHECKCOL) == BST_CHECKED);
+
+ CheckFPopup = (IsDlgButtonChecked(hDlg, IDC_CHECKFPOP) == BST_CHECKED);
+ CheckFPopupW = (IsDlgButtonChecked(hDlg, IDC_CHECKFCOL) == BST_CHECKED);
+
+ CheckNPopup = (IsDlgButtonChecked(hDlg, IDC_CHECKNPOP) == BST_CHECKED);
+ CheckNPopupW = (IsDlgButtonChecked(hDlg, IDC_CHECKNCOL) == BST_CHECKED);
+
+ CheckPopN = (IsDlgButtonChecked(hDlg, IDC_RADIOPOPN) == BST_CHECKED);
+
+
+ Time = GetDlgItemInt(hDlg, IDC_EDITPOPS, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITPOPS));
+ break;
}
- break;
+ TimeN = GetDlgItemInt(hDlg, IDC_EDITNPOPS, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITNPOPS));
+ break;
+ }
+ TimeF = GetDlgItemInt(hDlg, IDC_EDITFPOPS, &Translated, FALSE);
+ if (!Translated) {
+ MessageBox(hDlg, TranslateT("This is not a valid number value"), TranslateT("Input error"), MB_OK);
+ SetFocus(GetDlgItem(hDlg, IDC_EDITFPOPS));
+ break;
+ }
+
+ DlgSetItemTextT(hDlg, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
+
+ ActualAccount->Flags =
+ (ActualAccount->Flags & YAMN_ACC_ENA) |
+ (ActualAccount->Flags & YAMN_ACC_SSL23) |
+ (ActualAccount->Flags & YAMN_ACC_NOTLS) |
+ (ActualAccount->Flags & YAMN_ACC_APOP) |
+ (ActualAccount->Flags & YAMN_ACC_BODY) |
+ (CheckPopN ? YAMN_ACC_POPN : 0);
+
+ ActualAccount->NewMailN.Flags =
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_SND) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_MSG) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_ICO) |
+ (CheckPopup ? YAMN_ACC_POP : 0) |
+ (CheckPopupW ? YAMN_ACC_POPC : 0) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_APP) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_KBN) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_CONT) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNICK) |
+ (ActualAccount->NewMailN.Flags & YAMN_ACC_CONTNOEVENT) |
+ YAMN_ACC_MSGP;
+
+ ActualAccount->NoNewMailN.Flags =
+ (CheckNPopup ? YAMN_ACC_POP : 0) |
+ (CheckNPopupW ? YAMN_ACC_POPC : 0) |
+ (ActualAccount->NoNewMailN.Flags & YAMN_ACC_MSGP);
+
+ ActualAccount->BadConnectN.Flags =
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_SND) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_MSG) |
+ (ActualAccount->BadConnectN.Flags & YAMN_ACC_ICO) |
+ (CheckFPopup ? YAMN_ACC_POP : 0) |
+ (CheckFPopupW ? YAMN_ACC_POPC : 0);
+
+ ActualAccount->NewMailN.PopupB = SendDlgItemMessage(hDlg, IDC_CPB, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NewMailN.PopupT = SendDlgItemMessage(hDlg, IDC_CPT, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NewMailN.PopupTime = Time;
+
+ ActualAccount->NoNewMailN.PopupB = SendDlgItemMessage(hDlg, IDC_CPNB, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NoNewMailN.PopupT = SendDlgItemMessage(hDlg, IDC_CPNT, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->NoNewMailN.PopupTime = TimeN;
+
+ ActualAccount->BadConnectN.PopupB = SendDlgItemMessage(hDlg, IDC_CPFB, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->BadConnectN.PopupT = SendDlgItemMessage(hDlg, IDC_CPFT, CPM_GETCOLOUR, 0, 0);
+ ActualAccount->BadConnectN.PopupTime = TimeF;
+
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:ActualAccountSO-write done\n");
+ #endif
+ WriteDone(ActualAccount);
+ #ifdef DEBUG_SYNCHRO
+ DebugLog(SynchroFile, "Options:APPLY:AccountBrowserSO-write done\n");
+ #endif
+ WriteDoneSO(POP3Plugin->AccountBrowserSO);
+
+ WritePOP3Accounts();
+ RefreshContact();
+ return TRUE;
}
- break;
+ }
+ break;
}
break;
+ }
+ break;
}
if (Changed)
- SendMessage(GetParent(hDlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
return FALSE;
}
-
diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 8ffac76e0b..0557790b2d 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -220,7 +220,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) {
case CNFT_BYTE:
{
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.bVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.bVal);
buffer = _tcsdup(tmp);
break;
@@ -228,7 +228,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) case CNFT_WORD:
{
- mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.wVal);
+ mir_sntprintf(tmp, _T("%d"), ctInfo.wVal);
buffer = _tcsdup(tmp);
break;
@@ -236,7 +236,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) case CNFT_DWORD:
{
- mir_sntprintf(tmp, _countof(tmp), _T("%ld"), ctInfo.dVal);
+ mir_sntprintf(tmp, _T("%ld"), ctInfo.dVal);
buffer = _tcsdup(tmp);
break;
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index 575d8d203b..e79c66a7c4 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -85,7 +85,7 @@ int AddDebugLogMessageA(const char* fmt, ...) mir_vsnprintf(szText, _countof(szText), fmt, va);
va_end(va);
#ifdef MODULENAME
- mir_snprintf(szFinal, _countof(szFinal), "%s: %s", MODULENAME, szText);
+ mir_snprintf(szFinal, "%s: %s", MODULENAME, szText);
#else
strncpy(szFinal, szText, _countof(szFinal));
#endif
@@ -106,7 +106,7 @@ int AddDebugLogMessage(const TCHAR* fmt, ...) mir_vsntprintf(tszText, _countof(tszText), fmt, va);
va_end(va);
#ifdef MODULENAME
- mir_sntprintf(tszFinal, _countof(tszFinal), _T("%s: %s"), MODULENAME, tszText);
+ mir_sntprintf(tszFinal, _T("%s: %s"), MODULENAME, tszText);
#else
_tcsncpy(tszFinal, tszText, _countof(tszFinal));
#endif
diff --git a/plugins/mTextControl/src/FormattedTextDraw.cpp b/plugins/mTextControl/src/FormattedTextDraw.cpp index 8e3afd3103..0c734a02b8 100644 --- a/plugins/mTextControl/src/FormattedTextDraw.cpp +++ b/plugins/mTextControl/src/FormattedTextDraw.cpp @@ -120,7 +120,7 @@ HRESULT CFormattedTextDraw::putTextA(char *newVal) cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), _T("MS Shell Dlg"));
+ _tcsncpy_s(cf.szFaceName, _T("MS Shell Dlg"), _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
@@ -148,7 +148,7 @@ HRESULT CFormattedTextDraw::putTextW(WCHAR *newVal) cf.cbSize = sizeof(cf);
cf.dwMask = CFM_FACE | CFM_BOLD;
cf.dwEffects = 0;
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), _T("MS Shell Dlg"));
+ _tcsncpy_s(cf.szFaceName, _T("MS Shell Dlg"), _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
return S_OK;
}
@@ -170,7 +170,7 @@ HRESULT CFormattedTextDraw::Draw(void *hdcDraw, RECT *prc) cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), lf.lfFaceName);
+ _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
m_spTextServices->TxSendMessage(EM_SETCHARFORMAT, (WPARAM)(SCF_ALL), (LPARAM)&cf, &lResult);
m_spTextServices->TxDraw(
@@ -211,7 +211,7 @@ HRESULT CFormattedTextDraw::get_NaturalSize(void *hdcDraw, long *Width, long *He cf.crTextColor = GetTextColor((HDC)hdcDraw);
cf.bCharSet = lf.lfCharSet;
cf.yHeight = 1440 * abs(lf.lfHeight) / GetDeviceCaps((HDC)hdcDraw, LOGPIXELSY);
- mir_sntprintf(cf.szFaceName, _countof(cf.szFaceName), lf.lfFaceName);
+ _tcsncpy_s(cf.szFaceName, lf.lfFaceName, _TRUNCATE);
if (!m_spTextServices)
return S_FALSE;
diff --git a/plugins/mTextControl/src/richeditutils.cpp b/plugins/mTextControl/src/richeditutils.cpp index 0107d2d92f..16008472f9 100644 --- a/plugins/mTextControl/src/richeditutils.cpp +++ b/plugins/mTextControl/src/richeditutils.cpp @@ -77,7 +77,7 @@ public: HRESULT STDMETHODCALLTYPE GetNewStorage(LPSTORAGE * lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), this->nextStgId);
+ mir_sntprintf(sztName, _T("s%u"), this->nextStgId);
if (this->pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index 98f227bf41..5d09e1bc6b 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -63,7 +63,7 @@ int ProtoAck(WPARAM,LPARAM lparam) DWORD ann = db_get_dw( NULL, THIS_MODULE, "announce", DEFAULT_ANNOUNCE );
if ( ann & ( 1 << ( ack->lParam - ID_STATUS_OFFLINE ))) {
TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
+ mir_sntprintf(buffer, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(ack->hContact, 0), pcli->pfnGetStatusModeDescription(ack->lParam, 0));
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), ack->hContact);
} } }
@@ -121,7 +121,7 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) return 0;
TCHAR bufferW[512];
- mir_sntprintf(bufferW, _countof(bufferW), TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
+ mir_sntprintf(bufferW, TranslateT("%s is %s"), pcli->pfnGetContactDisplayName(wParam, 0), pcli->pfnGetStatusModeDescription(newStatus, 0));
ShowOSD(bufferW, 0, db_get_dw(NULL,THIS_MODULE, "clr_status", DEFAULT_CLRSTATUS), hContact);
return 0;
}
@@ -193,7 +193,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent) c2 = DbGetEventTextT( &dbe, 0 );
TCHAR buffer[512];
- mir_sntprintf(buffer, _countof(buffer), buf, c1, c2);
+ mir_sntprintf(buffer, buf, c1, c2);
ShowOSD(buffer, 0, db_get_dw(NULL,THIS_MODULE, "clr_msg", DEFAULT_CLRMSG), wParam);
mir_free( c1 );
diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp index b99ca2e133..1718f23ef5 100644 --- a/protocols/AimOscar/src/client.cpp +++ b/protocols/AimOscar/src/client.cpp @@ -54,7 +54,7 @@ int CAimProto::aim_auth_request(HANDLE hServerConn, unsigned short &seqno, const char client_id[64], mirver[64];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirver), (LPARAM)mirver);
- int client_id_len = mir_snprintf(client_id, _countof(client_id), "Miranda AIM, version %s", mirver);
+ int client_id_len = mir_snprintf(client_id, "Miranda AIM, version %s", mirver);
char* buf = (char*)alloca(SNAC_SIZE + TLV_HEADER_SIZE * 14 + MD5_HASH_LENGTH + mir_strlen(username) + client_id_len + 30 + mir_strlen(language) + mir_strlen(country));
diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 33bcbf0afe..aaf531eb22 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -97,7 +97,7 @@ void CAimProto::report_file_error(TCHAR *fname) {
TCHAR errmsg[512];
TCHAR* error = mir_a2t(_strerror(NULL));
- mir_sntprintf(errmsg, _countof(errmsg), TranslateT("Failed to open file: %s : %s"), fname, error);
+ mir_sntprintf(errmsg, TranslateT("Failed to open file: %s : %s"), fname, error);
mir_free(error);
ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP);
}
@@ -324,7 +324,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET mir_free(buf);
TCHAR fname[256];
- mir_sntprintf(fname, _countof(fname), _T("%s%s"), ft->pfts.tszWorkingDir, name);
+ mir_sntprintf(fname, _T("%s%s"), ft->pfts.tszWorkingDir, name);
mir_free(name);
mir_free(ft->pfts.tszCurrentFile);
ft->pfts.tszCurrentFile = mir_tstrdup(fname);
diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp index 01eec9d9b2..13d1888690 100644 --- a/protocols/AimOscar/src/popup.cpp +++ b/protocols/AimOscar/src/popup.cpp @@ -65,7 +65,7 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url) {
POPUPDATAT ppd = {0};
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mir_sntprintf(ppd.lptzContactName, TranslateT("%s Protocol"), m_tszUserName);
if (flags & ERROR_POPUP)
{
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 276706acc7..2d359ac09e 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -57,7 +57,7 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2P[128];
- mir_snprintf(szP2P, _countof(szP2P), "%sP2P", m_szModuleName);
+ mir_snprintf(szP2P, "%sP2P", m_szModuleName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
mir_sntprintf(descr, TranslateT("%s Client-to-client connection"), m_tszUserName);
nlu.szSettingsModule = szP2P;
@@ -672,7 +672,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
char szDbsettings[64];
- mir_snprintf(szDbsettings, _countof(szDbsettings), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbsettings, "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
break;
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index a69a768d25..c780fb5129 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -289,7 +289,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[13];
char g = cap[14];
char h = cap[15];
- mir_snprintf(client, _countof(client), CLIENT_OSCARJ, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e));
+ mir_snprintf(client, CLIENT_OSCARJ, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e));
}
else if (memcmp(cap, "MirandaA", 8) == 0) {
char a = cap[8];
@@ -300,7 +300,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[13];
char g = cap[14];
char h = cap[15];
- mir_snprintf(client, _countof(client), CLIENT_AIMOSCAR, a, b, c, d, e, f, g, h);
+ mir_snprintf(client, CLIENT_AIMOSCAR, a, b, c, d, e, f, g, h);
}
if (memcmp(cap, "sinj", 4) == 0) {
char a = cap[4];
@@ -311,7 +311,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[9];
char g = cap[10];
char h = cap[11];
- mir_snprintf(client, _countof(client), CLIENT_OSCARSN, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
+ mir_snprintf(client, CLIENT_OSCARSN, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
}
if (memcmp(cap, "icqp", 4) == 0) {
char a = cap[4];
@@ -322,7 +322,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[9];
char g = cap[10];
char h = cap[11];
- mir_snprintf(client, _countof(client), CLIENT_OSCARPL, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
+ mir_snprintf(client, CLIENT_OSCARPL, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
}
else if (memcmp(cap, "Kopete ICQ", 10) == 0) {
mir_strcpy(client, CLIENT_KOPETE);
@@ -1469,7 +1469,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, _countof(msg), "Error removing buddy from list. Error code %#x", code);
+ mir_snprintf(msg, "Error removing buddy from list. Error code %#x", code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1503,7 +1503,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, _countof(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code);
+ mir_snprintf(msg, Translate("Unknown error when adding buddy to list. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1521,7 +1521,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, _countof(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
+ mir_snprintf(msg, Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1661,7 +1661,7 @@ void CAimProto::snac_mail_response(SNAC &snac)//family 0x0018 if (new_mail && num_msgs) {
TCHAR msg[1024];
- int len = mir_sntprintf(msg, _countof(msg), _T("%S@%S (%d)\r\n%s "), sn, address, num_msgs,
+ int len = mir_sntprintf(msg, _T("%S@%S (%d)\r\n%s "), sn, address, num_msgs,
TranslateT("You've got mail! Checked at"));
SYSTEMTIME stLocal;
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index 27fe595f9a..a4e6b7050f 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -467,7 +467,7 @@ INT_PTR CAimProto::SetAvatar(WPARAM, LPARAM lParam) int fileId = _topen(tFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
if (fileId < 0) {
char errmsg[512];
- mir_snprintf(errmsg, _countof(errmsg), "Cannot store avatar. File '%s' could not be created/overwritten", tFileName);
+ mir_snprintf(errmsg, "Cannot store avatar. File '%s' could not be created/overwritten", tFileName);
ShowPopup(errmsg, ERROR_POPUP);
return 1;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 200c6f90cf..374f517d9c 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -63,7 +63,7 @@ void InitIcons(void) HICON LoadIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "AIM_%s", name);
+ mir_snprintf(szSettingName, "AIM_%s", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -79,7 +79,7 @@ HANDLE GetIconHandle(const char *name) void ReleaseIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName ), "%s_%s", "AIM", name);
+ mir_snprintf(szSettingName, "%s_%s", "AIM", name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 0a774fbf5b..0c785deb79 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -474,42 +474,42 @@ void BdList::remove_by_id(unsigned short id) unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i);
+ mir_snprintf(item, AIM_KEY_BI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_BI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i);
+ mir_snprintf(item, AIM_KEY_BI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i);
+ mir_snprintf(item, AIM_KEY_BI"%d", i);
return delSetting(hContact, item);
}
unsigned short CAimProto::getGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i);
+ mir_snprintf(item, AIM_KEY_GI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_GI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i);
+ mir_snprintf(item, AIM_KEY_GI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i);
+ mir_snprintf(item, AIM_KEY_GI"%d", i);
return delSetting(hContact, item);
}
@@ -530,7 +530,7 @@ int CAimProto::open_contact_file(const char*, const TCHAR* file, const char*, TC int fid = _topen(path, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD);
if (fid < 0) {
TCHAR errmsg[512];
- mir_sntprintf(errmsg, _countof(errmsg), TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL));
+ mir_sntprintf(errmsg, TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL));
ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP);
}
return fid;
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 047f9a29d2..f78db6f0a1 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -126,7 +126,7 @@ void FacebookProto::UpdateAvatarWorker(void *) std::tstring FacebookProto::GetAvatarFolder()
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(path, _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
return path;
}
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 674bbae204..c25734b129 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -415,7 +415,7 @@ void FacebookProto::PrepareNotificationsChatRoom() { MCONTACT hNotificationsChatRoom = ChatIDToHContact(FACEBOOK_NOTIFICATIONS_CHATROOM); if (hNotificationsChatRoom == NULL || getDword(hNotificationsChatRoom, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE) { TCHAR nameT[200]; - mir_sntprintf(nameT, _countof(nameT), _T("%s: %s"), m_tszUserName, TranslateT("Notifications")); + mir_sntprintf(nameT, _T("%s: %s"), m_tszUserName, TranslateT("Notifications")); // Create the group chat session GCSESSION gcw = { sizeof(gcw) }; diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 7083a918ee..05afa3ed0c 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -313,7 +313,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc) if (fbc->participants.size() > namesUsed) { TCHAR more[200]; - mir_sntprintf(more, _countof(more), TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - namesUsed); + mir_sntprintf(more, TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - namesUsed); fbc->chat_name = more; } diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 2cbcfff995..80a825acc9 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -219,7 +219,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara ptrA firstname(data->proto->getStringA(FACEBOOK_KEY_FIRST_NAME)); if (firstname != NULL) { char title[100]; - mir_snprintf(title, _countof(title), Translate("What's on your mind, %s?"), firstname); + mir_snprintf(title, Translate("What's on your mind, %s?"), firstname); SetWindowTextA(hwnd, title); } } diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 3970cf44d8..69b28da0ad 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -391,7 +391,7 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO newText = _A2T(type.c_str()); TCHAR title[200]; - mir_sntprintf(title, _countof(title), TranslateT("User sent %s:"), newText.c_str()); + mir_sntprintf(title, TranslateT("User sent %s:"), newText.c_str()); *message_text += T2Utf(title); *message_text += attachments_text; @@ -685,7 +685,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector< facebo StatusTextData st = { 0 }; st.cbSize = sizeof(st); - mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s is typing a message..."), name); + mir_sntprintf(st.tszText, TranslateT("%s is typing a message..."), name); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 23969b97bc..cfa288d696 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -267,7 +267,7 @@ HANDLE FacebookProto::SearchByEmail(const TCHAR* email) HANDLE FacebookProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName) { TCHAR arg[200]; - mir_sntprintf(arg, _countof(arg), _T("%s %s %s"), nick, firstName, lastName); + mir_sntprintf(arg, _T("%s %s %s"), nick, firstName, lastName); return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs) } @@ -521,7 +521,7 @@ int FacebookProto::OnToolbarInit(WPARAM, LPARAM) ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE; char service[100]; - mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, "/Mind"); + mir_snprintf(service, "%s%s", m_szModuleName, "/Mind"); ttb.pszService = service; ttb.pszTooltipUp = ttb.name = LPGEN("Share status..."); @@ -762,7 +762,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam) return 1; TCHAR tstr[256]; - mir_sntprintf(tstr, _countof(tstr), TranslateT("Do you want to cancel your friendship with '%s'?"), tname); + mir_sntprintf(tstr, TranslateT("Do you want to cancel your friendship with '%s'?"), tname); if (MessageBox(0, tstr, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) { ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); @@ -1123,10 +1123,10 @@ void FacebookProto::MessageRead(MCONTACT hContact) if (isChatRoom(hContact)) { // Load readers names ptrT treaders(getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS)); - mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???")); + mir_sntprintf(st.tszText, TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???")); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } else if (!ServiceExists("MessageState/DummyService")){ - mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("Message read: %s"), ttime); + mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } } diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp index a4721aa652..a35854bfd6 100644 --- a/protocols/GTalkExt/src/menu.cpp +++ b/protocols/GTalkExt/src/menu.cpp @@ -41,7 +41,7 @@ int InitMenus(WPARAM wParam, LPARAM lParam) if (pga != NULL) {
LPCSTR szModuleName = pga->m_japi->GetModuleName();
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX);
+ mir_snprintf(szServiceName, "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX);
CreateServiceFunctionParam(szServiceName, OpenMailboxMenuHandler, (LPARAM)szModuleName);
CMenuItem mi;
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index eca670801e..6978e81507 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -199,7 +199,7 @@ static MEVENT AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *da dbei.eventType = EVENTTYPE_MESSAGE;
char szEventText[4096];
- dbei.cbBlob = mir_snprintf(szEventText, _countof(szEventText), "%s\r\n%s", szUrl, szText);
+ dbei.cbBlob = mir_snprintf(szEventText, "%s\r\n%s", szUrl, szText);
dbei.pBlob = (PBYTE)szEventText;
return db_event_add(hContact, &dbei);
}
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index c666bd591b..f560cddf89 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -389,7 +389,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) size_t avatarFileB64EncLen = mir_strlen(avatarFileB64Enc);
char dataPrefix[64];
- mir_snprintf(dataPrefix, _countof(dataPrefix), "uin=%d&photo=", getDword(GG_KEY_UIN, 0));
+ mir_snprintf(dataPrefix, "uin=%d&photo=", getDword(GG_KEY_UIN, 0));
size_t dataPrefixLen = mir_strlen(dataPrefix);
size_t dataLen = dataPrefixLen + avatarFileB64EncLen;
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 014beec412..e56024d1c3 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -637,7 +637,7 @@ retry: _tcsncpy_s(strFmt2, pcli->pfnGetStatusModeDescription( status_gg2m(atoi(__status)), 0), _TRUNCATE);
if (__city) {
- mir_sntprintf(strFmt1, _countof(strFmt1), _T(", %s %s"), TranslateT("City:"), __city);
+ mir_sntprintf(strFmt1, _T(", %s %s"), TranslateT("City:"), __city);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
}
if (__birthyear) {
@@ -646,7 +646,7 @@ retry: int br = atoi(__birthyear);
if (br < (lt->tm_year + 1900) && br > 1900) {
- mir_sntprintf(strFmt1, _countof(strFmt1), _T(", %s %d"), TranslateT("Age:"), (lt->tm_year + 1900) - br);
+ mir_sntprintf(strFmt1, _T(", %s %d"), TranslateT("Age:"), (lt->tm_year + 1900) - br);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
}
}
@@ -975,7 +975,7 @@ retry: if (iIndexes && iIndexes[i])
continue;
- mir_sntprintf(szMsg, _countof(szMsg), _T("%s (%s)"), szText,
+ mir_sntprintf(szMsg, _T("%s (%s)"), szText,
*e->event.multilogon_info.sessions[i].name != '\0' ?
_A2T(e->event.multilogon_info.sessions[i].name) : TranslateT("Unknown client"));
showpopup(m_tszUserName, szMsg, GG_POPUP_MULTILOGON);
@@ -1008,7 +1008,7 @@ retry: {
CLISTEVENT cle = {0};
char service[128];
- mir_snprintf(service, _countof(service), GGS_RECVIMAGE, m_szModuleName);
+ mir_snprintf(service, GGS_RECVIMAGE, m_szModuleName);
cle.cbSize = sizeof(cle);
cle.hContact = hContact;
@@ -1716,7 +1716,7 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, in {
char sversion[48];
setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD) version);
- mir_snprintf(sversion, _countof(sversion), "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
+ mir_snprintf(sversion, "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
setString(hContact, "MirVer", sversion);
}
}
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 722fb18a97..9c498c4e2a 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -68,7 +68,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule if (dbv.cVal == -100) unspecified = 1; else { ptstr = str; - mir_sntprintf(str, _countof(str), dbv.cVal ? _T("GMT%+d:%02d") : _T("GMT"), -dbv.cVal / 2, (dbv.cVal & 1) * 30); + mir_sntprintf(str, dbv.cVal ? _T("GMT%+d:%02d") : _T("GMT"), -dbv.cVal / 2, (dbv.cVal & 1) * 30); } } else { unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0); @@ -82,7 +82,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule unspecified = 1; } else { ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), pstr); + mir_sntprintf(str, _T("%S"), pstr); } } else { @@ -100,12 +100,12 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule unspecified = 1; } else { ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), pstr); + mir_sntprintf(str, _T("%S"), pstr); } if (dbv.dVal == 0) unspecified = 1; } else if (special == SVS_GGVERSION) { ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), (char *)gg_version2string(dbv.dVal)); + mir_sntprintf(str, _T("%S"), (char *)gg_version2string(dbv.dVal)); } else { ptstr = _itot(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10); } @@ -113,7 +113,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule case DBVT_ASCIIZ: unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0'); ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), dbv.pszVal); + mir_sntprintf(str, _T("%S"), dbv.pszVal); break; case DBVT_TCHAR: unspecified = (special == SVS_ZEROISUNSPEC && dbv.ptszVal[0] == '\0'); diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index dfa99bcffe..3c85052673 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -269,7 +269,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc->tick = tick;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc->file_info.filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc->contact;
@@ -299,7 +299,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc->file_info.filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc->contact;
@@ -497,7 +497,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc7->tick = tick;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc7->filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc7->contact;
@@ -527,7 +527,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc7->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc7->filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc7->contact;
@@ -662,7 +662,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath) {
struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- mir_snprintf(fileName, _countof(fileName), "%s%s", path, dcc->file_info.filename);
+ mir_snprintf(fileName, "%s%s", path, dcc->file_info.filename);
dcc->folder = _strdup((char*)path);
dcc->tick = 0;
mir_free(path);
@@ -702,7 +702,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath) {
struct gg_dcc7 *dcc7 = (struct gg_dcc7 *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- mir_snprintf(fileName, _countof(fileName), "%s%s", path, dcc7->filename);
+ mir_snprintf(fileName, "%s%s", path, dcc7->filename);
dcc7->folder = _strdup((char*)path);
dcc7->tick = 0;
mir_free(path);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index af3bd97329..31d0aa96fb 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -65,9 +65,9 @@ TCHAR* ws_strerror(int code) TCHAR buff[128];
int len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(), 0, buff, _countof(buff), NULL);
if (len == 0)
- mir_sntprintf(err_desc, _countof(err_desc), _T("WinSock %u: Unknown error."), WSAGetLastError());
+ mir_sntprintf(err_desc, _T("WinSock %u: Unknown error."), WSAGetLastError());
else
- mir_sntprintf(err_desc, _countof(err_desc), _T("WinSock %d: %s"), WSAGetLastError(), buff);
+ mir_sntprintf(err_desc, _T("WinSock %d: %s"), WSAGetLastError(), buff);
return err_desc;
}
@@ -154,18 +154,18 @@ void GGPROTO::cleanuplastplugin(DWORD version) debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version);
TCHAR avatarsPath[MAX_PATH];
- mir_sntprintf(avatarsPath, _countof(avatarsPath), _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(avatarsPath, _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
debugLog(_T("cleanuplastplugin() 1: miranda_avatarcache = %s"), avatarsPath);
TCHAR spec[MAX_PATH + 10];
- mir_sntprintf(spec, _countof(spec), _T("%s\\*.(null)"), avatarsPath);
+ mir_sntprintf(spec, _T("%s\\*.(null)"), avatarsPath);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(spec, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
TCHAR filePathT [2*MAX_PATH + 10];
- mir_sntprintf(filePathT, _countof(filePathT), _T("%s\\%s"), avatarsPath, ffd.cFileName);
+ mir_sntprintf(filePathT, _T("%s\\%s"), avatarsPath, ffd.cFileName);
if (!_taccess(filePathT, 0)){
debugLog(_T("cleanuplastplugin() 1: remove file = %s"), filePathT);
_tremove(filePathT);
@@ -410,7 +410,7 @@ void gg_debughandler(int level, const char *format, va_list ap) strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
char prefix[6];
- mir_snprintf(prefix, _countof(prefix), "%lu", GetCurrentThreadId());
+ mir_snprintf(prefix, "%lu", GetCurrentThreadId());
size_t prefixLen = mir_strlen(prefix);
if (prefixLen < PREFIXLEN) memset(prefix + prefixLen, ' ', PREFIXLEN - prefixLen);
memcpy(szText, prefix, PREFIXLEN);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 855542a409..3bcfd97cd5 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -40,7 +40,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) : // Register m_hNetlibUser user
TCHAR name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 4e2bfc3038..51767d71fe 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -43,7 +43,7 @@ int GGPROTO::gc_init() gc_enabled = TRUE;
// create & hook event
- mir_snprintf(service, _countof(service), GG_GC_GETCHAT, m_szModuleName);
+ mir_snprintf(service, GG_GC_GETCHAT, m_szModuleName);
debugLogA("gc_init(): Registered with groupchat plugin.");
}
else debugLogA("gc_init(): Cannot register with groupchat plugin !!!");
@@ -299,7 +299,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count // Create new chat window
TCHAR status[256];
TCHAR *senderName = sender ? pcli->pfnGetContactDisplayName(getcontact(sender, 1, 0, NULL), 0) : NULL;
- mir_sntprintf(status, _countof(status), (sender) ? TranslateT("%s initiated the conference.") : TranslateT("This is my own conference."), senderName);
+ mir_sntprintf(status, (sender) ? TranslateT("%s initiated the conference.") : TranslateT("This is my own conference."), senderName);
GCSESSION gcwindow = { sizeof(gcwindow) };
gcwindow.iType = GCW_CHATROOM;
diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp index c527755058..ea6e2503a2 100644 --- a/protocols/Gadu-Gadu/src/icolib.cpp +++ b/protocols/Gadu-Gadu/src/icolib.cpp @@ -51,7 +51,7 @@ void gg_icolib_init() HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GGDEF_PROTO, name);
+ mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -66,7 +66,7 @@ HANDLE GetIconHandle(int iconId) void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GGDEF_PROTO, name);
+ mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 8f03d5bd26..5cc84e4942 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -845,7 +845,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) if (res != 0) {
TCHAR image_msg[MAX_PATH + 11];
- mir_sntprintf(image_msg, _countof(image_msg), _T("[img]%s[/img]"), szPath);
+ mir_sntprintf(image_msg, _T("[img]%s[/img]"), szPath);
T2Utf szMessage(image_msg);
PROTORECVEVENT pre = {0};
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 4aad3c3838..be19ab681c 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -248,7 +248,7 @@ char *oauth_auth_header(const char *httpmethod, const char *url, OAUTHSIGNMETHOD case RSASHA1: oauth_setparam(oauth_parameters, "oauth_signature_method", "RSA-SHA1"); break;
default: oauth_setparam(oauth_parameters, "oauth_signature_method", "PLAINTEXT"); break;
};
- mir_snprintf(timestamp, _countof(timestamp), "%ld", time(NULL));
+ mir_snprintf(timestamp, "%ld", time(NULL));
oauth_setparam(oauth_parameters, "oauth_timestamp", timestamp);
oauth_setparam(oauth_parameters, "oauth_nonce", ptrA(oauth_generate_nonce()));
if (token != NULL && *token)
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp index ea440fb6b0..daf2d252a6 100644 --- a/protocols/Gadu-Gadu/src/popups.cpp +++ b/protocols/Gadu-Gadu/src/popups.cpp @@ -87,16 +87,16 @@ void GGPROTO::initpopups() puc.hIcon = CopyIcon(LoadIconEx("main", FALSE));
ReleaseIconEx("main", FALSE);
puc.iSeconds = 4;
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Notify");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
hPopupNotify = Popup_RegisterClass(&puc);
puc.colorBack = RGB(191, 0, 0); // Red
puc.colorText = RGB(255, 245, 225); // Yellow
puc.iSeconds = 60;
puc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Error"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
hPopupError = Popup_RegisterClass(&puc);
}
@@ -117,9 +117,9 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) ppd.pszClassName = szName;
if (puData->flags & GG_POPUP_ERROR || puData->flags & GG_POPUP_WARNING)
- mir_snprintf(szName, _countof(szName), "%s_%s", gg->m_szModuleName, "Error");
+ mir_snprintf(szName, "%s_%s", gg->m_szModuleName, "Error");
else
- mir_snprintf(szName, _countof(szName), "%s_%s", gg->m_szModuleName, "Notify");
+ mir_snprintf(szName, "%s_%s", gg->m_szModuleName, "Notify");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
return;
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 077e9ab556..5fa6fb5612 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -42,7 +42,7 @@ char *gg_status2db(int status, const char *suffix) }
static char str[64];
- mir_snprintf(str, _countof(str), "%s%s", prefix, suffix);
+ mir_snprintf(str, "%s%s", prefix, suffix);
return str;
}
@@ -219,7 +219,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) char *AvatarName = strrchr(AvatarURL, '/');
AvatarName++;
char AvatarNameWithTS[128];
- mir_snprintf(AvatarNameWithTS, _countof(AvatarNameWithTS), "%s%s", AvatarName, AvatarTs);
+ mir_snprintf(AvatarNameWithTS, "%s%s", AvatarName, AvatarTs);
AvatarHash = gg_avatarhash(AvatarNameWithTS);
}
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index 001d2189b9..49a84ea229 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -168,7 +168,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w HANDLE hProtoAckEvent;
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
- mir_sntprintf(newTitle, _countof(newTitle), oldTitle, gg->m_tszUserName);
+ mir_sntprintf(newTitle, oldTitle, gg->m_tszUserName);
SetWindowText(hwndDlg, newTitle);
WindowSetIcon(hwndDlg, "sessions");
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w TCHAR szUrl[256], szIP[64];
szIP[0] = 0;
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, _countof(szIP));
- mir_sntprintf(szUrl, _countof(szUrl), _T("http://whois.domaintools.com/%s"), szIP);
+ mir_sntprintf(szUrl, _T("http://whois.domaintools.com/%s"), szIP);
Utils_OpenUrlT(szUrl);
break;
}
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 8e403f4198..d63dc3cfc1 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -69,7 +69,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, cle.hIcon = LoadIconEx(IDI_DCC);
mir_snprintf(szService, "%s/DblClickEvent", m_szModuleName);
cle.pszService = szService;
- mir_sntprintf(szNick, _countof(szNick), TranslateT("CTCP chat request from %s"), name.c_str());
+ mir_sntprintf(szNick, TranslateT("CTCP chat request from %s"), name.c_str());
cle.ptszTooltip = szNick;
cle.lParam = (LPARAM)pdci;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index a73cec6b40..41befe1236 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -70,9 +70,9 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) TCHAR temp2[270];
if (!ppro->m_info.sServerName.IsEmpty())
- mir_sntprintf(temp2, _countof(temp2), _T("PING %s"), ppro->m_info.sServerName.c_str());
+ mir_sntprintf(temp2, _T("PING %s"), ppro->m_info.sServerName.c_str());
else
- mir_sntprintf(temp2, _countof(temp2), _T("PING %u"), time(0));
+ mir_sntprintf(temp2, _T("PING %u"), time(0));
if (ppro->IsConnected())
ppro->SendIrcMessage(temp2, false);
@@ -259,7 +259,7 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di) bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
{
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _countof(szResponse), _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
return false;
}
@@ -670,7 +670,7 @@ bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg) {
if (pmsg->m_bIncoming && pmsg->sCommand == _T("PING")) {
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _countof(szResponse), _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
}
@@ -1677,7 +1677,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg) TCHAR temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
mir_tstrcat(temp, _T("%s\r\n"));
- mir_sntprintf(temp2, _countof(temp2), temp, pmsg->parameters[2].c_str());
+ mir_sntprintf(temp2, temp, pmsg->parameters[2].c_str());
m_whoisDlg->m_InfoOther.SetText(temp2);
}
ShowMessage(pmsg);
@@ -1727,7 +1727,7 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg) TCHAR tTimeBuf[128], *tStopStr;
time_t ttTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
_tcsftime(tTimeBuf, 128, _T("%c"), localtime(&ttTime));
- mir_sntprintf(temp3, _countof(temp3), TranslateT("online since %s, idle %s"), tTimeBuf, temp);
+ mir_sntprintf(temp3, TranslateT("online since %s, idle %s"), tTimeBuf, temp);
m_whoisDlg->m_AwayTime.SetText(temp3);
}
ShowMessage(pmsg);
@@ -1813,7 +1813,7 @@ bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg) if (pmsg->m_bIncoming) {
if (nickflag && ((m_alternativeNick[0] != 0)) && (pmsg->parameters.getCount() > 2 && mir_tstrcmp(pmsg->parameters[1].c_str(), m_alternativeNick))) {
TCHAR m[200];
- mir_sntprintf(m, _countof(m), _T("NICK %s"), m_alternativeNick);
+ mir_sntprintf(m, _T("NICK %s"), m_alternativeNick);
if (IsConnected())
SendIrcMessage(m);
}
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index d5967a7b22..ef2611db39 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -121,7 +121,7 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) TCHAR buf[5];
for (int index = 1; index < 8; index++) {
- mir_sntprintf(buf, _countof(buf), _T("#$%u"), index);
+ mir_sntprintf(buf, _T("#$%u"), index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
str.Replace(buf, GetWord(line, index).c_str());
else {
@@ -131,11 +131,11 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) }
}
for (int index2 = 1; index2 < 8; index2++) {
- mir_sntprintf(buf, _countof(buf), _T("$%u-"), index2);
+ mir_sntprintf(buf, _T("$%u-"), index2);
str.Replace(buf, GetWordAddress(line, index2));
}
for (int index3 = 1; index3 < 8; index3++) {
- mir_sntprintf(buf, _countof(buf), _T("$%u"), index3);
+ mir_sntprintf(buf, _T("$%u"), index3);
str.Replace(buf, GetWord(line, index3).c_str());
}
Messageout += GetWordAddress(str.c_str(), 1);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 9625abd87a..91c2744542 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -181,15 +181,15 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(name, _countof(name), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = name;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
char szTemp2[256];
- mir_snprintf(szTemp2, _countof(szTemp2), "%s DCC", m_szModuleName);
+ mir_snprintf(szTemp2, "%s DCC", m_szModuleName);
nlu.szSettingsModule = szTemp2;
- mir_sntprintf(name, _countof(name), TranslateT("%s client-to-client connections"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.ptszDescriptiveName = name;
hNetlibDCC = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -274,13 +274,13 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) if (m_nick[0]) {
TCHAR szBuf[40];
if (mir_tstrlen(m_alternativeNick) == 0) {
- mir_sntprintf(szBuf, _countof(szBuf), _T("%s%u"), m_nick, rand() % 9999);
+ mir_sntprintf(szBuf, _T("%s%u"), m_nick, rand() % 9999);
setTString("AlernativeNick", szBuf);
mir_tstrncpy(m_alternativeNick, szBuf, 30);
}
if (mir_tstrlen(m_name) == 0) {
- mir_sntprintf(szBuf, _countof(szBuf), _T("Miranda%u"), rand() % 9999);
+ mir_sntprintf(szBuf, _T("Miranda%u"), rand() % 9999);
setTString("Name", szBuf);
mir_tstrncpy(m_name, szBuf, 200);
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index dff5b71451..e187f941e6 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -398,7 +398,7 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto> pData->m_name = m_server.GetTextA();
char temp[255];
- mir_snprintf(temp, _countof(temp), "%s: %s", pData->m_group, pData->m_name);
+ mir_snprintf(temp, "%s: %s", pData->m_group, pData->m_name);
mir_free(pData->m_name);
pData->m_name = mir_strdup(temp);
@@ -776,9 +776,9 @@ void CConnectPrefsDlg::OnApply() char TextLine[512];
if (pData->m_iSSL > 0)
- mir_snprintf(TextLine, _countof(TextLine), "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
else
- mir_snprintf(TextLine, _countof(TextLine), "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
db_set_s(NULL, SERVERSMODULE, pData->m_name, TextLine);
// combobox might contain new items
@@ -1372,7 +1372,7 @@ void CIrcProto::InitIgnore(void) int idx = 0;
char settingName[40];
for (;;) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", idx++);
+ mir_snprintf(settingName, "IGNORE:%d", idx++);
DBVARIANT dbv;
if (getTString(settingName, &dbv))
@@ -1392,13 +1392,13 @@ void CIrcProto::RewriteIgnoreSettings(void) int i = 0;
for (;;) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", i++);
+ mir_snprintf(settingName, "IGNORE:%d", i++);
if (db_unset(NULL, m_szModuleName, settingName))
break;
}
for (i = 0; i < m_ignoreItems.getCount(); i++) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", i);
+ mir_snprintf(settingName, "IGNORE:%d", i);
CIrcIgnoreItem& C = m_ignoreItems[i];
setTString(settingName, (C.mask + _T(" ") + C.flags + _T(" ") + C.network).c_str());
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 579c409c47..8a293c72da 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -116,7 +116,7 @@ int IrcPrebuildContactMenu(WPARAM wParam, LPARAM lParam) void InitContactMenus(void)
{
char temp[MAXMODULELABELLENGTH];
- char *d = temp + mir_snprintf(temp, _countof(temp), "IRC");
+ char *d = temp + mir_snprintf(temp, "IRC");
CMenuItem mi;
mi.pszService = temp;
@@ -438,7 +438,7 @@ static void DoChatFormatting(TCHAR* pszText) if (p1 - 3 >= pszText && p1[-3] == '\003')
mir_tstrcpy(InsertThis, _T(","));
else if (iFG >= 0)
- mir_sntprintf(InsertThis, _countof(InsertThis), _T("\x03%u,"), iFG);
+ mir_sntprintf(InsertThis, _T("\x03%u,"), iFG);
else
mir_tstrcpy(InsertThis, _T("\x0399,"));
@@ -447,7 +447,7 @@ static void DoChatFormatting(TCHAR* pszText) case 'F':
if (iFG >= 0)
- mir_sntprintf(InsertThis, _countof(InsertThis), _T("\x03%u,99"), iFG);
+ mir_sntprintf(InsertThis, _T("\x03%u,99"), iFG);
else
mir_tstrcpy(InsertThis, _T("\x0399,99"));
iRemoveChars = 2;
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 2b40c291fe..fded5db590 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -376,13 +376,13 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) ShowWindow(m_list.GetHwnd(), SW_HIDE);
// New dialog title
- mir_sntprintf(newTitle, _countof(newTitle), TranslateT("%s - Filtered - %d items"), strFilterText, itemCount);
+ mir_sntprintf(newTitle, TranslateT("%s - Filtered - %d items"), strFilterText, itemCount);
SetWindowText(m_hwnd, newTitle);
}
else {
ShowWindow(m_list.GetHwnd(), SW_SHOW);
ShowWindow(m_list2.GetHwnd(), SW_HIDE);
- mir_sntprintf(newTitle, _countof(newTitle), TranslateT("Channels on server"));
+ mir_sntprintf(newTitle, TranslateT("Channels on server"));
SetWindowText(m_hwnd, newTitle);
}
}
@@ -967,7 +967,7 @@ void CManagerDlg::OnAdd(CCtrlButton*) TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _countof(temp2), _T("/MODE %s %s %s"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, _T("/MODE %s %s %s"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -1010,7 +1010,7 @@ void CManagerDlg::OnEdit(CCtrlButton*) TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _countof(temp2), _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index d1361cf9f3..25610a5bf7 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -735,7 +735,7 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info) // prepare mood id
if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus - 1] != -1)
- mir_snprintf(szMoodData, _countof(szMoodData), "icqmood%d", moodXStatus[bXStatus - 1]);
+ mir_snprintf(szMoodData, "icqmood%d", moodXStatus[bXStatus - 1]);
else
szMoodData[0] = '\0';
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index e8afe60295..f0f32a831b 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -2602,7 +2602,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, size_t wLen) char szMsg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- mir_snprintf(szMsg, _countof(szMsg), ICQTranslateUtfStatic(LPGEN("Contact \"%s\" has closed the message window."), szFormat, MAX_PATH), nick);
+ mir_snprintf(szMsg, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" has closed the message window."), szFormat, MAX_PATH), nick);
ShowPopupMsg(hContact, ICQTranslateUtfStatic(LPGEN("ICQ Note"), szFormat, MAX_PATH), szMsg, LOG_NOTE);
SAFE_FREE((void**)&nick);
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 4d52f6fc21..a447dfe7dc 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -181,7 +181,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, size_t wBufferLength, snac_hea break; char szLogText[MAX_PATH]; - mir_snprintf(szLogText, _countof(szLogText), szChange, nItems); + mir_snprintf(szLogText, szChange, nItems); debugLogA("Server sent SNAC(x13,x%02x) - %s", pSnacHeader->wSubtype, szLogText); } break; diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 7c6a406454..654bfa7f2e 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -525,7 +525,7 @@ int CIcqProto::parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfo for (int i = 0; i < nRecordDef; i++) {
char szItemKey[MAX_PATH];
- mir_snprintf(szItemKey, _countof(szItemKey), pRecordDef[i].szDbSetting, nRecords);
+ mir_snprintf(szItemKey, pRecordDef[i].szDbSetting, nRecords);
switch (pRecordDef[i].dbType) {
case DBVT_UTF8:
@@ -550,7 +550,7 @@ int CIcqProto::parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfo for (int i = nRecords; i <= nMaxRecords; i++)
for (int j = 0; j < nRecordDef; j++) {
char szItemKey[MAX_PATH];
- mir_snprintf(szItemKey, _countof(szItemKey), pRecordDef[j].szDbSetting, i);
+ mir_snprintf(szItemKey, pRecordDef[j].szDbSetting, i);
delSetting(hContact, szItemKey);
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 53caf1b702..284ccf03d4 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -1211,7 +1211,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen const TCHAR *ptszExt;
int dwPaFormat = ProtoGetBufferFormat(pBuffer, &ptszExt);
TCHAR tszImageFile[MAX_PATH];
- mir_sntprintf(tszImageFile, _countof(tszImageFile), _T("%s%s"), pCookieData->szFile, ptszExt);
+ mir_sntprintf(tszImageFile, _T("%s%s"), pCookieData->szFile, ptszExt);
ppro->setByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
ai.format = dwPaFormat; // set the format
diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index 0993175820..1eaa7898ae 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -473,7 +473,7 @@ const char* CIcqProto::detectUserClient( else if (MatchCapability(caps, wLen, &capQipInfium)) {
mir_strcpy(szClientBuf, "QIP Infium");
if (dwFT1) {
- mir_snprintf(ver, _countof(ver), " (%d)", dwFT1);
+ mir_snprintf(ver, " (%d)", dwFT1);
mir_strcat(szClientBuf, ver);
}
if (dwFT2 == 0x0B)
@@ -484,7 +484,7 @@ const char* CIcqProto::detectUserClient( else if (MatchCapability(caps, wLen, &capQip2010, 12)) {
mir_strcpy(szClientBuf, "QIP 2010");
if (dwFT1) {
- mir_snprintf(ver, _countof(ver), " (%d)", dwFT1);
+ mir_snprintf(ver, " (%d)", dwFT1);
mir_strcat(szClientBuf, ver);
}
@@ -493,7 +493,7 @@ const char* CIcqProto::detectUserClient( else if (MatchCapability(caps, wLen, &capQip2012, 12)) {
mir_strcpy(szClientBuf, "QIP 2012");
if (dwFT1) {
- mir_snprintf(ver, _countof(ver), " (%d)", dwFT1);
+ mir_snprintf(ver, " (%d)", dwFT1);
mir_strcat(szClientBuf, ver);
}
@@ -507,7 +507,7 @@ const char* CIcqProto::detectUserClient( mir_snprintf(szClientBuf, 64, cliQip, ver);
if (dwFT1 && dwFT2 == 0x0E) {
- mir_snprintf(ver, _countof(ver), " (%d%d%d%d)", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF, (dwFT1 >> 0x08) & 0xFF, dwFT1 & 0xFF);
+ mir_snprintf(ver, " (%d%d%d%d)", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF, (dwFT1 >> 0x08) & 0xFF, dwFT1 & 0xFF);
mir_strcat(szClientBuf, ver);
}
szClient = szClientBuf;
@@ -528,7 +528,7 @@ const char* CIcqProto::detectUserClient( if (dwFT2 == 0x0FFFF0011 && dwFT3 == 0x1100FFFF && (dwFT1 >> 0x18)) {
char ver[16];
- mir_snprintf(ver, _countof(ver), " %d.%d", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF);
+ mir_snprintf(ver, " %d.%d", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF);
if ((dwFT1 & 0xFF) == 0x0B)
mir_strcat(ver, " Beta");
mir_strcat(szClientBuf, ver);
@@ -943,7 +943,7 @@ const char* CIcqProto::detectUserClient( capstr *capId = MatchCapability(caps, wLen, &capMimPack, 4);
if (capId) {
char szPack[16];
- mir_snprintf(szPack, _countof(szPack), " [%.12s]", (*capId) + 4);
+ mir_snprintf(szPack, " [%.12s]", (*capId) + 4);
// make sure client string is not constant
if (szClient != szClientBuf) {
diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp index 7570cb68fc..91a5de00f0 100644 --- a/protocols/IcqOscarJ/src/icq_firstrun.cpp +++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp @@ -30,7 +30,7 @@ static void accountLoadDetails(CIcqProto *ppro, HWND hwndDlg) char pszUIN[20];
DWORD dwUIN = ppro->getContactUin(NULL);
if (dwUIN) {
- mir_snprintf(pszUIN, _countof(pszUIN), "%u", dwUIN);
+ mir_snprintf(pszUIN, "%u", dwUIN);
SetDlgItemTextA(hwndDlg, IDC_UIN, pszUIN);
}
diff --git a/protocols/IcqOscarJ/src/icq_http.cpp b/protocols/IcqOscarJ/src/icq_http.cpp index 6a46f8e35b..5c5492cbc3 100644 --- a/protocols/IcqOscarJ/src/icq_http.cpp +++ b/protocols/IcqOscarJ/src/icq_http.cpp @@ -54,7 +54,7 @@ int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST * unpackDWord(&buf, &dwSid2);
unpackDWord(&buf, &dwSid3);
unpackDWord(&buf, &dwSid4);
- mir_snprintf(szSid, _countof(szSid), "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4);
+ mir_snprintf(szSid, "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4);
unpackWord(&buf, &wIpLen);
if(nlhr->dataLength < 30 + wIpLen || wIpLen == 0 || wIpLen > sizeof(szHttpServer) - 1)
@@ -73,8 +73,8 @@ int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST * nlhpi.szHttpGetUrl = szHttpGetUrl;
nlhpi.szHttpPostUrl = szHttpPostUrl;
nlhpi.firstPostSequence = 1;
- mir_snprintf(szHttpGetUrl, _countof(szHttpGetUrl), "http://%s/monitor?sid=%s", szHttpServer, szSid);
- mir_snprintf(szHttpPostUrl, _countof(szHttpPostUrl), "http://%s/data?sid=%s&seq=", szHttpServer, szSid);
+ mir_snprintf(szHttpGetUrl, "http://%s/monitor?sid=%s", szHttpServer, szSid);
+ mir_snprintf(szHttpPostUrl, "http://%s/data?sid=%s&seq=", szHttpServer, szSid);
return CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index f420108707..6f79e313c8 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -172,7 +172,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2PModuleName[MAX_PATH];
- mir_snprintf(szP2PModuleName, _countof(szP2PModuleName), "%sP2P", m_szModuleName);
+ mir_snprintf(szP2PModuleName, "%sP2P", m_szModuleName);
mir_sntprintf(szBuffer, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
@@ -241,9 +241,9 @@ int CIcqProto::OnModulesLoaded(WPARAM, LPARAM) char pszSrvGroupsName[MAX_PATH];
char* modules[5] = { 0, 0, 0, 0, 0 };
- mir_snprintf(pszP2PName, _countof(pszP2PName), "%sP2P", m_szModuleName);
- mir_snprintf(pszGroupsName, _countof(pszGroupsName), "%sGroups", m_szModuleName);
- mir_snprintf(pszSrvGroupsName, _countof(pszSrvGroupsName), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(pszP2PName, "%sP2P", m_szModuleName);
+ mir_snprintf(pszGroupsName, "%sGroups", m_szModuleName);
+ mir_snprintf(pszSrvGroupsName, "%sSrvGroups", m_szModuleName);
modules[0] = m_szModuleName;
modules[1] = pszP2PName;
modules[2] = pszGroupsName;
@@ -1215,7 +1215,7 @@ HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription }
else {
char tmp[64];
- mir_snprintf(szFiles, _countof(szFiles), ICQTranslateUtfStatic("%d Files", tmp, _countof(tmp)), ft->dwFileCount);
+ mir_snprintf(szFiles, ICQTranslateUtfStatic("%d Files", tmp, _countof(tmp)), ft->dwFileCount);
pszFiles = szFiles;
}
@@ -1857,11 +1857,11 @@ int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
{
char szDbSetting[MAX_PATH];
- mir_snprintf(szDbSetting, _countof(szDbSetting), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbSetting, "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- mir_snprintf(szDbSetting, _countof(szDbSetting), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- mir_snprintf(szDbSetting, _countof(szDbSetting), "%sGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
}
break;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 3b7745d7d0..8f2b8ba7bb 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -850,7 +850,7 @@ void CIcqProto::LoadServerIDs() int nStart = nServerIDListCount;
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
GroupReserveIdsEnumParam param = { this, szModule };
DBCONTACTENUMSETTINGS dbces = { 0 };
@@ -1178,7 +1178,7 @@ int CIcqProto::IsServerGroupsDefined() char szModule[MAX_PATH];
// flush obsolete linking data
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
iRes = 0; // no groups defined, or older version
@@ -1193,7 +1193,7 @@ void CIcqProto::FlushSrvGroupsCache() {
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
}
@@ -1273,7 +1273,7 @@ void CIcqProto::removeGroupPathLinks(WORD wGroupID) char szModule[MAX_PATH];
char* pars[3];
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
pars[0] = NULL;
pars[1] = (char*)wGroupID;
@@ -1308,7 +1308,7 @@ char* CIcqProto::getServListGroupName(WORD wGroupID) return NULL;
}
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
_itoa(wGroupID, szGroup, 0x10);
if (!CheckServerID(wGroupID, 0)) { // check if valid id, if not give empty and remove
@@ -1330,7 +1330,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName) return;
}
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
_itoa(wGroupID, szGroup, 0x10);
if (szGroupName)
@@ -1344,7 +1344,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName) WORD CIcqProto::getServListGroupLinkID(const char *szPath)
{
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
WORD wGroupId = db_get_w(NULL, szModule, szPath, 0);
@@ -1360,7 +1360,7 @@ WORD CIcqProto::getServListGroupLinkID(const char *szPath) void CIcqProto::setServListGroupLinkID(const char *szPath, WORD wGroupID)
{
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
if (wGroupID)
db_set_w(NULL, szModule, szPath, wGroupID);
@@ -1530,7 +1530,7 @@ char* CIcqProto::getServListUniqueGroupName(const char *szGroupName, int bAlloce szGroupNameBase = null_strdup(szGroupName);
null_strcut(szGroupNameBase, m_wServerListRecordNameMaxLength);
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
do {
pars[0] = (char*)this;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 51b58641c9..a39ec5864f 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -155,7 +155,7 @@ static int GroupEnumIdsEnumProc(const char *szSetting,LPARAM lParam) static void enumServerGroups(CIcqProto* ppro)
{
char szModule[MAX_PATH+9];
- mir_snprintf(szModule, _countof(szModule), "%s%s", ppro->m_szModuleName, "SrvGroups");
+ mir_snprintf(szModule, "%s%s", ppro->m_szModuleName, "SrvGroups");
DBCONTACTENUMSETTINGS dbces = { 0 };
dbces.pfnEnumProc = &GroupEnumIdsEnumProc;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index e663d4ee38..251841a4c9 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -78,9 +78,11 @@ DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) if (!CheckContactCapabilities(hContact, CAPF_XTRAZ) && bAllowDelay)
return 0; // Contact does not support xtraz, do not request details
- struct rates_xstatus_request: public rates_queue_item {
+ struct rates_xstatus_request : public rates_queue_item
+ {
protected:
- virtual rates_queue_item* copyItem(rates_queue_item *aDest = NULL) {
+ virtual rates_queue_item* copyItem(rates_queue_item *aDest = NULL)
+ {
rates_xstatus_request *pDest = (rates_xstatus_request*)aDest;
if (!pDest)
pDest = new rates_xstatus_request(ppro, wGroup);
@@ -89,10 +91,11 @@ DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) return rates_queue_item::copyItem(pDest);
};
public:
- rates_xstatus_request(CIcqProto *ppro, WORD wGroup): rates_queue_item(ppro, wGroup) { };
- virtual ~rates_xstatus_request() { };
+ rates_xstatus_request(CIcqProto *ppro, WORD wGroup) : rates_queue_item(ppro, wGroup) {};
+ virtual ~rates_xstatus_request() {};
- virtual void execute() {
+ virtual void execute()
+ {
dwCookie = ppro->sendXStatusDetailsRequest(hContact, bForced);
};
@@ -136,7 +139,7 @@ static HANDLE LoadXStatusIconLibrary(TCHAR *path, const TCHAR *sub) static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size)
{
- TCHAR path[2*MAX_PATH];
+ TCHAR path[2 * MAX_PATH];
HMODULE hXStatusIconsDLL;
// get miranda's exe path
@@ -150,7 +153,7 @@ static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size) null_strcpy(buf, path, buf_size - 1);
char ident[MAX_PATH];
- if ( LoadStringA(hXStatusIconsDLL, IDS_IDENTIFY, ident, sizeof(ident)) == 0 || mir_strcmp(ident, "# Custom Status Icons #"))
+ if (LoadStringA(hXStatusIconsDLL, IDS_IDENTIFY, ident, sizeof(ident)) == 0 || mir_strcmp(ident, "# Custom Status Icons #"))
*buf = 0;
FreeLibrary(hXStatusIconsDLL);
@@ -165,14 +168,14 @@ HICON CIcqProto::getXStatusIcon(int bStatus, UINT flags) HICON icon = NULL;
if (bStatus > 0 && bStatus <= XSTATUS_COUNT)
- icon = IcoLib_GetIconByHandle(hXStatusIcons[bStatus-1], (flags & LR_BIGICON) != 0);
+ icon = IcoLib_GetIconByHandle(hXStatusIcons[bStatus - 1], (flags & LR_BIGICON) != 0);
return (flags & LR_SHARED || !icon) ? icon : CopyIcon(icon);
}
void setContactExtraIcon(MCONTACT hContact, int xstatus)
{
- ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus-1] : NULL);
+ ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus - 1] : NULL);
}
#define NULLCAP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -207,7 +210,7 @@ capstr capXStatus[XSTATUS_COUNT] = { {0x16, 0x0C, 0x60, 0xBB, 0xDD, 0x44, 0x43, 0xF3, 0x91, 0x40, 0x05, 0x0F, 0x00, 0xE6, 0xC0, 0x09},
{0x64, 0x43, 0xC6, 0xAF, 0x22, 0x60, 0x45, 0x17, 0xB5, 0x8C, 0xD7, 0xDF, 0x8E, 0x29, 0x03, 0x52},
{0x16, 0xF5, 0xB7, 0x6F, 0xA9, 0xD2, 0x40, 0x35, 0x8C, 0xC5, 0xC0, 0x84, 0x70, 0x3C, 0x98, 0xFA},
- {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64},
+ {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64},
{0xb7, 0x08, 0x67, 0xf5, 0x38, 0x25, 0x43, 0x27, 0xa1, 0xff, 0xcf, 0x4c, 0xc1, 0x93, 0x97, 0x97},
{0xdd, 0xcf, 0x0e, 0xa9, 0x71, 0x95, 0x40, 0x48, 0xa9, 0xc6, 0x41, 0x32, 0x06, 0xd6, 0xf2, 0x80},
NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
@@ -215,7 +218,7 @@ capstr capXStatus[XSTATUS_COUNT] = { NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
- NULLCAP, NULLCAP, NULLCAP, NULLCAP};
+ NULLCAP, NULLCAP, NULLCAP, NULLCAP };
const char *nameXStatus[XSTATUS_COUNT] = {
LPGEN("Angry"), // 23
@@ -304,7 +307,7 @@ const char *nameXStatus[XSTATUS_COUNT] = { LPGEN("Sushi"), //79
LPGEN("Playing"), //81
LPGEN("Writing") //84
- };
+};
const int moodXStatus[XSTATUS_COUNT] = {
23,
@@ -392,7 +395,7 @@ const int moodXStatus[XSTATUS_COUNT] = { 78,
79,
81,
- 84};
+ 84 };
void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize)
{
@@ -406,40 +409,40 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, B int nOldXStatusID = getContactXStatus(hContact);
if (m_bMoodsEnabled) {
- // process custom statuses (moods) from ICQ6
+ // process custom statuses (moods) from ICQ6
if (moods) {
if (moodsize > 0)
if (moodsize >= 32)
moods[32] = '\0';
- for (int i = 0; i < XSTATUS_COUNT; i++) {
- char szMoodId[32], szMoodData[32];
+ for (int i = 0; i < XSTATUS_COUNT; i++) {
+ char szMoodId[32], szMoodData[32];
- null_strcpy(szMoodData, moods, moodsize);
+ null_strcpy(szMoodData, moods, moodsize);
- if (moodXStatus[i] == -1) continue;
- mir_snprintf(szMoodId, _countof(szMoodId), "0icqmood%d", moodXStatus[i]);
- if (!mir_strcmp(szMoodId, szMoodData)) {
- BYTE bXStatusId = (BYTE)(i+1);
- char str[MAX_PATH];
+ if (moodXStatus[i] == -1) continue;
+ mir_snprintf(szMoodId, "0icqmood%d", moodXStatus[i]);
+ if (!mir_strcmp(szMoodId, szMoodData)) {
+ BYTE bXStatusId = (BYTE)(i + 1);
+ char str[MAX_PATH];
- SetContactCapabilities(hContact, CAPF_STATUS_MOOD);
+ SetContactCapabilities(hContact, CAPF_STATUS_MOOD);
- // only write default name when it is really needed, i.e. on Custom Status change
- if (nOldXStatusID != bXStatusId) {
- setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
- db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
- delSetting(hContact, DBSETTING_XSTATUS_MSG);
+ // only write default name when it is really needed, i.e. on Custom Status change
+ if (nOldXStatusID != bXStatusId) {
+ setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
+ db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
+ delSetting(hContact, DBSETTING_XSTATUS_MSG);
- debugLogA("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
- bChanged = TRUE;
- }
+ debugLogA("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
+ bChanged = TRUE;
+ }
- // cannot retrieve mood details here - need to be processed with new user details
- nMoodID = bXStatusId;
+ // cannot retrieve mood details here - need to be processed with new user details
+ nMoodID = bXStatusId;
- break;
- }
+ break;
+ }
}
if (nMoodID == 0 && moods)
@@ -448,17 +451,17 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, B }
if (m_bXStatusEnabled) {
- // detect custom status capabilities
+ // detect custom status capabilities
if (caps) {
if (capsize > 0)
for (int i = 0; i < XSTATUS_COUNT; i++) {
if (MatchCapability(caps, capsize, (const capstr*)capXStatus[i], BINARY_CAP_SIZE)) {
- BYTE bXStatusId = (BYTE)(i+1);
+ BYTE bXStatusId = (BYTE)(i + 1);
char str[MAX_PATH];
SetContactCapabilities(hContact, CAPF_XSTATUS);
- // only write default name when it is really needed, i.e. on Custom Status change
+ // only write default name when it is really needed, i.e. on Custom Status change
if (nMoodID == 0 && nOldXStatusID != bXStatusId) {
setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
@@ -509,8 +512,8 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) char szMoodData[32];
// prepare mood id
- if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus-1] != -1)
- mir_snprintf(szMoodData, _countof(szMoodData), "0icqmood%d", moodXStatus[bXStatus-1]);
+ if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus - 1] != -1)
+ mir_snprintf(szMoodData, "0icqmood%d", moodXStatus[bXStatus - 1]);
else
szMoodData[0] = '\0';
@@ -523,14 +526,14 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) if (bXStatus && (m_bXStatusEnabled || m_bMoodsEnabled))
szStatusNote = getSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, "");
// retrieve standard status message (e.g. custom status set to none)
- else {
+ else {
char **pszMsg = MirandaStatusToAwayMsg(m_iStatus);
{
mir_cslock l(m_modeMsgsMutex);
if (pszMsg)
szStatusNote = null_strdup(*pszMsg);
}
-
+
// no default status message, set empty
if (!szStatusNote)
szStatusNote = null_strdup("");
@@ -542,12 +545,12 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) SAFE_FREE(&szStatusNote);
}
-static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_CHAR:
- if(wParam=='\n' && GetKeyState(VK_CONTROL) & 0x8000) {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ if (wParam == '\n' && GetKeyState(VK_CONTROL) & 0x8000) {
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
if (wParam == 1 && GetKeyState(VK_CONTROL) & 0x8000) { // ctrl-a
@@ -560,15 +563,15 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam }
if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) { // ctrl-backspace
DWORD start, end;
- SendMessage(hwnd, EM_GETSEL, (WPARAM)&end, (LPARAM) (PDWORD) NULL);
+ SendMessage(hwnd, EM_GETSEL, (WPARAM)&end, (LPARAM)(PDWORD)NULL);
SendMessage(hwnd, WM_KEYDOWN, VK_LEFT, 0);
- SendMessage(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM) (PDWORD) NULL);
+ SendMessage(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM)(PDWORD)NULL);
WCHAR *text = GetWindowTextUcs(hwnd);
memmove(text + start, text + end, sizeof(WCHAR) * (mir_wstrlen(text) + 1 - end));
SetWindowTextUcs(hwnd, text);
SAFE_FREE(&text);
SendMessage(hwnd, EM_SETSEL, start, start);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM)hwnd);
return 0;
}
break;
@@ -599,23 +602,23 @@ struct InitXStatusData };
#define HM_PROTOACK (WM_USER+10)
-static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
SetXStatusData *dat = (SetXStatusData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char str[MAX_PATH];
- switch(message) {
+ switch (message) {
case HM_PROTOACK:
{
ACKDATA *ack = (ACKDATA*)lParam;
- if (ack->type != ICQACKTYPE_XSTATUS_RESPONSE) break;
+ if (ack->type != ICQACKTYPE_XSTATUS_RESPONSE) break;
if (ack->hContact != dat->hContact) break;
if ((UINT_PTR)ack->hProcess != dat->iEvent) break;
ShowDlgItem(hwndDlg, IDC_RETRXSTATUS, SW_HIDE);
ShowDlgItem(hwndDlg, IDC_XMSG, SW_SHOW);
ShowDlgItem(hwndDlg, IDC_XTITLE, SW_SHOW);
- SetDlgItemText(hwndDlg,IDOK,TranslateT("Close"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("Close"));
UnhookEvent(dat->hEvent); dat->hEvent = NULL;
char *szText = dat->ppro->getSettingStringUtf(dat->hContact, DBSETTING_XSTATUS_NAME, "");
SetDlgItemTextUtf(hwndDlg, IDC_XTITLE, szText);
@@ -633,18 +636,18 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara TranslateDialogDefault(hwndDlg);
dat = (SetXStatusData*)SAFE_MALLOC(sizeof(SetXStatusData));
dat->ppro = init->ppro;
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->bAction = init->bAction;
if (!init->bAction) { // set our xStatus
dat->bXStatus = init->bXStatus;
SendDlgItemMessage(hwndDlg, IDC_XMSG, EM_LIMITTEXT, 1024, 0);
- mir_subclassWindow( GetDlgItem(hwndDlg,IDC_XMSG), MessageEditSubclassProc);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_XMSG), MessageEditSubclassProc);
SetDlgItemTextUtf(hwndDlg, IDC_XMSG, init->szXStatusMsg);
if (dat->ppro->m_bXStatusEnabled) { // custom status enabled, prepare title edit
SendDlgItemMessage(hwndDlg, IDC_XTITLE, EM_LIMITTEXT, 256, 0);
- mir_subclassWindow( GetDlgItem(hwndDlg,IDC_XTITLE), MessageEditSubclassProc);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_XTITLE), MessageEditSubclassProc);
SetDlgItemTextUtf(hwndDlg, IDC_XTITLE, init->szXStatusName);
}
else { // only moods enabled, hide title, resize message edit control
@@ -654,10 +657,10 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara MoveDlgItem(hwndDlg, IDC_XMSG, 5, 9, 179, 65);
}
- dat->okButtonFormat = GetDlgItemTextUtf(hwndDlg,IDOK);
+ dat->okButtonFormat = GetDlgItemTextUtf(hwndDlg, IDOK);
dat->countdown = 5;
SendMessage(hwndDlg, WM_TIMER, 0, 0);
- SetTimer(hwndDlg,1,1000,0);
+ SetTimer(hwndDlg, 1, 1000, 0);
}
else { // retrieve contact's xStatus
dat->hContact = init->hContact;
@@ -667,7 +670,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_XMSG, EM_SETREADONLY, 1, 0);
if (dat->ppro->CheckContactCapabilities(dat->hContact, CAPF_XSTATUS) && !dat->ppro->getByte("XStatusAuto", DEFAULT_XSTATUS_AUTO)) {
- SetDlgItemText(hwndDlg,IDOK,TranslateT("Cancel"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("Cancel"));
dat->hEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_PROTOACK);
ShowDlgItem(hwndDlg, IDC_RETRXSTATUS, SW_SHOW);
ShowDlgItem(hwndDlg, IDC_XMSG, SW_HIDE);
@@ -675,7 +678,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara dat->iEvent = dat->ppro->requestXStatusDetails(dat->hContact, FALSE);
}
else {
- SetDlgItemText(hwndDlg,IDOK,TranslateT("Close"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("Close"));
dat->hEvent = NULL;
char *szText = dat->ppro->getSettingStringUtf(dat->hContact, DBSETTING_XSTATUS_NAME, "");
SetDlgItemTextUtf(hwndDlg, IDC_XTITLE, szText);
@@ -698,41 +701,41 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara }
if (dat->bXStatus) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->ppro->getXStatusIcon(dat->bXStatus, LR_SHARED | LR_BIGICON));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->ppro->getXStatusIcon(dat->bXStatus, LR_SHARED | LR_BIGICON));
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)dat->ppro->getXStatusIcon(dat->bXStatus, LR_SHARED));
}
char buf[MAX_PATH];
char *format = GetWindowTextUtf(hwndDlg);
- mir_snprintf(str, format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):"");
+ mir_snprintf(str, format, dat->bXStatus ? ICQTranslateUtfStatic(nameXStatus[dat->bXStatus - 1], buf, MAX_PATH) : "");
SetWindowTextUtf(hwndDlg, str);
SAFE_FREE(&format);
}
return TRUE;
case WM_TIMER:
- if(dat->countdown == -1) {
- DestroyWindow(hwndDlg);
+ if (dat->countdown == -1) {
+ DestroyWindow(hwndDlg);
break;
}
- mir_snprintf(str,_countof(str),dat->okButtonFormat,dat->countdown);
- SetDlgItemTextUtf(hwndDlg,IDOK,str);
+ mir_snprintf(str, dat->okButtonFormat, dat->countdown);
+ SetDlgItemTextUtf(hwndDlg, IDOK, str);
dat->countdown--;
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDOK:
DestroyWindow(hwndDlg);
break;
-
+
case IDC_XTITLE:
case IDC_XMSG:
if (!dat->bAction) { // set our xStatus
- KillTimer(hwndDlg,1);
- SetDlgItemText(hwndDlg,IDOK,TranslateT("OK"));
+ KillTimer(hwndDlg, 1);
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("OK"));
}
}
break;
@@ -742,14 +745,14 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara char szSetting[64];
dat->ppro->setByte(DBSETTING_XSTATUS_ID, dat->bXStatus);
- char *szValue = GetDlgItemTextUtf(hwndDlg,IDC_XMSG);
+ char *szValue = GetDlgItemTextUtf(hwndDlg, IDC_XMSG);
mir_snprintf(szSetting, "XStatus%dMsg", dat->bXStatus);
db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_MSG, szValue);
SAFE_FREE(&szValue);
if (dat->ppro->m_bXStatusEnabled) {
- szValue = GetDlgItemTextUtf(hwndDlg,IDC_XTITLE);
+ szValue = GetDlgItemTextUtf(hwndDlg, IDC_XTITLE);
mir_snprintf(szSetting, "XStatus%dName", dat->bXStatus);
db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_NAME, szValue);
@@ -793,7 +796,7 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet) if (m_bXStatusEnabled) {
mir_snprintf(szSetting, "XStatus%dName", bXStatus);
- szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus-1], str, MAX_PATH));
+ szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus - 1], str, MAX_PATH));
}
mir_snprintf(szSetting, "XStatus%dMsg", bXStatus);
szMsg = getSettingStringUtf(NULL, szSetting, "");
@@ -851,7 +854,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) HGENMENU hRoot;
{
TCHAR szItem[MAX_PATH + 64];
- mir_sntprintf(szItem, _countof(szItem), TranslateT("%s Custom Status"), m_tszUserName);
+ mir_sntprintf(szItem, TranslateT("%s Custom Status"), m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
@@ -867,7 +870,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) int bXStatusMenuBuilt = 0;
for (int i = 0; i <= XSTATUS_COUNT; i++) {
char srvFce[MAX_PATH + 64];
- mir_snprintf(srvFce, _countof(srvFce), "/menuXStatus%d", i);
+ mir_snprintf(srvFce, "/menuXStatus%d", i);
mi.position++;
if (!i)
@@ -877,8 +880,8 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) CreateProtoServiceParam(srvFce, &CIcqProto::menuXStatus, i);
mi.flags = (bXStatus == i ? CMIF_CHECKED : 0);
- mi.hIcolibItem = i ? hXStatusIcons[i-1] : NULL;
- mi.name.a = i ? (char*)nameXStatus[i-1] : (char *)LPGEN("None");
+ mi.hIcolibItem = i ? hXStatusIcons[i - 1] : NULL;
+ mi.name.a = i ? (char*)nameXStatus[i - 1] : (char *)LPGEN("None");
mi.pszService = srvFce;
hXStatusItems[i] = Menu_AddStatusMenuItem(&mi, m_szModuleName);
@@ -888,7 +891,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) void InitXStatusIcons()
{
- TCHAR lib[2*MAX_PATH] = {0};
+ TCHAR lib[2 * MAX_PATH] = { 0 };
SKINICONDESC sid = { 0 };
sid.section.a = "Protocols/" ICQ_PROTOCOL_NAME "/" LPGEN("Custom Status");
@@ -900,7 +903,7 @@ void InitXStatusIcons() mir_snprintf(szTemp, "icq_xstatus%d", i);
sid.pszName = szTemp;
sid.description.a = (LPSTR)nameXStatus[i];
- sid.iDefaultIndex = -(IDI_XSTATUS1+i);
+ sid.iDefaultIndex = -(IDI_XSTATUS1 + i);
hXStatusIcons[i] = IcoLib_AddIcon(&sid);
}
@@ -982,7 +985,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) // fill status member
if (pData->flags & CSSF_MASK_STATUS)
*pData->status = getContactXStatus(hContact);
-
+
// fill status name member
if (pData->flags & CSSF_MASK_NAME) {
if (pData->flags & CSSF_DEFAULT_NAME) {
@@ -991,10 +994,10 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) return 1; // Failure
if (pData->flags & CSSF_UNICODE) {
- char *text = (char*)nameXStatus[status-1];
+ char *text = (char*)nameXStatus[status - 1];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, text, -1, pData->pwszName, MAX_PATH);
}
- else mir_strcpy(pData->pszName, (char*)nameXStatus[status-1]);
+ else mir_strcpy(pData->pszName, (char*)nameXStatus[status - 1]);
}
else { // moods does not support status title
if (!m_bXStatusEnabled) return 1;
@@ -1009,7 +1012,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) }
else {
DBVARIANT dbv;
- if ( !getString(hContact, DBSETTING_XSTATUS_NAME, &dbv) && dbv.pszVal) {
+ if (!getString(hContact, DBSETTING_XSTATUS_NAME, &dbv) && dbv.pszVal) {
mir_strcpy(pData->pszName, dbv.pszVal);
db_free(&dbv);
}
@@ -1028,7 +1031,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) SAFE_FREE(&wstr);
}
else {
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
if (!getString(hContact, CheckContactCapabilities(hContact, CAPF_STATUS_MOOD) ? DBSETTING_STATUS_NOTE : DBSETTING_XSTATUS_MSG, &dbv) && dbv.pszVal)
mir_strcpy(pData->pszMessage, dbv.pszVal);
@@ -1052,7 +1055,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) *pData->wParam = XSTATUS_COUNT;
if (pData->flags & CSSF_STR_SIZES) {
- DBVARIANT dbv = {DBVT_DELETED};
+ DBVARIANT dbv = { DBVT_DELETED };
if (pData->wParam) {
if (m_bXStatusEnabled && !getString(hContact, DBSETTING_XSTATUS_NAME, &dbv))
@@ -1107,24 +1110,24 @@ INT_PTR CIcqProto::RequestAdvStatusIconIdx(WPARAM wParam, LPARAM) BYTE bXStatus = getContactXStatus(wParam);
if (bXStatus) {
- if (!bXStatusCListIconsValid[bXStatus-1]) { // adding icon
- int idx = hXStatusCListIcons[bXStatus-1];
- HIMAGELIST hCListImageList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
+ if (!bXStatusCListIconsValid[bXStatus - 1]) { // adding icon
+ int idx = hXStatusCListIcons[bXStatus - 1];
+ HIMAGELIST hCListImageList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
if (hCListImageList) {
HICON hXStatusIcon = getXStatusIcon(bXStatus, LR_SHARED);
if (idx > 0)
ImageList_ReplaceIcon(hCListImageList, idx, hXStatusIcon);
else
- hXStatusCListIcons[bXStatus-1] = ImageList_AddIcon(hCListImageList, hXStatusIcon);
+ hXStatusCListIcons[bXStatus - 1] = ImageList_AddIcon(hCListImageList, hXStatusIcon);
// mark icon index in the array as valid
- bXStatusCListIconsValid[bXStatus-1] = TRUE;
+ bXStatusCListIconsValid[bXStatus - 1] = TRUE;
IcoLib_ReleaseIcon(hXStatusIcon);
- }
+ }
}
- int idx = bXStatusCListIconsValid[bXStatus-1] ? hXStatusCListIcons[bXStatus-1] : -1;
+ int idx = bXStatusCListIconsValid[bXStatus - 1] ? hXStatusCListIcons[bXStatus - 1] : -1;
if (idx > 0)
return (idx & 0xFFFF) << 16;
}
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index 644fef9e5c..04709b2579 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -126,7 +126,7 @@ void CIcqProto::icq_LogUsingErrorCode(int level, DWORD dwError, const char *szMs break;
}
- mir_snprintf(szBuf, _countof(szBuf), "%s%s%s (%s %d)",
+ mir_snprintf(szBuf, "%s%s%s (%s %d)",
szMsg ? ICQTranslateUtfStatic(szMsg, str, 1024) : "",
szMsg ? "\r\n\r\n" : "",
ICQTranslateUtfStatic(pszErrorMsg, szErrorMsg, 512),
diff --git a/protocols/IcqOscarJ/src/loginpassword.cpp b/protocols/IcqOscarJ/src/loginpassword.cpp index 2b19ad07eb..81ea3741ed 100644 --- a/protocols/IcqOscarJ/src/loginpassword.cpp +++ b/protocols/IcqOscarJ/src/loginpassword.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DWORD dwUin = ppro->getContactUin(NULL);
TCHAR pszUIN[MAX_PATH];
- mir_sntprintf(pszUIN, _countof(pszUIN), TranslateT("Enter a password for UIN %u:"), dwUin);
+ mir_sntprintf(pszUIN, TranslateT("Enter a password for UIN %u:"), dwUin);
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN);
SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index d378d71dba..4367dadc88 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -1586,7 +1586,7 @@ int CIcqProto::oft_handleFileData(oscar_connection *oc, BYTE *buf, size_t len) char *pszMsg = ICQTranslateUtf(LPGEN("The checksum of file \"%s\" does not match, the file is probably damaged."));
char szBuf[MAX_PATH];
- mir_snprintf(szBuf, _countof(szBuf), pszMsg, ExtractFileName(ft->szThisFile));
+ mir_snprintf(szBuf, pszMsg, ExtractFileName(ft->szThisFile));
icq_LogMessage(LOG_ERROR, szBuf);
SAFE_FREE(&pszMsg);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 15a5048d18..c0974eba95 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -194,7 +194,7 @@ static void sttEmptyBuf(StringBuf *buf) static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
{
char indentLevel[128];
- mir_snprintf(indentLevel, _countof(indentLevel), RTF_INDENT_FMT, (int)(indent*200));
+ mir_snprintf(indentLevel, RTF_INDENT_FMT, (int)(indent*200));
sttAppendBufRaw(buf, RTF_BEGINTAG);
sttAppendBufRaw(buf, indentLevel);
@@ -228,7 +228,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) if (XmlGetChildCount(node)) {
sttAppendBufRaw(buf, RTF_BEGINTEXT);
char indentTextLevel[128];
- mir_snprintf(indentTextLevel, _countof(indentTextLevel), RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
+ mir_snprintf(indentTextLevel, RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
sttAppendBufRaw(buf, indentTextLevel);
}
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 6a00da7d80..6f448c2bab 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -288,7 +288,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) myAddr = (char*)CallService(MS_NETLIB_ADDRESSTOSTRING, 1, nlb.dwExternalIP);
char szAddr[256];
- mir_snprintf(szAddr, _countof(szAddr), "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
+ mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
size_t len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2;
TCHAR *fulljid = (TCHAR *)alloca(sizeof(TCHAR) * len);
@@ -403,7 +403,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer, }
char fileBuffer[2048];
- int bytes = mir_snprintf(fileBuffer, _countof(fileBuffer), "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size);
+ int bytes = mir_snprintf(fileBuffer, "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size);
WsSend(s, fileBuffer, bytes, MSG_DUMPASTEXT);
ft->std.flags |= PFTS_SENDING;
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index ebca9d50dd..0008e5443e 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -113,7 +113,7 @@ CIconPool::~CIconPool() void CIconPool::RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHAR *szSection, TCHAR *szDescription)
{
char szSettingName[128];
- mir_snprintf(szSettingName, _countof(szSettingName), "jabber_%s", name);
+ mir_snprintf(szSettingName, "jabber_%s", name);
CPoolItem *item = new CPoolItem;
item->m_name = mir_strdup(name);
@@ -278,8 +278,8 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, TCHAR *Sec GetModuleFileNameA(NULL, szPath, MAX_PATH);
str = strrchr(szPath, '\\');
if (str != NULL) *str = 0;
- mir_snprintf(szMyPath, _countof(szMyPath), "%s\\Icons\\%s", szPath, filename);
- mir_snprintf(szFullPath, _countof(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
+ mir_snprintf(szMyPath, "%s\\Icons\\%s", szPath, filename);
+ mir_snprintf(szFullPath, "%s\\Icons\\%s,%d", szPath, filename, i);
BOOL nf;
HICON hi = ExtractIconFromPath(szFullPath, &nf);
if (hi) has_proto_icon = TRUE;
@@ -317,7 +317,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) BOOL needFree;
int n = skinStatusToJabberStatus[i];
TCHAR *descr = pcli->pfnGetStatusModeDescription(n + ID_STATUS_OFFLINE, 0);
- mir_snprintf(Uname, _countof(Uname), "%s_Transport_%s_%d", m_szModuleName, proto, n);
+ mir_snprintf(Uname, "%s_Transport_%s_%d", m_szModuleName, proto, n);
HICON hicon = LoadTransportIcon(defFile, -skinIconStatusToResourceId[i], Uname, Group, descr, -(n + ID_STATUS_OFFLINE), &needFree);
int index = (m_transportProtoTableStartIndex[iID] == -1) ? -1 : m_transportProtoTableStartIndex[iID] + n;
int added = ImageList_ReplaceIcon(hAdvancedStatusIcon, index, hicon ? hicon : empty);
@@ -548,7 +548,7 @@ HANDLE g_GetIconHandle(int iconId) HICON g_LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GLOBAL_SETTING_PREFIX, name);
+ mir_snprintf(szSettingName, "%s_%s", GLOBAL_SETTING_PREFIX, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 5c55583396..475e14a7f3 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -219,7 +219,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) JabberShaStrBuf buf;
T2Utf str(m_ThreadInfo->conn.password);
char text[200];
- mir_snprintf(text, _countof(text), "%s%s", m_ThreadInfo->szStreamId, str);
+ mir_snprintf(text, "%s%s", m_ThreadInfo->szStreamId, str);
query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf)));
}
else if (XmlGetChild(queryNode, "password") != NULL)
@@ -751,13 +751,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (nEmail == 0)
mir_strcpy(text, "e-mail");
else
- mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1);
+ mir_snprintf(text, "e-mail%d", nEmail - 1);
}
- else mir_snprintf(text, _countof(text), "e-mail%d", nEmail);
+ else mir_snprintf(text, "e-mail%d", nEmail);
setTString(hContact, text, XmlGetText(m));
if (hContact == NULL) {
- mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail);
+ mir_snprintf(text, "e-mailFlag%d", nEmail);
int nFlag = 0;
if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME;
if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
@@ -925,10 +925,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
else {
char text[100];
- mir_snprintf(text, _countof(text), "Phone%d", nPhone);
+ mir_snprintf(text, "Phone%d", nPhone);
setTString(text, XmlGetText(m));
- mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone);
+ mir_snprintf(text, "PhoneFlag%d", nPhone);
int nFlag = 0;
if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME;
if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK;
@@ -1013,7 +1013,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) delSetting(hContact, "e-mail");
else {
char text[100];
- mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1);
+ mir_snprintf(text, "e-mail%d", nEmail - 1);
if (db_get_s(hContact, m_szModuleName, text, &dbv)) break;
db_free(&dbv);
delSetting(hContact, text);
@@ -1024,11 +1024,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else {
while (true) {
char text[100];
- mir_snprintf(text, _countof(text), "e-mail%d", nEmail);
+ mir_snprintf(text, "e-mail%d", nEmail);
if (getString(text, &dbv)) break;
db_free(&dbv);
delSetting(text);
- mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail);
+ mir_snprintf(text, "e-mailFlag%d", nEmail);
delSetting(text);
nEmail++;
}
@@ -1058,11 +1058,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else {
while (true) {
char text[100];
- mir_snprintf(text, _countof(text), "Phone%d", nPhone);
+ mir_snprintf(text, "Phone%d", nPhone);
if (getString(text, &dbv)) break;
db_free(&dbv);
delSetting(text);
- mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone);
+ mir_snprintf(text, "PhoneFlag%d", nPhone);
delSetting(text);
nPhone++;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index ba19e2ef1e..2ac9597335 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -424,7 +424,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) CMString szTmp;
for (int i = 0; i < nMenuResourceItemsNew; i++) {
- mir_snprintf(text, _countof(text), "/UseResource_%d", i);
+ mir_snprintf(text, "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
CreateProtoServiceParam(text, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES + i);
mi.name.a = "";
@@ -690,7 +690,7 @@ void CJabberProto::MenuInit() mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.root = m_hMenuPriorityRoot;
- mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", 0);
+ mir_snprintf(srvFce, "/menuSetPriority/%d", 0);
bool needServices = !ProtoServiceExists(m_szModuleName, srvFce);
if (needServices)
CreateProtoServiceParam(srvFce, &CJabberProto::OnMenuSetPriority, 0);
@@ -702,7 +702,7 @@ void CJabberProto::MenuInit() continue;
}
- mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", steps[i]);
+ mir_snprintf(srvFce, "/menuSetPriority/%d", steps[i]);
if (steps[i] > 0) {
mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
mi.hIcolibItem = GetIconHandle(IDI_ARROW_UP);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 13fe033689..5f9a47bfdb 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2127,7 +2127,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) mi.pszService = srvFce;
int i = 0;
- mir_snprintf(srvFce, _countof(srvFce), "/menuPrivacy%d", i);
+ mir_snprintf(srvFce, "/menuPrivacy%d", i);
if (i > m_privacyMenuServiceAllocated) {
CreateProtoServiceParam(srvFce, &CJabberProto::menuSetPrivacyList, i);
m_privacyMenuServiceAllocated = i;
@@ -2139,7 +2139,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) for (CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) {
i++;
- mir_snprintf(srvFce, _countof(srvFce), "/menuPrivacy%d", i);
+ mir_snprintf(srvFce, "/menuPrivacy%d", i);
if (i > m_privacyMenuServiceAllocated) {
CreateProtoServiceParam(srvFce, &CJabberProto::menuSetPrivacyList, i);
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index d05e00da66..ee1c82d201 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -493,21 +493,21 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr //search in recent for (int i = 0; i < 10; i++) { char key[30]; - mir_snprintf(key, _countof(key), "RecentlySearched_%d", i); + mir_snprintf(key, "RecentlySearched_%d", i); ptrT szValue(getTStringA(key)); if (szValue == NULL || mir_tstrcmpi(szAddr, szValue)) continue; for (int j = i; j < 10; j++) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j + 1); + mir_snprintf(key, "RecentlySearched_%d", j + 1); szValue = getTStringA(key); if (szValue != NULL) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); } else { if (deleteLastFromDB) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); delSetting(NULL, key); } break; @@ -523,15 +523,15 @@ void CJabberProto::SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog) SearchDeleteFromRecent(szAddr); for (int j = 9; j > 0; j--) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j - 1); + mir_snprintf(key, "RecentlySearched_%d", j - 1); ptrT szValue(getTStringA(key)); if (szValue != NULL) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); } } - mir_snprintf(key, _countof(key), "RecentlySearched_%d", 0); + mir_snprintf(key, "RecentlySearched_%d", 0); setTString(key, szAddr); if (hwndDialog) JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr); @@ -563,7 +563,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR for (i = 0; i < 10; i++) { char key[30]; - mir_snprintf(key, _countof(key), "RecentlySearched_%d", i); + mir_snprintf(key, "RecentlySearched_%d", i); ptrT szValue(dat->ppro->getTStringA(key)); if (szValue != NULL) JabberSearchAddUrlToRecentCombo(hwndDlg, szValue); diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 9edeb32d7e..cf0e6089cf 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -155,7 +155,7 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) mir_md5_state_t ctx;
Utils_GetRandom(digest, sizeof(digest));
- mir_snprintf(cnonce, _countof(cnonce), "%08x%08x%08x%08x", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3]));
+ mir_snprintf(cnonce, "%08x%08x%08x%08x", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3]));
T2Utf uname(info->conn.username), passw(info->conn.password);
ptrA serv(mir_utf8encode(info->conn.server));
@@ -182,15 +182,15 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) mir_md5_finish(&ctx, (BYTE*)hash2);
mir_md5_init(&ctx);
- mir_snprintf(tmpBuf, _countof(tmpBuf), "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
+ mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_append(&ctx, (BYTE*)":", 1);
mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
- mir_snprintf(tmpBuf, _countof(tmpBuf), ":%08d:", iCallCount);
+ mir_snprintf(tmpBuf, ":%08d:", iCallCount);
mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
mir_md5_append(&ctx, (BYTE*)":auth:", 6);
- mir_snprintf(tmpBuf, _countof(tmpBuf), "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
+ mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_finish(&ctx, (BYTE*)digest);
@@ -278,7 +278,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge) mir_sha1_finish(&ctx, storedKey);
char authmsg[4096];
- int authmsgLen = mir_snprintf(authmsg, _countof(authmsg), "%s,%s,c=biws,r=%s", msg1, chl, snonce);
+ int authmsgLen = mir_snprintf(authmsg, "%s,%s,c=biws,r=%s", msg1, chl, snonce);
BYTE clientSig[MIR_SHA1_HASH_SIZE];
mir_hmac_sha1(clientSig, storedKey, sizeof(storedKey), (BYTE*)authmsg, authmsgLen);
diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index e911f2a2c9..ef5cb2a80c 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -72,17 +72,17 @@ void CJabberProto::ConvertPasswords() for (int i = 0;; i++) {
char varName[100];
- mir_snprintf(varName, _countof(varName), "rcMuc_%d_server", i);
+ mir_snprintf(varName, "rcMuc_%d_server", i);
ptrA str(getStringA(NULL, varName));
if (str == NULL)
break;
- mir_snprintf(varName, _countof(varName), "rcMuc_%d", i);
+ mir_snprintf(varName, "rcMuc_%d", i);
passw = JSetStringCrypt(m_szModuleName, NULL, varName);
if (passw != NULL) {
delSetting(varName);
- mir_snprintf(varName, _countof(varName), "password_rcMuc_%d", i);
+ mir_snprintf(varName, "password_rcMuc_%d", i);
setTString(varName, passw);
}
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 31bb9c7241..9122ce016d 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -148,7 +148,7 @@ void ThreadData::xmpp_client_query(void) return;
char temp[256];
- mir_snprintf(temp, _countof(temp), "_xmpp-client._tcp.%s", conn.server);
+ mir_snprintf(temp, "_xmpp-client._tcp.%s", conn.server);
DNS_RECORDA *results = NULL;
DNS_STATUS status = DnsQuery_A(temp, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, (PDNS_RECORD *)&results, NULL);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 1837898e5c..42d77dd05c 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1221,7 +1221,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s setTString(hContact, "ListeningTo", szListeningTo);
char tuneIcon[128];
- mir_snprintf(tuneIcon, _countof(tuneIcon), "%s_%s", m_szModuleName, "main");
+ mir_snprintf(tuneIcon, "%s_%s", m_szModuleName, "main");
WriteAdvStatus(hContact, ADVSTATUS_TUNE, _T("listening_to"), tuneIcon, TranslateT("Listening To"), szListeningTo);
mir_free(szListeningTo);
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index a8056de463..f793de682b 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -77,7 +77,7 @@ void InitComboBoxNumders(HWND hWndCombo, DWORD dwStart, DWORD dwEnd) for (DWORD i = dwStart; i <= dwEnd; i++) {
TCHAR szBuff[MAX_PATH];
- mir_sntprintf(szBuff, _countof(szBuff), _T("%lu"), i);
+ mir_sntprintf(szBuff, _T("%lu"), i);
DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff);
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 05ccb0ba1e..76339802f0 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -48,7 +48,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
{
- mir_snprintf(szAvtSectName, _countof(szAvtSectName), "%s Avatars", m_szModuleName);
+ mir_snprintf(szAvtSectName, "%s Avatars", m_szModuleName);
if (phAvatarsQueueHandle == NULL)
return ERROR_INVALID_HANDLE;
@@ -230,7 +230,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) break;
default:
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode);
+ mir_sntprintf(szErrorText, TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode);
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
break;
}
@@ -288,7 +288,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) }
else {
dwErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Avatars: can't open file %s, error"), wszFileName);
+ mir_sntprintf(szErrorText, TranslateT("Avatars: can't open file %s, error"), wszFileName);
ShowFormattedErrorMessage(szErrorText, dwErrorCode);
}
}
@@ -375,7 +375,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR }
char szBuff[4096];
- mir_snprintf(szBuff, _countof(szBuff), "http://%s/%s/%s/%s", lpszHost, lpszDomain, lpszUser, lpszReqObj);
+ mir_snprintf(szBuff, "http://%s/%s/%s/%s", lpszHost, lpszDomain, lpszUser, lpszReqObj);
CMStringA szSelfVersionString = MraGetSelfVersionString();
NETLIBHTTPHEADER nlbhHeaders[8] = { 0 };
@@ -473,7 +473,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hQueue, MCONTACT hContact, DWORD d return ERROR_NOT_SUPPORTED;
TCHAR tszBase[MAX_PATH];
- mir_sntprintf(tszBase, _countof(tszBase), _T("%s\\%s\\"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(tszBase, _T("%s\\%s\\"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
res = tszBase;
// some path in buff and free space for file name is avaible
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index cc7c1621cc..9ddef0f711 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -857,7 +857,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
else {// err allocating file disk space
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Receive files: can't allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
+ mir_sntprintf(szErrorText, TranslateT("Receive files: can't allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
}
CloseHandle(hFile);
@@ -870,7 +870,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
else {// err on open file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Receive files: can't open file %s, error"), wszFileName);
+ mir_sntprintf(szErrorText, TranslateT("Receive files: can't open file %s, error"), wszFileName);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
bFailed = TRUE;
break;
@@ -878,7 +878,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
else {// err on send request for file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Receive files: request for file %s not sent, error"), dat->pmfqfFiles[i].lpwszName);
+ mir_sntprintf(szErrorText, TranslateT("Receive files: request for file %s not sent, error"), dat->pmfqfFiles[i].lpwszName);
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
bFailed = TRUE;
break;
@@ -1101,14 +1101,14 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) }
else { // err on open file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Send files: can't open file %s, error"), dat->pmfqfFiles[j].lpwszName);
+ mir_sntprintf(szErrorText, TranslateT("Send files: can't open file %s, error"), dat->pmfqfFiles[j].lpwszName);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
bFailed = TRUE;
break;
}
}
else {
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff) + sizeof(MRA_FT_GET_FILE)));
+ mir_sntprintf(szErrorText, TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff) + sizeof(MRA_FT_GET_FILE)));
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
bFailed = TRUE;
break;
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index c92a183c2a..8e71438ceb 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -108,7 +108,7 @@ void InitXStatusIcons() hXStatusAdvancedStatusIcons[0] = NULL;
for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
char szIconName[MAX_PATH];
- mir_snprintf(szIconName, _countof(szIconName), "mra_xstatus%ld", i);
+ mir_snprintf(szIconName, "mra_xstatus%ld", i);
sid.pszName = szIconName;
int iCurIndex = i+IDI_XSTATUS1-1;
@@ -124,7 +124,7 @@ void DestroyXStatusIcons() char szBuff[MAX_PATH];
for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "mra_xstatus%ld", i);
+ mir_snprintf(szBuff, "mra_xstatus%ld", i);
IcoLib_RemoveIcon(szBuff);
}
diff --git a/protocols/MRA/src/MraPlaces.h b/protocols/MRA/src/MraPlaces.h index 4adccbb8a9..d2b0d4d417 100644 --- a/protocols/MRA/src/MraPlaces.h +++ b/protocols/MRA/src/MraPlaces.h @@ -41,7 +41,7 @@ typedef struct {
if (mrapPlaces[i].dwCityID == 0 && mrapPlaces[i].dwPlaceID == 0)
{
- mir_sntprintf(szBuff, _countof(szBuff), L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData);
+ mir_sntprintf(szBuff, L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData);
DebugPrintCRLFW(szBuff);
}
}
@@ -53,7 +53,7 @@ typedef struct {
if (mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID == 0)
{
- mir_sntprintf(szBuff, _countof(szBuff), L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData);
+ mir_sntprintf(szBuff, L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData);
DebugPrintCRLFW(szBuff);
}
}
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 3fb69e53aa..1665a6543c 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -47,20 +47,20 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR bEnabled = GetBit(ppro->getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
CheckDlgButton(hWndDlg, IDC_CHK_ENABLE, bEnabled ? BST_CHECKED : BST_UNCHECKED);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
bUseWinColors = ppro->getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
CheckDlgButton(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
SendDlgItemMessage(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE);
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled);
}
@@ -105,16 +105,16 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR ppro->setDword("PopupsEventFilter", dwPopupsEventFilter);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
ppro->setByte(szBuff, IsDlgButtonChecked(hWndDlg, IDC_CHK_USE_WIN_COLORS));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
}
return TRUE;
@@ -262,21 +262,21 @@ void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LP ppd.PluginData = dat;
char szBuff[MAX_PATH];
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
BOOL bUseWinColors = getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
if (bUseWinColors) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
else {
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
ppd.colorBack = getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
ppd.colorText = getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
}
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
ppd.iSeconds = getDword(szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS && dat->ppro->hWndEMailPopupStatus)
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 012b3d0247..2ac6cdec77 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -36,7 +36,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : m_heNudgeReceived = CreateProtoEvent(PE_NUDGE);
TCHAR name[MAX_PATH];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
@@ -46,7 +46,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : InitMenus();
- mir_snprintf(szNewMailSound, _countof(szNewMailSound), "%s_new_email", m_szModuleName);
+ mir_snprintf(szNewMailSound, "%s_new_email", m_szModuleName);
SkinAddNewSoundEx(szNewMailSound, m_szModuleName, MRA_SOUND_NEW_EMAIL);
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
@@ -525,11 +525,11 @@ HANDLE CMraProto::GetAwayMsg(MCONTACT hContact) SYSTEMTIME tt = { 0 };
dwTime = getDword(hContact, DBSETTING_BLOGSTATUSTIME, 0);
if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &tt))
- mir_sntprintf(szTime, _countof(szTime), _T("%04ld.%02ld.%02ld %02ld:%02ld: "), tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute);
+ mir_sntprintf(szTime, _T("%04ld.%02ld.%02ld %02ld:%02ld: "), tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute);
else
szTime[0] = 0;
- mir_sntprintf(szStatusDesc, _countof(szStatusDesc), _T("%s%s"), szTime, szBlogStatus.c_str());
+ mir_sntprintf(szStatusDesc, _T("%s%s"), szTime, szBlogStatus.c_str());
iRet = GetTickCount();
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)szStatusDesc);
}
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index f43beb4a9d..8925910c2a 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -22,7 +22,7 @@ void AddContactEMailToListParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModu for (int i = 0; true; i++) {
char szBuff[MAX_PATH];
- mir_snprintf(szBuff, _countof(szBuff), "%s%lu", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%lu", lpszValueName, i);
if (DB_GetStringA(hContact, lpszModule, szBuff, szEmail)) {
if (bMRAOnly == FALSE || IsEMailMR(szEmail)) {
WCHAR wszBuff[MAX_EMAIL_LEN];
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index ef7ded50ad..2031f3ad84 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -423,7 +423,7 @@ DWORD CMraProto::GetContactBasicInfoW(MCONTACT hContact, DWORD *pdwID, DWORD *pd for (int i = 0; i < 3; i++) {
char szValue[50];
- mir_snprintf(szValue, _countof(szValue), "MyPhone%d", i);
+ mir_snprintf(szValue, "MyPhone%d", i);
if (DB_GetStringA(hContact, "UserInfo", szValue, szPhone)) {
if (szPhones->GetLength())
szPhones->AppendChar(',');
@@ -474,7 +474,7 @@ DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, D break;
char szValue[MAX_PATH];
- mir_snprintf(szValue, _countof(szValue), "MyPhone%d", i++);
+ mir_snprintf(szValue, "MyPhone%d", i++);
DB_SetStringExA(hContact, "UserInfo", szValue, "+" + szPhone);
}
}
@@ -644,14 +644,14 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & MCONTACT hContact = NULL;
TCHAR szMailBoxStatus[MAX_SECONDLINE];
- mir_sntprintf(szMailBoxStatus, _countof(szMailBoxStatus), TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
+ mir_sntprintf(szMailBoxStatus, TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
if (!pszFrom.IsEmpty() || !pszSubject.IsEmpty()) {
CMStringA szFrom, szSubject;
if (GetEMailFromString(szFrom, szEmail))
hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
- mir_sntprintf(szStatusText, _countof(szStatusText), TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
+ mir_sntprintf(szStatusText, TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
}
else _tcsncpy_s(szStatusText, szMailBoxStatus, _TRUNCATE);
@@ -692,7 +692,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & hWndEMailPopupStatus = NULL;
}
else {
- mir_sntprintf(szStatusText, _countof(szStatusText), TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
+ mir_sntprintf(szStatusText, TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText);
}
}
@@ -802,7 +802,7 @@ DWORD GetContactEMailCountParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModu for (int i = 0; TRUE; i++) {
char szBuff[100];
- mir_snprintf(szBuff, _countof(szBuff), "%s%lu", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%lu", lpszValueName, i);
if (DB_GetStringA(hContact, lpszModule, szBuff, szEmail)) {
if (bMRAOnly == FALSE || IsEMailMR(szEmail))
dwRet++;
@@ -840,7 +840,7 @@ bool GetContactFirstEMailParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModul for (int i = 0; true; i++) {
char szBuff[100];
- mir_snprintf(szBuff, _countof(szBuff), "%s%lu", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%lu", lpszValueName, i);
if (DB_GetStringA(hContact, lpszModule, szBuff, szEmail)) {
if (bMRAOnly == FALSE || IsEMailMR(szEmail)) {
res = szEmail;
@@ -877,7 +877,7 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode else {
dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), NULL) - 2);
szErrDescription[dwErrDescriptionSize] = 0;
- mir_sntprintf(szErrorText, _countof(szErrorText), _T("%s %lu: %s"), TranslateTS(lpwszErrText), dwErrorCode, szErrDescription);
+ mir_sntprintf(szErrorText, _T("%s %lu: %s"), TranslateTS(lpwszErrText), dwErrorCode, szErrDescription);
}
MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, 0, szErrorText);
}
@@ -996,13 +996,13 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->hDlgIcon);
SetWindowText(hWndDlg, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldName", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
SetDlgItemText(hWndDlg, IDC_XTITLE, szBuff.c_str()); // custom xstatus name
else // default xstatus name
SetDlgItemText(hWndDlg, IDC_XTITLE, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
SetDlgItemText(hWndDlg, IDC_XMSG, szBuff.c_str()); // custom xstatus description
else // default xstatus description
@@ -1017,7 +1017,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP case WM_TIMER:
if (dat->dwCountdown != -1) {
TCHAR szBuff[MAX_PATH];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("Closing in %ld"), dat->dwCountdown--);
+ mir_sntprintf(szBuff, TranslateT("Closing in %ld"), dat->dwCountdown--);
SetDlgItemText(hWndDlg, IDOK, szBuff);
break;
}
@@ -1047,7 +1047,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP DWORD dwBuffSize = GetDlgItemText(hWndDlg, IDC_XMSG, szBuff, (STATUS_DESC_MAX + 1));
char szValueName[MAX_PATH];
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dat->dwXStatus);
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff);
@@ -1056,7 +1056,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP mir_tstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1);
dwBuffSize = (DWORD)mir_wstrlen(szBuff);
}
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%dName", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%dName", dat->dwXStatus);
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff);
@@ -1173,7 +1173,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w size_t dwMessageSize = GetWindowTextLength(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND));
EnableWindow(GetDlgItem(hWndDlg, IDOK), (int)dwMessageSize);
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%d/%d"), dwMessageSize, MICBLOG_STATUS_MAX);
+ mir_sntprintf(tszBuff, _T("%d/%d"), dwMessageSize, MICBLOG_STATUS_MAX);
SetDlgItemText(hWndDlg, IDC_STATIC_CHARS_COUNTER, tszBuff);
}
break;
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index b251560c18..59d26b620e 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -282,7 +282,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) HGENMENU hRoot;
{
TCHAR szItem[MAX_PATH + 64];
- mir_sntprintf(szItem, _countof(szItem), _T("%s Custom Status"), m_tszUserName);
+ mir_sntprintf(szItem, _T("%s Custom Status"), m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
@@ -303,10 +303,10 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) if (getByte(NULL, "xStatusShowAll", MRA_DEFAULT_SHOW_ALL_XSTATUSES))
dwCount = MRA_XSTATUS_COUNT;
for (DWORD i = 0; i < dwCount; i ++) {
- mir_snprintf(szServiceFunction, _countof(szServiceFunction), "/menuXStatus%ld", i);
+ mir_snprintf(szServiceFunction, "/menuXStatus%ld", i);
mi.position ++;
if (i) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", i);
+ mir_snprintf(szValueName, "XStatus%ldName", i);
if (mraGetStringW(NULL, szValueName, szStatusTitle))
mi.name.t = (TCHAR*)szStatusTitle.c_str();
else
@@ -400,7 +400,7 @@ void CMraProto::InitMenus() // xstatus menu
for (DWORD i = 0; i < MRA_XSTATUS_COUNT; i++) {
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "/menuXStatus%d", i);
+ mir_snprintf(szServiceName, "/menuXStatus%d", i);
CreateProtoServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i);
}
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 0975551c5e..23f02d6ed6 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -349,11 +349,11 @@ bool CMraProto::CmdHelloAck(BinBuffer &buf) DWORD dwXStatusMir = m_iXStatus, dwXStatus;
DWORD dwStatus = GetMraStatusFromMiradaStatus(m_iDesiredStatus, dwXStatusMir, &dwXStatus);
if (IsXStatusValid(dwXStatusMir)) {// xstatuses
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatusMir);
if (!mraGetStringW(NULL, szValueName, wszStatusTitle))
wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatusMir);
mraGetStringW(NULL, szValueName, wszStatusDesc);
}
else wszStatusTitle = pcli->pfnGetStatusModeDescription(m_iDesiredStatus, 0);
@@ -646,7 +646,7 @@ bool CMraProto::CmdFileTransferAck(BinBuffer &buf) break;
default:// ## unknown error
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
ShowFormattedErrorMessage(szBuff, NO_ERROR);
break;
}
@@ -743,7 +743,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) break;
default:// ## unknown error
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
@@ -1037,7 +1037,7 @@ bool CMraProto::CmdGame(BinBuffer &buf) break;
default:
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
@@ -1205,7 +1205,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) }
else if (fieldType == 'u') {
char szBuff[50];
- mir_snprintf(szBuff, _countof(szBuff), "%lu, ", dwTemp);//;
+ mir_snprintf(szBuff, "%lu, ", dwTemp);//;
debugLogA("%s ", szBuff);
}
else _CrtDbgBreak();
@@ -1345,7 +1345,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error", NO_ERROR);
else {
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
}
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 0440cfa9eb..4b74f823a0 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -353,13 +353,13 @@ DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus) // obsolete (TODO: remove in next version)
char szValueName[MAX_PATH];
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatus);
if (!mraGetStringW(NULL, szValueName, szBuff))
szBuff = lpcszXStatusNameDef[dwXStatus];
mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff);
// obsolete (TODO: remove in next version)
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatus);
if (mraGetStringW(NULL, szValueName, szBuff))
mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff);
else
@@ -401,7 +401,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM, LPARAM lParam) // set custom status name
if (pData->flags & CSSF_MASK_NAME) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatus);
if (pData->flags & CSSF_UNICODE) {
mraSetStringExW(NULL, szValueName, pData->pwszName);
mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, pData->pwszName);
@@ -414,7 +414,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM, LPARAM lParam) // set custom status message
if (pData->flags & CSSF_MASK_MESSAGE) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatus);
if (pData->flags & CSSF_UNICODE) {
mraSetStringExW(NULL, szValueName, pData->pwszMessage);
mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, pData->pwszMessage);
@@ -528,7 +528,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const C if (IsXStatusValid(dwXStatusMir)) {
char szValueName[MAX_PATH];
if (pwszStatusTitle.IsEmpty()) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatusMir);
// custom xstatus name
if (!mraGetStringW(NULL, szValueName, wszStatusTitle))
wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
@@ -536,7 +536,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const C else wszStatusTitle = pwszStatusTitle;
if (pwszStatusDesc.IsEmpty()) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatusMir);
// custom xstatus description
mraGetStringW(NULL, szValueName, wszStatusDesc);
}
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index b8f403a100..aead5f7480 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -278,7 +278,7 @@ int CMsnProto::MSN_GetPassportAuth(void) }
else if (retVal != 3 && retVal != 7) {
char err[512];
- mir_snprintf(err, _countof(err), "Unknown Authentication error: %s", szFault);
+ mir_snprintf(err, "Unknown Authentication error: %s", szFault);
MSN_ShowError(err);
}
}
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 6bb8167167..fbecb676ac 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -480,7 +480,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) sprintf(ft->szInvcookie, "%s/content/imgpsh", uri);
TCHAR tComment[40];
- mir_sntprintf(tComment, _countof(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -521,7 +521,7 @@ void CMsnProto::MSN_ProcessYFind(char* buf, size_t len) const char* szCont = ezxml_attr(cont, "n");
char szEmail[128];
- mir_snprintf(szEmail, _countof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, "%s@%s", szCont, szDom);
const char *szNetId = ezxml_attr(cont, "t");
if (msnSearchId != NULL) {
@@ -761,7 +761,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) for (unsigned i = 4; i < pCount; i++) {
char part[16];
- size_t lenPart = mir_snprintf(part, _countof(part), "{%d}", i - 4);
+ size_t lenPart = mir_snprintf(part, "{%d}", i - 4);
if (parts[i][0] == '\0' && unknown != NULL)
parts[i] = unknown;
size_t lenPartsI = mir_strlen(parts[i]);
@@ -1431,7 +1431,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, ft->p2p_dest = mir_strdup(email);
TCHAR tComment[40];
- mir_sntprintf(tComment, _countof(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -1449,9 +1449,9 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, ThreadData* newThread = new ThreadData;
if (inet_addr(IPAddress) != MyConnection.extIP || !IPAddressInt)
- mir_snprintf(newThread->mServer, _countof(newThread->mServer), "%s:%s", IPAddress, Port);
+ mir_snprintf(newThread->mServer, "%s:%s", IPAddress, Port);
else
- mir_snprintf(newThread->mServer, _countof(newThread->mServer), "%s:%u", IPAddressInt, atol(PortXInt) ^ 0x3141);
+ mir_snprintf(newThread->mServer, "%s:%u", IPAddressInt, atol(PortXInt) ^ 0x3141);
newThread->mType = SERVER_FILETRANS;
@@ -1528,7 +1528,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, if (IPAddress != NULL && Port == NULL && SessionID != NULL && SessionProtocol == NULL) { // netmeeting receive 2
char ipaddr[256];
- mir_snprintf(ipaddr, _countof(ipaddr), "callto://%s", IPAddress);
+ mir_snprintf(ipaddr, "callto://%s", IPAddress);
ShellExecuteA(NULL, "open", ipaddr, NULL, NULL, SW_SHOW);
}
}
@@ -1545,7 +1545,7 @@ void CMsnProto::MSN_ProcessRemove(char* buf, size_t len) int listId = atol(ezxml_attr(cont, "l"));
char szEmail[128];
- mir_snprintf(szEmail, _countof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, "%s@%s", szCont, szDom);
Lists_Remove(listId, szEmail);
MsnContact* msc = Lists_Get(szEmail);
@@ -1641,7 +1641,7 @@ void CMsnProto::MSN_ProcessAdd(char* buf, size_t len) int netId = atol(ezxml_attr(cont, "t"));
char szEmail[128];
- mir_snprintf(szEmail, _countof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, "%s@%s", szCont, szDom);
UrlDecode((char*)szNick);
@@ -2203,7 +2203,7 @@ LBL_InvalidCommand: newThread->mType = SERVER_SWITCHBOARD;
newThread->mInitialContactWLID = mir_strdup(data.callerEmail);
MSN_HContactFromEmail(data.callerEmail, data.callerNick, true, true);
- mir_snprintf(newThread->mCookie, _countof(newThread->mCookie), "%s %d", data.authChallengeInfo, trid);
+ mir_snprintf(newThread->mCookie, "%s %d", data.authChallengeInfo, trid);
ReleaseSemaphore(newThread->hWaitEvent, MSN_PACKETS_COMBINE, NULL);
diff --git a/protocols/MSN/src/msn_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp index 94e257fade..bdb3ebd46f 100644 --- a/protocols/MSN/src/msn_ftold.cpp +++ b/protocols/MSN/src/msn_ftold.cpp @@ -64,7 +64,7 @@ void CMsnProto::msnftp_invite(filetransfer *ft) pszFiles = *ft->std.ptszFiles;
char msg[1024];
- mir_snprintf(msg, _countof(msg),
+ mir_snprintf(msg,
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Application-Name: File Transfer\r\n"
"Application-GUID: {5D3E02AB-6190-11d3-BBBB-00C04F795683}\r\n"
@@ -152,7 +152,7 @@ int CMsnProto::MSN_HandleMSNFTP(ThreadData *info, char *cmdString) char tCommand[30];
size_t tCommandLen;
- tCommandLen = mir_snprintf(tCommand, _countof(tCommand), "FIL %i\r\n", info->mMsnFtp->std.totalBytes);
+ tCommandLen = mir_snprintf(tCommand, "FIL %i\r\n", info->mMsnFtp->std.totalBytes);
info->send(tCommand, tCommandLen);
break;
@@ -176,7 +176,7 @@ LBL_InvalidCommand: if (info->mCaller == 0) { //receive
char tCommand[MSN_MAX_EMAIL_LEN + 50];
size_t tCommandLen;
- tCommandLen = mir_snprintf(tCommand, _countof(tCommand), "USR %s %s\r\n", MyOptions.szEmail, info->mCookie);
+ tCommandLen = mir_snprintf(tCommand, "USR %s %s\r\n", MyOptions.szEmail, info->mCookie);
info->send(tCommand, tCommandLen);
}
else if (info->mCaller == 2) { //send
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index 2afcc94d86..8e747106ca 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -243,7 +243,7 @@ void CMsnProto::MSN_CleanupLists(void) mir_free(sze);
TCHAR title[128];
- mir_sntprintf(title, _countof(title), TranslateT("%s protocol"), m_tszUserName);
+ mir_sntprintf(title, TranslateT("%s protocol"), m_tszUserName);
if (MessageBox(NULL, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES) {
MSN_AddUser(p.hContact, p.email, 0, LIST_LL);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 312cc2bfd7..375c28873c 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -255,14 +255,14 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) wchar_t* mimeSubjectW = tFileInfo.decode(Subject);
- mir_sntprintf(tBuffer2, _countof(tBuffer2), TranslateT("Subject: %s"), mimeSubjectW);
+ mir_sntprintf(tBuffer2, TranslateT("Subject: %s"), mimeSubjectW);
TCHAR* msgtxt = _stricmp(From, Fromaddr) ?
TranslateT("Hotmail from %s (%S)") : TranslateT("Hotmail from %s");
- mir_sntprintf(tBuffer, _countof(tBuffer), msgtxt, mimeFromW, Fromaddr);
+ mir_sntprintf(tBuffer, msgtxt, mimeFromW, Fromaddr);
mir_free(mimeFromW);
mir_free(mimeSubjectW);
ShowPopup = true;
@@ -271,8 +271,8 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) const char* MailData = tFileInfo["Mail-Data"];
if (MailData != NULL) processMailData((char*)MailData);
- mir_sntprintf(tBuffer, _countof(tBuffer), m_tszUserName);
- mir_sntprintf(tBuffer2, _countof(tBuffer2), TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
+ mir_sntprintf(tBuffer, m_tszUserName);
+ mir_sntprintf(tBuffer2, TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
}
if (UnreadMessages == mUnreadMessages && UnreadJunkEmails == mUnreadJunkEmails && !isInitial)
@@ -390,8 +390,7 @@ void CMsnProto::displayEmailCount(MCONTACT hContact) rtrimt(name);
TCHAR szNick[128];
- mir_sntprintf(szNick, _countof(szNick),
- getByte("DisableHotmailJunk", 0) ? _T("%s [%d]") : _T("%s [%d][%d]"), name, mUnreadMessages, mUnreadJunkEmails);
+ mir_sntprintf(szNick, getByte("DisableHotmailJunk", 0) ? _T("%s [%d]") : _T("%s [%d][%d]"), name, mUnreadMessages, mUnreadJunkEmails);
nickChg = true;
db_set_ts(hContact, "CList", "MyHandle", szNick);
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index e199fab8da..5d04fa9bc4 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -93,7 +93,7 @@ INT_PTR CMsnProto::MsnViewProfile(WPARAM hContact, LPARAM) }
char tUrl[256];
- mir_snprintf(tUrl, _countof(tUrl), "http://cid-%I64X.profiles.live.com", _atoi64(cid));
+ mir_snprintf(tUrl, "http://cid-%I64X.profiles.live.com", _atoi64(cid));
MsnInvokeMyURL(false, tUrl);
return 0;
}
@@ -177,7 +177,7 @@ INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM) char msg[1024];
- mir_snprintf(msg, _countof(msg),
+ mir_snprintf(msg,
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Application-Name: NetMeeting\r\n"
"Application-GUID: {44BBA842-CC51-11CF-AAFA-00AA00B6015C}\r\n"
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 9f7f6ab15f..7efabf73f9 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -122,7 +122,7 @@ void CMsnProto::InitCustomFolders(void) if (InitCstFldRan) return;
TCHAR folder[MAX_PATH];
- mir_sntprintf(folder, _countof(folder), _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
+ mir_sntprintf(folder, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
hCustomSmileyFolder = FoldersRegisterCustomPathT(LPGEN("Custom Smileys"), m_szModuleName, folder, m_tszUserName);
InitCstFldRan = true;
@@ -541,7 +541,7 @@ void ThreadData::sendCaps(void) char mversion[100], capMsg[1000];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mversion), (LPARAM)mversion);
- mir_snprintf(capMsg, _countof(capMsg),
+ mir_snprintf(capMsg,
"Content-Type: text/x-clientcaps\r\n\r\n"
"Client-Name: Miranda NG %s (MSN v.%s)\r\n",
mversion, __VERSION_STRING_DOTS);
@@ -586,7 +586,7 @@ int ThreadData::sendRawMessage(int msgType, const char* data, int datLen) void CMsnProto::MSN_SendTyping(ThreadData* info, const char* email, int netId, bool bTyping)
{
char tCommand[1024];
- mir_snprintf(tCommand, _countof(tCommand),
+ mir_snprintf(tCommand,
"Messaging: 2.0\r\n"
"Message-Type: %s\r\n"
"Content-Type: Application/Message\r\n"
@@ -632,7 +632,7 @@ void CMsnProto::MSN_SendStatusMessage(const char*) size_t sz;
char szMsg[2048];
if (msnCurrentMedia.cbSize == 0) {
- sz = mir_snprintf(szMsg, _countof(szMsg), "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia><MachineGuid>%s</MachineGuid>"
+ sz = mir_snprintf(szMsg, "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia><MachineGuid>%s</MachineGuid>"
"<DDP></DDP><SignatureSound></SignatureSound><Scene></Scene><ColorScheme></ColorScheme></Data>",
msgEnc, MyOptions.szMachineGuid);
}
@@ -799,7 +799,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) char szMsg[2048];
#ifdef OBSOLETE
if (m_iStatus < ID_STATUS_ONLINE) {
- int sz = mir_snprintf(szMsg, _countof(szMsg),
+ int sz = mir_snprintf(szMsg,
"<EndpointData><Capabilities>%u:%u</Capabilities></EndpointData>", myFlags, myFlagsEx);
msnNsThread->sendPacket("UUX", "%d\r\n%s", sz, szMsg);
@@ -826,7 +826,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) }
char** msgptr = GetStatusMsgLoc(newStatus);
- int sz = mir_snprintf(szMsg, _countof(szMsg),
+ int sz = mir_snprintf(szMsg,
"<user>"
"<sep n=\"PE\" epid=\"%s\"><VER>%s</VER><TYP>11</TYP><Capabilities>0:0</Capabilities></sep>"
"<s n=\"IM\"><Status>%s</Status></s>"
@@ -859,7 +859,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) // TODO: Send, MSN_SendStatusMessage anpassen.
#ifdef OBSOLETE
- int sz = mir_snprintf(szMsg, _countof(szMsg),
+ int sz = mir_snprintf(szMsg,
"<PrivateEndpointData>"
"<EpName>%s</EpName>"
"<Idle>%s</Idle>"
@@ -1068,7 +1068,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) if ((iserr && !pud->proto->MyOptions.ShowErrorsAsPopups) || !ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
if (pud->flags & MSN_ALLOW_MSGBOX) {
TCHAR szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
- mir_sntprintf(szMsg, _countof(szMsg), _T("%s:\n%s"), pud->title, pud->text);
+ mir_sntprintf(szMsg, _T("%s:\n%s"), pud->title, pud->text);
int ret = MessageBox(NULL, szMsg, TranslateT("MSN Protocol"),
MB_YESNO | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
if (ret == IDYES)
@@ -1404,7 +1404,7 @@ void MSN_MakeDigest(const char* chl, char* dgst) md5hash[i] &= 0x7FFFFFFF;
char chlString[128];
- mir_snprintf(chlString, _countof(chlString), "%s%s00000000", chl, msnProductID);
+ mir_snprintf(chlString, "%s%s00000000", chl, msnProductID);
chlString[(mir_strlen(chl) + mir_strlen(msnProductID) + 7) & 0xF8] = 0;
LONGLONG high = 0, low = 0;
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 6b267e22cf..648b4af59f 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -53,7 +53,7 @@ void MsnInitIcons(void) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "MSN_%s", name);
+ mir_snprintf(szSettingName, "MSN_%s", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -69,7 +69,7 @@ HANDLE GetIconHandle(int iconId) void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "MSN_%s", name);
+ mir_snprintf(szSettingName, "MSN_%s", name);
IcoLib_Release(szSettingName, big);
}
@@ -204,7 +204,7 @@ LBL_Continue: if (strchr(szFile, ' ') != NULL) {
char tmpBuf[MAX_PATH + 2];
- mir_snprintf(tmpBuf, _countof(tmpBuf), "\"%s\"", szFile);
+ mir_snprintf(tmpBuf, "\"%s\"", szFile);
mir_strcpy(szFile, tmpBuf);
}
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index dc965db7dd..c1676a91de 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -1224,7 +1224,7 @@ void CMsnProto::p2p_InitFileTransfer( ft->std.totalFiles = 1;
TCHAR tComment[40];
- mir_sntprintf(tComment, _countof(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -1396,8 +1396,7 @@ void CMsnProto::p2p_startConnect(const char* wlid, const char* szCallID, const c newThread->mType = SERVER_P2P_DIRECT;
newThread->mInitialContactWLID = mir_strdup(wlid);
strncpy_s(newThread->mCookie, szCallID, _TRUNCATE);
- mir_snprintf(newThread->mServer, _countof(newThread->mServer),
- ipv6 ? "[%s]:%s" : "%s:%s", pAddrTokBeg, pPortTokBeg);
+ mir_snprintf(newThread->mServer, ipv6 ? "[%s]:%s" : "%s:%s", pAddrTokBeg, pPortTokBeg);
newThread->startThread(&CMsnProto::p2p_fileActiveThread, this);
@@ -1739,7 +1738,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* wl if (hdrdata.mRemSize || hdrdata.mTFCode == 0) {
char msgid[128];
- mir_snprintf(msgid, _countof(msgid), "%s_%08x", wlid, hdrdata.mPacketNum);
+ mir_snprintf(msgid, "%s_%08x", wlid, hdrdata.mPacketNum);
int idx;
if (hdrdata.mTFCode == 0x01) {
@@ -1830,7 +1829,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wlid if (hdrdata.mPacketLen < hdrdata.mTotalSize) {
char msgid[128];
- mir_snprintf(msgid, _countof(msgid), "%s_%08x", wlid, hdrdata.mID);
+ mir_snprintf(msgid, "%s_%08x", wlid, hdrdata.mID);
int idx = addCachedMsg(msgid, msgbody, (size_t)hdrdata.mOffset, hdrdata.mPacketLen,
(size_t)hdrdata.mTotalSize, false);
@@ -2094,7 +2093,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) if (ft->p2p_isV2) {
if (cont->places.getCount() && cont->places[0].cap1 & cap_SupportsP2PBootstrap) {
char wlid[128];
- mir_snprintf(wlid, _countof(wlid),
+ mir_snprintf(wlid,
mir_strcmp(cont->places[0].id, sttVoidUid) ? "%s;%s" : "%s",
cont->email, cont->places[0].id);
@@ -2145,7 +2144,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) if (ft->p2p_isV2 && ft->std.currentFileNumber == 0) {
for (int i = 0; i < cont->places.getCount(); ++i) {
char wlid[128];
- mir_snprintf(wlid, _countof(wlid),
+ mir_snprintf(wlid,
mir_strcmp(cont->places[i].id, sttVoidUid) ? "%s;%s" : "%s",
cont->email, cont->places[i].id);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 5c9955d37b..69bd39aa5d 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -128,7 +128,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu1.szSettingsModule = szDbsettings;
nlu1.ptszDescriptiveName = szBuffer;
- mir_snprintf(szDbsettings, _countof(szDbsettings), "%s_HTTPS", m_szModuleName);
+ mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
mir_sntprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
@@ -492,7 +492,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) filetransfer* ft = (filetransfer*)arg;
TCHAR filefull[MAX_PATH];
- mir_sntprintf(filefull, _countof(filefull), _T("%s\\%s"), ft->std.tszWorkingDir, ft->std.tszCurrentFile);
+ mir_sntprintf(filefull, _T("%s\\%s"), ft->std.tszWorkingDir, ft->std.tszCurrentFile);
replaceStrT(ft->std.tszCurrentFile, filefull);
ResetEvent(ft->hResumeEvt);
@@ -1224,7 +1224,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
char szDbsettings[64];
- mir_snprintf(szDbsettings, _countof(szDbsettings), "%s_HTTPS", m_szModuleName);
+ mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
break;
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index c9404004f9..a6cc884788 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -74,8 +74,8 @@ ezxml_t CMsnProto::abSoapHdr(const char* service, const char* scenario, ezxml_t& ezxml_t CMsnProto::getSoapResponse(ezxml_t bdy, const char* service)
{
char resp1[40], resp2[40];
- mir_snprintf(resp1, _countof(resp1), "%sResponse", service);
- mir_snprintf(resp2, _countof(resp2), "%sResult", service);
+ mir_snprintf(resp1, "%sResponse", service);
+ mir_snprintf(resp2, "%sResult", service);
ezxml_t res = ezxml_get(bdy, "soap:Body", 0, resp1, 0, resp2, -1);
if (res == NULL)
@@ -93,7 +93,7 @@ ezxml_t CMsnProto::getSoapFault(ezxml_t bdy, bool err) void CMsnProto::UpdateABHost(const char* service, const char* url)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "ABHost-%s", service);
+ mir_snprintf(hostname, "ABHost-%s", service);
if (url)
setString(hostname, url);
@@ -112,7 +112,7 @@ void CMsnProto::UpdateABCacheKey(ezxml_t bdy, bool isSharing) char* CMsnProto::GetABHost(const char* service, bool isSharing)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "ABHost-%s", service);
+ mir_snprintf(hostname, "ABHost-%s", service);
char* host = (char*)mir_alloc(256);
if (db_get_static(NULL, m_szModuleName, hostname, host, 256)) {
@@ -265,7 +265,7 @@ bool CMsnProto::MSN_SharingFindMembership(bool deltas, bool allowRecurse) }
else if (mir_strcmp(szType, "Phone") == 0) {
netId = NETID_MOB;
- mir_snprintf(email, _countof(email), "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
+ mir_snprintf(email, "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
szEmail = email;
}
else if (mir_strcmp(szType, "Email") == 0) {
@@ -656,7 +656,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas szMsgUsr = ezxml_txt(ezxml_child(phn, "isMessengerEnabled"));
if (mir_strcmp(szMsgUsr, "true") == 0) {
szEmail = ezxml_txt(ezxml_child(phn, "number"));
- mir_snprintf(email, _countof(email), "tel:%s", szEmail);
+ mir_snprintf(email, "tel:%s", szEmail);
szEmail = email;
netId = NETID_MOB;
break;
@@ -1551,7 +1551,7 @@ void CMsnProto::MSN_ABUpdateDynamicItem(bool allowRecurse) tm *tmst = gmtime(&timer);
char tmstr[64];
- mir_snprintf(tmstr, _countof(tmstr), "%04u-%02u-%02uT%02u:%02u:%02uZ",
+ mir_snprintf(tmstr, "%04u-%02u-%02uT%02u:%02u:%02uZ",
tmst->tm_year + 1900, tmst->tm_mon + 1, tmst->tm_mday,
tmst->tm_hour, tmst->tm_min, tmst->tm_sec);
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp index fc8a5b96f2..8a86cd0635 100644 --- a/protocols/MSN/src/msn_soapstore.cpp +++ b/protocols/MSN/src/msn_soapstore.cpp @@ -71,7 +71,7 @@ ezxml_t CMsnProto::storeSoapHdr(const char* service, const char* scenario, ezxml char* CMsnProto::GetStoreHost(const char* service)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "StoreHost-%s", service);
+ mir_snprintf(hostname, "StoreHost-%s", service);
char* host = (char*)mir_alloc(256);
if (db_get_static(NULL, m_szModuleName, hostname, host, 256) || !*host)
@@ -83,7 +83,7 @@ char* CMsnProto::GetStoreHost(const char* service) void CMsnProto::UpdateStoreHost(const char* service, const char* url)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "StoreHost-%s", service);
+ mir_snprintf(hostname, "StoreHost-%s", service);
setString(hostname, url);
}
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index ce0afcc440..9b0ba9f3d5 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -551,7 +551,7 @@ bool Omegle_client::events() st.cbSize = sizeof(st);
// st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on")); // TODO: typing icon
- mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s is typing."), TranslateT("Stranger"));
+ mir_sntprintf(st.tszText, TranslateT("%s is typing."), TranslateT("Stranger"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
@@ -566,7 +566,7 @@ bool Omegle_client::events() st.cbSize = sizeof(st);
// st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off")); // TODO: typing icon
- mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s stopped typing."), TranslateT("Stranger"));
+ mir_sntprintf(st.tszText, TranslateT("%s stopped typing."), TranslateT("Stranger"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 45686560e5..3cb3bb9d2a 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -27,11 +27,11 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : {
this->facy.parent = this;
- this->signon_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->log_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->facy.send_message_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->facy.connection_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->events_loop_lock_ = CreateMutex( NULL, FALSE, NULL );
+ this->signon_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->log_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->facy.send_message_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->facy.connection_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->events_loop_lock_ = CreateMutex(NULL, FALSE, NULL);
// Group chats
CreateProtoService(PS_JOINCHAT, &OmegleProto::OnJoinChat);
@@ -44,12 +44,12 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : // Create standard network connection
TCHAR descr[512];
- NETLIBUSER nlu = {sizeof(nlu)};
+ NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(descr,_countof(descr),TranslateT("%s server connection"),m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
- m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
+ m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
@@ -58,32 +58,32 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : facy.set_handle(m_hNetlibUser);
- SkinAddNewSoundExT( "StrangerTyp", m_tszUserName, LPGENT( "Stranger typing" ));
- SkinAddNewSoundExT( "StrangerTypStop", m_tszUserName, LPGENT( "Stranger stopped typing" ));
- SkinAddNewSoundExT( "StrangerChange", m_tszUserName, LPGENT( "Changing stranger" ));
+ SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENT("Stranger typing"));
+ SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENT("Stranger stopped typing"));
+ SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENT("Changing stranger"));
}
-OmegleProto::~OmegleProto( )
+OmegleProto::~OmegleProto()
{
- Netlib_CloseHandle( m_hNetlibUser );
-
- WaitForSingleObject( this->signon_lock_, IGNORE );
- WaitForSingleObject( this->log_lock_, IGNORE );
- WaitForSingleObject( this->facy.send_message_lock_, IGNORE );
- WaitForSingleObject( this->events_loop_lock_, IGNORE );
-
- CloseHandle( this->signon_lock_ );
- CloseHandle( this->log_lock_ );
- CloseHandle( this->facy.send_message_lock_ );
- CloseHandle( this->events_loop_lock_ );
- CloseHandle( this->facy.connection_lock_ );
+ Netlib_CloseHandle(m_hNetlibUser);
+
+ WaitForSingleObject(this->signon_lock_, IGNORE);
+ WaitForSingleObject(this->log_lock_, IGNORE);
+ WaitForSingleObject(this->facy.send_message_lock_, IGNORE);
+ WaitForSingleObject(this->events_loop_lock_, IGNORE);
+
+ CloseHandle(this->signon_lock_);
+ CloseHandle(this->log_lock_);
+ CloseHandle(this->facy.send_message_lock_);
+ CloseHandle(this->events_loop_lock_);
+ CloseHandle(this->facy.connection_lock_);
}
//////////////////////////////////////////////////////////////////////////////
DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT)
{
- switch(type) {
+ switch (type) {
case PFLAGNUM_1:
return PF1_CHAT;
case PFLAGNUM_2:
@@ -93,7 +93,7 @@ DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE:
return OMEGLE_MESSAGE_LIMIT;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR) Translate("Visible name");
+ return (DWORD_PTR)Translate("Visible name");
case PFLAG_UNIQUEIDSETTING:
return (DWORD_PTR) "Nick";
}
@@ -102,10 +102,10 @@ DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT) //////////////////////////////////////////////////////////////////////////////
-int OmegleProto::SetStatus( int new_status )
+int OmegleProto::SetStatus(int new_status)
{
// Routing statuses not supported by Omegle
- switch ( new_status ) {
+ switch (new_status) {
case ID_STATUS_OFFLINE:
case ID_STATUS_CONNECTING:
new_status = ID_STATUS_OFFLINE;
@@ -117,44 +117,39 @@ int OmegleProto::SetStatus( int new_status ) m_iDesiredStatus = new_status;
- if ( new_status == m_iStatus)
- {
+ if (new_status == m_iStatus) {
return 0;
}
- if ( m_iStatus == ID_STATUS_CONNECTING && new_status != ID_STATUS_OFFLINE )
- {
+ if (m_iStatus == ID_STATUS_CONNECTING && new_status != ID_STATUS_OFFLINE) {
return 0;
}
- if ( new_status == ID_STATUS_OFFLINE )
- {
- ForkThread( &OmegleProto::SignOff, this );
+ if (new_status == ID_STATUS_OFFLINE) {
+ ForkThread(&OmegleProto::SignOff, this);
}
- else
- {
- ForkThread( &OmegleProto::SignOn, this );
+ else {
+ ForkThread(&OmegleProto::SignOn, this);
}
return 0;
}
//////////////////////////////////////////////////////////////////////////////
-int OmegleProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam)
+int OmegleProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
{
- switch(event)
- {
+ switch (event) {
case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam,lParam);
+ return OnModulesLoaded(wParam, lParam);
case EV_PROTO_ONEXIT:
- return OnPreShutdown (wParam,lParam);
+ return OnPreShutdown(wParam, lParam);
case EV_PROTO_ONOPTIONS:
- return OnOptionsInit (wParam,lParam);
+ return OnOptionsInit(wParam, lParam);
case EV_PROTO_ONCONTACTDELETED:
- return OnContactDeleted(wParam,lParam);
+ return OnContactDeleted(wParam, lParam);
}
return 1;
@@ -165,21 +160,21 @@ int OmegleProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam) INT_PTR OmegleProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
{
- return (INT_PTR)CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_OmegleACCOUNT),
+ return (INT_PTR)CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_OmegleACCOUNT),
(HWND)lParam, OmegleAccountProc, (LPARAM)this);
}
int OmegleProto::OnModulesLoaded(WPARAM, LPARAM)
{
// Register group chat
- GCREGISTER gcr = {sizeof(gcr)};
+ GCREGISTER gcr = { sizeof(gcr) };
gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG;
gcr.pszModule = m_szModuleName;
gcr.ptszDispName = m_tszUserName;
gcr.iMaxText = OMEGLE_MESSAGE_LIMIT;
gcr.nColors = 0;
gcr.pColors = NULL;
- CallService(MS_GC_REGISTER,0,reinterpret_cast<LPARAM>(&gcr));
+ CallService(MS_GC_REGISTER, 0, reinterpret_cast<LPARAM>(&gcr));
return 0;
}
@@ -187,23 +182,23 @@ int OmegleProto::OnModulesLoaded(WPARAM, LPARAM) int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.hInstance = g_hInstance;
+ odp.ptszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.position = 271828;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.position = 271828;
+ odp.ptszGroup = LPGENT("Network");
+ odp.ptszTab = LPGENT("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pfnDlgProc = OmegleOptionsProc;
+ odp.pfnDlgProc = OmegleOptionsProc;
Options_AddPage(wParam, &odp);
return 0;
}
int OmegleProto::OnPreShutdown(WPARAM, LPARAM)
{
- SetStatus( ID_STATUS_OFFLINE );
+ SetStatus(ID_STATUS_OFFLINE);
return 0;
}
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 4aaf949a27..4c9ce74460 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -410,7 +410,7 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam) if (my_login_info && GetAwareIdFromContact(hContact, &id_block)) {
TCHAR title[512];
TCHAR* ts = mir_utf8decodeT(my_login_info->user_name);
- mir_sntprintf(title, _countof(title), TranslateT("%s's conference"), ts);
+ mir_sntprintf(title, TranslateT("%s's conference"), ts);
mir_free(ts);
idb.user = id_block.user;
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index 8393eb31a8..53141f1587 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -33,7 +33,7 @@ void mwFileTransfer_offered(mwFileTransfer* ft) TCHAR descriptionT[512];
if (message) {
TCHAR* messageT = mir_utf8decodeT(message);
- mir_sntprintf(descriptionT, _countof(descriptionT), _T("%s - %s"), filenameT, messageT);
+ mir_sntprintf(descriptionT, _T("%s - %s"), filenameT, messageT);
mir_free(messageT);
} else
_tcsncpy_s(descriptionT, filenameT, _TRUNCATE);
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index 46540ad090..0a7f8a24f2 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -98,7 +98,7 @@ void mwIm_place_invite(struct mwConversation* conv, const char* message, const c TCHAR* tszMessage = mir_utf8decodeT(message);
TCHAR msg[512];
- mir_sntprintf(msg, _countof(msg), TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
+ mir_sntprintf(msg, TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
proto->showPopup(msg, SAMETIME_POPUP_INFO);
mir_free(tszMessage);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index d8c3c33bbc..6d47ca05fd 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -103,14 +103,14 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA WORD client_ver = proto->GetClientVersion();
if (client_ver) {
TCHAR verbuf[100];
- mir_sntprintf(verbuf, _countof(verbuf), TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
+ mir_sntprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf);
}
WORD server_ver = proto->GetServerVersion();
if (server_ver) {
TCHAR verbuf[100];
- mir_sntprintf(verbuf, _countof(verbuf), TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
+ mir_sntprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_SERVERVER, verbuf);
}
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 863430b20d..3f04f7ee22 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -108,14 +108,14 @@ HANDLE GetIconHandle(int iconId) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "SAMETIME", name);
+ mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
return IcoLib_GetIcon(szSettingName, big);
}
void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "SAMETIME", name);
+ mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 1e568c1a31..5a9b5cd2d5 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -15,7 +15,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserNam {
// Register m_hNetlibUser user
TCHAR name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
@@ -45,7 +45,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserNam RegisterPopups();
InitAwayMsg();
- mir_snprintf(szProtoGroups, _countof(szProtoGroups), "%s_GROUPS", m_szModuleName);
+ mir_snprintf(szProtoGroups, "%s_GROUPS", m_szModuleName);
m_iStatus = ID_STATUS_OFFLINE;
previous_status = ID_STATUS_OFFLINE;
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index abd9a0b508..a0e6eb8bdf 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -155,7 +155,7 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from TCHAR stzFromBuff[256];
stzFrom = mir_utf8decodeT(from->user_name);
stzText = mir_utf8decodeT(text);
- mir_sntprintf(stzFromBuff, _countof(stzFromBuff), TranslateT("Session announcement - from '%s'"), stzFrom);
+ mir_sntprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
MessageBox(0, TranslateTS(stzText), stzFromBuff, MB_OK);
mir_free(stzText);
mir_free(stzFrom);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index 8bf46c72d1..346ccd5027 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -40,8 +40,8 @@ void CSametimeProto::RegisterPopups() puc.ptszDescription = szDescr;
puc.pszName = szName;
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Notify");
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Notification"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Notification"));
puc.hIcon = CopyIcon(LoadIconEx("notify", FALSE));
ReleaseIconEx("notify", FALSE);
puc.iSeconds = 8;
@@ -49,8 +49,8 @@ void CSametimeProto::RegisterPopups() puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
hPopupNotify = Popup_RegisterClass(&puc);
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Error");
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Error"));
puc.hIcon = CopyIcon(LoadIconEx("error", FALSE));
ReleaseIconEx("error", FALSE);
puc.iSeconds = 10;
@@ -89,9 +89,9 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) ppd.ptszTitle = puData->title;
ppd.ptszText = puData->text;
if (puData->flag == SAMETIME_POPUP_ERROR)
- mir_snprintf(szName, _countof(szName), "%s_%s", proto->m_szModuleName, "Error");
+ mir_snprintf(szName, "%s_%s", proto->m_szModuleName, "Error");
else
- mir_snprintf(szName, _countof(szName), "%s_%s", proto->m_szModuleName, "Notify");
+ mir_snprintf(szName, "%s_%s", proto->m_szModuleName, "Notify");
ppd.pszClassName = szName;
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
diff --git a/protocols/SkypeWeb/src/http_request.h b/protocols/SkypeWeb/src/http_request.h index 80f301908f..9f25884f6d 100644 --- a/protocols/SkypeWeb/src/http_request.h +++ b/protocols/SkypeWeb/src/http_request.h @@ -277,7 +277,7 @@ public: }
char message[1024];
- mir_snprintf(message, _countof(message), "Send request to %s", szUrl);
+ mir_snprintf(message, "Send request to %s", szUrl);
CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
return (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)this);
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp index 228c7876a8..ee5d6d904a 100644 --- a/protocols/SkypeWeb/src/skype_icons.cpp +++ b/protocols/SkypeWeb/src/skype_icons.cpp @@ -44,10 +44,10 @@ void CSkypeProto::InitIcons() sid.pszName = szSettingName;
sid.section.t = szSectionName;
- mir_sntprintf(szSectionName, _countof(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
+ mir_sntprintf(szSectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
for (int i = 0; i < _countof(Icons); i++)
{
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, Icons[i].Name);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, Icons[i].Name);
sid.description.t = Icons[i].Description;
sid.iDefaultIndex = -Icons[i].IconId;
@@ -67,7 +67,7 @@ HANDLE CSkypeProto::GetIconHandle(const char *name) HANDLE CSkypeProto::Skin_GetIconHandle(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, "%s_%s", MODULE, name);
HANDLE hIcon = IcoLib_GetIconHandle(iconName);
if (hIcon == NULL)
hIcon = GetIconHandle(name);
diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp index f0f3e2c804..06b7213a88 100644 --- a/protocols/SkypeWeb/src/skype_network.cpp +++ b/protocols/SkypeWeb/src/skype_network.cpp @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void CSkypeProto::InitNetwork()
{
TCHAR name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
diff --git a/protocols/Steam/src/api/friend_list.h b/protocols/Steam/src/api/friend_list.h index 7721f0c921..c16a7d84bf 100644 --- a/protocols/Steam/src/api/friend_list.h +++ b/protocols/Steam/src/api/friend_list.h @@ -20,10 +20,10 @@ public: HttpRequest(REQUEST_POST, STEAM_WEB_URL "/actions/AddFriendAjax")
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[128];
mir_snprintf(data, _countof(data),
@@ -44,10 +44,10 @@ public: HttpRequest(REQUEST_POST, STEAM_WEB_URL "/actions/BlockUserAjax")
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[128];
mir_snprintf(data, _countof(data),
@@ -68,10 +68,10 @@ public: HttpRequest(REQUEST_POST, STEAM_WEB_URL "/actions/RemoveFriendAjax")
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[128];
mir_snprintf(data, _countof(data),
diff --git a/protocols/Steam/src/api/login.h b/protocols/Steam/src/api/login.h index 00392dd34d..331822d260 100644 --- a/protocols/Steam/src/api/login.h +++ b/protocols/Steam/src/api/login.h @@ -8,7 +8,7 @@ public: HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Logon/v0001")
{
char data[256];
- mir_snprintf(data, _countof(data), "access_token=%s&ui_mode=web", token);
+ mir_snprintf(data, "access_token=%s&ui_mode=web", token);
SetData(data, strlen(data));
AddHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -22,7 +22,7 @@ public: HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Logoff/v0001")
{
char data[256];
- mir_snprintf(data, _countof(data), "access_token=%s&umqid=%s", token, umqId);
+ mir_snprintf(data, "access_token=%s&umqid=%s", token, umqId);
SetData(data, strlen(data));
AddHeader("Content-Type", "application/x-www-form-urlencoded");
diff --git a/protocols/Steam/src/api/pending.h b/protocols/Steam/src/api/pending.h index 4e971275b4..b07e14f087 100644 --- a/protocols/Steam/src/api/pending.h +++ b/protocols/Steam/src/api/pending.h @@ -8,13 +8,13 @@ public: HttpRequest(REQUEST_POST, FORMAT, STEAM_WEB_URL "/profiles/%s/home_process", steamId)
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[MAX_PATH];
- mir_snprintf(data, _countof(data), "sessionID=%s&id=%s&perform=accept&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
+ mir_snprintf(data, "sessionID=%s&id=%s&perform=accept&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
SetData(data, strlen(data));
AddHeader("Cookie", cookie);
@@ -29,13 +29,13 @@ public: HttpRequest(REQUEST_POST, FORMAT, STEAM_WEB_URL "/profiles/%s/home_process", steamId)
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[MAX_PATH];
- mir_snprintf(data, _countof(data), "sessionID=%s&id=%s&perform=ignore&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
+ mir_snprintf(data, "sessionID=%s&id=%s&perform=ignore&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
SetData(data, strlen(data));
AddHeader("Cookie", cookie);
@@ -50,13 +50,13 @@ public: HttpRequest(REQUEST_POST, FORMAT, STEAM_WEB_URL "/profiles/%s/home_process", steamId)
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[MAX_PATH];
- mir_snprintf(data, _countof(data), "sessionID=%s&id=%s&perform=block&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
+ mir_snprintf(data, "sessionID=%s&id=%s&perform=block&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
SetData(data, strlen(data));
AddHeader("Cookie", cookie);
diff --git a/protocols/Steam/src/http_request.h b/protocols/Steam/src/http_request.h index 35a6352d42..89e76e8ac2 100644 --- a/protocols/Steam/src/http_request.h +++ b/protocols/Steam/src/http_request.h @@ -131,7 +131,7 @@ public: szUrl = m_url.GetBuffer();
char message[1024];
- mir_snprintf(message, _countof(message), "Send request to %s", szUrl);
+ mir_snprintf(message, "Send request to %s", szUrl);
CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
NETLIBHTTPREQUEST* response = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)this);
diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index 204bdd56db..4010b9e46f 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -47,7 +47,7 @@ extern "C" int __declspec(dllexport) Load(void) Proto_RegisterModule(&pd);
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "gaming");
+ mir_snprintf(iconName, "%s_%s", MODULE, "gaming");
// extra statuses
HookEvent(ME_SKIN2_ICONSCHANGED, OnReloadIcons);
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index bd3b14f60e..77382eb5c4 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -3,7 +3,7 @@ TCHAR* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 4fee4049ac..3766a81611 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -626,7 +626,7 @@ void CSteamProto::OnAuthRequested(const NETLIBHTTPREQUEST *response, void *arg) lastName = mir_strdup(""); char reason[MAX_PATH]; - mir_snprintf(reason, _countof(reason), Translate("%s has added you to his or her Friend List"), nickName); + mir_snprintf(reason, Translate("%s has added you to his or her Friend List"), nickName); // blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), firstName(ASCIIZ), lastName(ASCIIZ), sid(ASCIIZ), reason(ASCIIZ) DWORD cbBlob = (DWORD)(sizeof(DWORD)* 2 + mir_strlen(nickName) + mir_strlen(firstName) + mir_strlen(lastName) + mir_strlen(steamId) + mir_strlen(reason) + 5); diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index be88b7c86e..116d0a48bc 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -10,7 +10,7 @@ CSteamPasswordEditor::CSteamPasswordEditor(CSteamProto *proto) void CSteamPasswordEditor::OnInitDialog()
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "main");
+ mir_snprintf(iconName, "%s_%s", MODULE, "main");
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
@@ -48,7 +48,7 @@ CSteamGuardDialog::CSteamGuardDialog(CSteamProto *proto, const char *domain) void CSteamGuardDialog::OnInitDialog()
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "main");
+ mir_snprintf(iconName, "%s_%s", MODULE, "main");
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
@@ -95,7 +95,7 @@ CSteamCaptchaDialog::~CSteamCaptchaDialog() void CSteamCaptchaDialog::OnInitDialog()
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "main");
+ mir_snprintf(iconName, "%s_%s", MODULE, "main");
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index be3282378a..0dd594bf72 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -45,7 +45,7 @@ int CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM) {
char url[MAX_PATH];
DWORD gameId = getDword(hContact, "GameID", 0);
- mir_snprintf(url, _countof(url), "steam://rungameid/%lu", gameId);
+ mir_snprintf(url, "steam://rungameid/%lu", gameId);
Utils_OpenUrl(url);
return 0;
}
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 113c5f47b5..5d5fc876f7 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -18,10 +18,10 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : GetModuleFileName(g_hInstance, filePath, MAX_PATH); wchar_t sectionName[100]; - mir_sntprintf(sectionName, _countof(sectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); + mir_sntprintf(sectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); char settingName[100]; - mir_snprintf(settingName, _countof(settingName), "%s_%s", MODULE, "main"); + mir_snprintf(settingName, "%s_%s", MODULE, "main"); SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; @@ -32,7 +32,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : sid.iDefaultIndex = -IDI_STEAM; IcoLib_AddIcon(&sid); - mir_snprintf(settingName, _countof(settingName), "%s_%s", MODULE, "gaming"); + mir_snprintf(settingName, "%s_%s", MODULE, "gaming"); sid.description.t = LPGENT("Gaming icon"); sid.iDefaultIndex = -IDI_GAMING; IcoLib_AddIcon(&sid); @@ -63,7 +63,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : // netlib support TCHAR name[128]; - mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName); + mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName); NETLIBUSER nlu = { sizeof(nlu) }; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index 72a4a0e5b6..7a42c3f4e3 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -20,7 +20,7 @@ int CSteamProto::GetContactXStatus(MCONTACT hContact) void SetContactExtraIcon(MCONTACT hContact, int status) { char iconName[100]; - mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "gaming"); + mir_snprintf(iconName, "%s_%s", MODULE, "gaming"); ExtraIcon_SetIcon(hExtraXStatus, hContact, (status > 0) ? IcoLib_GetIconHandle(iconName) : NULL); } @@ -96,7 +96,7 @@ HICON CSteamProto::GetXStatusIcon(int status, UINT flags) return 0; char iconName[100]; - mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "gaming"); + mir_snprintf(iconName, "%s_%s", MODULE, "gaming"); HICON icon = IcoLib_GetIcon(iconName, (flags & LR_BIGICON) != 0); return (flags & LR_SHARED) ? icon : CopyIcon(icon); diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 97f6d9f981..dd1959e8ee 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -66,7 +66,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
static IconItem iconList[] =
{
@@ -98,7 +98,8 @@ HICON GetIcolibIcon(int iconId) return NULL;
}
-void ReleaseIcolibIcon(HICON hIcon) {
+void ReleaseIcolibIcon(HICON hIcon)
+{
IcoLib_ReleaseIcon(hIcon);
}
@@ -165,7 +166,7 @@ INT_PTR TlenProtocol::ContactMenuHandleSendPicture(WPARAM hContact, LPARAM) INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM)
{
- char szFileName[ MAX_PATH ];
+ char szFileName[MAX_PATH];
DBVARIANT dbv;
NETLIBHTTPREQUEST req;
NETLIBHTTPHEADER headers[2];
@@ -185,7 +186,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM) memset(&cookie, 0, sizeof(cookie));
if (login != NULL && password != NULL) {
- mir_snprintf( form, _countof(form), "username=%s&password=%s", login, password);
+ mir_snprintf(form, "username=%s&password=%s", login, password);
headers[0].szName = "Content-Type";
headers[0].szValue = "application/x-www-form-urlencoded";
memset(&req, 0, sizeof(req));
@@ -199,9 +200,9 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM) req.szUrl = "http://poczta.o2.pl/login.html";
resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp != NULL) {
- if (resp->resultCode/100 == 2 || resp->resultCode == 302) {
+ if (resp->resultCode / 100 == 2 || resp->resultCode == 302) {
int i;
- for (i=0; i<resp->headersCount; i++ ) {
+ for (i = 0; i < resp->headersCount; i++) {
if (strcmpi(resp->headers[i].szName, "Set-Cookie") == 0) {
char *start = strstr(resp->headers[i].szValue, "ssid=");
if (start != NULL) {
@@ -221,8 +222,8 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM) }
mir_free(login);
mir_free(password);
-
- mir_snprintf(szFileName, _countof(szFileName), "http://poczta.o2.pl/login.html?sid=%s", cookie);
+
+ mir_snprintf(szFileName, "http://poczta.o2.pl/login.html?sid=%s", cookie);
Utils_OpenUrl(szFileName);
return 0;
}
@@ -329,7 +330,7 @@ void TlenProtocol::initMenuItems() TlenProtocol* tlenProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
{
- TlenProtocol* ppro = new TlenProtocol( pszProtoName, tszUserName );
+ TlenProtocol* ppro = new TlenProtocol(pszProtoName, tszUserName);
return ppro;
}
@@ -341,12 +342,12 @@ static int tlenProtoUninit(TlenProtocol* ppro) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP( &pluginInfo );
+ mir_getLP(&pluginInfo);
mir_getCLI();
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
- srand((unsigned) time(NULL));
+ srand((unsigned)time(NULL));
TlenRegisterIcons();
@@ -354,8 +355,8 @@ extern "C" int __declspec(dllexport) Load(void) PROTOCOLDESCRIPTOR pd = { 0 };
pd.cbSize = sizeof(pd);
pd.szName = "TLEN";
- pd.fnInit = ( pfnInitProto )tlenProtoInit;
- pd.fnUninit = ( pfnUninitProto )tlenProtoUninit;
+ pd.fnInit = (pfnInitProto)tlenProtoInit;
+ pd.fnUninit = (pfnUninitProto)tlenProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
Proto_RegisterModule(&pd);
return 0;
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index 44d6134e7c..baa05c1f2f 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -42,7 +42,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts else { proto->debugLog(_T("getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s"), ptszDest, errno, strerror(errno)); TCHAR buffer[512]; - mir_sntprintf(buffer, _countof(buffer), TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest); + mir_sntprintf(buffer, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest); PUShowMessageT(buffer, SM_WARNING); } } @@ -111,7 +111,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it db_set_dw(hContact, proto->m_szModuleName, "AvatarFormat", format); } else { TCHAR buffer[128]; - mir_sntprintf(buffer, _countof(buffer), TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno); + mir_sntprintf(buffer, TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno); PUShowMessageT(buffer, SM_WARNING); proto->debugLog(buffer); return; diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index 887ef89994..f97f47efae 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -551,7 +551,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) char *from = TlenXmlGetAttrValue(node, "f");
if (from != NULL) {
if (strchr(from, '@') == NULL)
- mir_snprintf(jid, _countof(jid), "%s@%s", from, info->server);
+ mir_snprintf(jid, "%s@%s", from, info->server);
else
strncpy_s(jid, from, _TRUNCATE);
@@ -577,7 +577,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) else mir_strcpy(szFilename, Translate("1 File"));
}
else if (numFiles > 1)
- mir_snprintf(szFilename, _countof(szFilename), Translate("%d Files"), numFiles);
+ mir_snprintf(szFilename, Translate("%d Files"), numFiles);
}
if (szFilename[0] != '\0' && ft->iqId != NULL) {
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index 2f2d7ba943..786c642758 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -54,7 +54,7 @@ void TlenIqResultAuth(TlenProtocol *proto, XmlNode *iqNode) char text[128];
TlenSend(proto, "</s>");
- mir_snprintf(text, _countof(text), Translate("Authentication failed for %s@%s."), proto->threadData->username, proto->threadData->server);
+ mir_snprintf(text, Translate("Authentication failed for %s@%s."), proto->threadData->username, proto->threadData->server);
MessageBoxA(NULL, text, Translate("Tlen Authentication"), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
proto->threadData = NULL; // To disallow auto reconnect
@@ -258,7 +258,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) if (strchr(jid, '@') != NULL) {
strncpy_s(text, jid, _TRUNCATE);
} else {
- mir_snprintf(text, _countof(text), "%s@%s", jid, dbv.pszVal); // Add @tlen.pl
+ mir_snprintf(text, "%s@%s", jid, dbv.pszVal); // Add @tlen.pl
}
db_free(&dbv);
if ((hContact=TlenHContactFromJID(proto, text)) == NULL) {
@@ -419,7 +419,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) if (strchr(jid, '@') != NULL) {
strncpy_s(jsr.jid, jid, _TRUNCATE);
} else {
- mir_snprintf(jsr.jid, _countof(jsr.jid), "%s@%s", jid, dbv.pszVal);
+ mir_snprintf(jsr.jid, "%s@%s", jid, dbv.pszVal);
}
jsr.jid[sizeof(jsr.jid)-1] = '\0';
jsr.hdr.id.t = mir_a2t(jid);
@@ -467,7 +467,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) if (strchr(proto->searchJID, '@') != NULL)
strncpy_s(jsr.jid, proto->searchJID, _TRUNCATE);
else
- mir_snprintf(jsr.jid, _countof(jsr.jid), "%s@%s", proto->searchJID, dbv.pszVal);
+ mir_snprintf(jsr.jid, "%s@%s", proto->searchJID, dbv.pszVal);
jsr.hdr.nick.t = jsr.hdr.firstName.t = jsr.hdr.lastName.t = jsr.hdr.email.t = jsr.hdr.id.t = TEXT("");
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) id, (LPARAM) &jsr);
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index 888d71c5a1..b429c2fee6 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -70,7 +70,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) MCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", id, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if (((hContact=TlenHContactFromJID(proto, jid)) != NULL) || !mir_strcmp(id, proto->threadData->username)) {
CONTACTINFO ci = { sizeof(ci) };
@@ -107,7 +107,7 @@ int TlenMUCRecvInvitation(TlenProtocol *proto, const char *roomId, const char*, char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
mir_strcpy(jid, from);
@@ -119,7 +119,7 @@ int TlenMUCRecvInvitation(TlenProtocol *proto, const char *roomId, const char*, TLEN_LIST_ITEM *item;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
mir_strcpy(jid, from);
@@ -190,7 +190,7 @@ static int TlenMUCSendQuery(TlenProtocol *proto, int type, const char *parent, i if (type == 3) { // find chat room by name
char serialId[32];
TLEN_LIST_ITEM *item;
- mir_snprintf(serialId, _countof(serialId), TLEN_IQID"%d", TlenSerialNext(proto));
+ mir_snprintf(serialId, TLEN_IQID"%d", TlenSerialNext(proto));
item = TlenListAdd(proto, LIST_SEARCH, serialId);
item->roomName = mir_strdup(parent);
TlenSend(proto, "<iq to='c' type='3' n='%s' id='%s'/>", parent, serialId);
@@ -236,7 +236,7 @@ INT_PTR TlenProtocol::MUCContactMenuHandleMUC(WPARAM wParam, LPARAM) if ((hContact=wParam) != NULL && isOnline) {
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
char serialId[32];
- mir_snprintf(serialId, _countof(serialId), TLEN_IQID"%d", TlenSerialNext(this));
+ mir_snprintf(serialId, TLEN_IQID"%d", TlenSerialNext(this));
item = TlenListAdd(this, LIST_INVITATIONS, serialId);
item->nick = mir_strdup(dbv.pszVal);
TlenSend(this, "<p to='c' tp='c' id='%s'/>", serialId);
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp index d904537185..fe413beb9b 100644 --- a/protocols/Tlen/src/tlen_opt.cpp +++ b/protocols/Tlen/src/tlen_opt.cpp @@ -656,7 +656,7 @@ static INT_PTR CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, } else { delay=GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE); } - mir_sntprintf(title, _countof(title), TranslateT("%S mail"), proto->m_szModuleName); + mir_sntprintf(title, TranslateT("%S mail"), proto->m_szModuleName); MailPopupPreview((DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0), (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0), title, diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp index 7c7c7ecd50..a2155c16e5 100644 --- a/protocols/Tlen/src/tlen_p2p_new.cpp +++ b/protocols/Tlen/src/tlen_p2p_new.cpp @@ -185,7 +185,7 @@ void TlenBindUDPSocket(TLEN_FILE_TRANSFER *ft) char host_name[256];
gethostname(host_name, sizeof(host_name));
hp = gethostbyname(host_name);
- mir_snprintf(host_name, _countof(host_name), "%u.%u.%u.%u", (unsigned char)hp->h_addr_list[0][0],
+ mir_snprintf(host_name, "%u.%u.%u.%u", (unsigned char)hp->h_addr_list[0][0],
(unsigned char)hp->h_addr_list[0][1],
(unsigned char)hp->h_addr_list[0][2],
(unsigned char)hp->h_addr_list[0][3]);
@@ -259,7 +259,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { if ((item=TlenListAdd(ft->proto, LIST_FILE, ft->iqId)) != NULL) {
char fileInfo[128];
item->ft = ft;
- mir_snprintf(fileInfo, _countof(fileInfo), "%s file(s), %s bytes", c, s);
+ mir_snprintf(fileInfo, "%s file(s), %s bytes", c, s);
TCHAR* filenameT = mir_utf8decodeT((char*)fileInfo);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index 1b08824840..840bc0134c 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -34,7 +34,7 @@ static void LogPictureMessage(TlenProtocol *proto, const char *jid, const char * {
char message[1024];
const char *msg = isSent ? LPGEN("Image sent file://%s") : LPGEN("Image received file://%s");
- mir_snprintf(message, _countof(message), Translate(msg), filename);
+ mir_snprintf(message, Translate(msg), filename);
TlenLogMessage(proto, TlenHContactFromJID(proto, jid), isSent ? DBEF_SENT : 0, message);
}
@@ -49,7 +49,7 @@ static void TlenPsPostThread(void *ptr) { DWORD ret;
item->ft->s = socket;
item->ft->hFileEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- ret = mir_snprintf(header, _countof(header), "<pic auth='%s' t='p' to='%s' size='%d' idt='%s'/>", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid);
+ ret = mir_snprintf(header, "<pic auth='%s' t='p' to='%s' size='%d' idt='%s'/>", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid);
TlenWsSend(proto, socket, header, (int)ret);
ret = WaitForSingleObject(item->ft->hFileEvent, 1000 * 60 * 5);
if (ret == WAIT_OBJECT_0) {
@@ -58,7 +58,7 @@ static void TlenPsPostThread(void *ptr) { int i;
char header[512];
char fileBuffer[2048];
- i = mir_snprintf(header, _countof(header), "<pic st='%s' idt='%s'/>", item->ft->iqId, item->jid);
+ i = mir_snprintf(header, "<pic st='%s' idt='%s'/>", item->ft->iqId, item->jid);
TlenWsSend(proto, socket, header, i);
proto->debugLogA("Sending picture data...");
for (i = item->ft->filesSize[0]; i > 0; ) {
@@ -114,7 +114,7 @@ static void TlenPsGetThread(void *ptr) { char header[512];
char fileBuffer[2048];
TlenXmlInitState(&xmlState);
- int header_len = mir_snprintf(header, _countof(header), "<pic auth='%s' t='g' to='%s' pid='1001' idt='%s' rt='%s'/>", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2);
+ int header_len = mir_snprintf(header, "<pic auth='%s' t='g' to='%s' pid='1001' idt='%s' rt='%s'/>", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2);
TlenWsSend(proto, socket, header, header_len);
proto->debugLogA("Reveiving picture data...");
{
@@ -221,7 +221,7 @@ void TlenProcessPic(XmlNode *node, TlenProtocol *proto) { char fileName[MAX_PATH];
char *ext = TlenXmlGetAttrValue(node, "ext");
char *tmpPath = Utils_ReplaceVars( "%miranda_userdata%" );
- int tPathLen = mir_snprintf(fileName, _countof(fileName), "%s\\Images\\Tlen", tmpPath);
+ int tPathLen = mir_snprintf(fileName, "%s\\Images\\Tlen", tmpPath);
long oldSize = 0, lSize = atol(size);
DWORD dwAttributes = GetFileAttributesA( fileName );
if ( dwAttributes == 0xffffffff || ( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ) == 0 )
@@ -285,7 +285,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { char fileBuffer[2048];
int id = TlenSerialNext(proto);
T2Utf szFileName(tszFileName);
- mir_snprintf(idStr, _countof(idStr), "%d", id);
+ mir_snprintf(idStr, "%d", id);
item = TlenListAdd(proto, LIST_PICTURE, idStr);
item->ft = TlenFileCreateFT(proto, jid);
item->ft->files = (char **) mir_alloc(sizeof(char *));
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 5108cba8cc..c8aaed11fe 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -803,7 +803,7 @@ HANDLE TlenProtocol::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCH db_free(&dbv);
int id = TlenSerialNext(this);
- mir_snprintf(idStr, _countof(idStr), "%d", id);
+ mir_snprintf(idStr, "%d", id);
TLEN_LIST_ITEM *item = TlenListAdd(this, LIST_FILE, idStr);
if (item != NULL) {
ft->iqId = mir_strdup(idStr);
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 3a736cc836..3567701282 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -72,7 +72,7 @@ static INT_PTR CALLBACK TlenPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- mir_snprintf(text, _countof(text), Translate("Enter password for %s"), (char *) lParam);
+ mir_snprintf(text, Translate("Enter password for %s"), (char *) lParam);
SetDlgItemTextA(hwndDlg, IDC_JID, text);
return TRUE;
case WM_COMMAND:
@@ -207,7 +207,7 @@ void __cdecl TlenServerThread(ThreadData *info) return;
}
- mir_snprintf(jidStr, _countof(jidStr), "%s@%s", info->username, info->server);
+ mir_snprintf(jidStr, "%s@%s", info->username, info->server);
db_set_s(NULL, info->proto->m_szModuleName, "jid", jidStr);
if (!db_get(NULL, info->proto->m_szModuleName, "ManualHost", &dbv)) {
@@ -400,7 +400,7 @@ static void TlenSendAuth(TlenProtocol *proto) { int iqId;
char text[128];
char *str = TlenPasswordHash(proto->threadData->password);
- mir_snprintf(text, _countof(text), "%s%s", proto->threadData->streamId, str);
+ mir_snprintf(text, "%s%s", proto->threadData->streamId, str);
mir_free(str);
str = TlenSha1(text);
char *p=TlenTextEncode(proto->threadData->username);
@@ -913,7 +913,7 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) char *f = TlenXmlGetAttrValue(node, "f");
if (f != NULL) {
char webContactName[128];
- mir_snprintf(webContactName, _countof(webContactName), Translate("%s Web Messages"), info->proto->m_szModuleName);
+ mir_snprintf(webContactName, Translate("%s Web Messages"), info->proto->m_szModuleName);
MCONTACT hContact = TlenHContactFromJID(info->proto, webContactName);
if (hContact == NULL) {
hContact = TlenDBCreateContact(info->proto, webContactName, webContactName, TRUE);
@@ -1204,7 +1204,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) char *from=TlenXmlGetAttrValue(node, "f");
if (from != NULL) {
if (strchr(from, '@') == NULL) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, info->server);
+ mir_snprintf(jid, "%s@%s", from, info->server);
} else {
strncpy_s(jid, from, _TRUNCATE);
}
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index 8b31557e48..00d0afacb8 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -493,7 +493,7 @@ static void TlenVoiceReceiveParse(TLEN_FILE_TRANSFER *ft) }
{
char ttt[2048];
- mir_snprintf(ttt, _countof(ttt), "%s %d %d ", statusTxt, ft->proto->framesAvailableForPlayback, ft->proto->availOverrunValue);
+ mir_snprintf(ttt, "%s %d %d ", statusTxt, ft->proto->framesAvailableForPlayback, ft->proto->availOverrunValue);
SetDlgItemTextA(ft->proto->voiceDlgHWND, IDC_STATUS, ttt);
}
TlenP2PPacketFree(packet);
@@ -683,7 +683,7 @@ INT_PTR TlenProtocol::VoiceContactMenuHandleVoice(WPARAM wParam, LPARAM) DBVARIANT dbv;
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
char serialId[32];
- mir_snprintf(serialId, _countof(serialId), "%d", TlenSerialNext(this));
+ mir_snprintf(serialId, "%d", TlenSerialNext(this));
TLEN_LIST_ITEM *item = TlenListAdd(this, LIST_VOICE, serialId);
if (item != NULL) {
TLEN_FILE_TRANSFER *ft = TlenFileCreateFT(this, dbv.pszVal);
@@ -931,7 +931,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) MCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", id, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if ((hContact = TlenHContactFromJID(proto, jid)) != NULL)
return mir_strdup((char *)pcli->pfnGetContactDisplayName(hContact, 0));
@@ -1012,7 +1012,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
}
else {
@@ -1025,7 +1025,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
}
else {
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp index 8b0a40554f..10d7042ae9 100644 --- a/protocols/Tlen/src/tlen_ws.cpp +++ b/protocols/Tlen/src/tlen_ws.cpp @@ -32,13 +32,13 @@ BOOL TlenWsInit(TlenProtocol *proto) nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), proto->m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = proto->m_szModuleName;
proto->m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_TCHAR;
- mir_sntprintf(name, _countof(name), TranslateT("%s SOCKS connection"), proto->m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s SOCKS connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
proto->hFileNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
nlus.cbSize = sizeof(nlus);
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp index a819f1bd3f..e8aab00e57 100644 --- a/protocols/Tox/src/tox_avatars.cpp +++ b/protocols/Tox/src/tox_avatars.cpp @@ -3,7 +3,7 @@ std::tstring CToxProto::GetAvatarFilePath(MCONTACT hContact)
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -229,7 +229,7 @@ void CToxProto::OnGotFriendAvatarInfo(AvatarTransferParam *transfer) }
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
OnFileAllow(transfer->pfts.hContact, transfer, path);
}
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index a0363afd5f..ae7ef71ada 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -29,7 +29,7 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) setWord(hContact, TOX_SETTINGS_CHAT_ID, groupNumber);
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), _T("%s #%d"), TranslateT("Groupchat"), groupNumber);
+ mir_sntprintf(title, _T("%s #%d"), TranslateT("Groupchat"), groupNumber);
setTString(hContact, "Nick", title);
DBVARIANT dbv;
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index 3bb4302513..756fc13bad 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -23,10 +23,10 @@ void CToxProto::InitIcons() sid.pszName = szSettingName;
sid.section.t = szSectionName;
- mir_sntprintf(szSectionName, _countof(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
+ mir_sntprintf(szSectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
for (int i = 0; i < _countof(Icons); i++)
{
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, Icons[i].Name);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, Icons[i].Name);
sid.description.t = Icons[i].Description;
sid.iDefaultIndex = -Icons[i].IconId;
@@ -55,7 +55,7 @@ HANDLE CToxProto::GetIconHandle(const char *name) HANDLE CToxProto::Skin_GetIconHandle(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, "%s_%s", MODULE, name);
HANDLE hIcon = IcoLib_GetIconHandle(iconName);
if (hIcon == NULL)
hIcon = GetIconHandle(name);
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 7fa7a9c7b8..d24a5df474 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -27,7 +27,7 @@ INT_PTR CToxCallDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) void CToxCallDlgBase::SetIcon(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, "%s_%s", MODULE, name);
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
}
@@ -56,7 +56,7 @@ void CToxIncomingCall::OnInitDialog() from.SetText(nick);
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), TranslateT("Incoming call from %s"), nick);
+ mir_sntprintf(title, TranslateT("Incoming call from %s"), nick);
SetTitle(title);
SetIcon("audio_ring");
}
@@ -98,7 +98,7 @@ void CToxOutgoingCall::OnInitDialog() to.SetText(nick);
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), TranslateT("Outgoing call to %s"), nick);
+ mir_sntprintf(title, TranslateT("Outgoing call to %s"), nick);
SetTitle(title);
SetIcon("audio_end");
}
@@ -290,7 +290,7 @@ void CToxProto::OnAvInvite(void*, int32_t callId, void *arg) }
TCHAR message[MAX_PATH];
- mir_sntprintf(message, _countof(message), TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(message, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
T2Utf szMessage(message);
PROTORECVEVENT recv = { 0 };
@@ -317,7 +317,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam) cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle("audio_ring"));
TCHAR szTooltip[MAX_PATH];
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTooltip, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
char szService[MAX_PATH];
diff --git a/protocols/Tox/src/tox_netlib.cpp b/protocols/Tox/src/tox_netlib.cpp index b08bc7ddf9..4c1ae3e09f 100644 --- a/protocols/Tox/src/tox_netlib.cpp +++ b/protocols/Tox/src/tox_netlib.cpp @@ -3,7 +3,7 @@ void CToxProto::InitNetlib()
{
wchar_t name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index e8fa7ef88d..84db80e7c3 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -20,7 +20,7 @@ void CToxProto::BootstrapNode(const char *address, int port, const char *hexKey) void CToxProto::BootstrapNodesFromDb(bool isIPv6)
{
char module[MAX_PATH];
- mir_snprintf(module, _countof(module), "%s_Nodes", m_szModuleName);
+ mir_snprintf(module, "%s_Nodes", m_szModuleName);
int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
if (nodeCount > 0)
{
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 7376bd02e0..0e9ccafc6b 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -109,7 +109,7 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
{
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s(*.tox)%c*.tox%c%s(*.*)%c*.*%c%c"),
+ mir_sntprintf(filter, _T("%s(*.tox)%c*.tox%c%s(*.*)%c*.*%c%c"),
TranslateT("Tox profile"), 0, 0, TranslateT("All files"), 0, 0, 0);
TCHAR profilePath[MAX_PATH] = { 0 };
@@ -141,7 +141,7 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*) void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*)
{
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s(*.tox)%c*.tox%c%c"),
+ mir_sntprintf(filter, _T("%s(*.tox)%c*.tox%c%c"),
TranslateT("Tox profile"), 0, 0, 0);
TCHAR profilePath[MAX_PATH];
@@ -195,7 +195,7 @@ CToxOptionsMultimedia::CToxOptionsMultimedia(CToxProto *proto) bool CToxOptionsMultimedia::GetDeviceFullName(GUID guid, TCHAR *deviceName, DWORD deviceNameLength)
{
TCHAR registryKey[MAX_PATH];
- mir_sntprintf(registryKey, _countof(registryKey), _T("System\\CurrentControlSet\\Control\\MediaCategories\\{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"),
+ mir_sntprintf(registryKey, _T("System\\CurrentControlSet\\Control\\MediaCategories\\{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"),
guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
HKEY hKey;
@@ -424,7 +424,7 @@ void CToxOptionsNodeList::OnInitDialog() }
char module[MAX_PATH], setting[MAX_PATH];
- mir_snprintf(module, _countof(module), "%s_Nodes", m_proto->m_szModuleName);
+ mir_snprintf(module, "%s_Nodes", m_proto->m_szModuleName);
int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
for (int i = 0; i < nodeCount; i++)
{
@@ -530,7 +530,7 @@ void CToxOptionsNodeList::OnApply() lvi.pszText = (TCHAR*)mir_alloc(MAX_PATH * sizeof(TCHAR));
char module[MAX_PATH];
- mir_snprintf(module, _countof(module), "%s_Nodes", m_proto->m_szModuleName);
+ mir_snprintf(module, "%s_Nodes", m_proto->m_szModuleName);
int iItem = 0;
int itemCount = m_nodes.GetItemCount();
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index eee0c009d4..33479ba034 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -95,7 +95,7 @@ void CToxProto::SearchByNameAsync(void *arg) {
dnsString[length] = 0;
char dnsQuery[MAX_PATH * 2];
- mir_snprintf(dnsQuery, _countof(dnsQuery), "_%s._tox.%s", dnsString, dnsDomain);
+ mir_snprintf(dnsQuery, "_%s._tox.%s", dnsString, dnsDomain);
ToxHexAddress address = ResolveToxAddressFromDns(dnsQuery);
if (!address.IsEmpty())
@@ -106,7 +106,7 @@ void CToxProto::SearchByNameAsync(void *arg) psr.nick.a = mir_strdup(name);
char email[MAX_PATH];
- mir_snprintf(email, _countof(email), "%s@%s", name, domain);
+ mir_snprintf(email, "%s@%s", name, domain);
psr.email.a = mir_strdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
@@ -123,7 +123,7 @@ void CToxProto::SearchByNameAsync(void *arg) if (resolved == 0 && domain)
{
char dnsQuery[MAX_PATH];
- mir_snprintf(dnsQuery, _countof(dnsQuery), "%s._tox.%s", name, domain);
+ mir_snprintf(dnsQuery, "%s._tox.%s", name, domain);
ToxHexAddress address = ResolveToxAddressFromDns(dnsQuery);
if (!address.IsEmpty())
@@ -134,7 +134,7 @@ void CToxProto::SearchByNameAsync(void *arg) psr.nick.a = mir_strdup(name);
char email[MAX_PATH];
- mir_snprintf(email, _countof(email), "%s@%s", name, domain);
+ mir_snprintf(email, "%s@%s", name, domain);
psr.email.a = mir_strdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index 7b61637cff..da28e1f120 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -76,7 +76,7 @@ HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR * // stupid fix
TCHAR fullPath[MAX_PATH];
- mir_sntprintf(fullPath, _countof(fullPath), _T("%s\\%s"), transfer->pfts.tszWorkingDir, transfer->pfts.tszCurrentFile);
+ mir_sntprintf(fullPath, _T("%s\\%s"), transfer->pfts.tszWorkingDir, transfer->pfts.tszCurrentFile);
transfer->ChangeName(fullPath);
if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)transfer, (LPARAM)&transfer->pfts))
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 3891325d47..88f3be83c5 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -45,7 +45,7 @@ TwitterProto::TwitterProto(const char *proto_name, const TCHAR *username) : // Initialize hotkeys
char text[512];
- mir_snprintf(text, _countof(text), "%s/Tweet", m_szModuleName);
+ mir_snprintf(text, "%s/Tweet", m_szModuleName);
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = text;
@@ -324,7 +324,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) // Create avatar network connection (TODO: probably remove this)
char module[512];
- mir_snprintf(module, _countof(module), "%sAv", m_szModuleName);
+ mir_snprintf(module, "%sAv", m_szModuleName);
nlu.szSettingsModule = module;
mir_sntprintf(descr, TranslateT("%s avatar connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
@@ -380,7 +380,7 @@ int TwitterProto::ShowPinDialog() void TwitterProto::ShowPopup(const wchar_t *text, int Error)
{
POPUPDATAT popup = {};
- mir_sntprintf(popup.lptzContactName, _countof(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mir_sntprintf(popup.lptzContactName, TranslateT("%s Protocol"), m_tszUserName);
wcsncpy_s(popup.lptzText, text, _TRUNCATE);
if (Error) {
@@ -398,7 +398,7 @@ void TwitterProto::ShowPopup(const wchar_t *text, int Error) void TwitterProto::ShowPopup(const char *text, int Error)
{
POPUPDATAT popup = {};
- mir_sntprintf(popup.lptzContactName, _countof(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mir_sntprintf(popup.lptzContactName, TranslateT("%s Protocol"), m_tszUserName);
mbcs_to_tcs(CP_UTF8, text, popup.lptzText, _countof(popup.lptzText));
if (Error) {
popup.iSeconds = -1;
@@ -422,7 +422,7 @@ void TwitterProto::SendTweetWorker(void *p) char *text = static_cast<char*>(p);
if (mir_strlen(mir_utf8decodeA(text)) > 140) { // looks like the chat max outgoing msg thing doesn't work, so i'll do it here.
TCHAR errorPopup[280];
- mir_sntprintf(errorPopup, _countof(errorPopup), TranslateT("Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?"), mir_strlen(text));
+ mir_sntprintf(errorPopup, TranslateT("Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?"), mir_strlen(text));
ShowPopup(errorPopup, 1);
return;
}
@@ -455,7 +455,7 @@ void TwitterProto::UpdateSettings() std::tstring TwitterProto::GetAvatarFolder()
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(path, _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
return path;
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index ae8dd27cfc..fd82475a54 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -113,7 +113,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara // Set window title
TCHAR title[512];
- mir_sntprintf(title, _countof(title), _T("Send Tweet for %s"), proto->m_tszUserName);
+ mir_sntprintf(title, _T("Send Tweet for %s"), proto->m_tszUserName);
SetWindowText(hwndDlg, title);
return true;
@@ -146,7 +146,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara case WM_SETREPLY:
char foo[512];
- mir_snprintf(foo, _countof(foo), "@%s ", (char*)wParam);
+ mir_snprintf(foo, "@%s ", (char*)wParam);
size_t len = mir_strlen(foo);
SetDlgItemTextA(hwndDlg, IDC_TWEETMSG, foo);
@@ -190,7 +190,7 @@ INT_PTR CALLBACK options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar else SendDlgItemMessage(hwndDlg, IDC_BASEURL, CB_SETCURSEL, 0, 0);
char pollrate_str[32];
- mir_snprintf(pollrate_str, _countof(pollrate_str), "%d", proto->getDword(TWITTER_KEY_POLLRATE, 80));
+ mir_snprintf(pollrate_str, "%d", proto->getDword(TWITTER_KEY_POLLRATE, 80));
SetDlgItemTextA(hwndDlg, IDC_POLLRATE, pollrate_str);
CheckDlgButton(hwndDlg, IDC_TWEET_MSG, proto->getByte(TWITTER_KEY_TWEET_TO_MSG, 0) ? BST_CHECKED : BST_UNCHECKED);
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 67dec9e9cd..e3ae67cb04 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -732,7 +732,7 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact) StatusTextData st = { 0 };
st.cbSize = sizeof(st);
st.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_READMSG));
- mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("Message read: %s"), ttime);
+ mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime);
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
@@ -747,7 +747,7 @@ char* CVkProto::GetStickerId(const char* Msg, int &stickerid) if (tmpMsg)
iRes = sscanf(tmpMsg, "[sticker:%d]", &stickerid);
if (iRes == 1) {
- mir_snprintf(HeadMsg, _countof(HeadMsg), "[sticker:%d]", stickerid);
+ mir_snprintf(HeadMsg, "[sticker:%d]", stickerid);
size_t retLen = mir_strlen(HeadMsg);
if (retLen < mir_strlen(Msg)) {
CMStringA szMsg(Msg, int(mir_strlen(Msg) - mir_strlen(tmpMsg)));
diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index cf8616d9d5..dbd6ff57b9 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -71,7 +71,7 @@ void __cdecl CVkProto::SearchThread(void* p) PROTOSEARCHBYNAME *pParam = (PROTOSEARCHBYNAME *)p;
TCHAR arg[200];
- mir_sntprintf(arg, _countof(arg), _T("%s %s %s"), pParam->pszFirstName, pParam->pszNick, pParam->pszLastName);
+ mir_sntprintf(arg, _T("%s %s %s"), pParam->pszFirstName, pParam->pszNick, pParam->pszLastName);
debugLog(_T("CVkProto::SearchThread %s"), arg);
if (!IsOnline())
return;
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 43016048ee..670d5acae7 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -102,8 +102,8 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const TCHAR tszTempFile[MAX_PATH], tszMyFile[MAX_PATH];
if (hContact == NULL) {
- mir_sntprintf(tszMyFile, _countof(tszMyFile), _T("%s\\myavatar.jpg"), m_tszAvatarFolder.c_str());
- mir_sntprintf(tszTempFile, _countof(tszTempFile), _T("%s\\myavatar.preview.jpg"), m_tszAvatarFolder.c_str());
+ mir_sntprintf(tszMyFile, _T("%s\\myavatar.jpg"), m_tszAvatarFolder.c_str());
+ mir_sntprintf(tszTempFile, _T("%s\\myavatar.preview.jpg"), m_tszAvatarFolder.c_str());
}
else {
std::tstring tszContactAva = GetAvatarFileName(hContact);
diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index b5f9d12201..e7dc71b9bc 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -466,7 +466,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char return FALSE; //kein pfad bug?!?!
if (subid == 0) {
- mir_snprintf(idstring, _countof(idstring), "%d", gameid);
+ mir_snprintf(idstring, "%d", gameid);
if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path))
return TRUE;
@@ -474,7 +474,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char subid++;
}
- mir_snprintf(idstring, _countof(idstring), "%d_%d", gameid, subid);
+ mir_snprintf(idstring, "%d_%d", gameid, subid);
if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path))
return TRUE;
@@ -511,7 +511,7 @@ BOOL Xfire_base::getGamename(unsigned int gameid, char* out, int outsize) //customnamen laden, wenn vorhanden
DBVARIANT dbv;
char dbstr[XFIRE_MAXSIZEOFGAMENAME];
- mir_snprintf(dbstr, _countof(dbstr), "customgamename_%d", gameid);
+ mir_snprintf(dbstr, "customgamename_%d", gameid);
if (!db_get(NULL, protocolname, dbstr, &dbv)) {
strncpy_s(out, outsize, dbv.pszVal, _TRUNCATE);
db_free(&dbv);
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp index 186a3c91ec..7e641883b0 100644 --- a/protocols/Xfire/src/Xfire_game.cpp +++ b/protocols/Xfire/src/Xfire_game.cpp @@ -56,7 +56,7 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*) //port begrenzen
port = port % 65535;
//port in string wandeln
- mir_snprintf(portstr, _countof(portstr), "%d", port);
+ mir_snprintf(portstr, "%d", port);
str_replace(mynetworkparams, "%UA_GAME_HOST_NAME%", ip);
str_replace(mynetworkparams, "%UA_GAME_HOST_PORT%", portstr);
@@ -403,7 +403,7 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid) CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Start game"), 500084000);
- mir_snprintf(m_temp, _countof(m_temp), servicefunction, m_id);
+ mir_snprintf(m_temp, servicefunction, m_id);
//wenn die servicefunktion schon exisitert vernichten, hehe
if (ServiceExists(m_temp))
DestroyServiceFunction(m_temp);
diff --git a/protocols/Xfire/src/Xfire_icon_mng.cpp b/protocols/Xfire/src/Xfire_icon_mng.cpp index b51639d8fd..1a76b82167 100644 --- a/protocols/Xfire/src/Xfire_icon_mng.cpp +++ b/protocols/Xfire/src/Xfire_icon_mng.cpp @@ -140,7 +140,7 @@ Xfire_icon_cache Xfire_icon_mng::LoadGameIcon(unsigned int gameid) if (hIconDll) {
char resourcename[255];
//kurznamen des spiels uppercasen und .ICO anhängen
- mir_snprintf(resourcename, _countof(resourcename), "XF_%s.ICO", shortname);
+ mir_snprintf(resourcename, "XF_%s.ICO", shortname);
Xfire_base::strtoupper(resourcename);
//versuche die resource zufinden
diff --git a/protocols/Xfire/src/Xfire_voicechat.cpp b/protocols/Xfire/src/Xfire_voicechat.cpp index 732fa359ca..4417278b20 100644 --- a/protocols/Xfire/src/Xfire_voicechat.cpp +++ b/protocols/Xfire/src/Xfire_voicechat.cpp @@ -155,7 +155,7 @@ void Xfire_voicechat::writeToDatabase(SendGameStatus2Packet* packet) return;
}
//ip speichern
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
+ mir_snprintf(temp, "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
db_set_s(NULL, protocolname, "VServerIP", temp);
//namen jeh nach id schreiben
switch (packet->gameid) {
diff --git a/protocols/Xfire/src/addgamedialog.cpp b/protocols/Xfire/src/addgamedialog.cpp index 016c170a5c..7d789f3851 100644 --- a/protocols/Xfire/src/addgamedialog.cpp +++ b/protocols/Xfire/src/addgamedialog.cpp @@ -138,11 +138,11 @@ static void FillGameList(LPVOID hwndDlg) if (z2 != zahlbuffer2) {
listentry.gameid = MAKELONG(gameid, atoi(zahlbuffer2));
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid, atoi(zahlbuffer2));
+ mir_snprintf(gameidtemp, "%d_%d", gameid, atoi(zahlbuffer2));
}
else {
listentry.gameid = gameid;
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid);
+ mir_snprintf(gameidtemp, "%d", gameid);
}
@@ -254,7 +254,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) //kein backslash dann normal ret als exenamen verwenden
if ((INT_PTR)exename == 1) exename = exe;
//filterstring aufbauen
- mir_snprintf(szFilter, _countof(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
+ mir_snprintf(szFilter, "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
//umbruch in 0 wandeln
unsigned int sizeFilter = mir_strlen(szFilter);
for (unsigned int i = 0; i < sizeFilter; i++)
@@ -325,13 +325,13 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) int gameid2 = HIWORD(gameids);
if (gameid2 != 0)
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2);
+ mir_snprintf(gameidtemp, "%d_%d", gameid1, gameid2);
else
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, "%d", gameid1);
//spielnamen holen
if (xfire_GetPrivateProfileString(gameidtemp, "LongName", "", ret, 512, inipath)) {
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, "%d", gameid1);
//einige felder vorbelegen
SetDlgItemTextA(hPage, IDC_ADD_NAME, ret);
@@ -367,9 +367,9 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) char ret[512];
if (gameid2 != 0)
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2);
+ mir_snprintf(gameidtemp, "%d_%d", gameid1, gameid2);
else
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, "%d", gameid1);
//neuen gameeintrag anlegen
Xfire_game* newgame = new Xfire_game();
diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp index 2d267f831a..b9fec9aaeb 100644 --- a/protocols/Xfire/src/buddylist.cpp +++ b/protocols/Xfire/src/buddylist.cpp @@ -149,7 +149,7 @@ namespace xfirelib /* ## buddies im miranda verarbietn */ char temp[255]; char * dummy; - mir_snprintf(temp, _countof(temp), "Clan_%d", entry->m_clanid); + mir_snprintf(temp, "Clan_%d", entry->m_clanid); DBVARIANT dbv; if (!db_get(NULL, protocolname, temp, &dbv)) diff --git a/protocols/Xfire/src/iniupdater.cpp b/protocols/Xfire/src/iniupdater.cpp index ed3a43534e..29812cc5ac 100644 --- a/protocols/Xfire/src/iniupdater.cpp +++ b/protocols/Xfire/src/iniupdater.cpp @@ -51,11 +51,11 @@ void UpdateMyXFireIni(LPVOID) //ini pfad rausbekommen
char file[1024], file2[1024], file3[1024];
- mir_snprintf(file, _countof(file), "%sxfire_games.new", inipath);
- mir_snprintf(file2, _countof(file2), "%sxfire_games.ini", inipath);
- mir_snprintf(file3, _countof(file3), "%sxfire_games.old", inipath);
+ mir_snprintf(file, "%sxfire_games.new", inipath);
+ mir_snprintf(file2, "%sxfire_games.ini", inipath);
+ mir_snprintf(file3, "%sxfire_games.old", inipath);
- mir_snprintf(request, _countof(request), "%s%d", INI_URLREQUEST, getfilesize(file2));
+ mir_snprintf(request, "%s%d", INI_URLREQUEST, getfilesize(file2));
if (CheckWWWContent(request)) {
if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || DialogBox(hinstance, MAKEINTRESOURCE(IDD_UPDATE), NULL, DlgUpdateDialogProc) == IDOK) {
@@ -84,11 +84,11 @@ void UpdateMyIcons(LPVOID) //ini pfad rausbekommen
char file[1024], file2[1024], file3[1024];
- mir_snprintf(file, _countof(file), "%sicons.new", inipath);
- mir_snprintf(file2, _countof(file2), "%sicons.dll", inipath);
- mir_snprintf(file3, _countof(file3), "%sicons.old", inipath);
+ mir_snprintf(file, "%sicons.new", inipath);
+ mir_snprintf(file2, "%sicons.dll", inipath);
+ mir_snprintf(file3, "%sicons.old", inipath);
- mir_snprintf(request, _countof(request), "%s%d", ICO_URLREQUEST, getfilesize(file2));
+ mir_snprintf(request, "%s%d", ICO_URLREQUEST, getfilesize(file2));
if (CheckWWWContent(request)) {
if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || MessageBox(NULL, TranslateT("There is a new Icons.dll online, do you want to update now?"), TranslateT(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) {
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 6701140303..8e84db6709 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -419,7 +419,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) ClanInvitationPacket *claninv = (ClanInvitationPacket*)content;
for (int i = 0; i < claninv->numberOfInv; i++) {
char msg[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(msg, _countof(msg), Translate("%s (Nickname: %s) has invited you to join the %s clan. Message: %s%sPlease go to the XFire clan site to accept the Invitation."), claninv->invitefromusername[i].c_str(),
+ mir_snprintf(msg, Translate("%s (Nickname: %s) has invited you to join the %s clan. Message: %s%sPlease go to the XFire clan site to accept the Invitation."), claninv->invitefromusername[i].c_str(),
claninv->invitefrom[i].c_str(),
claninv->clanname[i].c_str(),
claninv->invitemsg[i].c_str(), "\n");
@@ -479,7 +479,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) char temp[255];
char * dummy;
ClanBuddyListNamesPacket *clan = (ClanBuddyListNamesPacket*)content;
- mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid);
+ mir_snprintf(temp, "Clan_%d", clan->clanid);
DBVARIANT dbv;
if (!db_get(NULL,protocolname,temp,&dbv))
@@ -623,10 +623,10 @@ void XFireClient::receivedPacket(XFirePacket *packet) XFireClanPacket *clan = (XFireClanPacket*)content;
for (int i = 0; i < clan->count; i++) {
- mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid[i]);
+ mir_snprintf(temp, "Clan_%d", clan->clanid[i]);
db_set_s(NULL, protocolname, temp, (char*)clan->name[i].c_str());
- mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clan->clanid[i]);
+ mir_snprintf(temp, "ClanUrl_%d", clan->clanid[i]);
db_set_s(NULL, protocolname, temp, (char*)clan->url[i].c_str());
if (!db_get_b(NULL, protocolname, "noclangroups", 0)) {
@@ -815,7 +815,7 @@ INT_PTR UrlCall(WPARAM, LPARAM lparam) if (mir_strlen(g) > 25) //zugroße abschneiden
*(g + 25) = 0;
- mir_snprintf(temp, _countof(temp), Translate("Do you really want to add %s to your friend list?"), g);
+ mir_snprintf(temp, Translate("Do you really want to add %s to your friend list?"), g);
//Nutzer vorher fragen, ob er wirklich user xyz adden möchte
if (MessageBoxA(NULL, temp, Translate(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) {
if (myClient != NULL) {
@@ -991,7 +991,7 @@ extern "C" __declspec(dllexport) int Load(void) //statusmessages setzen
mir_strcpy(statusmessage[0], "");
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
HookEvent(ME_OPT_INITIALISE, OptInit);
HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded);
@@ -1412,7 +1412,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM) {
//setze bei aktivem nocustomaway die alte awaystatusmsg zurück, bugfix
if (db_get_b(NULL, protocolname, "nocustomaway", 0))
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
myClient->Status(statusmessage[1]);
}
@@ -1783,7 +1783,7 @@ static INT_PTR GetIPPort(WPARAM hContact, LPARAM) return 0;
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
+ mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -1811,7 +1811,7 @@ static INT_PTR GetVIPPort(WPARAM hContact, LPARAM) return 0;
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
+ mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -1850,7 +1850,7 @@ static INT_PTR GotoXFireClanSite(WPARAM hContact, LPARAM) char temp[64] = "";
int clanid = db_get_dw(hContact, protocolname, "Clan", -1);
- mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clanid);
+ mir_snprintf(temp, "ClanUrl_%d", clanid);
if (db_get_s(NULL, protocolname, temp, &dbv))
return 0;
@@ -2125,7 +2125,7 @@ void gamedetectiont(void*) if (GetServerIPPort(pid, myClient->m_client->m_localaddr, myClient->m_client->m_llocaladdr, &packet->ip[3], &packet->ip[2], &packet->ip[1], &packet->ip[0], &packet->port)) {
if (packet->ip[3] != 0) {
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
+ mir_snprintf(temp, "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
db_set_s(NULL, protocolname, "ServerIP", temp);
XFireLog("Got IPPort: %s", temp);
}
@@ -2368,7 +2368,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) {
if ((unsigned char)gameob->m_ip[3] != 0) { // wenn ip, dann speichern
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
+ mir_snprintf(temp, "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
db_set_s(hContact, protocolname, "VServerIP", temp);
db_set_w(hContact, protocolname, "VPort", gameob->m_port);
}
@@ -2404,7 +2404,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc //popup, wenn jemand was spielt
if (db_get_b(NULL, protocolname, "gamepopup", 0) == 1) {
char szMsg[256] = "";
- mir_snprintf(szMsg, _countof(szMsg), Translate("%s is playing %s."),
+ mir_snprintf(szMsg, Translate("%s is playing %s."),
//ist ein nick gesetzt?
(entry->m_nick.length() == 0 ?
//nein dann username
@@ -2415,7 +2415,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) {
if ((unsigned char)gameob->m_ip[3] != 0) {
- mir_snprintf(szMsg, _countof(szMsg), Translate("%s is playing %s on server %d.%d.%d.%d:%d."),
+ mir_snprintf(szMsg, Translate("%s is playing %s on server %d.%d.%d.%d:%d."),
//ist ein nick gesetzt?
(entry->m_nick.length() == 0 ?
//nein dann username
@@ -2460,7 +2460,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) {
if ((unsigned char)gameob->m_ip[3] != 0) {
//ip und port in kontakt speichern
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
+ mir_snprintf(temp, "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
db_set_s(hContact, protocolname, "ServerIP", temp);
db_set_w(hContact, protocolname, "Port", gameob->m_port);
@@ -2572,10 +2572,10 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc else {
char temp[256];
DBVARIANT dbv;
- mir_snprintf(temp, _countof(temp), "%d", val - 1);
+ mir_snprintf(temp, "%d", val - 1);
db_get_s(NULL, "CListGroups", temp, &dbv);
if (dbv.pszVal != NULL) {
- mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group);
+ mir_snprintf(temp, "%s\\%s", &dbv.pszVal[1], group);
db_set_s(entry->m_hcontact, "CList", "Group", temp);
db_free(&dbv);
}
@@ -2592,10 +2592,10 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc else {
char temp[256];
DBVARIANT dbv;
- mir_snprintf(temp, _countof(temp), "%d", val - 1);
+ mir_snprintf(temp, "%d", val - 1);
db_get_s(NULL, "CListGroups", temp, &dbv);
if (dbv.pszVal != NULL) {
- mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group);
+ mir_snprintf(temp, "%s\\%s", &dbv.pszVal[1], group);
db_set_s(entry->m_hcontact, "CList", "Group", temp);
db_free(&dbv);
}
@@ -2693,9 +2693,9 @@ void CreateGroup(char*grpn, char*field) strcpy_s(grp, _countof(grp), grpn);//((char*)clan->name[i].c_str());
else {
char temp[255];
- mir_snprintf(temp, _countof(temp), "%d", val - 1);
+ mir_snprintf(temp, "%d", val - 1);
if (!db_get_s(NULL, "CListGroups", temp, &dbv)) {
- mir_snprintf(grp, _countof(grp), "%s\\%s", &dbv.pszVal[1], grpn);
+ mir_snprintf(grp, "%s\\%s", &dbv.pszVal[1], grpn);
db_free(&dbv);
}
else { //gruppe existiert nciht mehr, auf root alles legen
@@ -2709,7 +2709,7 @@ void CreateGroup(char*grpn, char*field) char temp[10];
int i = 0;
for (i = 0;; i++) {
- mir_snprintf(temp, _countof(temp), "%d", i);
+ mir_snprintf(temp, "%d", i);
if (db_get_s(NULL, "CListGroups", temp, &dbv)) {
i--;
break;
@@ -2723,7 +2723,7 @@ void CreateGroup(char*grpn, char*field) strcpy_s(group, 255, "D");
strcat_s(group, 255, grp);
group[0] = 1 | GROUPF_EXPANDED;
- mir_snprintf(temp, _countof(temp), "%d", i + 1);
+ mir_snprintf(temp, "%d", i + 1);
db_set_s(NULL, "CListGroups", temp, group);
CallServiceSync(MS_CLUI_GROUPADDED, i + 1, 0);
}
@@ -2736,17 +2736,16 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) if (wParam == ID_STATUS_ONLINE)
mir_strcpy(statusmessage[0], "");
else if (wParam != ID_STATUS_OFFLINE)
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
}
else {
if (wParam == ID_STATUS_ONLINE)
mir_strcpy(statusmessage[0], (char*)lParam);
else if (wParam != ID_STATUS_OFFLINE) {
- if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0) {
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", (char*)lParam);
- //mir_strcpy(statusmessage[1],( char* )lParam);
- }
- else mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0)
+ mir_snprintf(statusmessage[1], "(AFK) %s", (char*)lParam);
+ else
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
}
}
@@ -2832,7 +2831,7 @@ INT_PTR RemoveFriend(WPARAM hContact, LPARAM) char temp[256];
DBVARIANT dbv;
if (!db_get_s(hContact, protocolname, "Username", &dbv)) {
- mir_snprintf(temp, _countof(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
+ mir_snprintf(temp, Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
if (MessageBoxA(NULL, temp, Translate("Confirm Delete"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
if (myClient != NULL) {
if (myClient->m_client->m_connected) {
@@ -2923,7 +2922,7 @@ int doneQuery(WPARAM wParam, LPARAM lParam) db_set_s(bud->m_hcontact, protocolname, "ServerName", gameinfo->name);
db_set_s(bud->m_hcontact, protocolname, "GameType", gameinfo->gametype);
db_set_s(bud->m_hcontact, protocolname, "Map", gameinfo->map);
- mir_snprintf(temp, _countof(temp), "(%d/%d)", gameinfo->players, gameinfo->maxplayers);
+ mir_snprintf(temp, "(%d/%d)", gameinfo->players, gameinfo->maxplayers);
db_set_s(bud->m_hcontact, protocolname, "Players", temp);
db_set_b(bud->m_hcontact, protocolname, "Passworded", gameinfo->password);
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp index efde5c0404..a1ff71418f 100644 --- a/protocols/Xfire/src/options.cpp +++ b/protocols/Xfire/src/options.cpp @@ -177,7 +177,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } char temp[255] = ""; - mir_snprintf(temp, _countof(temp), "%d", db_get_b(NULL, protocolname, "protover", 0x5b)); + mir_snprintf(temp, "%d", db_get_b(NULL, protocolname, "protover", 0x5b)); SetDlgItemTextA(hwndDlg, IDC_PVER, temp); EnableWindow(GetDlgItem(hwndDlg, IDC_LASTGAME), FALSE); @@ -363,10 +363,10 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Root Group>")); SendDlgItemMessage(hwndDlg, IDC_FOFGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Root Group>")); - mir_snprintf(temp, _countof(temp), "%d", gruppen_id); + mir_snprintf(temp, "%d", gruppen_id); while (!db_get_s(NULL, "CListGroups", temp, &dbv)) { gruppen_id++; - mir_snprintf(temp, _countof(temp), "%d", gruppen_id); + mir_snprintf(temp, "%d", gruppen_id); if (dbv.pszVal != NULL) { SendDlgItemMessageA(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)&dbv.pszVal[1]); @@ -729,7 +729,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char temp[XFIRE_MAXSIZEOFGAMENAME]; for (int i = 0; i < found; i++) { //id auslesen - mir_snprintf(temp, _countof(temp), "gameid_%d", i); + mir_snprintf(temp, "gameid_%d", i); int gameid = db_get_w(NULL, protocolname, temp, 0); //spielnamen auslesen xgamelist.getGamename(gameid, temp, XFIRE_MAXSIZEOFGAMENAME); @@ -859,17 +859,17 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR //gameskip wert setzen char temp[64] = ""; - mir_snprintf(temp, _countof(temp), "gameskip_%d", gameid); + mir_snprintf(temp, "gameskip_%d", gameid); CheckDlgButton(hwndDlg, IDC_DONTDETECT, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); - mir_snprintf(temp, _countof(temp), "gamenostatus_%d", gameid); + mir_snprintf(temp, "gamenostatus_%d", gameid); CheckDlgButton(hwndDlg, IDC_NOSTATUSMSG, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); - mir_snprintf(temp, _countof(temp), "notinstartmenu_%d", gameid); + mir_snprintf(temp, "notinstartmenu_%d", gameid); CheckDlgButton(hwndDlg, IDC_NOTINSTARTMENU, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); //extra parameter auslesen, aber nur, wenn das spiel auch sowas unterstützt if (xgtemp && xgtemp->haveExtraGameArgs()) { EnableDlgItem(hwndDlg, IDC_EXTRAPARAMS, TRUE); - mir_snprintf(temp, _countof(temp), "gameextraparams_%d", gameid); + mir_snprintf(temp, "gameextraparams_%d", gameid); DBVARIANT dbv; if (!db_get(NULL, protocolname, temp, &dbv)) { SetDlgItemTextA(hwndDlg, IDC_EXTRAPARAMS, dbv.pszVal); diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp index 0a48997f31..6fd8961477 100644 --- a/protocols/Xfire/src/processbuddyinfo.cpp +++ b/protocols/Xfire/src/processbuddyinfo.cpp @@ -45,7 +45,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c mir_strcat(filename, ".gif");
type = PA_FORMAT_GIF;
- mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid);
+ mir_snprintf(temp, "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid);
dl = GetWWWContent("media.xfire.com", temp, filename, FALSE);
break;
@@ -54,7 +54,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c mir_strcat(filename, ".jpg");
type = PA_FORMAT_JPEG;
- mir_snprintf(temp, _countof(temp), "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid);
+ mir_snprintf(temp, "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid);
dl = GetWWWContent("screenshot.xfire.com", temp, filename, FALSE);
break;
@@ -62,7 +62,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c type = PA_FORMAT_GIF;
mir_strcat(filename, "xfire.gif");
- mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid);
+ mir_snprintf(temp, "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid);
dl = GetWWWContent("media.xfire.com", temp, filename, TRUE);
break;
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index c9b5192da4..1acf1fcf36 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -231,9 +231,9 @@ void Scan4Games(LPVOID) while (notfound < 200) {
//2 gameids?
if (split)
- mir_snprintf(temp, _countof(temp), "%i_%i", i, i2);
+ mir_snprintf(temp, "%i_%i", i, i2);
else
- mir_snprintf(temp, _countof(temp), "%i", i);
+ mir_snprintf(temp, "%i", i);
//MessageBox(0,temp,temp,0);
@@ -411,7 +411,7 @@ void Scan4Games(LPVOID) if (multiexe) {
multiexe = FALSE;
for (int j = 1; j < 9; j++) {
- mir_snprintf(ret, _countof(ret), "DetectExe[%d]", j);
+ mir_snprintf(ret, "DetectExe[%d]", j);
if (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) {
char *p = strrchr(path, '\\');
if (p != 0) {
@@ -488,7 +488,7 @@ void Scan4Games(LPVOID) newgame->setString(ret2, &newgame->m_launchparams);
//soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]");
+ mir_snprintf(ret, "CommandLineMustNotContain[0]");
int k = 0;
while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) {
@@ -498,7 +498,7 @@ void Scan4Games(LPVOID) newgame->appendString(ret2, &newgame->m_notcontain);
k++;
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", k);
+ mir_snprintf(ret, "CommandLineMustNotContain[%d]", k);
}
newgame->setNameandIcon();
@@ -583,7 +583,7 @@ void Scan4Games(LPVOID) newgame->m_setstatusmsg = atoi(ret2);
//soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]");
+ mir_snprintf(ret, "CommandLineMustNotContain[0]");
int k = 0;
while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) {
@@ -593,7 +593,7 @@ void Scan4Games(LPVOID) newgame->appendString(ret2, &newgame->m_notcontain);
k++;
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", k);
+ mir_snprintf(ret, "CommandLineMustNotContain[%d]", k);
}
newgame->setNameandIcon();
@@ -653,7 +653,7 @@ void Scan4Games(LPVOID) int p = mir_strlen(gamelist) - 2;
if (p > -1)
gamelist[p] = 0; //letztes koma killen
- mir_snprintf(ret, _countof(ret), Translate("Games found:%s%s"), "\r\n\r\n", gamelist);
+ mir_snprintf(ret, Translate("Games found:%s%s"), "\r\n\r\n", gamelist);
MSGBOX(ret);
}
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index aa4de637c3..9adabebebc 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -45,7 +45,7 @@ void LoadProfilStatus(void *arg) //dl
char url[255];
- mir_snprintf(url, _countof(url), "http://miniprofile.xfire.com/bg/sh/type/1/%s.png", fname);
+ mir_snprintf(url, "http://miniprofile.xfire.com/bg/sh/type/1/%s.png", fname);
char* buf = NULL;
unsigned int size = 0;
@@ -66,7 +66,7 @@ void SetItemTxt(HWND hwndDlg, int feldid, char*feld, MCONTACT hcontact, int type if (!db_get(hcontact, protocolname, feld, &dbv)) {
if (type == 1) {
char temp[255];
- mir_snprintf(temp, _countof(temp), "%i", dbv.wVal);
+ mir_snprintf(temp, "%i", dbv.wVal);
SetDlgItemTextA(hwndDlg, feldid, temp);
}
else {
@@ -91,7 +91,7 @@ static int GetIPPortUDetails(MCONTACT hContact, char* feld1, char* feld2) return 0;
char temp[255];
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
+ mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp index e3b7eabedc..879bb9e6b6 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -102,7 +102,7 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) char temp[24];
DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "ServerIP", &dbv3)) {
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
+ mir_snprintf(temp, "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
db_free(&dbv3);
return mir_strdup(temp);
}
@@ -125,7 +125,7 @@ char* Varxfirevoiceip(ARGUMENTSINFO *ai) char temp[24];
DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "VServerIP", &dbv3)) {
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
+ mir_snprintf(temp, "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
db_free(&dbv3);
return mir_strdup(temp);
}
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp index 7daff87be5..f80fa58e97 100644 --- a/protocols/Yahoo/src/chat.cpp +++ b/protocols/Yahoo/src/chat.cpp @@ -54,7 +54,7 @@ void ext_yahoo_conf_userdecline(int id, const char*, const char *who, const char TCHAR info[1024];
TCHAR *whot = mir_utf8decodeT(who);
TCHAR *msgt = mir_utf8decodeT(msg);
- mir_sntprintf(info, _countof(info), TranslateT("%s denied invitation with message: %s"), whot, msgt ? msgt : _T(""));
+ mir_sntprintf(info, TranslateT("%s denied invitation with message: %s"), whot, msgt ? msgt : _T(""));
GETPROTOBYID(id)->ChatEvent(room, who, GC_EVENT_INFORMATION, info);
mir_free(msgt);
mir_free(whot);
@@ -570,7 +570,7 @@ INT_PTR CALLBACK ChatRequestDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA INT_PTR __cdecl CYahooProto::CreateConference(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
char room[128];
- mir_snprintf(room, _countof(room), "%s-%u", m_yahoo_id, time(NULL));
+ mir_snprintf(room, "%s-%u", m_yahoo_id, time(NULL));
InviteChatParam* param = new InviteChatParam(room, this);
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL,
@@ -587,7 +587,7 @@ void CALLBACK ConferenceRequestCB(PVOID pParam) void ext_yahoo_got_conf_invite(int id, const char *me, const char *who, const char *room, const char *msg, YList *members)
{
char z[1024];
- mir_snprintf(z, _countof(z), Translate("[miranda] Got conference invite to room: %s with msg: %s"), room ? room : "", msg ? msg : "");
+ mir_snprintf(z, Translate("[miranda] Got conference invite to room: %s with msg: %s"), room ? room : "", msg ? msg : "");
LOG(("[ext_yahoo_got_conf_invite] %s", z));
CYahooProto* ppro = getProtoById(id);
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index f5e9dde563..058086921e 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -297,7 +297,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si *
* Don't rely on workingDir to be right, since it's not used to check if file exists.
*/
- mir_sntprintf(filefull, _countof(filefull), _T("%s\\%s"), sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
+ mir_sntprintf(filefull, _T("%s\\%s"), sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
FREE(sf->pfts.tszCurrentFile);
sf->pfts.tszCurrentFile = _tcsdup(filefull);
@@ -543,7 +543,7 @@ void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_ char z[1024];
yahoo_file_info *fi = (yahoo_file_info *) f->data;
- mir_snprintf(z, _countof(z), "%s (%lu)\r\n", fi->filename, fi->filesize);
+ mir_snprintf(z, "%s (%lu)\r\n", fi->filename, fi->filesize);
mir_strcat(fn, z);
fc++;
}
diff --git a/protocols/Yahoo/src/icolib.cpp b/protocols/Yahoo/src/icolib.cpp index f647d3887c..fc9144d14b 100644 --- a/protocols/Yahoo/src/icolib.cpp +++ b/protocols/Yahoo/src/icolib.cpp @@ -36,7 +36,7 @@ void CYahooProto::IconsInit(void) HICON CYahooProto::LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "YAHOO_%s", name);
+ mir_snprintf(szSettingName, "YAHOO_%s", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -52,6 +52,6 @@ HANDLE CYahooProto::GetIconHandle(int iconId) void CYahooProto::ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "YAHOO_%s", name);
+ mir_snprintf(szSettingName, "YAHOO_%s", name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 29d980c996..398dfda62a 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -40,7 +40,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons if (stat == 2) {
char z[1024];
- mir_snprintf(z, _countof(z), "Error sending message to %s", who);
+ mir_snprintf(z, "Error sending message to %s", who);
LOG((z));
ShowError(TranslateT("Yahoo Error"), _A2T(z));
return;
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index eb84f7dd0e..dd2ecdb1b9 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -68,7 +68,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CYahooProto::OnPrebuildContactMenu);
TCHAR tModuleDescr[100];
- mir_sntprintf(tModuleDescr, _countof(tModuleDescr), TranslateT("%s plugin connections"), m_tszUserName);
+ mir_sntprintf(tModuleDescr, TranslateT("%s plugin connections"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index 158f024364..f4bc06cf05 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -224,7 +224,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) y = yahoo_urlencode(yahoo_get_cookie(m_id, "y"));
t = yahoo_urlencode(yahoo_get_cookie(m_id, "t"));
u = yahoo_urlencode(url);
- mir_snprintf(tUrl, _countof(tUrl),
+ mir_snprintf(tUrl,
"http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.t=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s",
y, t, u);
@@ -233,7 +233,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) FREE(u);
}
else {
- mir_snprintf(tUrl, _countof(tUrl), url);
+ mir_snprintf(tUrl, url);
}
debugLogA("[YahooOpenURL] url: %s Final URL: %s", url, tUrl);
@@ -258,7 +258,7 @@ INT_PTR __cdecl CYahooProto::OnShowProfileCommand(WPARAM wParam, LPARAM) if (getString(wParam, YAHOO_LOGINID, &dbv))
return 0;
- mir_snprintf(tUrl, _countof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
+ mir_snprintf(tUrl, "http://profiles.yahoo.com/%s", dbv.pszVal);
db_free(&dbv);
OpenURL(tUrl, 0);
@@ -284,7 +284,7 @@ INT_PTR __cdecl CYahooProto::OnShowMyProfileCommand(WPARAM, LPARAM) }
char tUrl[4096];
- mir_snprintf(tUrl, _countof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
+ mir_snprintf(tUrl, "http://profiles.yahoo.com/%s", dbv.pszVal);
db_free(&dbv);
OpenURL(tUrl, 0);
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index e42c892797..df465c1668 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -521,7 +521,7 @@ void CYahooProto::ext_got_audible(const char *me, const char *who, const char *a }
char z[1028];
- mir_snprintf(z, _countof(z), "[miranda-audible] %s", msg ? msg : "");
+ mir_snprintf(z, "[miranda-audible] %s", msg ? msg : "");
ext_got_im((char*)me, (char*)who, 0, z, 0, 0, 1, -1, NULL, 0);
}
@@ -735,7 +735,7 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha nick[0] = '\0';
if (lname && fname)
- mir_snprintf(nick, _countof(nick), "%s %s", fname, lname);
+ mir_snprintf(nick, "%s %s", fname, lname);
else if (lname)
strncpy_s(nick, lname, _TRUNCATE);
else if (fname)
@@ -926,15 +926,15 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt) TCHAR z[MAX_SECONDLINE], title[MAX_CONTACTNAME];
if (from == NULL) {
- mir_sntprintf(title, _countof(title), _T("%s: %s"), m_tszUserName, TranslateT("New Mail"));
- mir_sntprintf(z, _countof(z), TranslateT("You have %i unread messages"), cnt);
+ mir_sntprintf(title, _T("%s: %s"), m_tszUserName, TranslateT("New Mail"));
+ mir_sntprintf(z, TranslateT("You have %i unread messages"), cnt);
}
else {
- mir_sntprintf(title, _countof(title), TranslateT("New Mail (%i messages)"), cnt);
+ mir_sntprintf(title, TranslateT("New Mail (%i messages)"), cnt);
ptrT tszFrom(mir_utf8decodeT(from));
ptrT tszSubj(mir_utf8decodeT(subj));
- mir_sntprintf(z, _countof(z), TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
+ mir_sntprintf(z, TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
}
if (!ShowPopup(title, z, "http://mail.yahoo.com"))
@@ -986,7 +986,7 @@ void ext_yahoo_got_cookies(int id) //wsprintfA(z, "Cookie: %s; C=%s; Y=%s; T=%s", Bcookie, yahoo_get_cookie(id, "c"), yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
//wsprintfA(z, "Cookie: %s; Y=%s", Bcookie, yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
- mir_snprintf(z, _countof(z), "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
+ mir_snprintf(z, "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hnuMain, (LPARAM)z);*/
@@ -995,7 +995,7 @@ void ext_yahoo_got_cookies(int id) char z[1024];
// need to add Cookie header to our requests or we get booted w/ "Bad Cookie" message.
- mir_snprintf(z, _countof(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
+ mir_snprintf(z, "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
yahoo_get_cookie(id, "t"), yahoo_get_cookie(id, "c"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hNetlibUser, (LPARAM)z);
@@ -1237,7 +1237,7 @@ void CYahooProto::ext_send_http_request(enum yahoo_connection_type type, const c if (nlhr.requestType == REQUEST_POST) {
httpHeaders[nlhr.headersCount].szName = "Content-Length";
- mir_snprintf(z, _countof(z), "%d", content_length);
+ mir_snprintf(z, "%d", content_length);
httpHeaders[nlhr.headersCount].szValue = z;
nlhr.headersCount++;
@@ -1381,7 +1381,7 @@ char * CYahooProto::ext_send_https_request(yahoo_data *yd, const char *host, con char z[4096], *result = NULL;
int i;
- mir_snprintf(z, _countof(z), "https://%s%s", host, path);
+ mir_snprintf(z, "https://%s%s", host, path);
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_HTTP11 | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT; /* Use HTTP/1.1 and don't dump the requests to the log */
@@ -1454,7 +1454,7 @@ void CYahooProto::ext_login(enum yahoo_status login_mode) NETLIBHTTPREQUEST nlhr = { 0 }, *nlhrReply;
char z[4096];
- mir_snprintf(z, _countof(z), "http://%s%s", getByte("YahooJapan", 0) != 0 ? "cs1.msg.vip.ogk.yahoo.co.jp" : "vcs.msg.yahoo.com", "/capacity");
+ mir_snprintf(z, "http://%s%s", getByte("YahooJapan", 0) != 0 ? "cs1.msg.vip.ogk.yahoo.co.jp" : "vcs.msg.yahoo.com", "/capacity");
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_HTTP11;
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index 29297e7426..74c7855d26 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -80,7 +80,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) break;
case CNFT_DWORD:
- mir_sntprintf(szUid, _countof(szUid), _T("%u"), ci.dVal);
+ mir_sntprintf(szUid, _T("%u"), ci.dVal);
break;
}
}
@@ -88,9 +88,9 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) if (dbei.eventType == EVENTTYPE_AUTHREQUEST) {
SkinPlaySound("AuthRequest");
if (szUid[0])
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%s requests authorization"), szUid);
+ mir_sntprintf(szTooltip, TranslateT("%s requests authorization"), szUid);
else
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%u requests authorization"), *(PDWORD)dbei.pBlob);
+ mir_sntprintf(szTooltip, TranslateT("%u requests authorization"), *(PDWORD)dbei.pBlob);
cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_REQUEST);
cli.pszService = MS_AUTH_SHOWREQUEST;
@@ -99,9 +99,9 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) else if (dbei.eventType == EVENTTYPE_ADDED) {
SkinPlaySound("AddedEvent");
if (szUid[0])
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%s added you to their contact list"), szUid);
+ mir_sntprintf(szTooltip, TranslateT("%s added you to their contact list"), szUid);
else
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("%u added you to their contact list"), *(PDWORD)dbei.pBlob);
+ mir_sntprintf(szTooltip, TranslateT("%u added you to their contact list"), *(PDWORD)dbei.pBlob);
cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_ADD);
cli.pszService = MS_AUTH_SHOWADDED;
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp index 85b08c1a20..0156498b77 100644 --- a/src/core/stdauth/src/authdialogs.cpp +++ b/src/core/stdauth/src/authdialogs.cpp @@ -63,11 +63,11 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR name[128] = _T("");
int off = 0;
if (firstT[0] && lastT[0])
- off = mir_sntprintf(name, _countof(name), _T("%s %s"), firstT, lastT);
+ off = mir_sntprintf(name, _T("%s %s"), firstT, lastT);
else if (firstT[0])
- off = mir_sntprintf(name, _countof(name), _T("%s"), firstT);
+ off = mir_sntprintf(name, _T("%s"), firstT);
else if (lastT[0])
- off = mir_sntprintf(name, _countof(name), _T("%s"), lastT);
+ off = mir_sntprintf(name, _T("%s"), lastT);
if (nickT[0]) {
if (off)
mir_sntprintf(name + off, _countof(name) - off, _T(" (%s)"), nickT);
@@ -79,11 +79,11 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR hdr[256];
if (uin && emailT[0])
- mir_sntprintf(hdr, _countof(hdr), TranslateT("%s added you to the contact list\n%u (%s) on %s"), name, uin, emailT, acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%u (%s) on %s"), name, uin, emailT, acc->tszAccountName);
else if (uin)
- mir_sntprintf(hdr, _countof(hdr), TranslateT("%s added you to the contact list\n%u on %s"), name, uin, acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%u on %s"), name, uin, acc->tszAccountName);
else
- mir_sntprintf(hdr, _countof(hdr), TranslateT("%s added you to the contact list\n%s on %s"), name, emailT[0] ? emailT : TranslateT("(Unknown)"), acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s added you to the contact list\n%s on %s"), name, emailT[0] ? emailT : TranslateT("(Unknown)"), acc->tszAccountName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr);
@@ -188,11 +188,11 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR name[128] = _T("");
int off = 0;
if (firstT[0] && lastT[0])
- off = mir_sntprintf(name, _countof(name), _T("%s %s"), (TCHAR*)firstT, (TCHAR*)lastT);
+ off = mir_sntprintf(name, _T("%s %s"), (TCHAR*)firstT, (TCHAR*)lastT);
else if (firstT[0])
- off = mir_sntprintf(name, _countof(name), _T("%s"), (TCHAR*)firstT);
+ off = mir_sntprintf(name, _T("%s"), (TCHAR*)firstT);
else if (lastT[0])
- off = mir_sntprintf(name, _countof(name), _T("%s"), (TCHAR*)lastT);
+ off = mir_sntprintf(name, _T("%s"), (TCHAR*)lastT);
if (mir_tstrlen(nickT)) {
if (off)
mir_sntprintf(name + off, _countof(name) - off, _T(" (%s)"), (TCHAR*)nickT);
@@ -204,11 +204,11 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR hdr[256];
if (uin && emailT[0])
- mir_sntprintf(hdr, _countof(hdr), TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (TCHAR*)emailT, acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u (%s) on %s"), name, uin, (TCHAR*)emailT, acc->tszAccountName);
else if (uin)
- mir_sntprintf(hdr, _countof(hdr), TranslateT("%s requested authorization\n%u on %s"), name, uin, acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%u on %s"), name, uin, acc->tszAccountName);
else
- mir_sntprintf(hdr, _countof(hdr), TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (TCHAR*)emailT : TranslateT("(Unknown)"), acc->tszAccountName);
+ mir_sntprintf(hdr, TranslateT("%s requested authorization\n%s on %s"), name, emailT[0] ? (TCHAR*)emailT : TranslateT("(Unknown)"), acc->tszAccountName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr);
SetDlgItemText(hwndDlg, IDC_REASON, reasonT);
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 9c333cef1b..477749441f 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -61,11 +61,11 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP TCHAR *status = pcli->pfnGetStatusModeDescription(dwStatus, 0);
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status, contactName);
+ mir_sntprintf(str, format, status, contactName);
SetWindowText(hwndDlg, str);
GetDlgItemText(hwndDlg, IDC_RETRIEVING, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, status);
+ mir_sntprintf(str, format, status);
SetDlgItemText(hwndDlg, IDC_RETRIEVING, str);
Window_SetProtoIcon_IcoLib(hwndDlg, szProto, dwStatus);
@@ -141,7 +141,7 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) {
TCHAR str[128];
- mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0));
+ mir_sntprintf(str, TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, Skin_LoadProtoIcon(szProto, status), CMIF_NOTOFFLINE);
return 0;
}
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 9fce5c6ef4..ea1589a372 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -226,7 +226,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa {
TCHAR str[256], format[128];
GetWindowText(hwndDlg, format, _countof(format));
- mir_sntprintf(str, _countof(str), format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0));
+ mir_sntprintf(str, format, pcli->pfnGetStatusModeDescription(dat->statusMode, 0));
SetWindowText(hwndDlg, str);
}
GetDlgItemText(hwndDlg, IDOK, dat->okButtonFormat, _countof(dat->okButtonFormat));
@@ -247,7 +247,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case WM_TIMER:
if (--dat->countdown >= 0) {
TCHAR str[64];
- mir_sntprintf(str, _countof(str), dat->okButtonFormat, dat->countdown);
+ mir_sntprintf(str, dat->okButtonFormat, dat->countdown);
SetDlgItemText(hwndDlg, IDOK, str);
}
else {
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index a65c523c7b..943ddd594b 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -471,7 +471,7 @@ STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE * lplpstg) {
WCHAR szwName[64];
char szName[64];
- mir_snprintf(szName, _countof(szName), "s%u", nextStgId++);
+ mir_snprintf(szName, "s%u", nextStgId++);
MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, _countof(szwName));
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 4f721cd819..b8bab73b79 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -135,7 +135,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up"));
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 2ad1e6c126..1fae21565d 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -996,7 +996,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *si }
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(si->pStatuses, ui->Status));
@@ -1149,13 +1149,13 @@ static int RestoreWindowPosition(HWND hwnd, MCONTACT hContact, char * szModule, GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
int x = db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
int y = (int)db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
int width = db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
int height = db_get_dw(hContact, szModule, szSettingName, -1);
if (x == -1)
@@ -2332,7 +2332,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
static TCHAR ptszBuf[1024];
- mir_sntprintf(ptszBuf, _countof(ptszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(ptszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -2451,11 +2451,11 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar _tcsncpy_s(szName, (pInfo->ptszModDispName ? pInfo->ptszModDispName : _A2T(si->pszModule)), _TRUNCATE);
ValidateFilename(szName);
- mir_sntprintf(szFolder, _countof(szFolder), _T("%s\\%s"), g_Settings.pszLogDir, szName);
+ mir_sntprintf(szFolder, _T("%s\\%s"), g_Settings.pszLogDir, szName);
mir_sntprintf(szName, _T("%s.log"), si->ptszID);
ValidateFilename(szName);
- mir_sntprintf(szFile, _countof(szFile), _T("%s\\%s"), szFolder, szName);
+ mir_sntprintf(szFile, _T("%s\\%s"), szFolder, szName);
ShellExecute(hwndDlg, _T("open"), szFile, NULL, NULL, SW_SHOW);
}
}
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 49d6cf72b1..9ba716b21f 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -123,7 +123,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) SkinPlaySound("RecvFile");
TCHAR szTooltip[256];
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTooltip, TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
cle.flags |= CLEF_TCHAR;
diff --git a/src/core/stdfile/src/fileexistsdlg.cpp b/src/core/stdfile/src/fileexistsdlg.cpp index ea087b0f24..ef765b56bf 100644 --- a/src/core/stdfile/src/fileexistsdlg.cpp +++ b/src/core/stdfile/src/fileexistsdlg.cpp @@ -37,7 +37,7 @@ static void SetControlToUnixTime(HWND hwndDlg, UINT idCtrl, time_t unixTime) FileTimeToSystemTime(&filetime, &st);
GetTimeFormatA(LOCALE_USER_DEFAULT, 0, &st, NULL, szTime, _countof(szTime));
GetDateFormatA(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate));
- mir_snprintf(szOutput, _countof(szOutput), "%s %s", szDate, szTime);
+ mir_snprintf(szOutput, "%s %s", szDate, szTime);
SetDlgItemTextA(hwndDlg, idCtrl, szOutput);
}
@@ -156,7 +156,7 @@ void __cdecl LoadIconsAndTypesThread(void* param) }
CharUpper(szExtension);
if (fileInfo.szTypeName[0] == '\0')
- mir_sntprintf(fileInfo.szTypeName, _countof(fileInfo.szTypeName), TranslateT("%s file"), szExtension);
+ mir_sntprintf(fileInfo.szTypeName, TranslateT("%s file"), szExtension);
SetDlgItemText(info->hwndDlg, IDC_EXISTINGTYPE, fileInfo.szTypeName);
SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName);
SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0);
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index da087ad49f..b58b539f58 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -127,7 +127,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iScanner >= _countof(virusScanners) || iScanner < 0) break;
str[0] = '\0';
if (SRFile_GetRegValue(HKEY_LOCAL_MACHINE, virusScanners[iScanner].szExeRegPath, virusScanners[iScanner].szExeRegValue, szScanExe, _countof(szScanExe)))
- mir_sntprintf(str, _countof(str), virusScanners[iScanner].szCommandLine, szScanExe);
+ mir_sntprintf(str, virusScanners[iScanner].szCommandLine, szScanExe);
SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str);
}
break;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index e8b7cda08c..09d5b16d99 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -129,7 +129,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO if (tszRecvPath)
_tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
- mir_sntprintf(tszTemp, _countof(tszTemp), _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files"));
+ mir_sntprintf(tszTemp, _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files"));
if (hContact) {
hContact = db_mc_tryMeta(hContact);
@@ -169,7 +169,7 @@ void GetReceivedFilesDir(TCHAR *szDir, int cchDir) if (tszRecvPath)
_tcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
- mir_sntprintf(tszTemp, _countof(tszTemp), _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files"));
+ mir_sntprintf(tszTemp, _T("%%mydocuments%%\\%s\\%%userid%%"), TranslateT("My received files"));
patchDir(tszTemp, _countof(tszTemp));
RemoveInvalidPathChars(tszTemp);
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index f719012644..75d955897b 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -49,16 +49,16 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat) if (i > 1) {
TCHAR szFormat[32];
if (fileCount && dirCount) {
- mir_sntprintf(szFormat, _countof(szFormat), _T("%s, %s"), TranslateTS(fileCount == 1 ? _T("%d file") : _T("%d files")), TranslateTS(dirCount == 1 ? _T("%d directory") : _T("%d directories")));
- mir_sntprintf(str, _countof(str), szFormat, fileCount, dirCount);
+ mir_sntprintf(szFormat, _T("%s, %s"), TranslateTS(fileCount == 1 ? _T("%d file") : _T("%d files")), TranslateTS(dirCount == 1 ? _T("%d directory") : _T("%d directories")));
+ mir_sntprintf(str, szFormat, fileCount, dirCount);
}
else if (fileCount) {
mir_tstrcpy(szFormat, TranslateT("%d files"));
- mir_sntprintf(str, _countof(str), szFormat, fileCount);
+ mir_sntprintf(str, szFormat, fileCount);
}
else {
mir_tstrcpy(szFormat, TranslateT("%d directories"));
- mir_sntprintf(str, _countof(str), szFormat, dirCount);
+ mir_sntprintf(str, szFormat, dirCount);
}
SetDlgItemText(hwndDlg, IDC_FILE, str);
}
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 1073ce9351..804318123b 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -105,7 +105,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) if (info->szFile[mir_tstrlen(info->szFile) - 1] == '\\') info->szFile[mir_tstrlen(info->szFile) - 1] = '\0'; *pszReplace = 0; - mir_sntprintf(szCmdLine, _countof(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2); + mir_sntprintf(szCmdLine, _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2); } else _tcsncpy_s(szCmdLine, dbv.ptszVal, _TRUNCATE); @@ -139,7 +139,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE if (dat->hIcon) DestroyIcon(dat->hIcon); dat->hIcon = NULL; if (fn && (fts->totalFiles > 1)) { - mir_sntprintf(msg, _countof(msg), _T("%s: %s (%d %s %d)"), + mir_sntprintf(msg, _T("%s: %s (%d %s %d)"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn, fts->currentFileNumber + 1, TranslateT("of"), fts->totalFiles); @@ -147,7 +147,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE dat->hIcon = shfi.hIcon; } else if (fn) { - mir_sntprintf(msg, _countof(msg), _T("%s: %s"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); + mir_sntprintf(msg, _T("%s: %s"), pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); SHGetFileInfo(fn, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); dat->hIcon = shfi.hIcon; @@ -322,7 +322,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR GetTimeFormat(LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER, &st, NULL, szTime, _countof(szTime)); } - mir_sntprintf(szDisplay, _countof(szDisplay), _T("%s/%s (%s %s)"), szSpeed, TranslateT("sec"), szTime, TranslateT("remaining")); + mir_sntprintf(szDisplay, _T("%s/%s (%s %s)"), szSpeed, TranslateT("sec"), szTime, TranslateT("remaining")); SetDlgItemText(hwndDlg, IDC_ALLSPEED, szDisplay); } break; @@ -596,14 +596,14 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR const unsigned long nextPos = fts->totalBytes ? (BIGI(100) * fts->totalProgress / fts->totalBytes) : 0; if (lastPos != nextPos || firstTime) { SendDlgItemMessage(hwndDlg, IDC_ALLFILESPROGRESS, PBM_SETPOS, nextPos, 0); - mir_sntprintf(str, _countof(str), _T("%u%%"), nextPos); + mir_sntprintf(str, _T("%u%%"), nextPos); SetDlgItemText(hwndDlg, IDC_ALLPRECENTS, str); } int units; GetSensiblyFormattedSize(fts->totalBytes, szSizeTotal, _countof(szSizeTotal), 0, 1, &units); GetSensiblyFormattedSize(fts->totalProgress, szSizeDone, _countof(szSizeDone), units, 0, NULL); - mir_sntprintf(str, _countof(str), _T("%s/%s"), szSizeDone, szSizeTotal); + mir_sntprintf(str, _T("%s/%s"), szSizeDone, szSizeTotal); str2[0] = 0; GetDlgItemText(hwndDlg, IDC_ALLTRANSFERRED, str2, _countof(str2)); if (mir_tstrcmp(str, str2)) diff --git a/src/core/stdhelp/src/about.cpp b/src/core/stdhelp/src/about.cpp index 366a9929f1..272ff76db1 100644 --- a/src/core/stdhelp/src/about.cpp +++ b/src/core/stdhelp/src/about.cpp @@ -51,7 +51,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar CallService(MS_SYSTEM_GETVERSIONTEXT, _countof(productVersion), (LPARAM)productVersion);
TCHAR str[64];
- mir_sntprintf(str, _countof(str), STR_VERSION_FORMAT, productVersion);
+ mir_sntprintf(str, STR_VERSION_FORMAT, productVersion);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, str);
}
ShowWindow(GetDlgItem(hwndDlg, IDC_CREDITSFILE), SW_HIDE);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index dabe41f5f1..5ed973eab0 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -956,7 +956,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR date[64], time[64], fmt[128];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0);
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0);
- mir_sntprintf(fmt, _countof(fmt), TranslateT("Last message received on %s at %s."), date, time);
+ mir_sntprintf(fmt, TranslateT("Last message received on %s at %s."), date, time);
SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)fmt);
}
else SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)_T(""));
@@ -1051,9 +1051,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR *szStatus = pcli->pfnGetStatusModeDescription(dat->szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE), 0);
if (statusIcon)
- mir_sntprintf(newtitle, _countof(newtitle), _T("%s - %s"), contactName, TranslateT("Message session"));
+ mir_sntprintf(newtitle, _T("%s - %s"), contactName, TranslateT("Message session"));
else
- mir_sntprintf(newtitle, _countof(newtitle), _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message session"));
+ mir_sntprintf(newtitle, _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message session"));
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)wParam;
if (!cws || (!mir_strcmp(cws->szModule, dat->szProto) && !mir_strcmp(cws->szSetting, "Status"))) {
@@ -1297,7 +1297,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l TCHAR* szContactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING);
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s is typing a message..."), szContactName);
+ mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), szContactName);
dat->nTypeSecs--;
SendMessage(dat->hwndStatus, SB_SETTEXT, 0, (LPARAM)szBuf);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index c459a50fb8..d1ebe85ad0 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -212,7 +212,7 @@ static char *SetToStyle(int style) LOGFONT lf;
LoadMsgDlgFont(style, &lf, NULL);
- mir_snprintf(szStyle, _countof(szStyle), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
+ mir_snprintf(szStyle, "\\f%u\\cf%u\\b%d\\i%d\\fs%u", style, style, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / logPixelSY);
return szStyle;
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 5436d0d6c6..938669c551 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -94,7 +94,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
TCHAR toolTip[256];
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
return 0;
@@ -165,7 +165,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) {
TCHAR szTip[256];
- mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags & SMF_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn = { sizeof(tn) };
@@ -257,7 +257,7 @@ static void RestoreUnreadMessageAlerts(void) else {
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -516,7 +516,7 @@ STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE * lplpstg) {
WCHAR szwName[64];
char szName[64];
- mir_snprintf(szName, _countof(szName), "s%u", nextStgId++);
+ mir_snprintf(szName, "s%u", nextStgId++);
MultiByteToWideChar(CP_ACP, 0, szName, -1, szwName, _countof(szwName));
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
diff --git a/src/core/stdssl/src/netlibssl.cpp b/src/core/stdssl/src/netlibssl.cpp index 1c5dd33569..8b088867e1 100644 --- a/src/core/stdssl/src/netlibssl.cpp +++ b/src/core/stdssl/src/netlibssl.cpp @@ -84,7 +84,7 @@ static void ReportSslError(SECURITY_STATUS scRet, int line, bool = false) }
TCHAR szMsgBuf2[512];
- mir_sntprintf(szMsgBuf2, _countof(szMsgBuf2), _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf);
+ mir_sntprintf(szMsgBuf2, _T("SSL connection failure (%x %u): %s"), scRet, line, szMsgBuf);
char* szMsg = Utf8EncodeT(szMsgBuf2);
Netlib_Logf(NULL, szMsg);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index 3b9048a3e1..9f6e104b38 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -165,7 +165,7 @@ static void FillHistoryThread(void* param) GetObjectSummary(&dbei, str, _countof(str));
if (str[0]) {
TimeZone_PrintTimeStamp(NULL, dbei.timestamp, _T("d t"), strdatetime, _countof(strdatetime), 0);
- mir_sntprintf(eventText, _countof(eventText), _T("%s: %s"), strdatetime, str);
+ mir_sntprintf(eventText, _T("%s: %s"), strdatetime, str);
i = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)eventText);
SendMessage(hwndList, LB_SETITEMDATA, i, (LPARAM)hDbEvent);
}
@@ -208,7 +208,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
TCHAR* contactName, str[200];
contactName = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(str, _countof(str), TranslateT("History for %s"), contactName);
+ mir_sntprintf(str, TranslateT("History for %s"), contactName);
SetWindowText(hwndDlg, str);
}
Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_HISTORY);
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp index 8a679012cd..c142be091b 100644 --- a/src/core/stduserinfo/src/contactinfo.cpp +++ b/src/core/stduserinfo/src/contactinfo.cpp @@ -115,7 +115,7 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar char szPhone[96], szArea[32], szNumber[64];
GetDlgItemTextA(hwndDlg, IDC_AREA, szArea, _countof(szArea));
GetDlgItemTextA(hwndDlg, IDC_NUMBER, szNumber, _countof(szNumber));
- mir_snprintf(szPhone, _countof(szPhone), "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber);
+ mir_snprintf(szPhone, "+%u (%s) %s", SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_GETCURSEL, 0, 0), 0), szArea, szNumber);
noRecursion = 1;
SetDlgItemTextA(hwndDlg, IDC_PHONE, szPhone);
noRecursion = 0;
@@ -284,7 +284,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
lvi.pszText = idstr2;
- mir_sntprintf(idstr2, _countof(idstr2), _T("%d"), i + 2);
+ mir_sntprintf(idstr2, _T("%d"), i + 2);
}
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
@@ -298,7 +298,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
- mir_sntprintf(idstr2, _countof(idstr2), TranslateT("Custom %d"), i + 1);
+ mir_sntprintf(idstr2, TranslateT("Custom %d"), i + 1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_EMAILS), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
@@ -359,7 +359,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
- mir_sntprintf(idstr2, _countof(idstr2), TranslateT("Custom %d"), i + 1);
+ mir_sntprintf(idstr2, TranslateT("Custom %d"), i + 1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
if (mir_tstrlen(dbv.ptszVal) > 4 && !mir_tstrcmp(dbv.ptszVal + mir_tstrlen(dbv.ptszVal) - 4, _T(" SMS"))) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
@@ -439,7 +439,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR szEmail[256];
if (IsOverEmail(hwndDlg, szEmail, _countof(szEmail))) {
TCHAR szExec[264];
- mir_sntprintf(szExec, _countof(szExec), _T("mailto:%s"), szEmail);
+ mir_sntprintf(szExec, _T("mailto:%s"), szEmail);
ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW);
break;
}
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 1dec08f526..4ebc2726cf 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -107,7 +107,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule WORD wSave = dbv.wVal;
if (wSave == (WORD)-1) {
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sName", szSetting);
+ mir_snprintf(szSettingName, "%sName", szSetting);
if (!db_get_ts(hContact, szModule, szSettingName, &dbv)) {
ptstr = dbv.ptszVal;
unspecified = false;
@@ -215,7 +215,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EMAIL))) {
TCHAR szExec[264], szEmail[256];
GetDlgItemText(hwndDlg, IDC_EMAIL, szEmail, _countof(szEmail));
- mir_sntprintf(szExec, _countof(szExec), _T("mailto:%s"), szEmail);
+ mir_sntprintf(szExec, _T("mailto:%s"), szEmail);
ShellExecute(hwndDlg, _T("open"), szExec, NULL, NULL, SW_SHOW);
}
break;
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 4ca8f3332d..f6629445bd 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -255,7 +255,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP name = pcli->pfnGetContactDisplayName(dat->hContact, 0);
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
- mir_sntprintf(newTitle, _countof(newTitle), oldTitle, name);
+ mir_sntprintf(newTitle, oldTitle, name);
SetWindowText(hwndDlg, newTitle);
//////////////////////////////////////////////////////////////////////
@@ -355,7 +355,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER:
TCHAR str[128];
- mir_sntprintf(str, _countof(str), _T("%.*s%s%.*s"), dat->updateAnimFrame % 10, _T("........."), dat->szUpdating, dat->updateAnimFrame % 10, _T("........."));
+ mir_sntprintf(str, _T("%.*s%s%.*s"), dat->updateAnimFrame % 10, _T("........."), dat->szUpdating, dat->updateAnimFrame % 10, _T("........."));
SetDlgItemText(hwndDlg, IDC_UPDATING, str);
if (++dat->updateAnimFrame == UPDATEANIMFRAMES)
dat->updateAnimFrame = 0;
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 4e916724f4..dc6a5e682b 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -67,7 +67,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) cle.hDbEvent = uniqueEventId++;
cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
- mir_sntprintf(tooltip, _countof(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = tooltip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
IcoLib_ReleaseIcon(cle.hIcon, 0);
diff --git a/src/mir_app/src/DefaultExtraIcons.cpp b/src/mir_app/src/DefaultExtraIcons.cpp index 2f7080f8cb..ece76bf24c 100644 --- a/src/mir_app/src/DefaultExtraIcons.cpp +++ b/src/mir_app/src/DefaultExtraIcons.cpp @@ -112,7 +112,7 @@ struct Info static void EmailOnClick(Info*, const char *text)
{
char cmd[1024];
- mir_snprintf(cmd, _countof(cmd), "mailto:%s", text);
+ mir_snprintf(cmd, "mailto:%s", text);
ShellExecuteA(NULL, "open", cmd, NULL, NULL, SW_SHOW);
}
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 33bb684cd1..7c5b0d7666 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -1075,7 +1075,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, case IDC_BTN_EXPORT:
{
TCHAR fname_buff[MAX_PATH], filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c"), TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.ini)%c*.ini%c%s (*.txt)%c*.TXT%c%s (*.*)%c*.*%c"), TranslateT("Configuration files"), 0, 0, TranslateT("Text files"), 0, 0, TranslateT("All files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index f238fd4217..41eab518cb 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -364,12 +364,12 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) static char szStyle[256];
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
int iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY);
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY);
Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", szStyle);
}
else {
int iii = lin->bIsHighlighted ? 16 : EventToIndex(lin);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY);
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY);
Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", szStyle);
}
}
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index a2d6810b51..b631984f2d 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -144,7 +144,7 @@ void RegisterFonts(void) strncpy_s(fontid.dbSettingsGroup, CHATFONT_MODULE, _TRUNCATE);
_tcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE);
- mir_snprintf(fontid.prefix, _countof(fontid.prefix), "Font%d", index);
+ mir_snprintf(fontid.prefix, "Font%d", index);
fontid.order = index;
switch (i) {
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 4ece7906d7..1de143f961 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -184,10 +184,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa pd.lchIcon = LoadIconEx("window", FALSE);
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_sntprintf(pd.lptzContactName, _countof(pd.lptzContactName), _T("%s - %s"),
- (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
- cli.pfnGetContactDisplayName(hContact, 0));
-
+ mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0));
mir_tstrncpy(pd.lptzText, TranslateTS(szBuf), _countof(pd.lptzText));
pd.iSeconds = g_Settings->iPopupTimeout;
@@ -563,9 +560,9 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) // formatting strings don't need to be translatable - changing them via language pack would
// only screw up the log format.
if (p)
- mir_sntprintf(szLine, _countof(szLine), _T("%s %c %s\r\n"), szTime, p, szBuffer);
+ mir_sntprintf(szLine, _T("%s %c %s\r\n"), szTime, p, szBuffer);
else
- mir_sntprintf(szLine, _countof(szLine), _T("%s %s\r\n"), szTime, szBuffer);
+ mir_sntprintf(szLine, _T("%s %s\r\n"), szTime, szBuffer);
if (szLine[0]) {
_fputts(szLine, hFile);
@@ -590,11 +587,11 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce) _tsplitpath(si->pszLogFileName, tszDrive, tszDir, tszName, tszExt);
TCHAR tszNewPath[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
- mir_sntprintf(tszNewPath, _countof(tszNewPath), _T("%s%sarchived\\"), tszDrive, tszDir);
+ mir_sntprintf(tszNewPath, _T("%s%sarchived\\"), tszDrive, tszDir);
CreateDirectoryTreeT(tszNewPath);
TCHAR tszNewName[_MAX_DRIVE + _MAX_DIR + _MAX_FNAME + _MAX_EXT + 20];
- mir_sntprintf(tszNewName, _countof(tszNewName), _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt);
+ mir_sntprintf(tszNewName, _T("%s%s-%s%s"), tszNewPath, tszName, tszTimestamp, tszExt);
fclose(hFile);
hFile = 0;
if (!PathFileExists(tszNewName))
@@ -742,7 +739,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) TCHAR tszTemp[MAX_PATH], *ptszVarPath;
if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') {
- mir_sntprintf(tszTemp, _countof(tszTemp), _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log"));
+ mir_sntprintf(tszTemp, _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log"));
ptszVarPath = tszTemp;
}
else ptszVarPath = g_Settings->pszLogDir;
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index d08d7736b0..4f8e9f3fd7 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -1135,7 +1135,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contacto->hContact, contactn->groupId);
else if (contacto->type == CLCIT_GROUP) { //dropee is a group
TCHAR szNewName[120];
- mir_sntprintf(szNewName, _countof(szNewName), _T("%s\\%s"), cli.pfnGetGroupName(contactn->groupId, NULL), contacto->szText);
+ mir_sntprintf(szNewName, _T("%s\\%s"), cli.pfnGetGroupName(contactn->groupId, NULL), contacto->szText);
cli.pfnRenameGroup(contacto->groupId, szNewName);
}
}
@@ -1268,8 +1268,8 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (contact->type == CLCIT_CONTACT)
if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), contact->hContact))
break;
- - if (contact->type == CLCIT_GROUP) { +
+ if (contact->type == CLCIT_GROUP) {
switch (LOWORD(wParam)) {
case POPUP_NEWSUBGROUP:
if (contact->type != CLCIT_GROUP)
@@ -1290,7 +1290,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam break;
}
- Menu_ProcessCommandById(wParam, (LPARAM)hwnd); + Menu_ProcessCommandById(wParam, (LPARAM)hwnd);
}
break;
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index 203720f278..97fafe101d 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -410,7 +410,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) if (contact->type == CLCIT_GROUP) {
if (contact->group->parent && contact->group->parent->parent) {
TCHAR szFullName[256];
- mir_sntprintf(szFullName, _countof(szFullName), _T("%s\\%s"),
+ mir_sntprintf(szFullName, _T("%s\\%s"),
cli.pfnGetGroupName(contact->group->parent->groupId, NULL), text);
cli.pfnRenameGroup(contact->groupId, szFullName);
}
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index e6a6897fed..db63eae84c 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -100,7 +100,7 @@ TCHAR* fnGetStatusModeDescription(int mode, int flags) default:
if (IsStatusConnecting(mode)) {
const TCHAR* connFmt = LPGENT("Connecting (attempt %d)");
- mir_sntprintf(szMode, _countof(szMode), (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
+ mir_sntprintf(szMode, (flags & GSMDF_UNTRANSLATED) ? connFmt : TranslateTS(connFmt), mode - ID_STATUS_CONNECTING + 1);
return szMode;
}
return NULL;
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 90c3d2fe8c..6294142941 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -126,7 +126,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP TCHAR szFormat[256], szFinal[256];
GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, _countof(szFormat));
- mir_sntprintf(szFinal, _countof(szFinal), szFormat, cli.pfnGetContactDisplayName(lParam, 0));
+ mir_sntprintf(szFinal, szFormat, cli.pfnGetContactDisplayName(lParam, 0));
SetDlgItemText(hWnd, IDC_TOPLINE, szFinal);
}
SetFocus( GetDlgItem(hWnd, IDNO));
@@ -993,7 +993,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM PROTOACCOUNT *pa;
TCHAR tszName[64];
if ((pa = Proto_GetAccount(szProto)) != NULL)
- mir_sntprintf(tszName, _countof(tszName), _T("%s "), pa->tszAccountName);
+ mir_sntprintf(tszName, _T("%s "), pa->tszAccountName);
else
tszName[0] = 0;
diff --git a/src/mir_app/src/cluiservices.cpp b/src/mir_app/src/cluiservices.cpp index 455c7b0614..f3679bcc75 100644 --- a/src/mir_app/src/cluiservices.cpp +++ b/src/mir_app/src/cluiservices.cpp @@ -167,7 +167,7 @@ void fnCluiProtocolStatusChanged(int, const char*) TCHAR tszName[64];
PROTOACCOUNT *pa = Proto_GetAccount(cli.menuProtos[i].szProto);
if (pa)
- mir_sntprintf(tszName, _countof(tszName), _T("%s "), pa->tszAccountName);
+ mir_sntprintf(tszName, _T("%s "), pa->tszAccountName);
else
tszName[0] = 0;
diff --git a/src/mir_app/src/database.cpp b/src/mir_app/src/database.cpp index 6066d0c059..e7df257bde 100644 --- a/src/mir_app/src/database.cpp +++ b/src/mir_app/src/database.cpp @@ -186,7 +186,7 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) if (isRootDir)
_tcsncpy_s(pfd, VARST(_T("%miranda_path%\\*.dat")), _TRUNCATE);
else
- mir_sntprintf(pfd, _countof(pfd), _T("%s\\*.dat"), profiledir);
+ mir_sntprintf(pfd, _T("%s\\*.dat"), profiledir);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(pfd, &ffd);
@@ -196,10 +196,10 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) TCHAR path[MAX_PATH], path2[MAX_PATH];
TCHAR* profile = mir_tstrdup(ffd.cFileName);
c = _tcsrchr(profile, '.'); if (c) *c = 0;
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), pfd, ffd.cFileName);
- mir_sntprintf(path2, _countof(path2), _T("%s\\%s"), profiledir, profile);
+ mir_sntprintf(path, _T("%s\\%s"), pfd, ffd.cFileName);
+ mir_sntprintf(path2, _T("%s\\%s"), profiledir, profile);
CreateDirectoryTreeT(path2);
- mir_sntprintf(path2, _countof(path2), _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName);
+ mir_sntprintf(path2, _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName);
if (_taccess(path2, 0) == 0) {
TCHAR buf[512];
mir_sntprintf(buf,
@@ -241,7 +241,7 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n if (bShowProfileManager || !reqfd) {
TCHAR searchspec[MAX_PATH];
- mir_sntprintf(searchspec, _countof(searchspec), _T("%s\\*.*"), profiledir);
+ mir_sntprintf(searchspec, _T("%s\\*.*"), profiledir);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(searchspec, &ffd);
@@ -252,7 +252,7 @@ static int getProfile1(TCHAR *szProfile, size_t cch, TCHAR *profiledir, BOOL * n continue;
TCHAR newProfile[MAX_PATH];
- mir_sntprintf(newProfile, _countof(newProfile), _T("%s\\%s\\%s.dat"), profiledir, ffd.cFileName, ffd.cFileName);
+ mir_sntprintf(newProfile, _T("%s\\%s\\%s.dat"), profiledir, ffd.cFileName, ffd.cFileName);
if (_taccess(newProfile, 0) != 0)
continue;
diff --git a/src/mir_app/src/dbini.cpp b/src/mir_app/src/dbini.cpp index b876f89c16..b3661aeb76 100644 --- a/src/mir_app/src/dbini.cpp +++ b/src/mir_app/src/dbini.cpp @@ -447,7 +447,7 @@ static void DoAutoExec(void) do {
bool secFN = mir_tstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0;
- mir_sntprintf(szIniPath, _countof(szIniPath), _T("%s%s"), szFindPath, fd.cFileName);
+ mir_sntprintf(szIniPath, _T("%s%s"), szFindPath, fd.cFileName);
if (!mir_tstrcmpi(szUse, _T("prompt")) && !secFN) {
int result = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_INSTALLINI), NULL, InstallIniDlgProc, (LPARAM)szIniPath);
if (result == IDC_NOTOALL) break;
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index c8a9e9dbea..ffce62d4f3 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -61,12 +61,12 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam) if (!p->textService) {
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "%s/GetEventText%d", p->module, p->eventType);
+ mir_snprintf(szServiceName, "%s/GetEventText%d", p->module, p->eventType);
p->textService = mir_strdup(szServiceName);
}
if (!p->iconService) {
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType);
+ mir_snprintf(szServiceName, "%s/GetEventIcon%d", p->module, p->eventType);
p->iconService = mir_strdup(szServiceName);
}
eventTypes.insert(p);
@@ -216,7 +216,7 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam) icon = IcoLib_GetIconByHandle(et->eventIcon);
if (!icon) {
char szName[100];
- mir_snprintf(szName, _countof(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType);
+ mir_snprintf(szName, "eventicon_%s%d", dbei->szModule, dbei->eventType);
icon = IcoLib_GetIcon(szName);
}
diff --git a/src/mir_app/src/groups.cpp b/src/mir_app/src/groups.cpp index 1788da5629..65eb0c8643 100644 --- a/src/mir_app/src/groups.cpp +++ b/src/mir_app/src/groups.cpp @@ -81,7 +81,7 @@ static INT_PTR CreateGroupInternal(INT_PTR iParent, const TCHAR *ptszName) if (db_get_ts(NULL, "CListGroups", str, &dbv))
return 0;
- mir_sntprintf(newBaseName, _countof(newBaseName), _T("%s\\%s"), dbv.ptszVal + 1, grpName);
+ mir_sntprintf(newBaseName, _T("%s\\%s"), dbv.ptszVal + 1, grpName);
mir_free(dbv.pszVal);
}
else mir_tstrncpy(newBaseName, grpName, _countof(newBaseName));
@@ -189,7 +189,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) db_free(&dbv);
if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT)) {
TCHAR szQuestion[256 + 100];
- mir_sntprintf(szQuestion, _countof(szQuestion), TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), name);
+ mir_sntprintf(szQuestion, TranslateT("Are you sure you want to delete group '%s'? This operation cannot be undone."), name);
if (MessageBox(cli.hwndContactList, szQuestion, TranslateT("Delete group"), MB_YESNO | MB_ICONQUESTION) == IDNO)
return 1;
}
@@ -243,7 +243,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) break;
if (!_tcsncmp(dbv.ptszVal + 1, name, len) && dbv.pszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
if (szNewParent[0])
- mir_sntprintf(szNewName, _countof(szNewName), _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2);
+ mir_sntprintf(szNewName, _T("%s\\%s"), szNewParent, dbv.ptszVal + len + 2);
else
mir_tstrncpy(szNewName, dbv.ptszVal + len + 2, _countof(szNewName));
cli.pfnRenameGroup(i + 1, szNewName);
@@ -302,7 +302,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) if (db_get_ts(NULL, "CListGroups", idstr, &dbv))
break;
if (!_tcsncmp(dbv.ptszVal + 1, oldName, len) && dbv.ptszVal[len + 1] == '\\' && _tcschr(dbv.ptszVal + len + 2, '\\') == NULL) {
- mir_sntprintf(szNewName, _countof(szNewName), _T("%s\\%s"), szName, dbv.ptszVal + len + 2);
+ mir_sntprintf(szNewName, _T("%s\\%s"), szName, dbv.ptszVal + len + 2);
RenameGroupWithMove(i, szNewName, 0); //luckily, child groups will never need reordering
}
db_free(&dbv);
diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index b13663b191..72482cdb94 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -154,7 +154,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam) if (item->rootHotkey = hotkeys.find(item)) {
if (item->rootHotkey->allowSubHotkeys) {
char nameBuf[MAXMODULELABELLENGTH];
- mir_snprintf(nameBuf, _countof(nameBuf), "%s$%d", item->rootHotkey->pszName, item->rootHotkey->nSubHotkeys);
+ mir_snprintf(nameBuf, "%s$%d", item->rootHotkey->pszName, item->rootHotkey->nSubHotkeys);
item->pszName = mir_strdup(nameBuf);
item->Enabled = TRUE;
@@ -221,7 +221,7 @@ static INT_PTR svcHotkeyUnregister(WPARAM, LPARAM lParam) char *pszName = (char *)lParam;
char pszNamePrefix[MAXMODULELABELLENGTH];
size_t cbNamePrefix;
- mir_snprintf(pszNamePrefix, _countof(pszNamePrefix), "%s$", pszName);
+ mir_snprintf(pszNamePrefix, "%s$", pszName);
cbNamePrefix = mir_strlen(pszNamePrefix);
for (i = 0; i < hotkeys.getCount(); i++) {
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index ff63098fc4..67f5453622 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -353,7 +353,7 @@ IconSourceItem* GetIconSourceItemFromPath(const TCHAR* path, int cxIcon, int cyI IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon)
{
TCHAR tszName[100];
- mir_sntprintf(tszName, _countof(tszName), _T("*StaticIcon_%d"), iStaticCount++);
+ mir_sntprintf(tszName, _T("*StaticIcon_%d"), iStaticCount++);
IconSourceItem* newItem = (IconSourceItem*)mir_calloc(sizeof(IconSourceItem));
newItem->file = IconSourceFile_Get(tszName, false);
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index 96f3f78553..919d7ffa9e 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -43,7 +43,7 @@ static void DisplayPackInfo(HWND hwndDlg, const LANGPACK_INFO *pack) /* add some note if its incompatible */
if (szLanguageName[0] && szContryName[0]) {
- mir_sntprintf(szLocaleName, _countof(szLocaleName), _T("%s (%s)"), TranslateTS(szLanguageName), TranslateTS(szContryName));
+ mir_sntprintf(szLocaleName, _T("%s (%s)"), TranslateTS(szLanguageName), TranslateTS(szContryName));
if (!IsValidLocale(pack->Locale, LCID_INSTALLED)) {
TCHAR *pszIncompat;
pszIncompat = TranslateT("(incompatible)");
@@ -77,7 +77,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM) /* insert */
TCHAR tszName[512];
- mir_sntprintf(tszName, _countof(tszName), _T("%s [%s]"),
+ mir_sntprintf(tszName, _T("%s [%s]"),
TranslateTS(pack->tszLanguage),
pack->flags & LPF_DEFAULT ? TranslateT("built-in") : pack->tszFileName);
UINT message = pack->flags & LPF_DEFAULT ? CB_INSERTSTRING : CB_ADDSTRING;
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index 55f8863d75..3b09379179 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -822,7 +822,7 @@ void RebuildMenuOrder(void) mi.hIcon = ic = (HICON)CallProtoServiceInt(NULL, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
if (Proto_IsAccountLocked(pa) && cli.bDisplayLocked) {
- mir_sntprintf(tbuf, _countof(tbuf), TranslateT("%s (locked)"), pa->tszAccountName);
+ mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName);
mi.name.t = tbuf;
}
else mi.name.t = pa->tszAccountName;
@@ -846,7 +846,7 @@ void RebuildMenuOrder(void) mi.flags |= CMIF_CHECKED;
if ((mi.flags & CMIF_CHECKED) && cli.bDisplayLocked) {
- mir_sntprintf(tbuf, _countof(tbuf), TranslateT("%s (locked)"), pa->tszAccountName);
+ mir_sntprintf(tbuf, TranslateT("%s (locked)"), pa->tszAccountName);
mi.name.t = tbuf;
}
else mi.name.t = pa->tszAccountName;
@@ -1150,7 +1150,7 @@ void InitCustomMenus(void) hkd.dwFlags = HKD_TCHAR;
for (int i = 0; i < _countof(statusHotkeys); i++) {
char szName[30];
- mir_snprintf(szName, _countof(szName), "StatusHotKey_%d", i);
+ mir_snprintf(szName, "StatusHotKey_%d", i);
hkd.pszName = szName;
hkd.lParam = statusModeList[i];
hkd.ptszDescription = fnGetStatusModeDescription(hkd.lParam, 0);
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index 4621f5c9df..2b7fafaa97 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -83,13 +83,13 @@ class CGenMenuOptionsPage : public CDlgBase char menuItemName[256], DBString[300]; GetMenuItemName(iod->pimi, menuItemName, sizeof(menuItemName)); - mir_snprintf(DBString, _countof(DBString), "%s_visible", menuItemName); + mir_snprintf(DBString, "%s_visible", menuItemName); db_set_b(NULL, szModule, DBString, tvi.iImage != 0); - mir_snprintf(DBString, _countof(DBString), "%s_pos", menuItemName); + mir_snprintf(DBString, "%s_pos", menuItemName); db_set_dw(NULL, szModule, DBString, runtimepos); - mir_snprintf(DBString, _countof(DBString), "%s_name", menuItemName); + mir_snprintf(DBString, "%s_name", menuItemName); if (iod->name != NULL && iod->defname != NULL && mir_tstrcmp(iod->name, iod->defname) != 0) db_set_ts(NULL, szModule, DBString, iod->name); else @@ -120,7 +120,7 @@ class CGenMenuOptionsPage : public CDlgBase return; char szModule[256]; - mir_snprintf(szModule, _countof(szModule), "%s_Items", pmo->pszName); + mir_snprintf(szModule, "%s_Items", pmo->pszName); CallService(MS_DB_MODULE_DELETE, NULL, (LPARAM)szModule); SaveTreeInternal(m_menuItems.GetRoot(), szModule); } @@ -244,7 +244,7 @@ class CGenMenuOptionsPage : public CDlgBase return false; char szModule[256]; - mir_snprintf(szModule, _countof(szModule), "%s_Items", pmo->pszName); + mir_snprintf(szModule, "%s_Items", pmo->pszName); bRebuild = true; m_menuItems.SendMsg(WM_SETREDRAW, FALSE, 0); diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 583acb9cb4..d1851d2976 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -950,7 +950,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU
if (GetKeyState(VK_CONTROL) & 0x8000) {
TCHAR str[256];
- mir_sntprintf(str, _countof(str), _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData);
+ mir_sntprintf(str, _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData);
mii.dwTypeData = str;
}
#endif
@@ -964,7 +964,7 @@ static HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, WPARAM #ifdef PUTPOSITIONSONMENU
if (GetKeyState(VK_CONTROL) & 0x8000) {
TCHAR str[256];
- mir_sntprintf(str, _countof(str), _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData);
+ mir_sntprintf(str, _T("%s (%d, id %x)"), mi->name.a, mi->position, mii.dwItemData);
mii.dwTypeData = str;
}
#endif
@@ -1046,10 +1046,10 @@ static int MO_RegisterIcon(TMO_IntMenuItem *pmi, void*) HICON hIcon = ImageList_GetIcon(pmi->parent->m_hMenuIcons, pmi->iconId, 0);
TCHAR sectionName[256];
- mir_sntprintf(sectionName, _countof(sectionName), LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName));
+ mir_sntprintf(sectionName, LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName));
char iconame[256];
- mir_snprintf(iconame, _countof(iconame), "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr);
+ mir_snprintf(iconame, "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr);
// remove '&'
if (descr) {
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 605dde9a21..661b7a986c 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -291,7 +291,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) // show hide nudge menu item
char serviceFunc[256];
- mir_snprintf(serviceFunc, _countof(serviceFunc), "%s%s", GetContactProto(Meta_GetMostOnline(cc)), PS_SEND_NUDGE);
+ mir_snprintf(serviceFunc, "%s%s", GetContactProto(Meta_GetMostOnline(cc)), PS_SEND_NUDGE);
CallService(MS_NUDGE_SHOWMENU, (WPARAM)META_PROTO, ServiceExists(serviceFunc));
return 0;
}
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 82c2fa90d7..d66a1334ca 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -570,7 +570,7 @@ static int Meta_MessageWindowEvent(WPARAM, LPARAM lParam) static INT_PTR Meta_SrmmCurrentSub(WPARAM hMeta, LPARAM)
{
- MetaSrmmData tmp = { (UINT_PTR)hMeta };
+ MetaSrmmData tmp = { (MCONTACT)hMeta };
if (MetaSrmmData *p = arMetaWindows.find(&tmp))
return p->m_hSub;
@@ -853,7 +853,7 @@ void Meta_InitServices() // hidden contact menu items...ho hum
for (int i = 0; i < MAX_CONTACTS; i++) {
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "MetaContacts/MenuFunc%d", i);
+ mir_snprintf(szServiceName, "MetaContacts/MenuFunc%d", i);
CreateServiceFunctionParam(szServiceName, MenuFunc, i);
}
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 3be2190071..838faace9b 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -489,8 +489,8 @@ int Meta_SetAllNicks() static void SwapValues(MCONTACT hContact, LPCSTR szSetting, int n1, int n2)
{
char buf1[100], buf2[100];
- mir_snprintf(buf1, _countof(buf1), "%s%d", szSetting, n1);
- mir_snprintf(buf2, _countof(buf2), "%s%d", szSetting, n2);
+ mir_snprintf(buf1, "%s%d", szSetting, n1);
+ mir_snprintf(buf2, "%s%d", szSetting, n2);
DBVARIANT dbv1, dbv2;
int ok1 = !db_get(hContact, META_PROTO, buf1, &dbv1);
@@ -526,7 +526,7 @@ int Meta_SwapContacts(DBCachedContact *cc, int n1, int n2) void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest)
{
char idStr[50];
- mir_snprintf(idStr, _countof(idStr), "Login%d", i);
+ mir_snprintf(idStr, "Login%d", i);
DBVARIANT dbv;
if(db_get(hMeta, META_PROTO, idStr, &dbv))
diff --git a/src/mir_app/src/netlibhttp.cpp b/src/mir_app/src/netlibhttp.cpp index 5c520f5ec5..88f657022f 100644 --- a/src/mir_app/src/netlibhttp.cpp +++ b/src/mir_app/src/netlibhttp.cpp @@ -269,7 +269,7 @@ struct HttpSecurityContext if (szHost && _stricmp(szProvider, "Basic")) {
unsigned long ip = inet_addr(szHost);
PHOSTENT host = (ip == INADDR_NONE) ? gethostbyname(szHost) : gethostbyaddr((char*)&ip, 4, AF_INET);
- mir_snprintf(szSpnStr, _countof(szSpnStr), "HTTP/%s", host && host->h_name ? host->h_name : szHost);
+ mir_snprintf(szSpnStr, "HTTP/%s", host && host->h_name ? host->h_name : szHost);
_strlwr(szSpnStr + 5);
NetlibLogf(nlu, "Host SPN: %s", szSpnStr);
}
@@ -897,9 +897,9 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) char *pspace = strchr(szMirandaVer, ' ');
if (pspace) {
*pspace++='\0';
- mir_snprintf(szUserAgent, _countof(szUserAgent), "Miranda/%s (%s)", szMirandaVer, pspace);
+ mir_snprintf(szUserAgent, "Miranda/%s (%s)", szMirandaVer, pspace);
}
- else mir_snprintf(szUserAgent, _countof(szUserAgent), "Miranda/%s", szMirandaVer);
+ else mir_snprintf(szUserAgent, "Miranda/%s", szMirandaVer);
}
if (!doneAcceptEncoding) {
nlhrSend.headers[nlhrSend.headersCount].szName = "Accept-Encoding";
diff --git a/src/mir_app/src/netliblog.cpp b/src/mir_app/src/netliblog.cpp index 7c9ae6e08d..7d4f9b454b 100644 --- a/src/mir_app/src/netliblog.cpp +++ b/src/mir_app/src/netliblog.cpp @@ -160,7 +160,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, _countof(str));
{
TCHAR filter[200];
- mir_sntprintf(filter, _countof(filter), _T("%s (*)%c*%c"), TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*)%c*%c"), TranslateT("All files"), 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
@@ -307,14 +307,14 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) case TIMEFORMAT_MILLISECONDS:
QueryPerformanceCounter(&liTimeNow);
liTimeNow.QuadPart -= mirandaStartTime;
- mir_snprintf(szTime, _countof(szTime), "%I64u.%03I64u ", liTimeNow.QuadPart / perfCounterFreq,
+ mir_snprintf(szTime, "%I64u.%03I64u ", liTimeNow.QuadPart / perfCounterFreq,
1000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq);
break;
case TIMEFORMAT_MICROSECONDS:
QueryPerformanceCounter(&liTimeNow);
liTimeNow.QuadPart -= mirandaStartTime;
- mir_snprintf(szTime, _countof(szTime), "%I64u.%06I64u ", liTimeNow.QuadPart / perfCounterFreq,
+ mir_snprintf(szTime, "%I64u.%06I64u ", liTimeNow.QuadPart / perfCounterFreq,
1000000 * (liTimeNow.QuadPart % perfCounterFreq) / perfCounterFreq);
break;
@@ -325,9 +325,9 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) char *szUser = (logOptions.showUser) ? (nlu == NULL ? NULL : nlu->user.szSettingsModule) : NULL;
if (szUser)
- mir_snprintf(szHead, _countof(szHead), "[%s%04X] [%s] ", szTime, GetCurrentThreadId(), szUser);
+ mir_snprintf(szHead, "[%s%04X] [%s] ", szTime, GetCurrentThreadId(), szUser);
else
- mir_snprintf(szHead, _countof(szHead), "[%s%04X] ", szTime, GetCurrentThreadId());
+ mir_snprintf(szHead, "[%s%04X] ", szTime, GetCurrentThreadId());
if (logOptions.toOutputDebugString) {
if (szHead[0])
@@ -401,7 +401,7 @@ void NetlibDumpData(NetlibConnection *nlc, PBYTE buf, int len, int sent, int fla WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
NetlibUser *nlu = nlc ? nlc->nlu : NULL;
- int titleLineLen = mir_snprintf(szTitleLine, _countof(szTitleLine), "(%p:%u) Data %s%s\r\n",
+ int titleLineLen = mir_snprintf(szTitleLine, "(%p:%u) Data %s%s\r\n",
nlc, nlc ? nlc->s : 0, sent ? "sent" : "received", flags & MSG_DUMPPROXY ? " (proxy)" : "");
ReleaseMutex(hConnectionHeaderMutex);
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 90e6a5a555..af53750b65 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, TCHAR str[80];
{
int selectedProxyType = SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_GETCURSEL, 0, 0), 0);
- mir_sntprintf(str, _countof(str), TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]);
+ mir_sntprintf(str, TranslateT("(often %d)"), oftenProxyPorts[selectedProxyType]);
SetDlgItemText(hwndDlg, IDC_STOFTENPORT, str);
if (IsDlgButtonChecked(hwndDlg, IDC_USEPROXY) != BST_UNCHECKED) {
int enableAuth = 0, enableUser = 0, enablePass = 0, enableServer = 1;
diff --git a/src/mir_app/src/netlibsock.cpp b/src/mir_app/src/netlibsock.cpp index 6ef069a290..c130bcf754 100644 --- a/src/mir_app/src/netlibsock.cpp +++ b/src/mir_app/src/netlibsock.cpp @@ -217,7 +217,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) if (addr->si_family == AF_INET) {
char *szIp = inet_ntoa(addr->Ipv4.sin_addr);
if (addr->Ipv4.sin_port != 0) {
- mir_snprintf(saddr, _countof(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port));
+ mir_snprintf(saddr, "%s:%d", szIp, htons(addr->Ipv4.sin_port));
return mir_strdup(saddr);
}
return mir_strdup(szIp);
diff --git a/src/mir_app/src/netlibupnp.cpp b/src/mir_app/src/netlibupnp.cpp index 578f641c67..ef0c713b2b 100644 --- a/src/mir_app/src/netlibupnp.cpp +++ b/src/mir_app/src/netlibupnp.cpp @@ -261,25 +261,16 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction char szData1[1024];
szReq = mir_strdup(szResult);
- sz = mir_snprintf(szData1, _countof(szData1),
- soap_action, szActionName, szDev, szReq, szActionName);
-
- sz = mir_snprintf(szData, 4096,
- szPostHdr, szPath, szHost, sPort,
- sz, szDev, szActionName, szData1);
+ sz = mir_snprintf(szData1, soap_action, szActionName, szDev, szReq, szActionName);
+ sz = mir_snprintf(szData, 4096, szPostHdr, szPath, szHost, sPort, sz, szDev, szActionName, szData1);
}
break;
case ControlQuery:
{
char szData1[1024];
-
- sz = mir_snprintf(szData1, _countof(szData1),
- soap_query, szActionName);
-
- sz = mir_snprintf(szData, 4096,
- szPostHdr, szPath, szHost, sPort,
- sz, "urn:schemas-upnp-org:control-1-0", "QueryStateVariable", szData1);
+ sz = mir_snprintf(szData1, soap_query, szActionName);
+ sz = mir_snprintf(szData, 4096, szPostHdr, szPath, szHost, sPort, sz, "urn:schemas-upnp-org:control-1-0", "QueryStateVariable", szData1);
}
break;
}
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 7858dfe27d..496e1184ae 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -380,7 +380,7 @@ void enumPlugins(SCAN_PLUGINS_CALLBACK cb, WPARAM wParam, LPARAM lParam) // create the search filter
TCHAR search[MAX_PATH];
- mir_sntprintf(search, _countof(search), _T("%s\\Plugins\\*.dll"), exe);
+ mir_sntprintf(search, _T("%s\\Plugins\\*.dll"), exe);
// FFFN will return filenames for things like dot dll+ or dot dllx
WIN32_FIND_DATA ffd;
@@ -404,7 +404,7 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) pluginList.insert(p);
TCHAR tszFullPath[MAX_PATH];
- mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s\\%s"), path, dir, tszFileName);
+ mir_sntprintf(tszFullPath, _T("%s\\%s\\%s"), path, dir, tszFileName);
// map dll into the memory and check its exports
bool bIsPlugin = false;
@@ -497,7 +497,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) if (!(p->pclass & PCLASS_BASICAPI)) {
BASIC_PLUGIN_INFO bpi;
- mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s\\%s"), exe, (p->pclass & PCLASS_CORE) ? _T("Core") : _T("Plugins"), p->pluginname);
+ mir_sntprintf(tszFullPath, _T("%s\\%s\\%s"), exe, (p->pclass & PCLASS_CORE) ? _T("Core") : _T("Plugins"), p->pluginname);
if (!checkAPI(tszFullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) {
p->pclass |= PCLASS_FAILED;
return false;
@@ -556,7 +556,7 @@ bool LoadCorePlugin(MuuidReplacement &mr) GetModuleFileName(NULL, exe, _countof(exe));
TCHAR *p = _tcsrchr(exe, '\\'); if (p) *p = 0;
- mir_sntprintf(tszPlugName, _countof(tszPlugName), _T("%s.dll"), mr.stdplugname);
+ mir_sntprintf(tszPlugName, _T("%s.dll"), mr.stdplugname);
pluginEntry* pPlug = OpenPlugin(tszPlugName, _T("Core"), exe);
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
@@ -614,14 +614,14 @@ static pluginEntry* getCListModule(TCHAR *exe) if (!isPluginOnWhiteList(p->pluginname))
continue;
- mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\Plugins\\%s"), exe, p->pluginname);
+ mir_sntprintf(tszFullPath, _T("%s\\Plugins\\%s"), exe, p->pluginname);
if (loadClistModule(tszFullPath, p))
return p;
}
MuuidReplacement& stdClist = pluginDefault[10];
if (LoadCorePlugin(stdClist)) {
- mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\Core\\%s.dll"), exe, stdClist.stdplugname);
+ mir_sntprintf(tszFullPath, _T("%s\\Core\\%s.dll"), exe, stdClist.stdplugname);
if (loadClistModule(tszFullPath, stdClist.pImpl))
return stdClist.pImpl;
}
@@ -775,7 +775,7 @@ int LoadNewPluginsModule(void) // if freeimage is present, load it to provide the basic core functions
if (plugin_freeimg != NULL) {
BASIC_PLUGIN_INFO bpi;
- mir_sntprintf(fullPath, _countof(fullPath), _T("%s\\Plugins\\%s"), exe, plugin_freeimg->pluginname);
+ mir_sntprintf(fullPath, _T("%s\\Plugins\\%s"), exe, plugin_freeimg->pluginname);
if (checkAPI(fullPath, &bpi, mirandaVersion, CHECKAPI_NONE)) {
plugin_freeimg->bpi = bpi;
plugin_freeimg->pclass |= PCLASS_OK | PCLASS_BASICAPI;
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index ceac065583..90409385b3 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -1151,7 +1151,7 @@ void OpenAccountOptions(PROTOACCOUNT *pa) return;
TCHAR tszTitle[100];
- mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("%s options"), pa->tszAccountName);
+ mir_sntprintf(tszTitle, TranslateT("%s options"), pa->tszAccountName);
OPENOPTIONSDIALOG ood = { sizeof(ood) };
ood.pszGroup = LPGEN("Network");
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index 73189cc361..4cf88ade76 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -144,13 +144,13 @@ static __forceinline char* GetPathVarX(const char*, int code) if (hAvatarFolder != NULL)
_tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
else
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(szFullPath, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
break;
case 2:
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(szFullPath, _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName);
break;
case 3:
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(szFullPath, _T("%s\\%s"), g_profileDir, g_shortProfileName);
break;
}
return makeFileName(szFullPath);
@@ -228,13 +228,13 @@ static __forceinline TCHAR* GetPathVarX(const TCHAR*, int code) if (hAvatarFolder != NULL)
_tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE);
else
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(szFullPath, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
break;
case 2:
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(szFullPath, _T("%s\\%s\\Logs"), g_profileDir, g_shortProfileName);
break;
case 3:
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\%s"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(szFullPath, _T("%s\\%s"), g_profileDir, g_shortProfileName);
break;
}
return mir_tstrdup(szFullPath);
@@ -387,7 +387,7 @@ MIR_APP_DLL(wchar_t*) Utils_ReplaceVarsW(const wchar_t *wszData, MCONTACT hConta static int OnFoldersChanged(WPARAM, LPARAM)
{
- mir_sntprintf(tszAvatarRoot, _countof(tszAvatarRoot), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(tszAvatarRoot, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
TCHAR tmpVar[MAX_PATH];
if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot))
@@ -397,7 +397,7 @@ static int OnFoldersChanged(WPARAM, LPARAM) void InitPathVar()
{
- mir_sntprintf(tszAvatarRoot, _countof(tszAvatarRoot), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
+ mir_sntprintf(tszAvatarRoot, _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName);
if (hAvatarFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatars root folder"), tszAvatarRoot)) {
TCHAR tmpVar[MAX_PATH];
if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, _countof(tmpVar), tszAvatarRoot))
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 55fe0885c3..0c4eb9916a 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -455,7 +455,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (hdr->hdr.code == PSN_APPLY) {
bool needRestart = false;
TCHAR bufRestart[1024];
- int bufLen = mir_sntprintf(bufRestart, _countof(bufRestart), _T("%s\n"), TranslateT("Miranda NG must be restarted to apply changes for these plugins:"));
+ int bufLen = mir_sntprintf(bufRestart, _T("%s\n"), TranslateT("Miranda NG must be restarted to apply changes for these plugins:"));
HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);
for (int iRow = 0; iRow != -1;) {
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index bda73395a4..caa4215997 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -46,7 +46,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA { // find in Miranda NG profile subfolders TCHAR searchspec[MAX_PATH]; - mir_sntprintf(searchspec, _countof(searchspec), _T("%s\\*.*"), szProfileDir); + mir_sntprintf(searchspec, _T("%s\\*.*"), szProfileDir); WIN32_FIND_DATA ffd; HANDLE hFind = FindFirstFile(searchspec, &ffd); @@ -59,7 +59,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA TCHAR buf[MAX_PATH], profile[MAX_PATH]; mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), szProfileDir, ffd.cFileName, ffd.cFileName); if (_taccess(buf, 0) == 0) { - mir_sntprintf(profile, _countof(profile), _T("%s.dat"), ffd.cFileName); + mir_sntprintf(profile, _T("%s.dat"), ffd.cFileName); if (!callback(buf, profile, lParam)) break; } @@ -264,11 +264,11 @@ class CChooseProfileDlg : public CDlgBase struct _stat statbuf; if (_tstat(tszFullPath, &statbuf) == 0) { if (statbuf.st_size > 1000000) { - mir_sntprintf(sizeBuf, _countof(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1048576.0); + mir_sntprintf(sizeBuf, _T("%.3lf"), (double)statbuf.st_size / 1048576.0); mir_tstrcpy(sizeBuf + 5, _T(" MB")); } else { - mir_sntprintf(sizeBuf, _countof(sizeBuf), _T("%.3lf"), (double)statbuf.st_size / 1024.0); + mir_sntprintf(sizeBuf, _T("%.3lf"), (double)statbuf.st_size / 1024.0); mir_tstrcpy(sizeBuf + 5, _T(" KB")); } bFileLocked = !fileExist(tszFullPath); @@ -319,7 +319,7 @@ class CChooseProfileDlg : public CDlgBase if (!m_profileList.GetItem(&item)) return; - mir_sntprintf(fullName, _countof(fullName), _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); + mir_sntprintf(fullName, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); CallService(MS_DB_CHECKPROFILE, (WPARAM)fullName, item.iImage == 2); } @@ -338,11 +338,11 @@ class CChooseProfileDlg : public CDlgBase if (!m_profileList.GetItem(&item)) return; - mir_sntprintf(profilef, _countof(profilef), TranslateT("Are you sure you want to remove profile \"%s\"?"), profile); + mir_sntprintf(profilef, TranslateT("Are you sure you want to remove profile \"%s\"?"), profile); if (IDYES != MessageBox(NULL, profilef, _T("Miranda NG"), MB_YESNO | MB_TASKMODAL | MB_ICONWARNING)) return; - mir_sntprintf(profilef, _countof(profilef), _T("%s\\%s%c"), m_pd->ptszProfileDir, profile, 0); + mir_sntprintf(profilef, _T("%s\\%s%c"), m_pd->ptszProfileDir, profile, 0); SHFILEOPSTRUCT sf = { 0 }; sf.wFunc = FO_DELETE; @@ -383,7 +383,7 @@ class CChooseProfileDlg : public CDlgBase // profile is placed in "profile_name" subfolder TCHAR tmpPath[MAX_PATH]; - mir_sntprintf(tmpPath, _countof(tmpPath), _T("%s\\%s.dat"), m_pd->ptszProfileDir, profile); + mir_sntprintf(tmpPath, _T("%s\\%s.dat"), m_pd->ptszProfileDir, profile); if (_taccess(tmpPath, 2)) mir_sntprintf(m_pd->ptszProfile, MAX_PATH, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profile, profile); else @@ -520,7 +520,7 @@ public: TCHAR profilename[MAX_PATH], tszFullPath[MAX_PATH]; struct _stat statbuf; m_profileList.GetItemText(pTip->iItem, 0, profilename, _countof(profilename)); - mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profilename, profilename); + mir_sntprintf(tszFullPath, _T("%s\\%s\\%s.dat"), m_pd->ptszProfileDir, profilename, profilename); _tstat(tszFullPath, &statbuf); mir_sntprintf(pTip->pszText, pTip->cchTextMax, _T("%s\n%s: %s\n%s: %s"), tszFullPath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime)))); } diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 151a3c2ff8..2ac28e13af 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -143,13 +143,13 @@ static bool OnCreateAccount(HWND hwndDlg) if (param->action == PRAC_UPGRADED) {
BOOL oldProto = pa->bOldProto;
TCHAR szPlugin[MAX_PATH];
- mir_sntprintf(szPlugin, _countof(szPlugin), _T("%s.dll"), _A2T(pa->szProtoName));
+ mir_sntprintf(szPlugin, _T("%s.dll"), _A2T(pa->szProtoName));
int idx = accounts.getIndex(pa);
UnloadAccount(pa, false, false);
accounts.remove(idx);
if (oldProto && UnloadPlugin(szPlugin, _countof(szPlugin))) {
TCHAR szNewName[MAX_PATH];
- mir_sntprintf(szNewName, _countof(szNewName), _T("%s~"), szPlugin);
+ mir_sntprintf(szNewName, _T("%s~"), szPlugin);
MoveFile(szPlugin, szNewName);
}
param->action = PRAC_ADDED;
@@ -202,9 +202,9 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam TCHAR str[200];
if (param->action == PRAC_CHANGED) { // update
EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOTYPECOMBO), FALSE);
- mir_sntprintf(str, _countof(str), _T("%s: %s"), TranslateT("Editing account"), param->pa->tszAccountName);
+ mir_sntprintf(str, _T("%s: %s"), TranslateT("Editing account"), param->pa->tszAccountName);
}
- else mir_sntprintf(str, _countof(str), _T("%s: %s"), TranslateT("Upgrading account"), param->pa->tszAccountName);
+ else mir_sntprintf(str, _T("%s: %s"), TranslateT("Upgrading account"), param->pa->tszAccountName);
SetWindowText(hwndDlg, str);
SetDlgItemText(hwndDlg, IDC_ACCNAME, param->pa->tszAccountName);
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index defdcb097b..c05d98d258 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -118,7 +118,7 @@ static void __fastcall MySetCursor(TCHAR* nCursor) static void LoadSectionIcons(TCHAR *filename, SectionItem* sectionActive)
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s,"), filename);
+ mir_sntprintf(path, _T("%s,"), filename);
size_t suffIndx = mir_tstrlen(path);
mir_cslock lck(csIconList);
@@ -418,7 +418,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.iItem = 0;
int count = (int)_ExtractIconEx(filename, -1, 16, 16, NULL, LR_DEFAULTCOLOR);
for (int i = 0; i < count; lvi.iItem++, i++) {
- mir_sntprintf(caption, _countof(caption), _T("%d"), i + 1);
+ mir_sntprintf(caption, _T("%d"), i + 1);
lvi.pszText = caption;
HICON hIcon = NULL;
@@ -520,7 +520,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lvi.mask = LVIF_PARAM;
lvi.iItem = dragItem; lvi.iSubItem = 0;
ListView_GetItem(hPreview, &lvi);
- mir_sntprintf(path, _countof(path), _T("%s,%d"), filename, (int)lvi.lParam);
+ mir_sntprintf(path, _T("%s,%d"), filename, (int)lvi.lParam);
SendMessage(hwndParent, DM_CHANGEICON, dropHiLite, (LPARAM)path);
ListView_SetItemState(GetDlgItem(hwndParent, IDC_PREVIEW), dropHiLite, 0, LVIS_DROPHILITED);
}
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 698f7d4b72..73dae4a49b 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -29,70 +29,70 @@ struct StandardIconDescription int id;
LPCSTR description;
int resource_id;
- int pf2;
+ UINT pf2;
LPCSTR section;
HANDLE hIcolib;
};
static struct StandardIconDescription mainIcons[] =
{
- { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA }, // 0
- { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG }, // 1
- { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL }, // 2
- { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE }, // 3
- { SKINICON_OTHER_USERONLINE, LPGEN("User online"), -IDI_USERONLINE }, // 4
- { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (open)"), -IDI_GROUPOPEN }, // 5
- { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (closed)"), -IDI_GROUPSHUT }, // 6
- { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD }, // 7
- { SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact"), -IDI_ADDCONTACT }, // 8
- { SKINICON_OTHER_USERDETAILS, LPGEN("User details"), -IDI_USERDETAILS }, // 9
- { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY }, // 10
- { SKINICON_OTHER_DOWNARROW, LPGEN("Down arrow"), -IDI_DOWNARROW }, // 11
- { SKINICON_OTHER_FINDUSER, LPGEN("Find user"), -IDI_FINDUSER }, // 12
- { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS }, // 13
- { SKINICON_OTHER_SENDEMAIL, LPGEN("Send e-mail"), -IDI_SENDEMAIL }, // 14
- { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE }, // 15
- { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME }, // 16
- { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS }, // 17
- { SKINICON_OTHER_SEARCHALL, LPGEN("Search all"), -IDI_SEARCHALL }, // 18
- { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK }, // 19
- { SKINICON_OTHER_NOTICK, LPGEN("No tick"), -IDI_NOTICK }, // 20
- { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP }, // 21
- { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda website"), -IDI_MIRANDAWEBSITE }, // 22
- { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING }, // 23
- { SKINICON_OTHER_SMALLDOT, LPGEN("Small dot"), -IDI_SMALLDOT }, // 24
- { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled blob"), -IDI_FILLEDBLOB }, // 25
- { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty blob"), -IDI_EMPTYBLOB }, // 26
- { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE }, // 27
- { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI }, // 28
- { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED }, // 29
- { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED }, // 30
- { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO }, // 31
- { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW }, // 32
- { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS }, // 33
- { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR }, // 34
- { SKINICON_OTHER_SHOWHIDE, LPGEN("Show/Hide"), -IDI_SHOWHIDE }, // 35
- { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT }, // 36
- { SKINICON_OTHER_MAINMENU, LPGEN("Main menu"), -IDI_MAINMENU }, // 37
- { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE }, // 38
- { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT }, // 39
- { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT }, // 40
- { SKINICON_OTHER_GROUP, LPGEN("Move to group"), -IDI_MOVETOGROUP }, // 41
- { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON }, // 42
- { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF }, // 43
- { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY }, // 44
- { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY }, // 45
- { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME }, // 46
- { SKINICON_OTHER_GROUPADD, LPGEN("Add group"), -IDI_ADDGROUP }, // 47
- { SKINICON_AUTH_ADD, LPGEN("Add to list"), -IDI_AUTH_ADD }, // 48
- { SKINICON_AUTH_REQUEST, LPGEN("Request authorization"), -IDI_AUTH_REQUEST }, // 49
- { SKINICON_AUTH_GRANT, LPGEN("Grant authorization"), -IDI_AUTH_GRANT }, // 50
- { SKINICON_AUTH_REVOKE, LPGEN("Revoke authorization"), -IDI_AUTH_REVOKE }, // 51
- { SKINICON_FATAL, LPGEN("Fatal error"), -IDI_MFATAL }, // 52
- { SKINICON_ERROR, LPGEN("Error"), -IDI_MERROR }, // 53
- { SKINICON_WARNING, LPGEN("Warning"), -IDI_MWARNING }, // 54
- { SKINICON_INFORMATION, LPGEN("Information"), -IDI_MINFO }, // 55
-
+ { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA, 0, 0 }, // 0
+ { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG, 0, 0 }, // 1
+ { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL, 0, 0 }, // 2
+ { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE, 0, 0 }, // 3
+ { SKINICON_OTHER_USERONLINE, LPGEN("User online"), -IDI_USERONLINE, 0, 0 }, // 4
+ { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (open)"), -IDI_GROUPOPEN, 0, 0 }, // 5
+ { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (closed)"), -IDI_GROUPSHUT, 0, 0 }, // 6
+ { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD, 0, 0 }, // 7
+ { SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact"), -IDI_ADDCONTACT, 0, 0 }, // 8
+ { SKINICON_OTHER_USERDETAILS, LPGEN("User details"), -IDI_USERDETAILS, 0, 0 }, // 9
+ { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY, 0, 0 }, // 10
+ { SKINICON_OTHER_DOWNARROW, LPGEN("Down arrow"), -IDI_DOWNARROW, 0, 0 }, // 11
+ { SKINICON_OTHER_FINDUSER, LPGEN("Find user"), -IDI_FINDUSER, 0, 0 }, // 12
+ { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS, 0, 0 }, // 13
+ { SKINICON_OTHER_SENDEMAIL, LPGEN("Send e-mail"), -IDI_SENDEMAIL, 0, 0 }, // 14
+ { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE, 0, 0 }, // 15
+ { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME, 0, 0 }, // 16
+ { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS, 0, 0 }, // 17
+ { SKINICON_OTHER_SEARCHALL, LPGEN("Search all"), -IDI_SEARCHALL, 0, 0 }, // 18
+ { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK, 0, 0 }, // 19
+ { SKINICON_OTHER_NOTICK, LPGEN("No tick"), -IDI_NOTICK, 0, 0 }, // 20
+ { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP, 0, 0 }, // 21
+ { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda website"), -IDI_MIRANDAWEBSITE, 0, 0 }, // 22
+ { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING, 0, 0 }, // 23
+ { SKINICON_OTHER_SMALLDOT, LPGEN("Small dot"), -IDI_SMALLDOT, 0, 0 }, // 24
+ { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled blob"), -IDI_FILLEDBLOB, 0, 0 }, // 25
+ { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty blob"), -IDI_EMPTYBLOB, 0, 0 }, // 26
+ { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE, 0, 0 }, // 27
+ { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI, 0, 0 }, // 28
+ { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED, 0, 0 }, // 29
+ { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED, 0, 0 }, // 30
+ { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO, 0, 0 }, // 31
+ { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW, 0, 0 }, // 32
+ { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS, 0, 0 }, // 33
+ { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR, 0, 0 }, // 34
+ { SKINICON_OTHER_SHOWHIDE, LPGEN("Show/Hide"), -IDI_SHOWHIDE, 0, 0 }, // 35
+ { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT, 0, 0 }, // 36
+ { SKINICON_OTHER_MAINMENU, LPGEN("Main menu"), -IDI_MAINMENU, 0, 0 }, // 37
+ { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE, 0, 0 }, // 38
+ { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT, 0, 0 }, // 39
+ { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT, 0, 0 }, // 40
+ { SKINICON_OTHER_GROUP, LPGEN("Move to group"), -IDI_MOVETOGROUP, 0, 0 }, // 41
+ { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON, 0, 0 }, // 42
+ { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF, 0, 0 }, // 43
+ { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY, 0, 0 }, // 44
+ { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY, 0, 0 }, // 45
+ { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME, 0, 0 }, // 46
+ { SKINICON_OTHER_GROUPADD, LPGEN("Add group"), -IDI_ADDGROUP, 0, 0 }, // 47
+ { SKINICON_AUTH_ADD, LPGEN("Add to list"), -IDI_AUTH_ADD, 0, 0 }, // 48
+ { SKINICON_AUTH_REQUEST, LPGEN("Request authorization"), -IDI_AUTH_REQUEST, 0, 0 }, // 49
+ { SKINICON_AUTH_GRANT, LPGEN("Grant authorization"), -IDI_AUTH_GRANT, 0, 0 }, // 50
+ { SKINICON_AUTH_REVOKE, LPGEN("Revoke authorization"), -IDI_AUTH_REVOKE, 0, 0 }, // 51
+ { SKINICON_FATAL, LPGEN("Fatal error"), -IDI_MFATAL, 0, 0 }, // 52
+ { SKINICON_ERROR, LPGEN("Error"), -IDI_MERROR, 0, 0 }, // 53
+ { SKINICON_WARNING, LPGEN("Warning"), -IDI_MWARNING, 0, 0 }, // 54
+ { SKINICON_INFORMATION, LPGEN("Information"), -IDI_MINFO, 0, 0 }, // 55
+
{ SKINICON_OTHER_VISIBLE_ALL, LPGEN("Always visible"), -IDI_ALWAYSVIS, 0, LPGEN("Contact list") },
{ SKINICON_OTHER_INVISIBLE_ALL, LPGEN("Always invisible"), -IDI_NEVERVIS, 0, LPGEN("Contact list") },
{ SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, LPGEN("Status icons") },
@@ -230,7 +230,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) caps2 = 0;
if (IsStatusConnecting(status)) {
- mir_snprintf(iconName, _countof(iconName), "%s%d", mainIconsFmt, 7);
+ mir_snprintf(iconName, "%s%d", mainIconsFmt, 7);
return IcoLib_GetIcon(iconName, big);
}
@@ -249,7 +249,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // Otherwise return the global icon. This affects the global status menu mainly.
if (accounts.getCount() == 1) {
// format: core_status_%proto%statusindex
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, statusIndx);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx);
HICON hIcon = IcoLib_GetIcon(iconName, big);
if (hIcon)
@@ -257,12 +257,12 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) }
// format: core_status_%s%d
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
return IcoLib_GetIcon(iconName, big);
}
// format: core_status_%s%d
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, statusIndx);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx);
HICON hIcon = IcoLib_GetIcon(iconName, big);
if (hIcon == NULL && (caps2 == 0 || (caps2 & statusIcons[statusIndx].pf2))) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
@@ -272,7 +272,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) // Queried protocol isn't in list, adding
TCHAR tszSection[MAX_PATH];
- mir_sntprintf(tszSection, _countof(tszSection), _T(PROTOCOLS_PREFIX)_T("/%s"), pa->tszAccountName);
+ mir_sntprintf(tszSection, _T(PROTOCOLS_PREFIX)_T("/%s"), pa->tszAccountName);
SKINICONDESC sid = { 0 };
sid.section.t = tszSection;
@@ -281,11 +281,11 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) str = _tcsrchr(szPath, '\\');
if (str != NULL)
*str = 0;
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName);
+ mir_sntprintf(szFullPath, _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName);
if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES)
sid.defaultFile.t = szFullPath;
else {
- mir_sntprintf(szFullPath, _countof(szFullPath), _T("%s\\Plugins\\%S.dll"), szPath, szProto);
+ mir_sntprintf(szFullPath, _T("%s\\Plugins\\%S.dll"), szPath, szProto);
if (int(ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1)) > 0) {
DestroyIcon(hIcon);
sid.defaultFile.t = szFullPath;
@@ -309,7 +309,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) for (int i = lowidx; i < highidx; i++)
if (caps2 == 0 || (caps2 & statusIcons[i].pf2)) {
// format: core_%s%d
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, i);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, i);
sid.pszName = iconName;
sid.description.t = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0);
sid.iDefaultIndex = statusIcons[i].resource_id;
@@ -318,14 +318,14 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big) }
// format: core_status_%s%d
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, szProto, statusIndx);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx);
hIcon = IcoLib_GetIcon(iconName, big);
if (hIcon)
return hIcon;
}
if (hIcon == NULL) {
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
hIcon = IcoLib_GetIcon(iconName, big);
}
@@ -347,7 +347,7 @@ MIR_APP_DLL(char*) Skin_GetIconName(int idx) for (int i = 0; i < _countof(mainIcons); i++) {
if (idx == mainIcons[i].id) {
- mir_snprintf(szIconName, _countof(szIconName), "%s%d", mainIconsFmt, i);
+ mir_snprintf(szIconName, "%s%d", mainIconsFmt, i);
return szIconName;
}
}
@@ -383,7 +383,7 @@ int LoadSkinIcons(void) // Add main icons to list
for (int i = 0; i < _countof(mainIcons); i++) {
- mir_snprintf(iconName, _countof(iconName), "%s%d", mainIconsFmt, i);
+ mir_snprintf(iconName, "%s%d", mainIconsFmt, i);
sid.section.a = mainIcons[i].section == NULL ? LPGEN("Main icons") : (char*)mainIcons[i].section;
sid.description.a = (char*)mainIcons[i].description;
sid.iDefaultIndex = mainIcons[i].resource_id;
@@ -396,7 +396,7 @@ int LoadSkinIcons(void) // Asterisk is used, to avoid conflict with proto-plugins
// 'coz users can't rename it to name with '*'
for (int i = 0; i < _countof(statusIcons); i++) {
- mir_snprintf(iconName, _countof(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, i);
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, i);
sid.pszName = iconName;
sid.description.a = (char*)statusIcons[i].description;
sid.iDefaultIndex = statusIcons[i].resource_id;
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index c4623211bb..cd90608e55 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -307,9 +307,9 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM OPENFILENAME ofn;
memset(&ofn, 0, sizeof(ofn));
if (GetModuleHandle(_T("bass_interface.dll")))
- mir_sntprintf(filter, _countof(filter), _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.wav, *.mp3, *.ogg)%c*.wav;*.mp3;*.ogg%c%s (*)%c*%c"), TranslateT("Sound files"), 0, 0, TranslateT("All files"), 0, 0);
else
- mir_sntprintf(filter, _countof(filter), _T("%s (*.wav)%c*.wav%c%s (*)%c*%c"), TranslateT("WAV files"), 0, 0, TranslateT("All files"), 0, 0);
+ mir_sntprintf(filter, _T("%s (*.wav)%c*.wav%c%s (*)%c*%c"), TranslateT("WAV files"), 0, 0, TranslateT("All files"), 0, 0);
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = GetParent(hwndDlg);
ofn.hInstance = NULL;
diff --git a/src/mir_app/src/xmlParser.cpp b/src/mir_app/src/xmlParser.cpp index 8911efec03..9e79495845 100644 --- a/src/mir_app/src/xmlParser.cpp +++ b/src/mir_app/src/xmlParser.cpp @@ -402,7 +402,7 @@ XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag) // create message char message[2000], *s1 = (char*)"", *s3 = (char*)""; XMLCSTR s2 = _CXML(""); if (pResults.error == eXMLErrorFirstTagNotFound) { s1 = (char*)"First Tag should be '"; s2 = tag; s3 = (char*)"'.\n"; } - mir_snprintf(message, _countof(message), + mir_snprintf(message, #ifdef _XMLWIDECHAR "XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s" #else diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index e28e07d21e..75bd198fe4 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -219,7 +219,7 @@ static void LoadLangPackFile(FILE *fp, char *line) TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\');
if (p)
*p = 0;
- mir_sntprintf(tszFileName, _countof(tszFileName), _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9));
+ mir_sntprintf(tszFileName, _T("%s\\%S"), langPack.tszFullPath, ltrim(line + 9));
if (p)
*p = '\\';
@@ -380,7 +380,7 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) // ensure that a lang's name is a full file name
TCHAR tszFullPath[MAX_PATH];
if (!PathIsAbsoluteT(ptszLangPack))
- mir_sntprintf(tszFullPath, _countof(tszFullPath), _T("%s\\%s"), g_tszRoot, ptszLangPack);
+ mir_sntprintf(tszFullPath, _T("%s\\%s"), g_tszRoot, ptszLangPack);
else
_tcsncpy_s(tszFullPath, ptszLangPack, _TRUNCATE);
@@ -653,7 +653,7 @@ void GetDefaultLang() // try to load langpack that matches UserDefaultUILanguage
if (GetLocaleInfo(MAKELCID(GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SENGLANGUAGE, tszLangName, _countof(tszLangName))) {
- mir_sntprintf(tszPath, _countof(tszPath), _T("langpack_%s.txt"), _tcslwr(tszLangName));
+ mir_sntprintf(tszPath, _T("langpack_%s.txt"), _tcslwr(tszLangName));
if (!LoadLangPack(tszPath)) {
db_set_ts(NULL, "Langpack", "Current", tszPath);
return;
@@ -661,7 +661,7 @@ void GetDefaultLang() }
// finally try to load first file
- mir_sntprintf(tszPath, _countof(tszPath), _T("%s\\langpack_*.txt"), g_tszRoot);
+ mir_sntprintf(tszPath, _T("%s\\langpack_*.txt"), g_tszRoot);
WIN32_FIND_DATA fd;
HANDLE hFind = FindFirstFile(tszPath, &fd);
diff --git a/src/mir_core/src/miranda.cpp b/src/mir_core/src/miranda.cpp index ac022681dd..208a8731e4 100644 --- a/src/mir_core/src/miranda.cpp +++ b/src/mir_core/src/miranda.cpp @@ -57,9 +57,9 @@ static INT_PTR RestartMiranda(WPARAM wParam, LPARAM) GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath));
if (wParam) {
VARST profilename(_T("%miranda_profilename%"));
- mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
+ mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), (TCHAR*)profilename);
}
- else mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
+ else mir_sntprintf(cmdLine, _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &pi);
diff --git a/src/mir_core/src/winutil.cpp b/src/mir_core/src/winutil.cpp index e0aeb7c803..42d3c331d8 100644 --- a/src/mir_core/src/winutil.cpp +++ b/src/mir_core/src/winutil.cpp @@ -31,16 +31,16 @@ MIR_CORE_DLL(int) Utils_SaveWindowPosition(HWND hwnd, MCONTACT hContact, const c GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.top);
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
db_set_dw(hContact, szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top);
return 0;
}
@@ -54,12 +54,12 @@ EXTERN_C MIR_CORE_DLL(int) Utils_RestoreWindowPosition(HWND hwnd, MCONTACT hCont GetWindowPlacement(hwnd, &wp);
char szSettingName[64];
- mir_snprintf(szSettingName, _countof(szSettingName), "%sx", szNamePrefix);
+ mir_snprintf(szSettingName, "%sx", szNamePrefix);
int x = db_get_dw(hContact, szModule, szSettingName, -1);
if (x == -1)
return 1;
- mir_snprintf(szSettingName, _countof(szSettingName), "%sy", szNamePrefix);
+ mir_snprintf(szSettingName, "%sy", szNamePrefix);
int y = (int)db_get_dw(hContact, szModule, szSettingName, -1);
if (flags & RWPF_NOSIZE)
@@ -68,10 +68,10 @@ EXTERN_C MIR_CORE_DLL(int) Utils_RestoreWindowPosition(HWND hwnd, MCONTACT hCont wp.rcNormalPosition.left = x;
wp.rcNormalPosition.top = y;
- mir_snprintf(szSettingName, _countof(szSettingName), "%swidth", szNamePrefix);
+ mir_snprintf(szSettingName, "%swidth", szNamePrefix);
wp.rcNormalPosition.right = wp.rcNormalPosition.left+db_get_dw(hContact, szModule, szSettingName, -1);
- mir_snprintf(szSettingName, _countof(szSettingName), "%sheight", szNamePrefix);
+ mir_snprintf(szSettingName, "%sheight", szNamePrefix);
wp.rcNormalPosition.bottom = wp.rcNormalPosition.top+db_get_dw(hContact, szModule, szSettingName, -1);
}
wp.flags = 0;
|