1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-14 23:30:23 +02:00

39 Commits

Author SHA1 Message Date
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
v.audacity
2def1e7f51 bug 195 - fixed 2010-08-03 01:46:37 +00:00
v.audacity
3729f067be more progress on bug 113
better handling of error conditions in all BuildFromXML methods, per comment: 

// BuildFromXML methods should always return a BlockFile, not NULL,  
// even if the result is flawed (e.g., refers to nonexistent file), 
// as testing will be done in DirManager::ProjectFSCK().
2010-07-30 03:04:37 +00:00
v.audacity
7501b9a865 minor changes on brief code review 2010-07-06 21:39:08 +00:00
ra
e74978ba77 Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches 2010-01-23 19:44:49 +00:00