diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-01 05:41:34 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-01 05:41:34 +0000 |
commit | d8a001c5720e135248fecd2d179af73d46549a75 (patch) | |
tree | ca4542771d9b029425ee518373171d18de338024 /plugins/ListeningTo | |
parent | 31f0cb350f66ed8f075971774751261f6fd800e4 (diff) |
git-svn-id: http://svn.miranda-ng.org/main/trunk@3812 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ListeningTo')
-rw-r--r-- | plugins/ListeningTo/src/commons.h | 3 | ||||
-rw-r--r-- | plugins/ListeningTo/src/listeningto.cpp | 24 | ||||
-rw-r--r-- | plugins/ListeningTo/src/options.cpp | 16 | ||||
-rw-r--r-- | plugins/ListeningTo/src/players/foobar.cpp | 2 | ||||
-rw-r--r-- | plugins/ListeningTo/src/players/player.cpp | 2 | ||||
-rw-r--r-- | plugins/ListeningTo/src/players/winamp.cpp | 2 |
6 files changed, 23 insertions, 26 deletions
diff --git a/plugins/ListeningTo/src/commons.h b/plugins/ListeningTo/src/commons.h index 3782d9d328..548dd4becd 100644 --- a/plugins/ListeningTo/src/commons.h +++ b/plugins/ListeningTo/src/commons.h @@ -77,10 +77,7 @@ Boston, MA 02111-1307, USA. extern HINSTANCE hInst;
extern BOOL loaded;
-
#define MIR_FREE(_X_) { mir_free(_X_); _X_ = NULL; }
-#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]))
-
#define MIN_TIME_BEETWEEN_SETS 10000 // ms
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 10f0db11b2..1c4fbf699b 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -189,7 +189,7 @@ void RebuildMenu() CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM) info->hMenu, 0);
TCHAR text[512];
- mir_sntprintf(text, MAX_REGS(text), TranslateT("Send to %s"), info->account);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("Send to %s"), info->account);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 100000 + i;
@@ -215,10 +215,10 @@ void RegisterProtocol(char *proto, TCHAR *account) size_t id = proto_items.size();
proto_items.resize(id+1);
- strncpy(proto_items[id].proto, proto, MAX_REGS(proto_items[id].proto));
- proto_items[id].proto[MAX_REGS(proto_items[id].proto)-1] = 0;
+ strncpy(proto_items[id].proto, proto, SIZEOF(proto_items[id].proto));
+ proto_items[id].proto[SIZEOF(proto_items[id].proto)-1] = 0;
- lstrcpyn(proto_items[id].account, account, MAX_REGS(proto_items[id].account));
+ lstrcpyn(proto_items[id].account, account, SIZEOF(proto_items[id].account));
proto_items[id].hMenu = NULL;
proto_items[id].old_xstatus = 0;
@@ -238,10 +238,10 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) {
if (wParam == PRAC_UPGRADED || wParam == PRAC_CHANGED)
{
- lstrcpyn(info->account, proto->tszAccountName, MAX_REGS(info->account));
+ lstrcpyn(info->account, proto->tszAccountName, SIZEOF(info->account));
TCHAR text[512];
- mir_sntprintf(text, MAX_REGS(text), TranslateT("Send to %s"), info->account);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("Send to %s"), info->account);
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
@@ -598,9 +598,9 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) };
Buffer<TCHAR> name;
- ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, MAX_REGS(fr));
+ ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, SIZEOF(fr));
Buffer<TCHAR> msg;
- ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, MAX_REGS(fr));
+ ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, SIZEOF(fr));
ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
ics.ptszName = name.str;
@@ -690,9 +690,9 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti = NULL) };
Buffer<TCHAR> name;
- ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, MAX_REGS(fr));
+ ReplaceTemplate(&name, NULL, opts.xstatus_name, fr, SIZEOF(fr));
Buffer<TCHAR> msg;
- ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, MAX_REGS(fr));
+ ReplaceTemplate(&msg, NULL, opts.xstatus_message, fr, SIZEOF(fr));
status = XSTATUS_MUSIC;
ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
@@ -826,7 +826,7 @@ TCHAR *GetParsedFormat(LISTENINGTOINFO *lti) };
Buffer<TCHAR> ret;
- ReplaceTemplate(&ret, NULL, opts.templ, fr, MAX_REGS(fr));
+ ReplaceTemplate(&ret, NULL, opts.templ, fr, SIZEOF(fr));
return ret.detach();
}
@@ -1036,7 +1036,7 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai) };
Buffer<TCHAR> ret;
- ReplaceTemplate(&ret, NULL, opts.templ, fr, MAX_REGS(fr));
+ ReplaceTemplate(&ret, NULL, opts.templ, fr, SIZEOF(fr));
return ret.detach();
}
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index d75cc9b9f0..a21e10cf1e 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -124,9 +124,9 @@ void DeInitOptions() void LoadOptions()
{
- LoadOpts(optionsControls, MAX_REGS(optionsControls), MODULE_NAME);
- LoadOpts(formatControls, MAX_REGS(formatControls), MODULE_NAME);
- LoadOpts(playersControls, MAX_REGS(playersControls), MODULE_NAME);
+ LoadOpts(optionsControls, SIZEOF(optionsControls), MODULE_NAME);
+ LoadOpts(formatControls, SIZEOF(formatControls), MODULE_NAME);
+ LoadOpts(playersControls, SIZEOF(playersControls), MODULE_NAME);
}
@@ -184,7 +184,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
BOOL ret;
if (msg != WM_INITDIALOG)
- ret = SaveOptsDlgProc(optionsControls, MAX_REGS(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ ret = SaveOptsDlgProc(optionsControls, SIZEOF(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
@@ -208,7 +208,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
}
- ret = SaveOptsDlgProc(optionsControls, MAX_REGS(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ ret = SaveOptsDlgProc(optionsControls, SIZEOF(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
OptionsEnableDisableCtrls(hwndDlg);
break;
@@ -256,7 +256,7 @@ static void PlayersEnableDisableCtrls(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_PLAYERS_L), enabled);
BOOL needPoll = FALSE;
- for (int i = 0; i < MAX_REGS(playerDlgs); i += 2) {
+ for (int i = 0; i < SIZEOF(playerDlgs); i += 2) {
EnableWindow(GetDlgItem(hwndDlg, playerDlgs[i+1]), enabled);
if (players[playerDlgs[i]]->needPoll && IsDlgButtonChecked(hwndDlg, playerDlgs[i+1]))
needPoll = TRUE;
@@ -273,7 +273,7 @@ static void PlayersEnableDisableCtrls(HWND hwndDlg) static INT_PTR CALLBACK PlayersDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL ret = SaveOptsDlgProc(playersControls, MAX_REGS(playersControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ BOOL ret = SaveOptsDlgProc(playersControls, SIZEOF(playersControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
@@ -301,6 +301,6 @@ static INT_PTR CALLBACK PlayersDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP static INT_PTR CALLBACK FormatDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- return SaveOptsDlgProc(formatControls, MAX_REGS(formatControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ return SaveOptsDlgProc(formatControls, SIZEOF(formatControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
}
diff --git a/plugins/ListeningTo/src/players/foobar.cpp b/plugins/ListeningTo/src/players/foobar.cpp index 3b06d55255..d4c59934bd 100644 --- a/plugins/ListeningTo/src/players/foobar.cpp +++ b/plugins/ListeningTo/src/players/foobar.cpp @@ -30,5 +30,5 @@ Foobar::Foobar() {
name = _T("foobar2000");
window_classes = wcs;
- num_window_classes = MAX_REGS(wcs);
+ num_window_classes = SIZEOF(wcs);
}
diff --git a/plugins/ListeningTo/src/players/player.cpp b/plugins/ListeningTo/src/players/player.cpp index 61428dce87..73b84dc71f 100644 --- a/plugins/ListeningTo/src/players/player.cpp +++ b/plugins/ListeningTo/src/players/player.cpp @@ -155,7 +155,7 @@ void CodeInjectionPlayer::InjectCode() // Get the dll path
char dll_path[1024] = {0};
- if (!GetModuleFileNameA(hInst, dll_path, MAX_REGS(dll_path)))
+ if (!GetModuleFileNameA(hInst, dll_path, SIZEOF(dll_path)))
return;
char *p = strrchr(dll_path, '\\');
diff --git a/plugins/ListeningTo/src/players/winamp.cpp b/plugins/ListeningTo/src/players/winamp.cpp index 903acbc675..20feea2b65 100644 --- a/plugins/ListeningTo/src/players/winamp.cpp +++ b/plugins/ListeningTo/src/players/winamp.cpp @@ -27,7 +27,7 @@ Winamp::Winamp() {
name = _T("Winamp");
window_classes = wcs;
- num_window_classes = MAX_REGS(wcs);
+ num_window_classes = SIZEOF(wcs);
message_window_class = MIRANDA_WINDOWCLASS _T(".Winamp");
dll_name = "gen_mlt";
}
|