mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[perf] Pass struct argument by pointer
Do not waste performance on unneeded copy.
This commit is contained in:
parent
c499da9364
commit
1abde9ba88
3 changed files with 8 additions and 6 deletions
|
@ -2307,7 +2307,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
|
||||||
SendMessage(hMultiToolbar, TB_GETRECT, (WPARAM)IDC_ABOUT, (LPARAM)&rc);
|
SendMessage(hMultiToolbar, TB_GETRECT, (WPARAM)IDC_ABOUT, (LPARAM)&rc);
|
||||||
MapWindowPoints(hDlg, NULL, (POINT*)&rc, 2);
|
MapWindowPoints(hDlg, NULL, (POINT*)&rc, 2);
|
||||||
rc.left += cbw / 2;
|
rc.left += cbw / 2;
|
||||||
ShowLanguageMenu(rc);
|
ShowLanguageMenu(&rc);
|
||||||
break;
|
break;
|
||||||
case IDC_SETTINGS:
|
case IDC_SETTINGS:
|
||||||
MyDialogBox(hMainInstance, IDD_UPDATE_POLICY, hDlg, UpdateCallback);
|
MyDialogBox(hMainInstance, IDD_UPDATE_POLICY, hDlg, UpdateCallback);
|
||||||
|
|
10
src/ui.c
10
src/ui.c
|
@ -1489,7 +1489,7 @@ void UpdateProgressWithInfo(int op, int msg, uint64_t processed, uint64_t total)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowLanguageMenu(RECT rcExclude)
|
void ShowLanguageMenu(const RECT *rcExclude)
|
||||||
{
|
{
|
||||||
TPMPARAMS tpm;
|
TPMPARAMS tpm;
|
||||||
HMENU menu;
|
HMENU menu;
|
||||||
|
@ -1500,6 +1500,8 @@ void ShowLanguageMenu(RECT rcExclude)
|
||||||
char *search = "()";
|
char *search = "()";
|
||||||
char *l, *r, *str;
|
char *l, *r, *str;
|
||||||
|
|
||||||
|
assert(rcExclude);
|
||||||
|
|
||||||
UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;
|
UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;
|
||||||
menu = CreatePopupMenu();
|
menu = CreatePopupMenu();
|
||||||
list_for_each_entry(lcmd, &locale_list, loc_cmd, list) {
|
list_for_each_entry(lcmd, &locale_list, loc_cmd, list) {
|
||||||
|
@ -1526,11 +1528,11 @@ void ShowLanguageMenu(RECT rcExclude)
|
||||||
|
|
||||||
// Open the menu such that it doesn't overlap the specified rect
|
// Open the menu such that it doesn't overlap the specified rect
|
||||||
tpm.cbSize = sizeof(TPMPARAMS);
|
tpm.cbSize = sizeof(TPMPARAMS);
|
||||||
tpm.rcExclude = rcExclude;
|
tpm.rcExclude = *rcExclude;
|
||||||
TrackPopupMenuEx(menu, 0,
|
TrackPopupMenuEx(menu, 0,
|
||||||
// In RTL languages, the menu should be placed at the bottom-right of the rect
|
// In RTL languages, the menu should be placed at the bottom-right of the rect
|
||||||
right_to_left_mode ? rcExclude.right : rcExclude.left,
|
right_to_left_mode ? rcExclude->right : rcExclude->left,
|
||||||
rcExclude.bottom + adjust, hMainDialog, &tpm);
|
rcExclude->bottom + adjust, hMainDialog, &tpm);
|
||||||
DestroyMenu(menu);
|
DestroyMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
src/ui.h
2
src/ui.h
|
@ -100,7 +100,7 @@ extern void ToggleImageOptions(void);
|
||||||
extern void CreateSmallButtons(HWND hDlg);
|
extern void CreateSmallButtons(HWND hDlg);
|
||||||
extern void CreateAdditionalControls(HWND hDlg);
|
extern void CreateAdditionalControls(HWND hDlg);
|
||||||
extern void InitProgress(BOOL bOnlyFormat);
|
extern void InitProgress(BOOL bOnlyFormat);
|
||||||
extern void ShowLanguageMenu(RECT rcExclude);
|
extern void ShowLanguageMenu(const RECT *rcExclude);
|
||||||
extern void SetPassesTooltip(void);
|
extern void SetPassesTooltip(void);
|
||||||
extern void SetBootTypeDropdownWidth(void);
|
extern void SetBootTypeDropdownWidth(void);
|
||||||
extern void OnPaint(HDC hdc);
|
extern void OnPaint(HDC hdc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue