fix warnings about parameters shadowing member variables
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -346,9 +346,10 @@ GdkVisual *wxApp::GetGdkVisual()
|
|||||||
return visual;
|
return visual;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxApp::Initialize(int& argc, wxChar **argv)
|
// use unusual names for the parameters to avoid conflict with wxApp::arg[cv]
|
||||||
|
bool wxApp::Initialize(int& argc_, wxChar **argv_)
|
||||||
{
|
{
|
||||||
if ( !wxAppBase::Initialize(argc, argv) )
|
if ( !wxAppBase::Initialize(argc_, argv_) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
@@ -407,15 +408,15 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
// gtk_init() wants UTF-8, not wchar_t, so convert
|
// gtk_init() wants UTF-8, not wchar_t, so convert
|
||||||
int i;
|
int i;
|
||||||
char **argvGTK = new char *[argc + 1];
|
char **argvGTK = new char *[argc_ + 1];
|
||||||
for ( i = 0; i < argc; i++ )
|
for ( i = 0; i < argc_; i++ )
|
||||||
{
|
{
|
||||||
argvGTK[i] = wxStrdupA(wxConvUTF8.cWX2MB(argv[i]));
|
argvGTK[i] = wxStrdupA(wxConvUTF8.cWX2MB(argv_[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
argvGTK[argc] = NULL;
|
argvGTK[argc_] = NULL;
|
||||||
|
|
||||||
int argcGTK = argc;
|
int argcGTK = argc_;
|
||||||
|
|
||||||
#ifdef __WXGPE__
|
#ifdef __WXGPE__
|
||||||
init_result = true; // is there a _check() version of this?
|
init_result = true; // is there a _check() version of this?
|
||||||
@@ -425,18 +426,18 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
#endif
|
#endif
|
||||||
wxUpdateLocaleIsUtf8();
|
wxUpdateLocaleIsUtf8();
|
||||||
|
|
||||||
if ( argcGTK != argc )
|
if ( argcGTK != argc_ )
|
||||||
{
|
{
|
||||||
// we have to drop the parameters which were consumed by GTK+
|
// we have to drop the parameters which were consumed by GTK+
|
||||||
for ( i = 0; i < argcGTK; i++ )
|
for ( i = 0; i < argcGTK; i++ )
|
||||||
{
|
{
|
||||||
while ( strcmp(wxConvUTF8.cWX2MB(argv[i]), argvGTK[i]) != 0 )
|
while ( strcmp(wxConvUTF8.cWX2MB(argv_[i]), argvGTK[i]) != 0 )
|
||||||
{
|
{
|
||||||
memmove(argv + i, argv + i + 1, (argc - i)*sizeof(*argv));
|
memmove(argv_ + i, argv_ + i + 1, (argc_ - i)*sizeof(*argv_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
argc = argcGTK;
|
argc_ = argcGTK;
|
||||||
}
|
}
|
||||||
//else: gtk_init() didn't modify our parameters
|
//else: gtk_init() didn't modify our parameters
|
||||||
|
|
||||||
@@ -448,14 +449,14 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
|
|
||||||
delete [] argvGTK;
|
delete [] argvGTK;
|
||||||
#else // !wxUSE_UNICODE
|
#else // !wxUSE_UNICODE
|
||||||
// gtk_init() shouldn't actually change argv itself (just its contents) so
|
// gtk_init() shouldn't actually change argv_ itself (just its contents) so
|
||||||
// it's ok to pass pointer to it
|
// it's ok to pass pointer to it
|
||||||
init_result = gtk_init_check( &argc, &argv );
|
init_result = gtk_init_check( &argc_, &argv_ );
|
||||||
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
|
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
|
||||||
|
|
||||||
// update internal arg[cv] as GTK+ may have removed processed options:
|
// update internal arg[cv] as GTK+ may have removed processed options:
|
||||||
this->argc = argc;
|
this->argc = argc_;
|
||||||
this->argv = argv;
|
this->argv = argv_;
|
||||||
|
|
||||||
if ( m_traits )
|
if ( m_traits )
|
||||||
{
|
{
|
||||||
@@ -466,10 +467,10 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
wxArrayString opt, desc;
|
wxArrayString opt, desc;
|
||||||
m_traits->GetStandardCmdLineOptions(opt, desc);
|
m_traits->GetStandardCmdLineOptions(opt, desc);
|
||||||
|
|
||||||
for ( int i = 0; i < argc; i++ )
|
for ( int i = 0; i < argc_; i++ )
|
||||||
{
|
{
|
||||||
// leave just the names of the options with values
|
// leave just the names of the options with values
|
||||||
const wxString str = wxString(argv[i]).BeforeFirst('=');
|
const wxString str = wxString(argv_[i]).BeforeFirst('=');
|
||||||
|
|
||||||
for ( size_t j = 0; j < opt.size(); j++ )
|
for ( size_t j = 0; j < opt.size(); j++ )
|
||||||
{
|
{
|
||||||
@@ -482,7 +483,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
|
|||||||
// options) it, so abort, just as we do if incorrect
|
// options) it, so abort, just as we do if incorrect
|
||||||
// program option is given
|
// program option is given
|
||||||
wxLogError(_("Invalid GTK+ command line option, use \"%s --help\""),
|
wxLogError(_("Invalid GTK+ command line option, use \"%s --help\""),
|
||||||
argv[0]);
|
argv_[0]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -49,15 +49,15 @@
|
|||||||
class wxSTCTimer : public wxTimer {
|
class wxSTCTimer : public wxTimer {
|
||||||
public:
|
public:
|
||||||
wxSTCTimer(ScintillaWX* swx) {
|
wxSTCTimer(ScintillaWX* swx) {
|
||||||
this->swx = swx;
|
m_swx = swx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notify() {
|
void Notify() {
|
||||||
swx->DoTick();
|
m_swx->DoTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScintillaWX* swx;
|
ScintillaWX* m_swx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -65,32 +65,32 @@ private:
|
|||||||
class wxStartDragTimer : public wxTimer {
|
class wxStartDragTimer : public wxTimer {
|
||||||
public:
|
public:
|
||||||
wxStartDragTimer(ScintillaWX* swx) {
|
wxStartDragTimer(ScintillaWX* swx) {
|
||||||
this->swx = swx;
|
m_swx = swx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notify() {
|
void Notify() {
|
||||||
swx->DoStartDrag();
|
m_swx->DoStartDrag();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScintillaWX* swx;
|
ScintillaWX* m_swx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
|
bool wxSTCDropTarget::OnDropText(wxCoord x, wxCoord y, const wxString& data) {
|
||||||
return swx->DoDropText(x, y, data);
|
return m_swx->DoDropText(x, y, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDragResult wxSTCDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) {
|
wxDragResult wxSTCDropTarget::OnEnter(wxCoord x, wxCoord y, wxDragResult def) {
|
||||||
return swx->DoDragEnter(x, y, def);
|
return m_swx->DoDragEnter(x, y, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
wxDragResult wxSTCDropTarget::OnDragOver(wxCoord x, wxCoord y, wxDragResult def) {
|
||||||
return swx->DoDragOver(x, y, def);
|
return m_swx->DoDragOver(x, y, def);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSTCDropTarget::OnLeave() {
|
void wxSTCDropTarget::OnLeave() {
|
||||||
swx->DoDragLeave();
|
m_swx->DoDragLeave();
|
||||||
}
|
}
|
||||||
#endif // wxUSE_DRAG_AND_DROP
|
#endif // wxUSE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
@@ -72,7 +72,7 @@ class ScintillaWX;
|
|||||||
class wxSTCDropTarget : public wxTextDropTarget {
|
class wxSTCDropTarget : public wxTextDropTarget {
|
||||||
public:
|
public:
|
||||||
void SetScintilla(ScintillaWX* swx) {
|
void SetScintilla(ScintillaWX* swx) {
|
||||||
this->swx = swx;
|
m_swx = swx;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
|
bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
|
||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
void OnLeave();
|
void OnLeave();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScintillaWX* swx;
|
ScintillaWX* m_swx;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user