mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 06:05:43 +01:00
Fix unnecessary const violation.
This commit is contained in:
parent
e77e7f1f3d
commit
933e9c2919
2 changed files with 10 additions and 6 deletions
|
|
@ -10,13 +10,14 @@
|
|||
std::string PBD::LocaleGuard::current;
|
||||
|
||||
PBD::LocaleGuard::LocaleGuard (const char* str)
|
||||
: old(0)
|
||||
: old(0)
|
||||
{
|
||||
if (current != str) {
|
||||
old = strdup (setlocale (LC_NUMERIC, NULL));
|
||||
if (strcmp (old, str)) {
|
||||
if (setlocale (LC_NUMERIC, str))
|
||||
current = str;
|
||||
if (setlocale (LC_NUMERIC, str)) {
|
||||
current = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,10 +25,11 @@ PBD::LocaleGuard::LocaleGuard (const char* str)
|
|||
PBD::LocaleGuard::~LocaleGuard ()
|
||||
{
|
||||
if (old) {
|
||||
if (setlocale (LC_NUMERIC, old))
|
||||
if (setlocale (LC_NUMERIC, old)) {
|
||||
current = old;
|
||||
}
|
||||
|
||||
free ((char*)old);
|
||||
free (old);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@ namespace PBD {
|
|||
struct LIBPBD_API LocaleGuard {
|
||||
LocaleGuard (const char*);
|
||||
~LocaleGuard ();
|
||||
const char* old;
|
||||
|
||||
static std::string current;
|
||||
|
||||
private:
|
||||
char* old;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue