mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 06:57:08 +00:00
Various application fixes by Jan Roeloffzen, bug #5182, part 1
Notepad: remove unused variable, tabs -> spaces Regedit: remove unused variable Calc: dword->bool, remove unused variables, tabs -> spaces svn path=/trunk/; revision=47458
This commit is contained in:
parent
d27f068a19
commit
63313191f0
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
void prepare_rpn_result_2(calc_number_t *rpn, TCHAR *buffer, int size, int base)
|
void prepare_rpn_result_2(calc_number_t *rpn, TCHAR *buffer, int size, int base)
|
||||||
{
|
{
|
||||||
TCHAR *ptr, *dst;
|
|
||||||
calc_number_t tmp;
|
calc_number_t tmp;
|
||||||
int width;
|
int width;
|
||||||
|
|
||||||
|
@ -21,9 +20,12 @@ void prepare_rpn_result_2(calc_number_t *rpn, TCHAR *buffer, int size, int base)
|
||||||
/* calculate the width of integer number */
|
/* calculate the width of integer number */
|
||||||
width = (rpn->f==0) ? 1 : (int)log10(fabs(rpn->f))+1;
|
width = (rpn->f==0) ? 1 : (int)log10(fabs(rpn->f))+1;
|
||||||
if (calc.sci_out == TRUE || width > MAX_LD_WIDTH || width < -MAX_LD_WIDTH)
|
if (calc.sci_out == TRUE || width > MAX_LD_WIDTH || width < -MAX_LD_WIDTH)
|
||||||
ptr = buffer + _stprintf(buffer, TEXT("%#e"), rpn->f);
|
_stprintf(buffer, TEXT("%#e"), rpn->f);
|
||||||
else {
|
else {
|
||||||
|
TCHAR *ptr, *dst;
|
||||||
|
|
||||||
ptr = buffer + _stprintf(buffer, TEXT("%#*.*f"), width, ((MAX_LD_WIDTH-width-1)>=0) ? MAX_LD_WIDTH-width-1 : 0, rpn->f);
|
ptr = buffer + _stprintf(buffer, TEXT("%#*.*f"), width, ((MAX_LD_WIDTH-width-1)>=0) ? MAX_LD_WIDTH-width-1 : 0, rpn->f);
|
||||||
|
/* format sring ensures there is a '.': */
|
||||||
dst = _tcschr(buffer, TEXT('.'));
|
dst = _tcschr(buffer, TEXT('.'));
|
||||||
while (--ptr > dst)
|
while (--ptr > dst)
|
||||||
if (*ptr != TEXT('0'))
|
if (*ptr != TEXT('0'))
|
||||||
|
|
|
@ -1110,11 +1110,11 @@ static void handle_context_menu(HWND hWnd, WPARAM wp, LPARAM lp)
|
||||||
{
|
{
|
||||||
TCHAR text[64];
|
TCHAR text[64];
|
||||||
HMENU hMenu = CreatePopupMenu();
|
HMENU hMenu = CreatePopupMenu();
|
||||||
DWORD idm;
|
BOOL idm;
|
||||||
|
|
||||||
LoadString(calc.hInstance, IDS_QUICKHELP, text, SIZEOF(text));
|
LoadString(calc.hInstance, IDS_QUICKHELP, text, SIZEOF(text));
|
||||||
AppendMenu(hMenu, MF_STRING | MF_ENABLED, IDM_HELP_HELP, text);
|
AppendMenu(hMenu, MF_STRING | MF_ENABLED, IDM_HELP_HELP, text);
|
||||||
idm = (DWORD)TrackPopupMenu(hMenu,
|
idm = TrackPopupMenu( hMenu,
|
||||||
TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
|
TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD | TPM_RIGHTBUTTON,
|
||||||
LOWORD(lp),
|
LOWORD(lp),
|
||||||
HIWORD(lp),
|
HIWORD(lp),
|
||||||
|
@ -1123,7 +1123,7 @@ static void handle_context_menu(HWND hWnd, WPARAM wp, LPARAM lp)
|
||||||
NULL);
|
NULL);
|
||||||
DestroyMenu(hMenu);
|
DestroyMenu(hMenu);
|
||||||
#ifndef DISABLE_HTMLHELP_SUPPORT
|
#ifndef DISABLE_HTMLHELP_SUPPORT
|
||||||
if (idm != 0) {
|
if (idm) {
|
||||||
HH_POPUP popup;
|
HH_POPUP popup;
|
||||||
|
|
||||||
memset(&popup, 0, sizeof(popup));
|
memset(&popup, 0, sizeof(popup));
|
||||||
|
@ -1139,6 +1139,8 @@ static void handle_context_menu(HWND hWnd, WPARAM wp, LPARAM lp)
|
||||||
popup.idString = GetWindowLongPtr((HWND)wp, GWL_ID);
|
popup.idString = GetWindowLongPtr((HWND)wp, GWL_ID);
|
||||||
HtmlHelp((HWND)wp, HTMLHELP_PATH("/popups.txt"), HH_DISPLAY_TEXT_POPUP, (DWORD_PTR)&popup);
|
HtmlHelp((HWND)wp, HTMLHELP_PATH("/popups.txt"), HH_DISPLAY_TEXT_POPUP, (DWORD_PTR)&popup);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)idm;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,6 @@ static UINT_PTR CALLBACK DIALOG_FileSaveAs_Hook(HWND hDlg, UINT msg, WPARAM wPar
|
||||||
{
|
{
|
||||||
TCHAR szText[128];
|
TCHAR szText[128];
|
||||||
HWND hCombo;
|
HWND hCombo;
|
||||||
OFNOTIFY *pNotify;
|
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(wParam);
|
UNREFERENCED_PARAMETER(wParam);
|
||||||
|
|
||||||
|
@ -440,8 +439,6 @@ static UINT_PTR CALLBACK DIALOG_FileSaveAs_Hook(HWND hDlg, UINT msg, WPARAM wPar
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
if (((NMHDR *) lParam)->code == CDN_FILEOK)
|
if (((NMHDR *) lParam)->code == CDN_FILEOK)
|
||||||
{
|
{
|
||||||
pNotify = (OFNOTIFY *) lParam;
|
|
||||||
|
|
||||||
hCombo = GetDlgItem(hDlg, ID_ENCODING);
|
hCombo = GetDlgItem(hDlg, ID_ENCODING);
|
||||||
if (hCombo)
|
if (hCombo)
|
||||||
Globals.iEncoding = (int) SendMessage(hCombo, CB_GETCURSEL, 0, 0);
|
Globals.iEncoding = (int) SendMessage(hCombo, CB_GETCURSEL, 0, 0);
|
||||||
|
|
|
@ -276,7 +276,6 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
{
|
{
|
||||||
WNDPROC oldproc;
|
WNDPROC oldproc;
|
||||||
HWND hwndValue;
|
HWND hwndValue;
|
||||||
int len;
|
|
||||||
TCHAR ValueString[32];
|
TCHAR ValueString[32];
|
||||||
LPTSTR Remainder;
|
LPTSTR Remainder;
|
||||||
DWORD Base;
|
DWORD Base;
|
||||||
|
@ -319,7 +318,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
dwordEditMode = EDIT_MODE_HEX;
|
dwordEditMode = EDIT_MODE_HEX;
|
||||||
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
|
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
|
||||||
{
|
{
|
||||||
if ((len = GetWindowTextLength(hwndValue)))
|
if (GetWindowTextLength(hwndValue))
|
||||||
{
|
{
|
||||||
if (GetWindowText(hwndValue, ValueString, 32))
|
if (GetWindowText(hwndValue, ValueString, 32))
|
||||||
{
|
{
|
||||||
|
@ -339,7 +338,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
dwordEditMode = EDIT_MODE_DEC;
|
dwordEditMode = EDIT_MODE_DEC;
|
||||||
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
|
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
|
||||||
{
|
{
|
||||||
if ((len = GetWindowTextLength(hwndValue)))
|
if (GetWindowTextLength(hwndValue))
|
||||||
{
|
{
|
||||||
if (GetWindowText(hwndValue, ValueString, 32))
|
if (GetWindowText(hwndValue, ValueString, 32))
|
||||||
{
|
{
|
||||||
|
@ -356,7 +355,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
|
||||||
case IDOK:
|
case IDOK:
|
||||||
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
|
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
|
||||||
{
|
{
|
||||||
if ((len = GetWindowTextLength(hwndValue)))
|
if (GetWindowTextLength(hwndValue))
|
||||||
{
|
{
|
||||||
if (!GetWindowText(hwndValue, ValueString, 32))
|
if (!GetWindowText(hwndValue, ValueString, 32))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue