Skip to content

Commit

Permalink
minor tweaks, a few hacks that'll go away soon
Browse files Browse the repository at this point in the history
  • Loading branch information
ariccio committed Mar 1, 2015
1 parent 30a31f0 commit ad00653
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions WinDirStat/windirstat/COM_helpers.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

#ifndef WDS_COM_HELPERS_H_INCLUDED
#define WDS_COM_HELPERS_H_INCLUDED

#include "stdafx.h"
#include "ScopeGuard.h"

Expand Down Expand Up @@ -262,3 +266,6 @@ std::wstring OnOpenAFolder( HWND /*hWnd*/ ) {



#else

#endif
1 change: 1 addition & 0 deletions WinDirStat/windirstat/globalhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,7 @@ _Success_( SUCCEEDED( return ) ) HRESULT CStyle_GetLastErrorAsFormattedMessage(
}
const auto error_err = GetLastError( );
TRACE( _T( "FormatMessageW failed with error code: `%lu`!!\r\n" ), error_err );
( void ) error_err;
if ( strSize > 41 ) {
wds_fmt::write_bad_fmt_msg( psz_formatted_error, chars_written );
return E_FAIL;
Expand Down
2 changes: 2 additions & 0 deletions WinDirStat/windirstat/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,10 @@ void CItemBranch::stdRecurseCollectExtensionData_FILE( _Inout_ std::unordered_ma

PCWSTR const resultPtrStr = CStyle_GetExtensionStrPtr( );
static_assert( std::is_same< std::decay<decltype(*m_name)>::type, wchar_t>::value, "Bad division below!" );
#ifdef DEBUG
const auto alt_length = ( ( std::ptrdiff_t( m_name + m_name_length ) - std::ptrdiff_t( resultPtrStr ) ) / sizeof( wchar_t ) );
ASSERT( wcslen( resultPtrStr ) == alt_length );
#endif
//TRACE( _T( "Calculated length: %lld, actual length: %llu\r\n" ), LONGLONG( alt_length ), ULONGLONG( wcslen( resultPtrStr ) ) );
auto& value = extensionMap[ resultPtrStr ];
++( value.files );
Expand Down
1 change: 1 addition & 0 deletions WinDirStat/windirstat/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ void CPersistence::GetSplitterPos( _In_z_ const PCTSTR name, _Inout_ bool& vali
}

void CPersistence::GetDialogRectangle( _In_z_ const PCTSTR name, _Out_ RECT& rc ) {
//TODO: BUGBUG: check return value!
GetRect( MakeDialogRectangleEntry( name ), rc );
RECT temp = rc;
SanifyRect( temp );
Expand Down
6 changes: 5 additions & 1 deletion WinDirStat/windirstat/xyslider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void CDC::FillSolidRect(LPCRECT lpRect, COLORREF clr)

//TODO: check this!
ASSERT( color_res_1 != CLR_INVALID );

(void)color_res_1;

//If the string is drawn, the return value [of ExtTextOutW] is nonzero. However, if the ANSI version of ExtTextOut is called with ETO_GLYPH_INDEX, the function returns TRUE even though the function does nothing.
VERIFY( ::ExtTextOutW( pdc.m_hDC, 0, 0, ETO_OPAQUE, &m_rcAll, NULL, 0u, NULL ) );
Expand Down Expand Up @@ -169,11 +169,14 @@ _AFXWIN_INLINE BOOL CDC::DrawEdge(LPRECT lpRect, UINT nEdge, UINT nFlags)

//TODO: check this!
ASSERT( color_res_2 != CLR_INVALID );
(void)color_res_2;

//If the string is drawn, the return value [of ExtTextOutW] is nonzero. However, if the ANSI version of ExtTextOut is called with ETO_GLYPH_INDEX, the function returns TRUE even though the function does nothing.
const BOOL text_out_res_2 = ::ExtTextOutW( pdc.m_hDC, 0, 0, ETO_OPAQUE, &rc, NULL, 0u, NULL );

//TODO: check this!
ASSERT( text_out_res_2 != 0 );
( void ) text_out_res_2;

//--------------------------------

Expand Down Expand Up @@ -359,6 +362,7 @@ void CDC::FillSolidRect(LPCRECT lpRect, COLORREF clr)
//If [SetBkColor] fails, the return value is CLR_INVALID.
const COLORREF bk_color_res_1 = ::SetBkColor( pdc.m_hDC, color );
ASSERT( bk_color_res_1 != CLR_INVALID );
( void ) bk_color_res_1;

//If the string is drawn, the return value [of ExtTextOutW] is nonzero. However, if the ANSI version of ExtTextOut is called with ETO_GLYPH_INDEX, the function returns TRUE even though the function does nothing.
VERIFY( ::ExtTextOutW( pdc.m_hDC, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL ) );
Expand Down

0 comments on commit ad00653

Please sign in to comment.