Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-10-05 15:38:40 +00:00
parent 908686c52e
commit 254a21292b
49 changed files with 721 additions and 792 deletions

View File

@@ -86,10 +86,6 @@ ctSettings::ctSettings(const ctSettings& settings)
}
ctSettings::~ctSettings()
{
}
void ctSettings::operator = (const ctSettings& settings)
{
Copy(settings);
@@ -265,7 +261,7 @@ bool ctSettings::SaveConfig()
// Indicate that we're no longer running, so we know if the program
// crashed last time around.
config.Write(wxT("Misc/RunningProgram"), (long) 0);
{
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistorySave(config);

View File

@@ -43,7 +43,7 @@ public:
ctSettings(const ctSettings& settings);
/// Destructor.
~ctSettings();
~ctSettings(){};
// Operations

View File

@@ -95,10 +95,6 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView)
END_EVENT_TABLE()
ctConfigToolView::ctConfigToolView()
{
}
// What to do when a view is created. Creates actual
// windows for displaying the view.
bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
@@ -121,11 +117,11 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl();
if (!treeCtrl)
return;
wxASSERT (doc != NULL);
ctConfigItem* selItem = NULL;
wxTreeItemId sel = treeCtrl->GetSelection();
if (sel.IsOk())
{
@@ -133,12 +129,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
if (data)
selItem = data->GetConfigItem() ;
}
ctConfigToolHint* hint = (ctConfigToolHint*) hintObj;
int hintOp = ctNoHint;
if (hint)
hintOp = hint->m_op;
switch (hintOp)
{
case ctInitialUpdate:
@@ -151,12 +147,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
}
}
break;
case ctSelChanged:
case ctSelChanged:
{
if (selItem)
{
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
}
}
}
break;
case ctAllSaved:
@@ -175,14 +171,14 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
treeCtrl->DeleteAllItems();
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL);
break;
}
}
case ctValueChanged:
{
// ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
}
}
break;
default:
break;
}
@@ -200,7 +196,7 @@ bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow))
wxGetApp().GetDocManager()->ActivateView(this, false);
Activate(false);
wxGetApp().GetMainFrame()->SetDocument(NULL);
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
@@ -443,7 +439,7 @@ void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg)
parent = sel->GetParent();
insertBefore = sel->FindNextSibling();
}
ctConfigItem* newItem = new ctConfigItem(NULL, type, name);
newItem->InitProperties();
@@ -634,7 +630,7 @@ void ctConfigToolView::OnContextPasteAsChild(wxCommandEvent& WXUNUSED(event))
{
ctConfigItem* parent = sel;
ctConfigItem* insertBefore = NULL;
ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone();
ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE,
NULL, newItem, parent, insertBefore);
@@ -766,7 +762,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
wxString oldType = property->GetVariant().GetType();
wxString oldEditorType = property->GetEditorType();
wxArrayString oldChoices = property->GetChoices();
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
wxID_ANY, _("Edit custom property"));
dialog.SetPropertyName(oldName);
@@ -779,7 +775,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
wxString editorType = dialog.GetEditorType();
wxArrayString choices = dialog.GetChoices();
wxString descr = dialog.GetPropertyDescription();
if (name != oldName && sel->GetProperties().FindProperty(name))
{
wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
@@ -813,7 +809,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
if (descr != oldDescription)
property->SetDescription(descr);
editor->ShowItem(sel);
OnChangeFilename();
}
@@ -917,12 +913,12 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Setup File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
@@ -936,7 +932,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
}
stream << setupStr;
}
}
}
void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
@@ -949,12 +945,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
if (path.IsEmpty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Configure Command File As"),
path, filename ,
wildcard, wxSAVE|wxOVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
@@ -968,7 +964,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
}
stream << configureStr;
}
}
}
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)

View File

