Fix unnecessary const violation.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user