mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 00:29:41 +02:00
Fix errors
This commit is contained in:
parent
592f8408c7
commit
d3a308ff2b
@ -1985,7 +1985,7 @@ bool AudioIO::StartPortMidiStream()
|
||||
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
|
||||
if (!info) continue;
|
||||
if (!info->output) continue;
|
||||
wxString interf = wxSafeConvertMB2WX((info->interf);
|
||||
wxString interf = wxSafeConvertMB2WX(info->interf);
|
||||
wxString name = wxSafeConvertMB2WX(info->name);
|
||||
interf.Append(wxT(": ")).Append(name);
|
||||
if (wxStrcmp(interf, playbackDeviceName) == 0) {
|
||||
|
@ -587,7 +587,7 @@ void AutoSaveFile::CheckSpace(wxMemoryOutputStream & os)
|
||||
size_t origPos = buf->GetIntPosition();
|
||||
char *temp = new char[mAllocSize];
|
||||
buf->Write(temp, mAllocSize);
|
||||
delete temp;
|
||||
delete[] temp;
|
||||
buf->SetIntPosition(origPos);
|
||||
}
|
||||
}
|
||||
@ -644,33 +644,33 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
// Close the file so we can reopen it in read/write mode
|
||||
file.Close();
|
||||
|
||||
// Add </project> tag, if necessary
|
||||
// Add </project> tag, if necessary
|
||||
if (!file.Open(fn.GetFullPath(), wxT("r+b")))
|
||||
{
|
||||
// Really shouldn't happen, but let the caller deal with it
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read the last 16 bytes of the file and check if they contain
|
||||
// "</project>" somewhere.
|
||||
const int bufsize = 16;
|
||||
char buf[bufsize + 1];
|
||||
if (file.SeekEnd(-bufsize) != wxInvalidOffset)
|
||||
{
|
||||
if (file.Read(buf, bufsize) == bufsize)
|
||||
{
|
||||
buf[bufsize] = 0;
|
||||
if (strstr(buf, "</project>") == 0)
|
||||
{
|
||||
// End of file does not contain closing </project> tag, so add it
|
||||
if (file.Seek(0, wxFromEnd) != wxInvalidOffset)
|
||||
{
|
||||
strcpy(buf, "</project>\n");
|
||||
file.Write(buf, strlen(buf));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
// Really shouldn't happen, but let the caller deal with it
|
||||
return false;
|
||||
}
|
||||
|
||||
// Read the last 16 bytes of the file and check if they contain
|
||||
// "</project>" somewhere.
|
||||
const int bufsize = 16;
|
||||
char buf[bufsize + 1];
|
||||
if (file.SeekEnd(-bufsize) != wxInvalidOffset)
|
||||
{
|
||||
if (file.Read(buf, bufsize) == bufsize)
|
||||
{
|
||||
buf[bufsize] = 0;
|
||||
if (strstr(buf, "</project>") == 0)
|
||||
{
|
||||
// End of file does not contain closing </project> tag, so add it
|
||||
if (file.Seek(0, wxFromEnd) != wxInvalidOffset)
|
||||
{
|
||||
strcpy(buf, "</project>\n");
|
||||
file.Write(buf, strlen(buf));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file.Close();
|
||||
|
||||
@ -682,7 +682,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
|
||||
if (file.Read(buf, len) != len)
|
||||
{
|
||||
delete buf;
|
||||
delete[] buf;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -698,7 +698,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
out.Open(tempName, wxT("wb"));
|
||||
if (!out.IsOpened())
|
||||
{
|
||||
delete buf;
|
||||
delete[] buf;
|
||||
|
||||
wxRemoveFile(tempName);
|
||||
|
||||
@ -737,7 +737,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
in.Read(name, len);
|
||||
|
||||
mIds[id] = wxString(name, len / sizeof(wxChar));
|
||||
delete name;
|
||||
delete[] name;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -767,7 +767,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
in.Read(val, len);
|
||||
|
||||
out.WriteAttr(mIds[id], wxString(val, len / sizeof(wxChar)));
|
||||
delete val;
|
||||
delete[] val;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -861,7 +861,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
in.Read(val, len);
|
||||
|
||||
out.WriteData(wxString(val, len / sizeof(wxChar)));
|
||||
delete val;
|
||||
delete[] val;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -874,7 +874,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
in.Read(val, len);
|
||||
|
||||
out.Write(wxString(val, len / sizeof(wxChar)));
|
||||
delete val;
|
||||
delete[] val;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -884,7 +884,7 @@ bool AutoSaveFile::Decode(const wxString & fileName)
|
||||
}
|
||||
}
|
||||
|
||||
delete buf;
|
||||
delete[] buf;
|
||||
|
||||
bool error = out.Error();
|
||||
|
||||
|
@ -1113,7 +1113,7 @@ void ToolBarArea::OnSize(wxSizeEvent & WXUNUSED(event))
|
||||
|
||||
wxSize currentSize = GetClientSize();
|
||||
|
||||
if (abs(currentSize.x - mLastLayoutSize.x >= 100)) {
|
||||
if (abs(currentSize.x - mLastLayoutSize.x) >= 100) {
|
||||
// If they resize by more than 100 pixels (horizontally),
|
||||
// we totally redo the layout, preserving the order of the
|
||||
// toolbars but not the exact position.
|
||||
|
Loading…
x
Reference in New Issue
Block a user