@@ -33,9 +33,9 @@ class ctConfigToolView: public wxView
{
DECLARE_DYNAMIC_CLASS(ctConfigToolView)
public:
ctConfigToolView();
~ctConfigToolView() {};
ctConfigToolView(){};
~ctConfigToolView(){};
//// Overrides
bool OnCreate(wxDocument *doc, long flags);
@@ -248,7 +248,7 @@ public:
// constructors and destructors
ctFindReplaceDialog( wxWindow* parent, const wxString& title,
long style = 0 );
void OnFind(wxFindDialogEvent& event);
void OnClose(wxFindDialogEvent& event);

View File

@@ -119,7 +119,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str)
bool bResult = ParseHtml(m_topLevel);
wxASSERT(bResult); // Failed to parse the TAGs.
wxASSERT(bResult); // Failed to parse the TAGs.
// Hint: Check if every open tag has a close tag!
return bResult;
@@ -164,7 +164,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
}
else
parent->AppendTag(tag);
}
}
}
else if (IsTagStartBracket(GetChar(m_pos)))
{
@@ -189,7 +189,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
if(parent->GetParent())
parent->GetParent()->AppendTag(tag);
else
parent->AppendTag(tag); // When this occurs it is probably the
parent->AppendTag(tag); // When this occurs it is probably the
// empty lines at the end of the file...
}
}
@@ -201,7 +201,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text)
{
while (!Eof() && GetChar(m_pos) != wxT('<'))
{
text += GetChar(m_pos);
text += (wxChar)GetChar(m_pos);
m_pos ++;
}
DecodeSpecialChars(text);
@@ -441,7 +441,7 @@ bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt)
while (!Eof(pos) && !IsWhitespace(GetChar(pos)) && !IsTagEndBracket(GetChar(pos)) && GetChar(pos) != wxT('='))
{
str += GetChar(pos);
str += (wxChar)GetChar(pos);
pos ++;
}
if (eatIt)
@@ -524,7 +524,7 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
// See here for the used table: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsql/ac_xml1_1nqk.asp
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
{
// XML translation
// XML translation
value.Replace(wxT("&gt;"), wxT(">"), true);
value.Replace(wxT("&lt;"), wxT("<"), true);
value.Replace(wxT("&quot;"), wxT("\""), true);
@@ -536,13 +536,13 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
{
wxString newvalue = value;
// XML translation
// XML translation
newvalue.Replace(wxT("&"), wxT("&amp;"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT("&gt;"), true);
newvalue.Replace(wxT("<"), wxT("&lt;"), true);
newvalue.Replace(wxT("\""),wxT("&quot;"), true);
newvalue.Replace(wxT("'"), wxT("&apos;"), true);
return newvalue;
}
@@ -695,7 +695,7 @@ void wxSimpleHtmlTag::RemoveChild(wxSimpleHtmlTag *remove)
{
child->m_next = NULL;
delete child;
if (prev != NULL)
prev->m_next = next;
else
@@ -721,7 +721,7 @@ void wxSimpleHtmlTag::AppendTag(wxSimpleHtmlTag* tag)
while (last->m_next)
last = last->m_next;
last->m_next = tag;
last->m_next = tag;
}
else
{
@@ -823,7 +823,7 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam
return false;
}
// Search forward from this tag until we find a tag with this name & attribute
// Search forward from this tag until we find a tag with this name & attribute
wxSimpleHtmlTag* wxSimpleHtmlTag::FindTag(const wxString& tagName, const wxString& attrName)
{
wxSimpleHtmlTag* tag = m_next;
@@ -902,10 +902,10 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream)
attr->Write(stream);
if (i < GetAttributeCount() - 1)
stream << wxT(" ");
}
}
if(!m_children)
{
sbUseTab = false; // We're putting the open a close tag on the same line,
sbUseTab = false; // We're putting the open a close tag on the same line,
// so we don't wan't any tabs
stream << wxT(">");
}

View File

