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:
Gregor Schneider 2010-05-30 20:19:21 +00:00
parent d27f068a19
commit 63313191f0
4 changed files with 48 additions and 48 deletions

View file

@ -2,7 +2,6 @@
void prepare_rpn_result_2(calc_number_t *rpn, TCHAR *buffer, int size, int base)
{
TCHAR *ptr, *dst;
calc_number_t tmp;
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 */
width = (rpn->f==0) ? 1 : (int)log10(fabs(rpn->f))+1;
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 {
TCHAR *ptr, *dst;
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('.'));
while (--ptr > dst)
if (*ptr != TEXT('0'))

View file

@ -1110,11 +1110,11 @@ static void handle_context_menu(HWND hWnd, WPARAM wp, LPARAM lp)
{
TCHAR text[64];
HMENU hMenu = CreatePopupMenu();
DWORD idm;
BOOL idm;
LoadString(calc.hInstance, IDS_QUICKHELP, text, SIZEOF(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,
LOWORD(lp),
HIWORD(lp),
@ -1123,7 +1123,7 @@ static void handle_context_menu(HWND hWnd, WPARAM wp, LPARAM lp)
NULL);
DestroyMenu(hMenu);
#ifndef DISABLE_HTMLHELP_SUPPORT
if (idm != 0) {
if (idm) {
HH_POPUP 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);
HtmlHelp((HWND)wp, HTMLHELP_PATH("/popups.txt"), HH_DISPLAY_TEXT_POPUP, (DWORD_PTR)&popup);
}
#else
(void)idm;
#endif
}

View file

@ -400,7 +400,6 @@ static UINT_PTR CALLBACK DIALOG_FileSaveAs_Hook(HWND hDlg, UINT msg, WPARAM wPar
{
TCHAR szText[128];
HWND hCombo;
OFNOTIFY *pNotify;
UNREFERENCED_PARAMETER(wParam);
@ -440,8 +439,6 @@ static UINT_PTR CALLBACK DIALOG_FileSaveAs_Hook(HWND hDlg, UINT msg, WPARAM wPar
case WM_NOTIFY:
if (((NMHDR *) lParam)->code == CDN_FILEOK)
{
pNotify = (OFNOTIFY *) lParam;
hCombo = GetDlgItem(hDlg, ID_ENCODING);
if (hCombo)
Globals.iEncoding = (int) SendMessage(hCombo, CB_GETCURSEL, 0, 0);

View file

@ -276,7 +276,6 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
{
WNDPROC oldproc;
HWND hwndValue;
int len;
TCHAR ValueString[32];
LPTSTR Remainder;
DWORD Base;
@ -319,7 +318,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
dwordEditMode = EDIT_MODE_HEX;
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
{
if ((len = GetWindowTextLength(hwndValue)))
if (GetWindowTextLength(hwndValue))
{
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;
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
{
if ((len = GetWindowTextLength(hwndValue)))
if (GetWindowTextLength(hwndValue))
{
if (GetWindowText(hwndValue, ValueString, 32))
{
@ -356,7 +355,7 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case IDOK:
if ((hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA)))
{
if ((len = GetWindowTextLength(hwndValue)))
if (GetWindowTextLength(hwndValue))
{
if (!GetWindowText(hwndValue, ValueString, 32))
{