]> git.saurik.com Git - wxWidgets.git/commitdiff
fix warnings about parameters shadowing member variables
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 22 Jun 2007 18:22:20 +0000 (18:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 22 Jun 2007 18:22:20 +0000 (18:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/app.cpp
src/stc/ScintillaWX.cpp
src/stc/ScintillaWX.h

index 14b556b2e5528546fd63e5c12f54e0e9aacbb424..ad027a0232fbd48ce2aea050093d39ee838ced60 100644 (file)
@@ -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;
 
 #if wxUSE_THREADS
         return false;
 
 #if wxUSE_THREADS
@@ -407,15 +408,15 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
 #if wxUSE_UNICODE
     // gtk_init() wants UTF-8, not wchar_t, so convert
     int i;
 #if wxUSE_UNICODE
     // gtk_init() wants UTF-8, not wchar_t, so convert
     int i;
-    char **argvGTK = new char *[argc + 1];
-    for ( i = 0; i < argc; i++ )
+    char **argvGTK = new char *[argc_ + 1];
+    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__
     init_result = true;  // is there a _check() version of this?
 
 #ifdef __WXGPE__
     init_result = true;  // is there a _check() version of this?
@@ -425,18 +426,18 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
 #endif
     wxUpdateLocaleIsUtf8();
 
 #endif
     wxUpdateLocaleIsUtf8();
 
-    if ( argcGTK != argc )
+    if ( argcGTK != argc_ )
     {
         // we have to drop the parameters which were consumed by GTK+
         for ( i = 0; i < argcGTK; i++ )
         {
     {
         // we have to drop the parameters which were consumed by GTK+
         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;
 #else // !wxUSE_UNICODE
 
     delete [] argvGTK;
 #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
 
     // update internal arg[cv] as GTK+ may have removed processed options:
 #endif // wxUSE_UNICODE/!wxUSE_UNICODE
 
     // update internal arg[cv] as GTK+ may have removed processed options:
-    this->argc = argc;
-    this->argv = argv;
+    this->argc = argc_;
+    this->argv = argv_;
 
     if ( m_traits )
     {
 
     if ( m_traits )
     {
@@ -466,10 +467,10 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
         wxArrayString opt, desc;
         m_traits->GetStandardCmdLineOptions(opt, desc);
 
         wxArrayString 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
                     // program option is given
                     wxLogError(_("Invalid GTK+ command line option, use \"%s --help\""),
                     // options) it, so abort, just as we do if incorrect
                     // program option is given
                     wxLogError(_("Invalid GTK+ command line option, use \"%s --help\""),
-                               argv[0]);
+                               argv_[0]);
                     return false;
                 }
             }
                     return false;
                 }
             }
index a45fc33fcd5737f65253b017aa0964f4021b027a..5f613664d8d17a9842b3392c3553aedd799df6eb 100644 (file)
 class wxSTCTimer : public wxTimer {
 public:
     wxSTCTimer(ScintillaWX* swx) {
 class wxSTCTimer : public wxTimer {
 public:
     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 {
 public:
     wxStartDragTimer(ScintillaWX* swx) {
 class wxStartDragTimer : public wxTimer {
 public:
     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
 
index cdad2be175a58fcdf9c2bee9a47614031862f2d6..cba72489834b6fd2d9496f4b2fdb7943647618ba 100644 (file)
@@ -72,7 +72,7 @@ class ScintillaWX;
 class wxSTCDropTarget : public wxTextDropTarget {
 public:
     void SetScintilla(ScintillaWX* swx) {
 class wxSTCDropTarget : public wxTextDropTarget {
 public:
     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();
 
 private:
     void OnLeave();
 
 private:
-    ScintillaWX* swx;
+    ScintillaWX* m_swx;
 };
 #endif
 
 };
 #endif