fix more Borland release build warnings about unused variable/code without effect
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -254,7 +254,11 @@ bool wxPrintfConvSpec<CharType>::Parse(const CharType *format)
|
||||
break;
|
||||
|
||||
case wxT('.'):
|
||||
CHECK_PREC
|
||||
// don't use CHECK_PREC here to avoid warning about the value
|
||||
// assigned to prec_dot inside it being never used (because
|
||||
// overwritten just below) from Borland in release build
|
||||
if (in_prec && !prec_dot)
|
||||
m_szFlags[flagofs++] = '.';
|
||||
in_prec = true;
|
||||
prec_dot = false;
|
||||
m_nMaxWidth = 0;
|
||||
|
@@ -174,8 +174,6 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message)
|
||||
|
||||
wxSizer *wxDialogBase::CreateButtonSizer(long flags)
|
||||
{
|
||||
wxSizer *sizer = NULL;
|
||||
|
||||
#ifdef __SMARTPHONE__
|
||||
wxDialog* dialog = (wxDialog*) this;
|
||||
if ( flags & wxOK )
|
||||
@@ -189,6 +187,8 @@ wxSizer *wxDialogBase::CreateButtonSizer(long flags)
|
||||
|
||||
if ( flags & wxNO )
|
||||
dialog->SetRightMenu(wxID_NO);
|
||||
|
||||
return NULL;
|
||||
#else // !__SMARTPHONE__
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
@@ -202,15 +202,19 @@ wxSizer *wxDialogBase::CreateButtonSizer(long flags)
|
||||
wxSystemOptions::GetOptionInt(wxT("wince.dialog.real-ok-cancel")) )
|
||||
#endif // __POCKETPC__
|
||||
{
|
||||
sizer = CreateStdDialogButtonSizer(flags);
|
||||
return CreateStdDialogButtonSizer(flags);
|
||||
}
|
||||
#ifdef __POCKETPC__
|
||||
return NULL;
|
||||
#endif // __POCKETPC__
|
||||
|
||||
#else // !wxUSE_BUTTON
|
||||
wxUnusedVar(flags);
|
||||
|
||||
return NULL;
|
||||
#endif // wxUSE_BUTTON/!wxUSE_BUTTON
|
||||
|
||||
#endif // __SMARTPHONE__/!__SMARTPHONE__
|
||||
|
||||
return sizer;
|
||||
}
|
||||
|
||||
wxSizer *wxDialogBase::CreateSeparatedButtonSizer(long flags)
|
||||
|
@@ -1398,7 +1398,7 @@ void wxEvtHandler::Connect( int id, int lastId,
|
||||
if ( evtConnRef )
|
||||
evtConnRef->IncRef( );
|
||||
else
|
||||
evtConnRef = new wxEventConnectionRef(this, eventSink);
|
||||
new wxEventConnectionRef(this, eventSink);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -55,7 +55,6 @@
|
||||
|
||||
static void AdjustFontSize(wxFont& font, wxDC& dc, const wxSize& pixelSize)
|
||||
{
|
||||
int currentSize = 0;
|
||||
int largestGood = 0;
|
||||
int smallestBad = 0;
|
||||
|
||||
@@ -64,7 +63,7 @@ static void AdjustFontSize(wxFont& font, wxDC& dc, const wxSize& pixelSize)
|
||||
|
||||
// NB: this assignment was separated from the variable definition
|
||||
// in order to fix a gcc v3.3.3 compiler crash
|
||||
currentSize = font.GetPointSize();
|
||||
int currentSize = font.GetPointSize();
|
||||
while (currentSize > 0)
|
||||
{
|
||||
dc.SetFont(font);
|
||||
|
@@ -2093,7 +2093,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
// compute which columns needs to be redrawn
|
||||
unsigned int cols = GetOwner()->GetColumnCount();
|
||||
unsigned int col_start = 0;
|
||||
unsigned int x_start = 0;
|
||||
unsigned int x_start;
|
||||
for (x_start = 0; col_start < cols; col_start++)
|
||||
{
|
||||
wxDataViewColumn *col = GetOwner()->GetColumn(col_start);
|
||||
@@ -2651,7 +2651,7 @@ void wxDataViewMainWindow::ScrollTo( int rows, int column )
|
||||
{
|
||||
wxRect rect = GetClientRect();
|
||||
int colnum = 0;
|
||||
int x_start = 0, x_end = 0, w = 0;
|
||||
int x_start = 0, w = 0;
|
||||
int xx, yy, xe;
|
||||
m_owner->CalcUnscrolledPosition( rect.x, rect.y, &xx, &yy );
|
||||
for (x_start = 0; colnum < column; colnum++)
|
||||
@@ -2664,7 +2664,7 @@ void wxDataViewMainWindow::ScrollTo( int rows, int column )
|
||||
x_start += w;
|
||||
}
|
||||
|
||||
x_end = x_start + w;
|
||||
int x_end = x_start + w;
|
||||
xe = xx + rect.width;
|
||||
if( x_end > xe )
|
||||
{
|
||||
@@ -3318,7 +3318,7 @@ void wxDataViewMainWindow::OnCollapsing(unsigned int row)
|
||||
{
|
||||
if (IsVirtualList())
|
||||
return;
|
||||
|
||||
|
||||
wxDataViewTreeNode * node = GetTreeNodeByRow(row);
|
||||
if( node != NULL )
|
||||
{
|
||||
@@ -3414,10 +3414,9 @@ void wxDataViewMainWindow::HitTest( const wxPoint & point, wxDataViewItem & item
|
||||
wxDataViewColumn *col = NULL;
|
||||
unsigned int cols = GetOwner()->GetColumnCount();
|
||||
unsigned int colnum = 0;
|
||||
unsigned int x_start = 0;
|
||||
int x, y;
|
||||
m_owner->CalcUnscrolledPosition( point.x, point.y, &x, &y );
|
||||
for (x_start = 0; colnum < cols; colnum++)
|
||||
for (unsigned x_start = 0; colnum < cols; colnum++)
|
||||
{
|
||||
col = GetOwner()->GetColumn(colnum);
|
||||
if (col->IsHidden())
|
||||
@@ -3536,7 +3535,7 @@ int wxDataViewMainWindow::GetRowByItem(const wxDataViewItem & item) const
|
||||
|
||||
//Compose the a parent-chain of the finding item
|
||||
ItemList list;
|
||||
wxDataViewItem * pItem = NULL;
|
||||
wxDataViewItem * pItem;
|
||||
list.DeleteContents( true );
|
||||
wxDataViewItem it( item );
|
||||
while( it.IsOk() )
|
||||
@@ -4093,7 +4092,7 @@ void wxDataViewCtrl::Init()
|
||||
{
|
||||
m_cols.DeleteContents(true);
|
||||
m_notifier = NULL;
|
||||
|
||||
|
||||
// No sorting column at start
|
||||
m_sortingColumn = NULL;
|
||||
m_headerArea = NULL;
|
||||
@@ -4160,7 +4159,7 @@ wxSize wxDataViewCtrl::GetSizeAvailableForScrollTarget(const wxSize& size)
|
||||
wxSize newsize = size;
|
||||
if (!HasFlag(wxDV_NO_HEADER) && (m_headerArea))
|
||||
newsize.y -= m_headerArea->GetSize().y;
|
||||
|
||||
|
||||
return newsize;
|
||||
}
|
||||
|
||||
|
@@ -965,32 +965,19 @@ bool wxGridCellEditor::IsAcceptedKey(wxKeyEvent& event)
|
||||
if ((ctrl || alt) && !(ctrl && alt))
|
||||
return false;
|
||||
|
||||
int key = 0;
|
||||
bool keyOk = true;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
// If it's a F-Key or other special key then it shouldn't start the
|
||||
// editor.
|
||||
if (event.GetKeyCode() >= WXK_START)
|
||||
return false;
|
||||
#endif
|
||||
#if wxUSE_UNICODE
|
||||
// if the unicode key code is not really a unicode character (it may
|
||||
// be a function key or etc., the platforms appear to always give us a
|
||||
// small value in this case) then fallback to the ASCII key code but
|
||||
// don't do anything for function keys or etc.
|
||||
key = event.GetUnicodeKey();
|
||||
if (key <= 127)
|
||||
{
|
||||
key = event.GetKeyCode();
|
||||
keyOk = (key <= 127);
|
||||
}
|
||||
if ( event.GetUnicodeKey() > 127 && event.GetKeyCode() > 127 )
|
||||
return false;
|
||||
#else
|
||||
key = event.GetKeyCode();
|
||||
keyOk = (key <= 255);
|
||||
if ( event.GetKeyCode() > 255 )
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return keyOk;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxGridCellEditor::StartingKey(wxKeyEvent& event)
|
||||
@@ -4903,10 +4890,9 @@ void wxGrid::InitColWidths()
|
||||
|
||||
m_colWidths.Add( m_defaultColWidth, m_numCols );
|
||||
|
||||
int colRight = 0;
|
||||
for ( int i = 0; i < m_numCols; i++ )
|
||||
{
|
||||
colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth;
|
||||
int colRight = ( GetColPos( i ) + 1 ) * m_defaultColWidth;
|
||||
m_colRights.Add( colRight );
|
||||
}
|
||||
}
|
||||
|
@@ -1170,7 +1170,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
||||
|
||||
// open file
|
||||
// ---------
|
||||
bool bOk = false;
|
||||
bool bOk;
|
||||
if ( wxFile::Exists(filename) ) {
|
||||
bool bAppend = false;
|
||||
wxString strMsg;
|
||||
|
@@ -877,10 +877,6 @@ wxGenericTreeItem::DoCalculateSize(wxGenericTreeCtrl* control,
|
||||
else
|
||||
state_w += MARGIN_BETWEEN_IMAGE_AND_TEXT;
|
||||
}
|
||||
else
|
||||
{
|
||||
state = wxTREE_ITEMSTATE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
m_height = (image_h > text_h) ? image_h : text_h;
|
||||
|
@@ -846,9 +846,10 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const
|
||||
while (substitutions[substitutions_cnt].code != 0)
|
||||
substitutions_cnt++;
|
||||
|
||||
wxHtmlEntityInfo *info = NULL;
|
||||
wxHtmlEntityInfo *info;
|
||||
#ifdef __WXWINCE__
|
||||
// bsearch crashes under WinCE for some reason
|
||||
info = NULL;
|
||||
size_t i;
|
||||
for (i = 0; i < substitutions_cnt; i++)
|
||||
{
|
||||
|
@@ -200,8 +200,10 @@ void wxHtmlPrintout::OnPreparePrinting()
|
||||
|
||||
int ppiPrinterX, ppiPrinterY;
|
||||
GetPPIPrinter(&ppiPrinterX, &ppiPrinterY);
|
||||
wxUnusedVar(ppiPrinterX);
|
||||
int ppiScreenX, ppiScreenY;
|
||||
GetPPIScreen(&ppiScreenX, &ppiScreenY);
|
||||
wxUnusedVar(ppiScreenX);
|
||||
|
||||
wxDisplaySize(&scr_w, &scr_h);
|
||||
GetDC()->GetSize(&dc_w, &dc_h);
|
||||
|
@@ -695,15 +695,13 @@ bool wxQTMediaBackend::Load(const wxString& fileName)
|
||||
if (m_movie)
|
||||
Cleanup();
|
||||
|
||||
bool result = true;
|
||||
OSErr err = noErr;
|
||||
short movieResFile = 0; //= 0 because of annoying VC6 warning
|
||||
FSSpec sfFile;
|
||||
|
||||
err = m_lib.NativePathNameToFSSpec(
|
||||
OSErr err = m_lib.NativePathNameToFSSpec(
|
||||
(char*) (const char*) fileName.mb_str(),
|
||||
&sfFile, 0);
|
||||
result = (err == noErr);
|
||||
bool result = (err == noErr);
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
@@ -935,15 +935,21 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
|
||||
|
||||
HRESULT hret =
|
||||
cpContainer->FindConnectionPoint(ta->guid, cp.GetRef());
|
||||
wxASSERT ( SUCCEEDED(hret));
|
||||
if ( !SUCCEEDED(hret) )
|
||||
{
|
||||
wxFAIL_MSG( wxString::Format("FindConnectionPoint(): %X",
|
||||
(unsigned)hret) );
|
||||
}
|
||||
|
||||
IDispatch* disp;
|
||||
frame->QueryInterface(IID_IDispatch, (void**)&disp);
|
||||
hret = cp->Advise(new wxActiveXEvents(this, ta->guid),
|
||||
&adviseCookie);
|
||||
wxASSERT_MSG( SUCCEEDED(hret),
|
||||
wxString::Format(wxT("Cannot connect!\nHRESULT:%X"), (unsigned int)hret)
|
||||
);
|
||||
if ( !SUCCEEDED(hret) )
|
||||
{
|
||||
wxFAIL_MSG( wxString::Format("Advise(): %X",
|
||||
(unsigned)hret) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -993,11 +993,11 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
|
||||
{
|
||||
wxTopLevelWindowBase::SetIcons(icons);
|
||||
|
||||
bool ok = DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL);
|
||||
if ( DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG) )
|
||||
ok = true;
|
||||
|
||||
wxASSERT_MSG( ok, "icon bundle doesn't contain any suitable icon" );
|
||||
if ( !DoSelectAndSetIcon(icons, SM_CXSMICON, SM_CYSMICON, ICON_SMALL) &&
|
||||
!DoSelectAndSetIcon(icons, SM_CXICON, SM_CYICON, ICON_BIG) )
|
||||
{
|
||||
wxFAIL_MSG( "icon bundle doesn't contain any suitable icon" );
|
||||
}
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
|
||||
|
@@ -3423,12 +3423,12 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
||||
rc.result = MSWDefWindowProc(message, wParam, lParam);
|
||||
processed = true;
|
||||
|
||||
// now alter the client size making room for drawing a themed border
|
||||
NCCALCSIZE_PARAMS *csparam = NULL;
|
||||
// now alter the client size making room for drawing a
|
||||
// themed border
|
||||
RECT *rect;
|
||||
if ( wParam )
|
||||
{
|
||||
csparam = (NCCALCSIZE_PARAMS *)lParam;
|
||||
NCCALCSIZE_PARAMS *csparam = (NCCALCSIZE_PARAMS *)lParam;
|
||||
rect = &csparam->rgrc[0];
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user