Fixes to warnings about assigning unused values.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2004-07-16 13:19:32 +00:00
parent 9b386ecadb
commit 5cb598ae20
13 changed files with 32 additions and 39 deletions

View File

@ -1008,7 +1008,6 @@ bool wxICOHandler::SaveFile(wxImage *image,
bool verbose)
{
bool bResult = FALSE;
//sanity check; icon must be less than 127 pixels high and 255 wide
if ( image->GetHeight () > 127 )
{
@ -1100,7 +1099,7 @@ bool wxICOHandler::SaveFile(wxImage *image,
//calculate size and offset of image and mask
wxCountingOutputStream cStream;
bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask);
bool bResult = SaveDib(image, cStream, verbose, IsBmp, IsMask);
if ( !bResult )
{
if ( verbose )
@ -1206,8 +1205,8 @@ bool wxICOHandler::LoadFile(wxImage *image, wxInputStream& stream,
bool wxICOHandler::DoLoadFile(wxImage *image, wxInputStream& stream,
bool WXUNUSED(verbose), int index)
{
bool bResult = FALSE;
bool IsBmp = FALSE;
bool bResult wxDUMMY_INITIALIZE(false);
bool IsBmp = false;
ICONDIR IconDir;
@ -1253,7 +1252,7 @@ bool wxICOHandler::DoLoadFile(wxImage *image, wxInputStream& stream,
if ( iSel == wxNOT_FOUND || iSel < 0 || iSel >= nIcons )
{
wxLogError(_("ICO: Invalid icon index."));
bResult = FALSE;
bResult = false;
}
else
{

View File

@ -152,10 +152,9 @@ int wxColourDialog::ShowModal()
bool success = ::ChooseColor(&(chooseColorStruct)) != 0;
// Try to highlight the correct window (the parent)
HWND hWndParent = 0;
if (GetParent())
{
hWndParent = (HWND) GetParent()->GetHWND();
HWND hWndParent = (HWND) GetParent()->GetHWND();
if (hWndParent)
::BringWindowToTop(hWndParent);
}

View File

@ -250,7 +250,7 @@ bool wxControl::MSWOnNotify(int idCtrl,
WXLPARAM lParam,
WXLPARAM* result)
{
wxEventType eventType = wxEVT_NULL;
wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL);
NMHDR *hdr = (NMHDR*) lParam;
switch ( hdr->code )

View File

@ -120,10 +120,10 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor)
ImageList_Destroy(GetHimageList());
m_hImageList = 0;
UINT flags = 0 ;
#ifdef __WXWINCE__
flags = ILC_COLOR;
UNIT flags = ILC_COLOR;
#else
UINT flags wxDUMMY_INITIALIZE(0) ;
if (image.GetDepth() <= 4)
flags = ILC_COLOR4;
else if (image.GetDepth() <= 8)
@ -177,10 +177,10 @@ bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor)
ImageList_Destroy(GetHimageList());
m_hImageList = 0;
UINT flags = 0 ;
#ifdef __WXWINCE__
flags = ILC_COLOR;
UINT flags = ILC_COLOR;
#else
UINT flags wxDUMMY_INITIALIZE(0) ;
if (image.GetDepth() <= 4)
flags = ILC_COLOR4;
else if (image.GetDepth() <= 8)

View File

@ -284,7 +284,7 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number,
wxWindowID id,
const wxString& name)
{
wxStatusBar *statusBar = NULL;
wxStatusBar *statusBar wxDUMMY_INITIALIZE(NULL);
#if wxUSE_NATIVE_STATUSBAR
if ( !UsesNativeStatusBar() )
@ -616,8 +616,8 @@ void wxFrame::PositionToolBar()
// Optimise such that we don't have to always resize the toolbar
// when the frame changes, otherwise we'll get a lot of flicker.
bool heightChanging = TRUE;
bool widthChanging = TRUE;
bool heightChanging wxDUMMY_INITIALIZE(true);
bool widthChanging wxDUMMY_INITIALIZE(true);
if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL )
{

View File

@ -463,10 +463,9 @@ void wxListCtrl::FreeAllInternalData()
if (m_AnyInternalData)
{
int n = GetItemCount();
int i = 0;
m_ignoreChangeMessages = TRUE;
for (i = 0; i < n; i++)
for (int i = 0; i < n; i++)
wxDeleteInternalData(this, i);
m_ignoreChangeMessages = FALSE;
@ -2313,7 +2312,6 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
wxSize clientSize = GetClientSize();
wxRect itemRect;
int cy=0;
int itemCount = GetItemCount();
int i;
@ -2324,7 +2322,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
{
if (GetItemRect(i, itemRect))
{
cy = itemRect.GetTop();
int cy = itemRect.GetTop();
if (i != 0) // Don't draw the first one
{
dc.DrawLine(0, cy, clientSize.x, cy);

View File

@ -115,7 +115,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
m_printDialogData.SetMaxPage(9999);
// Create a suitable device context
wxDC *dc = NULL;
wxDC *dc wxDUMMY_INITIALIZE(NULL);
if (prompt)
{
dc = PrintDialog(parent);
@ -134,18 +134,13 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
return false;
}
int logPPIScreenX = 0;
int logPPIScreenY = 0;
int logPPIPrinterX = 0;
int logPPIPrinterY = 0;
HDC hdc = ::GetDC(NULL);
logPPIScreenX = ::GetDeviceCaps(hdc, LOGPIXELSX);
logPPIScreenY = ::GetDeviceCaps(hdc, LOGPIXELSY);
int logPPIScreenX = ::GetDeviceCaps(hdc, LOGPIXELSX);
int logPPIScreenY = ::GetDeviceCaps(hdc, LOGPIXELSY);
::ReleaseDC(NULL, hdc);
logPPIPrinterX = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSX);
logPPIPrinterY = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSY);
int logPPIPrinterX = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSX);
int logPPIPrinterY = ::GetDeviceCaps((HDC) dc->GetHDC(), LOGPIXELSY);
if (logPPIPrinterX == 0 || logPPIPrinterY == 0)
{
delete dc;
@ -373,7 +368,7 @@ void wxWindowsPrintPreview::DetermineScaling()
wxPrinterDC printerDC(m_printDialogData.GetPrintData());
int printerWidth = 150;
int printerHeight = 250;
int printerHeight wxDUMMY_INITIALIZE(250);
int printerXRes = 1500;
int printerYRes = 2500;

View File

@ -1035,7 +1035,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
wxCHECK_MSG( radiobox, 0, wxT("radio button without radio box?") );
bool processed = TRUE;
bool processed wxDUMMY_INITIALIZE(true);
// HELPINFO doesn't seem to be supported on WinCE.
#ifndef __WXWINCE__
@ -1071,7 +1071,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
processed = radiobox->GetEventHandler()->ProcessEvent(helpEvent);
}
else
processed = FALSE;
processed = false;
#endif
if (processed)
return 0;

View File

@ -173,6 +173,8 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
int position,
maxPos, trackPos = pos;
wxUnusedVar(trackPos);
// when we're dragging the scrollbar we can't use pos parameter because it
// is limited to 16 bits
// JACS: now always using GetScrollInfo, since there's no reason

View File

@ -168,7 +168,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
minLabel.Printf(wxT("%d"), minValue);
wstyle = STATIC_FLAGS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
wstyle |= WS_CLIPSIBLINGS;
m_staticMin = (WXHWND) CreateWindowEx
(
0, wxT("STATIC"), minLabel,
@ -237,7 +237,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id,
wstyle = STATIC_FLAGS;
if ( m_windowStyle & wxCLIP_SIBLINGS )
msStyle |= WS_CLIPSIBLINGS;
wstyle |= WS_CLIPSIBLINGS;
m_staticMax = (WXHWND) CreateWindowEx
(

View File

@ -151,10 +151,9 @@ bool wxStaticBitmap::Create(wxWindow *parent,
// we may have either bitmap or icon: if a bitmap with mask is passed, we
// will transform it to an icon ourselves because otherwise the mask will
// be ignored by Windows
wxGDIImage *image = (wxGDIImage *)NULL;
m_isIcon = bitmap.IsKindOf(CLASSINFO(wxIcon));
image = ConvertImage( bitmap );
wxGDIImage *image = ConvertImage( bitmap );
m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) );
// create the native control

View File

@ -129,7 +129,7 @@ wxTabCtrl::~wxTabCtrl()
bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{
wxTabEvent event(wxEVT_NULL, m_windowId);
wxEventType eventType = wxEVT_NULL;
wxEventType eventType wxDUMMY_INITIALIZE(wxEVT_NULL);
NMHDR* hdr1 = (NMHDR*) lParam;
switch ( hdr1->code )
{

View File

@ -1746,9 +1746,10 @@ bool wxWindowMSW::DoPopupMenu(wxMenu *menu, int x, int y)
point.y = y;
::ClientToScreen(hWnd, &point);
wxCurrentPopupMenu = menu;
#if defined(__WXWINCE__)
UINT flags = 0;
#if !defined(__WXWINCE__)
flags = TPM_RIGHTBUTTON;
#else
UINT flags = TPM_RIGHTBUTTON;
#endif
::TrackPopupMenu(hMenu, flags, point.x, point.y, 0, hWnd, NULL);