From 42c37decc53971441199dfe4d8adf7fb842b2336 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 22 Aug 2003 10:00:25 +0000 Subject: [PATCH] more Unicode fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/samples/ogl/studio/cspalette.cpp | 2 +- contrib/samples/ogl/studio/csprint.cpp | 4 ++-- contrib/src/mmedia/cdwin.cpp | 12 ++++++------ contrib/src/mmedia/sndaiff.cpp | 4 ++-- contrib/src/mmedia/sndmsad.cpp | 4 ++-- contrib/src/mmedia/sndwav.cpp | 20 ++++++++++---------- contrib/src/mmedia/sndwin.cpp | 8 +++----- contrib/src/mmedia/vidbase.cpp | 4 ++-- contrib/src/mmedia/vidwin.cpp | 17 ++++++++--------- 9 files changed, 36 insertions(+), 39 deletions(-) diff --git a/contrib/samples/ogl/studio/cspalette.cpp b/contrib/samples/ogl/studio/cspalette.cpp index d05f1b46ec..23a238dc2a 100644 --- a/contrib/samples/ogl/studio/cspalette.cpp +++ b/contrib/samples/ogl/studio/cspalette.cpp @@ -133,7 +133,7 @@ bool csApp::CreatePalette(wxFrame *parent) palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, _T("Pointer")); palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, TRUE, 0, -1, NULL, _T("Text")); - char** symbols = new char*[20]; + wxChar** symbols = new wxChar*[20]; int noSymbols = 0; symbols[noSymbols] = _T("Wide Rectangle"); diff --git a/contrib/samples/ogl/studio/csprint.cpp b/contrib/samples/ogl/studio/csprint.cpp index d734476643..bf058de632 100644 --- a/contrib/samples/ogl/studio/csprint.cpp +++ b/contrib/samples/ogl/studio/csprint.cpp @@ -190,8 +190,8 @@ bool wxDiagramClipboard::CopyToClipboard(double scale) { delete newBitmap; - char buf[200]; - sprintf(buf, "Sorry, could not allocate clipboard bitmap (%dx%d)", (maxX+10), (maxY+10)); + wxChar buf[200]; + wxSprintf(buf, _T("Sorry, could not allocate clipboard bitmap (%dx%d)"), (maxX+10), (maxY+10)); wxMessageBox(buf, _T("Clipboard copy problem")); return FALSE; } diff --git a/contrib/src/mmedia/cdwin.cpp b/contrib/src/mmedia/cdwin.cpp index 6d3d7af530..3360732204 100644 --- a/contrib/src/mmedia/cdwin.cpp +++ b/contrib/src/mmedia/cdwin.cpp @@ -53,7 +53,7 @@ wxCDAudioWin::wxCDAudioWin(void) DWORD ret; m_internal = new CDAW_Internal; - open_struct.lpstrDeviceType = "cdaudio"; + open_struct.lpstrDeviceType = _T("cdaudio"); ret = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE, (DWORD)&open_struct); if (ret) { @@ -89,13 +89,13 @@ void wxCDAudioWin::PrepareToc(void) MCI_STATUS_PARMS status_struct; wxUint16 i, nb_m_trksize; wxCDtime total_time, *trk; - DWORD ret, tmem; + DWORD tmem; if (!m_ok) return; status_struct.dwItem = MCI_STATUS_NUMBER_OF_TRACKS; - ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, + mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)&status_struct); nb_m_trksize = status_struct.dwReturn; @@ -103,7 +103,7 @@ void wxCDAudioWin::PrepareToc(void) m_trkpos = new wxCDtime[nb_m_trksize+1]; status_struct.dwItem = MCI_STATUS_LENGTH; - ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, + mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)&status_struct); total_time.track = nb_m_trksize; tmem = status_struct.dwReturn; @@ -115,7 +115,7 @@ void wxCDAudioWin::PrepareToc(void) for (i=1;i<=nb_m_trksize;i++) { status_struct.dwItem = MCI_STATUS_POSITION; status_struct.dwTrack = i; - ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, + mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK, (DWORD)(LPVOID)&status_struct); tmem = status_struct.dwReturn; @@ -129,7 +129,7 @@ void wxCDAudioWin::PrepareToc(void) status_struct.dwItem = MCI_STATUS_LENGTH; status_struct.dwTrack = i; - ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, + mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK, (DWORD)(LPVOID)&status_struct); tmem = status_struct.dwReturn; diff --git a/contrib/src/mmedia/sndaiff.cpp b/contrib/src/mmedia/sndaiff.cpp index cca0b66add..c0427a7493 100644 --- a/contrib/src/mmedia/sndaiff.cpp +++ b/contrib/src/mmedia/sndaiff.cpp @@ -175,7 +175,7 @@ bool wxSoundAiff::PrepareToPlay() return TRUE; } -bool wxSoundAiff::PrepareToRecord(wxUint32 time) +bool wxSoundAiff::PrepareToRecord(wxUint32 WXUNUSED(time)) { // TODO return FALSE; @@ -187,7 +187,7 @@ bool wxSoundAiff::FinishRecording() return FALSE; } -bool wxSoundAiff::RepositionStream(wxUint32 position) +bool wxSoundAiff::RepositionStream(wxUint32 WXUNUSED(position)) { // If the stream is not seekable "TellI() returns wxInvalidOffset" we cannot reposition stream if (m_base_offset == wxInvalidOffset) diff --git a/contrib/src/mmedia/sndmsad.cpp b/contrib/src/mmedia/sndmsad.cpp index e120f4a223..3f627c63ed 100644 --- a/contrib/src/mmedia/sndmsad.cpp +++ b/contrib/src/mmedia/sndmsad.cpp @@ -66,7 +66,7 @@ wxUint16 wxSoundFormatMSAdpcm::GetChannels() const return m_nchannels; } -void wxSoundFormatMSAdpcm::SetCoefs(wxInt16 **coefs, wxUint16 ncoefs, +void wxSoundFormatMSAdpcm::SetCoefs(wxInt16 **WXUNUSED(coefs), wxUint16 ncoefs, wxUint16 coefs_len) { wxUint16 i; @@ -152,7 +152,7 @@ wxSoundStreamMSAdpcm::~wxSoundStreamMSAdpcm() delete m_router; } -wxSoundStream& wxSoundStreamMSAdpcm::Read(void *buffer, wxUint32 len) +wxSoundStream& wxSoundStreamMSAdpcm::Read(void *WXUNUSED(buffer), wxUint32 WXUNUSED(len)) { m_snderror = wxSOUND_NOCODEC; m_lastcount = 0; diff --git a/contrib/src/mmedia/sndwav.cpp b/contrib/src/mmedia/sndwav.cpp index a9712d8189..a32c2a20c4 100644 --- a/contrib/src/mmedia/sndwav.cpp +++ b/contrib/src/mmedia/sndwav.cpp @@ -98,10 +98,10 @@ bool wxSoundWave::CanRead() return TRUE; } -bool wxSoundWave::HandleOutputPCM(wxDataInputStream& data, wxUint32 len, +bool wxSoundWave::HandleOutputPCM(wxDataInputStream& WXUNUSED(data), wxUint32 len, wxUint16 channels, - wxUint32 sample_fq, wxUint32 byte_p_sec, - wxUint16 byte_p_spl, wxUint16 bits_p_spl) + wxUint32 sample_fq, wxUint32 WXUNUSED(byte_p_sec), + wxUint16 WXUNUSED(byte_p_spl), wxUint16 bits_p_spl) { wxSoundFormatPcm sndformat; @@ -121,8 +121,8 @@ bool wxSoundWave::HandleOutputPCM(wxDataInputStream& data, wxUint32 len, bool wxSoundWave::HandleOutputMSADPCM(wxDataInputStream& data, wxUint32 len, wxUint16 channels, - wxUint32 sample_fq, wxUint32 byte_p_sec, - wxUint16 byte_p_spl, wxUint16 bits_p_spl) + wxUint32 sample_fq, wxUint32 WXUNUSED(byte_p_sec), + wxUint16 WXUNUSED(byte_p_spl), wxUint16 WXUNUSED(bits_p_spl)) { wxSoundFormatMSAdpcm sndformat; wxInt16 *coefs[2]; @@ -159,10 +159,10 @@ bool wxSoundWave::HandleOutputMSADPCM(wxDataInputStream& data, wxUint32 len, return TRUE; } -bool wxSoundWave::HandleOutputG721(wxDataInputStream& data, wxUint32 len, - wxUint16 channels, - wxUint32 sample_fq, wxUint32 byte_p_sec, - wxUint16 byte_p_spl, wxUint16 bits_p_spl) +bool wxSoundWave::HandleOutputG721(wxDataInputStream& WXUNUSED(data), wxUint32 len, + wxUint16 WXUNUSED(channels), + wxUint32 sample_fq, wxUint32 WXUNUSED(byte_p_sec), + wxUint16 WXUNUSED(byte_p_spl), wxUint16 WXUNUSED(bits_p_spl)) { wxSoundFormatG72X sndformat; @@ -402,7 +402,7 @@ bool wxSoundWave::FinishRecording() return TRUE; } -bool wxSoundWave::RepositionStream(wxUint32 position) +bool wxSoundWave::RepositionStream(wxUint32 WXUNUSED(position)) { if (m_base_offset == wxInvalidOffset) return FALSE; diff --git a/contrib/src/mmedia/sndwin.cpp b/contrib/src/mmedia/sndwin.cpp index 467b53db9e..78ad0292b0 100644 --- a/contrib/src/mmedia/sndwin.cpp +++ b/contrib/src/mmedia/sndwin.cpp @@ -124,7 +124,7 @@ wxSoundStreamWin::~wxSoundStreamWin() LRESULT APIENTRY _EXPORT _wxSoundHandlerWndProc(HWND hWnd, UINT message, - WPARAM wParam, LPARAM lParam) + WPARAM wParam, LPARAM WXUNUSED(lParam)) { wxSoundStreamWin *sndwin; @@ -154,15 +154,13 @@ void wxSoundStreamWin::CreateSndWindow() { FARPROC proc = MakeProcInstance((FARPROC)_wxSoundHandlerWndProc, wxGetInstance()); - int error; - // NB: class name must be kept in sync with wxCanvasClassName in // src/msw/app.cpp! m_internal->m_sndWin = ::CreateWindow(wxT("wxWindowClass"), NULL, 0, 0, 0, 0, 0, NULL, (HMENU) NULL, wxGetInstance(), NULL); - error = GetLastError(); + GetLastError(); ::SetWindowLong(m_internal->m_sndWin, GWL_WNDPROC, (LONG)proc); @@ -661,7 +659,7 @@ wxSoundStream& wxSoundStreamWin::Read(void *buffer, wxUint32 len) // fragment finished. It reinitializes the parameters of the fragment and // sends an event to the clients. // ------------------------------------------------------------------------- -void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 dev_handle, int flag) +void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 WXUNUSED(dev_handle), int flag) { wxSoundInfoHeader *info; diff --git a/contrib/src/mmedia/vidbase.cpp b/contrib/src/mmedia/vidbase.cpp index dde026ab7d..a0fc70cb1e 100644 --- a/contrib/src/mmedia/vidbase.cpp +++ b/contrib/src/mmedia/vidbase.cpp @@ -33,12 +33,12 @@ wxVideoBaseDriver::wxVideoBaseDriver() m_video_output = NULL; } -wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str) +wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& WXUNUSED(str)) { m_video_output = NULL; } -wxVideoBaseDriver::wxVideoBaseDriver(const wxString& filename) +wxVideoBaseDriver::wxVideoBaseDriver(const wxString& WXUNUSED(filename)) { m_video_output = NULL; } diff --git a/contrib/src/mmedia/vidwin.cpp b/contrib/src/mmedia/vidwin.cpp index 14ab5558c4..1d9bf5c7c1 100644 --- a/contrib/src/mmedia/vidwin.cpp +++ b/contrib/src/mmedia/vidwin.cpp @@ -48,7 +48,7 @@ wxVideoWindows::wxVideoWindows(wxInputStream& str) { m_internal = new wxVIDWinternal; m_remove_file = TRUE; - m_filename = wxGetTempFileName("wxvid"); + m_filename = wxGetTempFileName(_T("wxvid")); m_paused = FALSE; m_stopped = TRUE; m_frameRate = 1.0; @@ -84,13 +84,12 @@ void wxVideoWindows::OpenFile() MCI_DGV_OPEN_PARMS openStruct; MCI_DGV_SET_PARMS setStruct; MCI_STATUS_PARMS statusStruct; - DWORD ret; - openStruct.lpstrDeviceType = "avivideo"; - openStruct.lpstrElementName = (LPSTR)(m_filename.mb_str()); + openStruct.lpstrDeviceType = _T("avivideo"); + openStruct.lpstrElementName = (wxChar *)m_filename.mb_str().data(); openStruct.hWndParent = 0; - ret = mciSendCommand(0, MCI_OPEN, + mciSendCommand(0, MCI_OPEN, MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_OPEN_TYPE|MCI_DGV_OPEN_32BIT, (DWORD)(LPVOID)&openStruct); m_internal->m_dev_id = openStruct.wDeviceID; @@ -99,20 +98,20 @@ void wxVideoWindows::OpenFile() setStruct.dwCallback = 0; setStruct.dwTimeFormat = MCI_FORMAT_FRAMES; - ret = mciSendCommand(m_internal->m_dev_id, MCI_SET, MCI_SET_TIME_FORMAT, + mciSendCommand(m_internal->m_dev_id, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID)&setStruct); statusStruct.dwCallback = 0; statusStruct.dwItem = MCI_DGV_STATUS_FRAME_RATE; - ret = mciSendCommand(m_internal->m_dev_id, MCI_STATUS, + mciSendCommand(m_internal->m_dev_id, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)(LPVOID)&statusStruct); m_frameRate = ((double)statusStruct.dwReturn) / 1000; statusStruct.dwItem = MCI_DGV_STATUS_BITSPERSAMPLE; - ret = mciSendCommand(m_internal->m_dev_id, MCI_STATUS, MCI_STATUS_ITEM, + mciSendCommand(m_internal->m_dev_id, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)(LPVOID)&statusStruct); m_bps = statusStruct.dwReturn; @@ -151,7 +150,7 @@ bool wxVideoWindows::GetSize(wxSize& size) const return TRUE; } -bool wxVideoWindows::SetSize(wxSize size) +bool wxVideoWindows::SetSize(wxSize WXUNUSED(size)) { return TRUE; } -- 2.45.2