Reduce the scope of some local variables
This commit is contained in:
@@ -155,13 +155,14 @@ Card* Pile::RemoveTopCard()
|
||||
//+-------------------------------------------------------------+
|
||||
Card* Pile::RemoveTopCard(wxDC& dc, int xOffset, int yOffset)
|
||||
{
|
||||
int topX, topY, x, y;
|
||||
int topX, topY;
|
||||
|
||||
GetTopCardPos(topX, topY);
|
||||
Card* card = RemoveTopCard();
|
||||
|
||||
if (card)
|
||||
{
|
||||
int x, y;
|
||||
card->Erase(dc, topX - xOffset, topY - yOffset);
|
||||
GetTopCardPos(x, y);
|
||||
if (m_topCard < 0)
|
||||
|
@@ -584,7 +584,7 @@ extern int g_tab2[];
|
||||
bool Life::NextTic()
|
||||
{
|
||||
LifeCellBox *c, *up, *dn, *lf, *rt;
|
||||
wxUint32 t1, t2, t3, t4;
|
||||
wxUint32 t1, t2;
|
||||
bool changed = false;
|
||||
|
||||
m_numcells = 0;
|
||||
@@ -833,6 +833,7 @@ bool Life::NextTic()
|
||||
t1 = 0;
|
||||
t2 = 0;
|
||||
|
||||
wxUint32 t3, t4;
|
||||
t3 = c->m_live1;
|
||||
c->m_old1 = t3;
|
||||
|
||||
|
@@ -148,7 +148,6 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
|
||||
int i = pages[current_page];
|
||||
int ch = -1;
|
||||
int y = 0;
|
||||
int j;
|
||||
wxChar *line_ptr;
|
||||
int curr_width = 0;
|
||||
bool page_break = false;
|
||||
@@ -204,6 +203,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y)
|
||||
|
||||
while (ch != 0 && !page_break)
|
||||
{
|
||||
int j;
|
||||
j = 0;
|
||||
#if defined(__WXMSW__) || defined(__WXMAC__)
|
||||
while (((ch = poem_buffer[i]) != 13) && (ch != 0))
|
||||
@@ -464,8 +464,6 @@ void MainWindow::PreviousPage(void)
|
||||
// Search for a string
|
||||
void MainWindow::Search(bool ask)
|
||||
{
|
||||
long position;
|
||||
|
||||
if (ask || m_searchString.empty())
|
||||
{
|
||||
wxString s = wxGetTextFromUser( wxT("Enter search string"), wxT("Search"), m_searchString);
|
||||
@@ -488,6 +486,7 @@ void MainWindow::Search(bool ask)
|
||||
|
||||
if (!m_searchString.empty() && search_ok)
|
||||
{
|
||||
long position;
|
||||
position = DoSearch();
|
||||
if (position > -1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user