From 0d5ab92f849923daa1418661aaf55135cddd4e47 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 14 Sep 2007 21:05:12 +0000 Subject: [PATCH] reverted the change of wxCmdLineEntryDesc fields to wxString as this doesn't compile with VC6; make them const char * instead git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 11 +++++++---- include/wx/cmdline.h | 10 +++++++--- src/common/appbase.cpp | 11 ++--------- src/common/appcmn.cpp | 13 +++---------- utils/wxrc/wxrc.cpp | 4 ++-- 5 files changed, 21 insertions(+), 28 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 9ad8f61b0c..8300f5c0c6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -24,10 +24,13 @@ changes: b) Passing NULL as argument: as NULL can't be unambiguously converted to wxString, in many cases code using it won't compile any more and NULL - should be replaced with an empty string. The same issue also applies to - the structure fields which used to contain "const wxChar *" pointers (such - as wxCmdLineEntryDesc::shortName, longName and description fields) and are - now wxStrings: empty strings should be assigned to them instead of NULL. + should be replaced with an empty string. + + +- Some structure fields which used to be of type "const wxChar *" (such as + wxCmdLineEntryDesc::shortName, longName and description fields) are now of + type "const char *", you need to remove wxT() or _T() around the values used + to initialize them (which should normally always be ASCII). diff --git a/include/wx/cmdline.h b/include/wx/cmdline.h index fc5726d1da..88ce4e51d3 100644 --- a/include/wx/cmdline.h +++ b/include/wx/cmdline.h @@ -64,13 +64,17 @@ enum wxCmdLineEntryType struct wxCmdLineEntryDesc { wxCmdLineEntryType kind; - wxString shortName; - wxString longName; - wxString description; + const char *shortName; + const char *longName; + const char *description; wxCmdLineParamType type; int flags; }; +// the list of wxCmdLineEntryDesc objects should be terminated with this one +#define wxCMD_LINE_DESC_END \ + { wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 } + // ---------------------------------------------------------------------------- // wxCmdLineParser is a class for parsing command line. // diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 8e819f62d1..66297871a4 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -485,7 +485,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser) #if wxUSE_LOG { wxCMD_LINE_SWITCH, - "", + NULL, OPTION_VERBOSE, gettext_noop("generate verbose log messages"), wxCMD_LINE_VAL_NONE, @@ -494,14 +494,7 @@ void wxAppConsoleBase::OnInitCmdLine(wxCmdLineParser& parser) #endif // wxUSE_LOG // terminator - { - wxCMD_LINE_NONE, - "", - "", - "", - wxCMD_LINE_VAL_NONE, - 0x0 - } + wxCMD_LINE_DESC_END }; parser.SetDesc(cmdLineDesc); diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index 421fff4699..789ebaad70 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -203,7 +203,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser) #ifdef __WXUNIVERSAL__ { wxCMD_LINE_OPTION, - "", + NULL, OPTION_THEME, gettext_noop("specify the theme to use"), wxCMD_LINE_VAL_STRING, @@ -217,7 +217,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser) // and not mgl/app.cpp { wxCMD_LINE_OPTION, - "", + NULL, OPTION_MODE, gettext_noop("specify display mode to use (e.g. 640x480-16)"), wxCMD_LINE_VAL_STRING, @@ -226,14 +226,7 @@ void wxAppBase::OnInitCmdLine(wxCmdLineParser& parser) #endif // __WXMGL__ // terminator - { - wxCMD_LINE_NONE, - "", - "", - "", - wxCMD_LINE_VAL_NONE, - 0x0 - } + wxCMD_LINE_DESC_END }; parser.SetDesc(cmdLineGUIDesc); diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index 0ea1ebdc09..aa5e0476a1 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -253,11 +253,11 @@ int XmlResApp::OnRun() #if 0 // not yet implemented { wxCMD_LINE_OPTION, _T("l"), _T("list-of-handlers"), _T("output list of necessary handlers to this file"), (wxCmdLineParamType)0, 0 }, #endif - { wxCMD_LINE_PARAM, "", "", _T("input file(s)"), + { wxCMD_LINE_PARAM, NULL, NULL, _T("input file(s)"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_OPTION_MANDATORY }, - { wxCMD_LINE_NONE, "", "", "", (wxCmdLineParamType)0, 0 } + wxCMD_LINE_DESC_END }; wxCmdLineParser parser(cmdLineDesc, argc, argv); -- 2.47.2