Commit Graph

54 Commits

Author SHA1 Message Date
Paul Licameli 6c57948d8f Remove unnecessary #include-s from .cpp files...
... Unnecessary because transitively included.

But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
2019-05-16 17:21:00 -04:00
Paul Licameli f6adeed47b Remove some unnecessary #include directives 2019-05-15 14:14:18 -04:00
Paul Licameli c68e336247 More use of std:: style members of wxString...
... replacing:

Length => length
Len => length
2019-03-10 14:44:54 -04:00
James Crook b60fae4470 Fix some warnings on mac
These are mostly missing 'overrides'
2018-04-07 20:28:27 +01:00
James Crook f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
Paul Licameli 55439247ad All the catches are in place for BlockFile and other errors, now throw. 2017-04-03 23:32:40 -04:00
Paul Licameli 98d1468a01 BlockFile::ReadData overrides: on failure, pad with 0s or throw...
... as the mayThrow argument directs.
2017-03-21 14:19:03 -04:00
Paul Licameli 7159966eb4 Comment that cache-filling should be no-fail (we don't use it anyway) 2017-03-21 14:11:26 -04:00
Paul Licameli 2677796b0c Zero and return false for all failures to read block file summary...
... Though in the only place where these summaries are used, which is
Sequence::GetWaveDisplay, we ignore the correctly reported error code anyway.

Also RAII in management of relevant memory buffers and mutexes.
2017-03-20 17:49:03 -04:00
Paul Licameli b81cdee7e3 Comment where xml writing functions may throw 2017-03-18 11:45:05 -04:00
Paul Licameli e6db1a57a3 Remove naked new[] in: blockfile and commands 2017-03-17 17:52:46 -04:00
Paul Licameli aebaaf46a0 require unsigned arguments for Array(s)Of::reinit 2017-03-17 17:52:43 -04:00
Paul Licameli a4a9df5c03 One function for the common parts of BlockFile::ReadData overrides 2017-03-17 17:52:27 -04:00
Paul Licameli ad04187a41 Change sampleCount arguments, variables, return values to size_t...
... whenever they really describe the size of a buffer that fits in memory, or
of a block file (which is never now more than a megabyte and so could be fit in
memory all at once), or a part thereof.
2016-09-15 21:03:17 -04:00
James Crook 65c7e8051a ThomasFeher - Unused parameters clean up. 2016-09-11 20:31:49 +01:00
Paul Licameli 2a2013cb4b More decltype and auto, mostly for loop index variables 2016-09-06 20:46:25 -04:00
Paul Licameli 919d77d176 More uses of min and max 2016-09-06 20:46:25 -04:00
Paul Licameli b093a8e406 SAMPLE_SIZE macro returns size_t 2016-09-06 12:39:58 -04:00
Paul Licameli c9bff2f0f4 BlockFile::GetSpaceUsage() returns an unsigned value 2016-09-06 12:39:57 -04:00
Paul Licameli 367ed1dfce Uniform init in blockfile ctors (prevents implicit narrowings) 2016-08-22 21:45:54 -04:00
Paul Licameli e7b4d935a5 Hide the use of new in factory functions for BlockFiles 2016-08-16 12:29:59 -04:00
Paul Licameli 2ede67be96 Use type alias for pointer to BlockFile, which is still a dumb pointer 2016-08-16 12:29:59 -04:00
James Crook 763485b0dc Add error check comments.
These are places where we don't properly handle error returns.
2016-07-10 21:40:48 +01:00
Paul Licameli b6fdffbab2 Don't copy wxFileName often, it's not lightweight! Use wxFileNameWrapper...
... which is a new class that defines moves.
2016-04-16 11:57:39 -04:00
Paul Licameli 61177a15ad More consistent mutual exclusion in calls to certain sf_ functions; ...
... also SFCall to simplify thread-safe calls, and SFFile for RAII of SNDFILE
objects.
2016-04-14 15:20:37 -04:00
Paul Licameli f94b3b3afa Add some const qualifiers to BlockFile methods 2016-04-10 21:05:20 -04:00
Paul Licameli 1108c1376c Fix possible memory leak in use of overrides of BlockFile::CalcSummary 2016-04-05 23:30:33 -04:00
Paul Licameli 0c9deb398c Fix mac build. No standard headers in Audacity.h. 2016-03-01 12:22:37 -05:00
Paul Licameli 60bcd7aea2 Fix warnings for unused variables and functions 2016-02-26 14:56:26 -05:00
Paul Licameli a8652c5e74 uses 2016-02-25 20:18:31 -05:00
Paul Licameli 7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
Paul Licameli 321d5259a2 More uses of SampleBuffer, eliminating explicit DeleteSamples calls 2016-02-01 10:16:00 -05:00
Leland Lucius 4db62ff68c Fix for bug #996 2015-06-02 18:27:37 -05:00
Leland Lucius cfddd5f069 Fix for bug #996 2015-05-31 19:22:06 -05:00
Leland Lucius 2457579091 Bug 765 - Delays using Edit commands and Draw Tool in long projects
A 4hr track used to take about 20s to cut a few samples. This is now significantly improved, to around 3s. Leland did this by

(a) moving the size calculation to when we examine the undo history, so it isn't slowing down the edits.
(b) in size calculation, using sizes that are cached rather than going to disk to find the sizes.
(c) writing the autosave file which is to an FFIle to a string first, i.e. using XMLStringWriter as a buffer for XMLFileWriter.

Step (c) may also make autosave marginally safer, as the risk of a partially updated autosave file is reduced.
2015-04-07 12:20:50 +01:00
james.k.crook@gmail.com 8a9987a0d9 From: martin@steghoefer.eu [PATCHES 02-15 of 15] Fix runtime problem with wxWidgets 3.0:
Correct string formatting for:
2/15  %d + enum => %d + int
3/15  %lld + int64_t => %lld + long long
4/15  %d + int64_t => %lld + long long
5/15  %d + double => %f + double
6/15  %d + int32_t => %d + int
7/15  %d + intptr_t => %p + void*
8/15  gint, guint
9/15  %d + long => %ld + long
10/15 %n + int => %d + int
11/15 %x + int => %x + unsigned int
12/15 %f + int => %d + int
13/15 %S + wxChar* => %s + wxChar*
14/15 %d + size_t => %d + int
15/15 %d + size_t => %lld + long long

"The functions wxString::Format, wxString::Printf (and others indirectly) have become stricter about parameter types that don't match (format specifier vs. function parameters). So the bugs (that were already present in audacity before) become visible in wx3.0 as error message dialogs. I've checked all occurrences of Printf, wxPrintf, PrintfV, Format, FormatV, wxLogDebug and wxLogError systematically and made the type match."

Note (9/15): In TrackPanel.cpp, ExportMP2.cpp and CompareAudioCommand.cpp this patch supersedes related change done in r13466 because the new solution requires fewer casts and therefore simplifies the code.

Note: Many .po files are affected, and we need to be very careful about this.  Incorrect "%d" and similar in translation files may lead to crashes in those languages (only).  This is something we should actually have been more careful about in the past.  We need to write a script to check that the "%d" and similar format specifiers match between English and translation.
2014-11-08 16:42:34 +00:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
martynshaw99 4ce2643d5f Remove the
// Indentation settings for Vim and Emacs
etc. lines from all files, as Campbell's patch (except for other changes to Languages.cpp)
2013-09-24 00:14:37 +00:00
james.k.crook@gmail.com a8944db4a6 Fix compilation (windows release build) header inclusion/order. 2013-04-07 16:48:09 +00:00
richardash1981 b95918fe52 apply parts of Campbell Bartons patch for cleaning up compiler warnings: add static qualifiers to methods, ensure prototypes match definitions and some whitespace and comment changes 2013-02-22 21:29:19 +00:00
martynshaw99 cdd2ccf594 Remove spurious windows.h includes. 2012-12-31 22:12:23 +00:00
v.audacity a42f5b45cb http://bugzilla.audacityteam.org/show_bug.cgi?id=545 (P2)
Remove crash-prone "Audio Cache" feature.
2012-07-18 01:18:59 +00:00
v.audacity 5f5b9778de Fixes per Vigilant Sentry (http://www.vigilantsw.com/)
* Fix memory leaks.

* Add comments about initializations and checking for successful results.

* Add checks for NULL deref.

* Consistency in "TODO" vs "TO-DO" comments!
2012-02-08 05:09:14 +00:00
v.audacity 4386504569 Martyn, good catch on commit r11461. I had gone back and forth between what you did and this commit, and messed up the edit. I like this one better because it doesn't duplicate the constant, and keeps all the wxLogDebug calls consistent -- less cognitive overhead. 2012-02-06 22:02:50 +00:00
martynshaw99 37eeb7628e Correct error trap - compare with what we are expecting. 2012-02-05 23:54:56 +00:00
v.audacity 9d5ddb52d5 Working on bug 437 (http://bugzilla.audacityteam.org/show_bug.cgi?id=437). Current architecture does not make it easy to alert user to this via dialog, but at least we now check for it and catch it in debug.
Removed some old debugging cruft.
2012-02-01 03:45:36 +00:00
v.audacity 939eab26ae Change "blockfile" to "block file" consistently in log and error dialogs. 2011-10-16 23:16:20 +00:00
v.audacity 04e23a0889 Define one constant, PLATFORM_MAX_PATH, for maximum path value, so we don't have to do platform-specific conditionals everywhere we want to check it. In fact, we were actually checking that only for Windows. This is follow-on to Richard's message on audacity-devel about "overflow vulns". 2011-01-06 03:09:21 +00:00
v.audacity 0332c60a2a Define one constant, PLATFORM_MAX_PATH, for maximum path value, so we don't have to do platform-specific conditionals everywhere we want to check it. In fact, we were actually checking that only for Windows. This is follow-on to Richard's message on audacity-devel about "overflow vulns".
Remove unnecessary declaration of MAX_PATH in BlockFile.h.
2011-01-06 00:07:59 +00:00
v.audacity 1c5ba68d55 (bug 137)
Make DirManager::MoveToNewProjectDirectory(), DirManager::CopyToNewProjectDirectory(), and several BuildFromXML() methods check the result of AssignFile() and do something appropriate about it on failure, rather than ignoring it. Also made AssignFile() check whether the assigned name is well-formed, so it doesn't always return TRUE when disckcheck is FALSE.

Briefer and more correct checks for uninitialized wxFileName objects.

Several "//ANSWER-ME" comments about file ops and commented-out cruft to probably remove.

Clarify some logic and readability.
2010-08-31 23:31:11 +00:00