@@ -192,11 +192,11 @@ void ctMainFrame::OnCloseWindow(wxCloseEvent& event)
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MINIMIZED ;
else
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_NORMAL ;
// Must delete this now since the DLL loading library will be
// uninitialised by the time the app object is deleted
wxGetApp().ClearHelpControllers();
if (!IsMaximized() && !IsIconized())
{
wxGetApp().GetSettings().m_frameSize = GetRect();
@@ -279,9 +279,9 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
{
// Make a menubar
wxMenu *fileMenu = new wxMenu;
wxGetApp().GetFileHistory().UseMenu(fileMenu);
fileMenu->Append(wxID_NEW, wxT("&New...\tCtrl+N"), wxT("Create a new settings document"));
fileMenu->Append(wxID_OPEN, wxT("&Open...\tCtrl+O"), wxT("Open a settings document"));
fileMenu->Append(wxID_CLOSE, wxT("&Close\tCtrl+W"), wxT("Close the current settings document"));
@@ -297,7 +297,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
wxMenu *editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
@@ -349,9 +349,9 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
helpMenu->Append(wxID_HELP_CONTEXT, wxT("&What's this?"), wxT("Show help on the clicked item"));
helpMenu->AppendSeparator();
helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("Show details about this application"));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(editMenu, wxT("&Edit"));
menuBar->Append(viewMenu, wxT("&View"));
@@ -361,7 +361,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("wxWidgets"));
config.SetPath(wxT("FileHistory/"));
wxGetApp().GetDocManager()->FileHistoryLoad(config);
}
}
return menuBar;
}
@@ -438,10 +438,6 @@ ctOutputWindow::ctOutputWindow(wxWindow* parent, wxWindowID id,
CreateWindows();
}
ctOutputWindow::~ctOutputWindow()
{
}
/// Initialise the windows.
void ctOutputWindow::CreateWindows()
{
@@ -492,13 +488,13 @@ void ctOutputWindow::OnCopyToClipboard(wxCommandEvent& WXUNUSED(event))
wxMessageBox(_("Sorry, could not open the clipboard."), _("Clipboard problem"), wxICON_EXCLAMATION|wxOK);
return;
}
wxString value(m_codeCtrl->GetValue());
#ifdef __WXMSW__
value.Replace(_T("\n"), _T("\r\n"));
#endif
wxTextDataObject *data = new wxTextDataObject( value );
if (!wxTheClipboard->SetData( data ))
{
wxTheClipboard->Close();

View File

@@ -41,7 +41,7 @@ class ctConfigurationBrowserWindow;
class ctMainFrame: public wxDocParentFrame
{
DECLARE_CLASS(ctMainFrame)
public:
public:
/// Constructor.
ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
@@ -124,7 +124,7 @@ class ctMainFrame: public wxDocParentFrame
/// Returns the configure page window
ctOutputWindow* GetConfigurePage() const { return m_configurePage; }
/// Returns the main notebook containing editor and text tabs
/// Returns the main notebook containing editor and text tabs
wxNotebook* GetMainNotebook() const { return m_mainNotebook; }
/// Sets the find dialog for future closing
@@ -178,7 +178,7 @@ DECLARE_CLASS(ctOutputWindow)
public:
ctOutputWindow(wxWindow* parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
~ctOutputWindow();
~ctOutputWindow(){};
/// Initialise the windows.
void CreateWindows();

View File

@@ -65,10 +65,6 @@ ctPropertyEditor::ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoin
CreateControls(this);
}
ctPropertyEditor::~ctPropertyEditor()
{
}
void ctPropertyEditor::CreateControls(wxWindow* parent)
{
m_elementTitleTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY);

View File

@@ -35,7 +35,7 @@ class ctPropertyEditor: public wxPanel
DECLARE_CLASS(ctPropertyEditor)
public:
ctPropertyEditor(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style);
~ctPropertyEditor();
~ctPropertyEditor(){};
// Event handlers
@@ -216,7 +216,7 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
bool AddControls(wxWindow* parent, const wxString& msg);
wxString GetText() const { return m_text; }
@@ -231,7 +231,7 @@ private:
* Special-purpose splitter window for changing sash look and
* also saving sash width
*/
class ctSplitterWindow: public wxSplitterWindow
{
public:

View File

@@ -82,9 +82,9 @@ wxString apColourToHexString(const wxColour& col)
// Convert 6-digit hex string to a colour
wxColour apHexStringToColour(const wxString& hex)
{
unsigned int r = wxHexToDec(hex.Mid(0, 2));
unsigned int g = wxHexToDec(hex.Mid(2, 2));
unsigned int b = wxHexToDec(hex.Mid(4, 2));
unsigned char r = (unsigned char)wxHexToDec(hex.Mid(0, 2));
unsigned char g = (unsigned char)wxHexToDec(hex.Mid(2, 2));
unsigned char b = (unsigned char)wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
@@ -132,7 +132,7 @@ wxFont apStringToFont(const wxString& str)
pointSize = 8;
if (pointSize == 9)
pointSize = 10;
#endif
#endif
}
else if (i == 1)
family = StringToInt(token);
@@ -230,7 +230,7 @@ wxString wxGetTempDir()
wxString envVar(wxGetenv(_T("TEMP")));
dir = envVar;
}
if ( dir.empty() )
{
// default
@@ -312,25 +312,25 @@ wxString apFindAppPath(const wxString& argv0, const wxString& cwd, const wxStrin
}
// Adds a context-sensitive help button, for non-Windows platforms
void apAddContextHelpButton(wxWindow*
void apAddContextHelpButton(wxWindow*
#if defined(__WXGTK__) || defined(__WXMAC__)
parent
#else
WXUNUSED(parent)
#endif
, wxSizer*
, wxSizer*
#if defined(__WXGTK__) || defined(__WXMAC__)
sizer
#else
WXUNUSED(sizer)
#endif
, int
, int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerFlags
#else
WXUNUSED(sizerFlags)
#endif
, int
, int
#if defined(__WXGTK__) || defined(__WXMAC__)
sizerBorder
#else
@@ -392,7 +392,7 @@ int wxIconInfo::GetIconId(int state, bool enabled) const
{
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
wxASSERT ( state < m_maxStates );
return m_states[state * 2 + (enabled ? 0 : 1)];
}
@@ -401,7 +401,7 @@ void wxIconInfo::SetIconId(int state, bool enabled, int iconId)
wxASSERT ( state < (wxMAX_ICON_STATES * 2) );
if (state+1 > m_maxStates)
m_maxStates = state+1;
m_states[state * 2 + (enabled ? 0 : 1)] = iconId;
}
@@ -426,7 +426,7 @@ void wxIconTable::AppendInfo(wxIconInfo* info)
bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, bool enabled)
{
wxASSERT (m_imageList != NULL);
wxIconInfo* info = FindInfo(name);
if (!info)
{

View File

@@ -57,27 +57,23 @@ ctApp::ctApp()
m_docManager = NULL;
}
ctApp::~ctApp()
{
}
bool ctApp::OnInit(void)
{
#if wxUSE_LOG
wxLog::SetTimestamp(NULL);
#endif // wxUSE_LOG
wxHelpProvider::Set(new wxSimpleHelpProvider);
#if wxUSE_LIBPNG
wxImage::AddHandler( new wxPNGHandler );
#endif
#if wxUSE_LIBJPEG
wxImage::AddHandler( new wxJPEGHandler );
#endif
#if wxUSE_GIF
wxImage::AddHandler( new wxGIFHandler );
#endif
@@ -124,13 +120,13 @@ bool ctApp::OnInit(void)
m_settings.Init();
LoadConfig();
wxString helpFilePathReference(GetFullAppPath(_("wx")));
m_helpControllerReference->Initialize(helpFilePathReference);
wxString helpFilePath(GetFullAppPath(_("configtool")));
m_helpController->Initialize(helpFilePath);
ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, wxID_ANY, wxGetApp().GetSettings().GetAppName(),
GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(),
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
@@ -194,16 +190,16 @@ bool ctApp::OnInit(void)
doc->SetDocumentSaved(true);
}
}
GetTopWindow()->Show(true);
return true;
}
int ctApp::OnExit(void)
{
SaveConfig();
// Save the file history
{
wxConfig config(wxGetApp().GetSettings().GetAppName(), wxT("Generic Organisation"));
@@ -212,7 +208,7 @@ int ctApp::OnExit(void)
delete m_docManager;
m_docManager = NULL;
return 0;
}
@@ -220,7 +216,7 @@ void ctApp::ClearHelpControllers()
{
delete m_helpController;
m_helpController = NULL;
delete m_helpControllerReference;
m_helpControllerReference = NULL;
}
@@ -233,7 +229,7 @@ wxString ctApp::GetFullAppPath(const wxString& filename) const
if (path.Last() != wxFILE_SEP_PATH && filename[0] != wxFILE_SEP_PATH)
path += wxFILE_SEP_PATH;
path += filename;
return path;
}

View File

@@ -43,7 +43,7 @@ public:
ctApp();
/// Destructor.
~ctApp();
~ctApp(){};
// Accessors