From ceefc965f987990f561915bba9eda19c6571918e Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 12 Nov 2004 14:23:02 +0000 Subject: [PATCH] Warning fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/zipstrm.h | 12 +++++------ samples/mediaplayer/mediaplayer.cpp | 32 ++++++++++++++--------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/include/wx/zipstrm.h b/include/wx/zipstrm.h index 7b83d0bc0b..1ecc46718d 100644 --- a/include/wx/zipstrm.h +++ b/include/wx/zipstrm.h @@ -164,7 +164,7 @@ public: // set accessors void SetDateTime(const wxDateTime& dt) { m_DateTime = dt; } void SetSize(wxFileOffset size) { m_Size = size; } - void SetMethod(int method) { m_Method = method; } + void SetMethod(int method) { m_Method = (wxUint16)method; } void SetComment(const wxString& comment) { m_Comment = comment; } void SetExternalAttributes(wxUint32 attr ) { m_ExternalAttributes = attr; } void SetSystemMadeBy(int system); @@ -200,15 +200,15 @@ protected: int GetDiskStart() const { return m_DiskStart; } int GetInternalAttributes() const { return m_InternalAttributes; } - void SetVersionNeeded(int version) { m_VersionNeeded = version; } + void SetVersionNeeded(int version) { m_VersionNeeded = (wxUint16)version; } void SetOffset(wxFileOffset offset) { m_Offset = offset; } - void SetFlags(int flags) { m_Flags = flags; } - void SetVersionMadeBy(int version) { m_VersionMadeBy = version; } + void SetFlags(int flags) { m_Flags = (wxUint16)flags; } + void SetVersionMadeBy(int version) { m_VersionMadeBy = (wxUint8)version; } void SetCrc(wxUint32 crc) { m_Crc = crc; } void SetCompressedSize(wxFileOffset size) { m_CompressedSize = size; } void SetKey(wxFileOffset offset) { m_Key = offset; } - void SetDiskStart(int start) { m_DiskStart = start; } - void SetInternalAttributes(int attr) { m_InternalAttributes = attr; } + void SetDiskStart(int start) { m_DiskStart = (wxUint16)start; } + void SetInternalAttributes(int attr) { m_InternalAttributes = (wxUint16)attr; } virtual wxZipEntry *ZipClone() const { return new wxZipEntry(*this); } diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index 8a4756a222..b8ca9a9f3e 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -102,13 +102,13 @@ private: // void MyFrame::ResetStatus() { - m_basestatus = wxString::Format(_T("Size(x,y):%i,%i Length(Seconds):%u Speed:%1.1fx"), - m_mediactrl->GetBestSize().x, - m_mediactrl->GetBestSize().y, - m_mediactrl->GetDuration() / 1000, + m_basestatus = wxString::Format(_T("Size(x,y):%i,%i Length(Seconds):%u Speed:%1.1fx"), + m_mediactrl->GetBestSize().x, + m_mediactrl->GetBestSize().y, + (unsigned)(m_mediactrl->GetDuration() / 1000), m_mediactrl->GetPlaybackRate() ); - + m_slider->SetRange(0, m_mediactrl->GetDuration() / 1000); } @@ -147,15 +147,13 @@ public: { long lPosition = m_frame->m_mediactrl->GetPosition() / 1000; m_frame->m_slider->SetValue(lPosition); - m_frame->SetStatusText(wxString::Format(_T("%s Pos:%u State:%s"), - m_frame->m_basestatus.c_str(), - lPosition, + m_frame->m_basestatus.c_str(), + (unsigned int)lPosition, wxGetMediaStateText(m_frame->m_mediactrl->GetState()) ) ); - } MyFrame* m_frame; @@ -268,7 +266,7 @@ MyFrame::MyFrame(const wxString& title) // Create and attach the first/main sizer // - m_sizer = new wxBoxSizer(wxVERTICAL); + m_sizer = new wxBoxSizer(wxVERTICAL); this->SetSizer(m_sizer); this->SetAutoLayout(true); @@ -284,16 +282,16 @@ MyFrame::MyFrame(const wxString& title) // m_slider = new wxSlider(this, Minimal_Slider, 0, //init - 0, //start - 0, //end - wxDefaultPosition, wxDefaultSize, + 0, //start + 0, //end + wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL ); m_sizer->Add(m_slider, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND , 5); // // Create the second sizer which will position things - // vertically - + // vertically - // // -------Menu---------- // [m_mediactrl] @@ -392,8 +390,8 @@ void MyFrame::OnOpenFile(wxCommandEvent& WXUNUSED(event)) wxMessageBox(wxT("Couldn't load file!")); if( !m_mediactrl->Play() ) - wxMessageBox(wxT("Couldn't play movie!")); - + wxMessageBox(wxT("Couldn't play movie!")); + ResetStatus(); } } @@ -463,4 +461,4 @@ void MyFrame::OnMediaFinished(wxMediaEvent& WXUNUSED(event)) if ( !m_mediactrl->Play() ) wxMessageBox(wxT("Couldn't loop movie!")); } -} \ No newline at end of file +} -- 2.45.2