1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-04 15:50:10 +01:00

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.
This commit is contained in:
james.k.crook@gmail.com
2014-11-08 16:42:34 +00:00
parent a9a0d576cc
commit 8a9987a0d9
71 changed files with 3565 additions and 3563 deletions

View File

@@ -1417,7 +1417,7 @@ int DirManager::ProjectFSCK(const bool bForceError, const bool bAutoRecoverMode)
{
wxString msgA =
_("Project check of \"%s\" folder \
\ndetected %d missing external audio file(s) \
\ndetected %lld missing external audio file(s) \
\n('aliased files'). There is no way for Audacity \
\nto recover these files automatically. \
\n\nIf you choose the first or second option below, \
@@ -1429,7 +1429,7 @@ _("Project check of \"%s\" folder \
\nproject in its current state, unless you \"Close \
\nproject immediately\" on further error alerts.");
wxString msg;
msg.Printf(msgA, this->projName.c_str(), missingAliasedFilePathHash.size());
msg.Printf(msgA, this->projName.c_str(), (long long) missingAliasedFilePathHash.size());
const wxChar *buttons[] =
{_("Close project immediately with no changes"),
_("Treat missing audio as silence (this session only)"),
@@ -1487,11 +1487,11 @@ _("Project check of \"%s\" folder \
{
wxString msgA =
_("Project check of \"%s\" folder \
\ndetected %d missing alias (.auf) blockfile(s). \
\ndetected %lld missing alias (.auf) blockfile(s). \
\nAudacity can fully regenerate these files \
\nfrom the current audio in the project.");
wxString msg;
msg.Printf(msgA, this->projName.c_str(), missingAUFHash.size());
msg.Printf(msgA, this->projName.c_str(), (long long) missingAUFHash.size());
const wxChar *buttons[] = {_("Regenerate alias summary files (safe and recommended)"),
_("Fill in silence for missing display data (this session only)"),
_("Close project immediately with no further changes"),
@@ -1538,7 +1538,7 @@ _("Project check of \"%s\" folder \
{
wxString msgA =
_("Project check of \"%s\" folder \
\ndetected %d missing audio data (.au) blockfile(s), \
\ndetected %lld missing audio data (.au) blockfile(s), \
\nprobably due to a bug, system crash, or accidental \
\ndeletion. There is no way for Audacity to recover \
\nthese missing files automatically. \
@@ -1548,7 +1548,7 @@ _("Project check of \"%s\" folder \
\n\nNote that for the second option, the waveform \
\nmay not show silence.");
wxString msg;
msg.Printf(msgA, this->projName.c_str(), missingAUHash.size());
msg.Printf(msgA, this->projName.c_str(), (long long) missingAUHash.size());
const wxChar *buttons[] =
{_("Close project immediately with no further changes"),
_("Treat missing audio as silence (this session only)"),