--- a\np2src\src\Edit.c Thu Oct 30 23:00:00 2008 +++ b\np2src\src\Edit.c Sat Nov 22 10:10:31 2008 @@ -425,10 +425,10 @@ BOOL IsUnicode(const char* pBuffer,int c bIsTextUnicode = IsTextUnicode(pBuffer,cb,&i); else bIsTextUnicode = FALSE; - bHasBOM = (*pBuffer == '\xFF' && *(pBuffer+1) == '\xFE'); - bHasRBOM = (*pBuffer == '\xFE' && *(pBuffer+1) == '\xFF'); + bHasBOM = (*((UNALIGNED PWCHAR)pBuffer) == 0xFEFF); + bHasRBOM = (*((UNALIGNED PWCHAR)pBuffer) == 0xFFFE); /* #define IS_TEXT_UNICODE_ASCII16 0x0001 #define IS_TEXT_UNICODE_REVERSE_ASCII16 0x0010 --- a\np2src\src\Helpers.c Thu Oct 30 23:00:00 2008 +++ b\np2src\src\Helpers.c Sat Nov 22 10:10:31 2008 @@ -708,48 +708,8 @@ int FormatString(LPWSTR lpOutput,int nOu } -//============================================================================= -// -// FormatBytes() -// -void FormatBytes(LPWSTR lpOutput,int nOutput,DWORD dwBytes) -{ - - WCHAR tch[256]; - int i; - double dBytes = dwBytes; - static const WCHAR *pBytes[] = { L"Bytes",L"KB",L"MB",L"GB" }; - - if (dwBytes > 1023) - { - for (i = 0; i < 4; i++) - { - - if (dBytes >= 1024.0) - dBytes /= 1024.0; - - else - break; - } - swprintf(tch,L"%.2f",dBytes); - GetNumberFormat(LOCALE_USER_DEFAULT,0,tch,NULL,lpOutput,nOutput); - lstrcat(lpOutput,L" "); - lstrcat(lpOutput,pBytes[i]); - } - - else - { - wsprintf(lpOutput,L"%i",dwBytes); - FormatNumberStr(lpOutput); - lstrcat(lpOutput,L" "); - lstrcat(lpOutput,pBytes[0]); - } - -} - - /////////////////////////////////////////////////////////////////////////////// // // // Name: PathIsLnkFile() --- a\np2src\src\Helpers.h Thu Oct 30 23:00:00 2008 +++ b\np2src\src\Helpers.h Sat Nov 22 10:10:31 2008 @@ -98,9 +98,8 @@ BOOL IsCmdEnabled(HWND, UINT); #define StrEnd(pStart) (pStart + lstrlen(pStart)) int FormatString(LPWSTR,int,UINT,...); -void FormatBytes(LPWSTR,int,DWORD); BOOL PathIsLnkFile(LPCWSTR); BOOL PathGetLnkPath(LPCWSTR,LPWSTR,int); --- a\np2src\src\Notepad2.c Sat Nov 22 10:10:19 2008 +++ b\np2src\src\Notepad2.c Sat Nov 22 10:10:31 2008 @@ -5115,9 +5115,9 @@ void UpdateStatusbar() else FormatString(tchDocPos,COUNTOF(tchDocPos),IDS_DOCPOS2,tchLn,tchLines,tchCol,tchCols,tchSel); iBytes = SendMessage(hwndEdit,SCI_GETLENGTH,0,0); - FormatBytes(tchBytes,COUNTOF(tchBytes),iBytes); + StrFormatByteSize(iBytes, tchBytes, COUNTOF(tchBytes)); FormatString(tchDocSize,COUNTOF(tchDocSize),IDS_DOCSIZE,tchBytes); if (iCodePage & NCP_UNICODE) --- a\np2src\src\Styles.c Sat Nov 22 10:10:19 2008 +++ b\np2src\src\Styles.c Sat Nov 22 10:11:35 2008 @@ -401,9 +401,9 @@ KEYWORDLIST KeyWords_CPP = { "compl const const_cast continue default delete do double " "dynamic_cast else enum explicit export extern false float for friend " "goto if inline int long mutable namespace new not not_eq operator or " "or_eq private protected public register reinterpret_cast return short " -"signed sizeof static static_cast struct switch template this throw true " +"signed size_t sizeof static static_cast struct switch template this throw true " "try typedef typeid typename union unsigned using virtual void volatile " "wchar_t while xor xor_eq", "", "a addindex addtogroup anchor arg attention author b brief bug c class code " @@ -2688,9 +2688,9 @@ BOOL CALLBACK Style_ConfigDlgProc(HWND h if (hFontTitle == NULL) { if (NULL == (hFontTitle = (HFONT)SendDlgItemMessage(hwnd,IDC_TITLE,WM_GETFONT,0,0))) hFontTitle = GetStockObject(DEFAULT_GUI_FONT); GetObject(hFontTitle,sizeof(LOGFONT),&lf); - lf.lfHeight = (LONG) (lf.lfHeight * 1.2); + lf.lfHeight += lf.lfHeight / 5; lf.lfWeight = FW_BOLD; hFontTitle = CreateFontIndirect(&lf); } CenterDlgInParent(hwnd);