diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-30 18:33:56 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-30 18:33:56 +0000 |
commit | 4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (patch) | |
tree | ded36ec10c55fb5d33c8d2e471ec808eeb058a04 /plugins/Weather | |
parent | 237d02ebbabbedfb8b33160ebfb5250bbd491eca (diff) |
Fix buf size for Get/Set text, open/save file name
SMS: SIZE_T -> size_t
MRA: small code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather')
-rw-r--r-- | plugins/Weather/src/weather_addstn.cpp | 2 | ||||
-rw-r--r-- | plugins/Weather/src/weather_opt.cpp | 20 | ||||
-rw-r--r-- | plugins/Weather/src/weather_popup.cpp | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp index f8951396ce..b97dba6b32 100644 --- a/plugins/Weather/src/weather_addstn.cpp +++ b/plugins/Weather/src/weather_addstn.cpp @@ -211,7 +211,7 @@ INT_PTR WeatherAdvancedSearch(WPARAM wParam, LPARAM lParam) if (searchId != -1) return 0; //only one search at a time
searchId = 1;
- GetDlgItemText((HWND)lParam, IDC_SEARCHCITY, name1, 256);
+ GetDlgItemText((HWND)lParam, IDC_SEARCHCITY, name1, SIZEOF(name1));
// search for the weather station using a thread
mir_forkthread(NameSearchTimerProc, NULL);
diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 1b4573da80..87facdb349 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -373,14 +373,14 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) }
// get update time and remove the old timer
- GetDlgItemText(hdlg, IDC_UPDATETIME, str, sizeof(str));
+ GetDlgItemText(hdlg, IDC_UPDATETIME, str, SIZEOF(str));
opt.UpdateTime = (WORD)_ttoi(str);
if (opt.UpdateTime < 1) opt.UpdateTime = 1;
KillTimer(NULL, timerId);
timerId = SetTimer(NULL, 0, opt.UpdateTime * 60000, (TIMERPROC)timerProc);
// other general options
- GetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign, sizeof(opt.DegreeSign));
+ GetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign, SIZEOF(opt.DegreeSign));
opt.StartupUpdate = IsDlgButtonChecked(hdlg, IDC_STARTUPUPD);
opt.AutoUpdate = IsDlgButtonChecked(hdlg, IDC_UPDATE);
opt.NoProtoCondition = !IsDlgButtonChecked(hdlg, IDC_PROTOCOND);
@@ -578,21 +578,21 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) // free memory for old settings
FreeTextVar();
// save new settings to memory
- GetDlgItemText(hdlg, IDC_CTEXT, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_CTEXT, textstr, SIZEOF(textstr));
wSetData(&opt.cText, textstr);
- GetDlgItemText(hdlg, IDC_BTEXT, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_BTEXT, textstr, SIZEOF(textstr));
wSetData(&opt.bText, textstr);
- GetDlgItemText(hdlg, IDC_BTITLE, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_BTITLE, textstr, SIZEOF(textstr));
wSetData(&opt.bTitle, textstr);
- GetDlgItemText(hdlg, IDC_ETEXT, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_ETEXT, textstr, SIZEOF(textstr));
wSetData(&opt.eText, textstr);
- GetDlgItemText(hdlg, IDC_NTEXT, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_NTEXT, textstr, SIZEOF(textstr));
wSetData(&opt.nText, textstr);
- GetDlgItemText(hdlg, IDC_HTEXT, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_HTEXT, textstr, SIZEOF(textstr));
wSetData(&opt.hText, textstr);
- GetDlgItemText(hdlg, IDC_XTEXT, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_XTEXT, textstr, SIZEOF(textstr));
wSetData(&opt.xText, textstr);
- GetDlgItemText(hdlg, IDC_BTITLE2, textstr, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_BTITLE2, textstr, SIZEOF(textstr));
wSetData(&opt.sText, textstr);
SaveOptions();
UpdateAllInfo(0, 0);
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 47f80c3eb5..81fda09026 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -219,7 +219,7 @@ void ReadPopupOpt(HWND hdlg) opt.BGColour = SendDlgItemMessage(hdlg,IDC_BGCOLOUR,CPM_GETCOLOUR,0,0);
// get delay time
- GetDlgItemText(hdlg, IDC_DELAY, str, sizeof(str));
+ GetDlgItemText(hdlg, IDC_DELAY, str, SIZEOF(str));
num = _ttoi(str);
opt.pDelay = num;
@@ -234,9 +234,9 @@ void ReadPopupOpt(HWND hdlg) // popup texts
wfree(&opt.pText);
wfree(&opt.pTitle);
- GetDlgItemText(hdlg, IDC_PText, text, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_PText, text, SIZEOF(text));
wSetData(&opt.pText, text);
- GetDlgItemText(hdlg, IDC_PTitle, text, MAX_TEXT_SIZE);
+ GetDlgItemText(hdlg, IDC_PTitle, text, SIZEOF(text));
wSetData(&opt.pTitle, text);
}
|