comparison base/RealTimeSV.cpp @ 1572:c36ffc195988 spectrogramparam

Fix usage of setlocale
author Chris Cannam
date Thu, 08 Nov 2018 14:39:34 +0000
parents 6415ac3becb6
children 70e172e6cc59
comparison
equal deleted inserted replaced
1571:5fe24e4af12c 1572:c36ffc195988
98 RealTime t; 98 RealTime t;
99 99
100 int year = 0, month = 0, day = 0, hour = 0, minute = 0; 100 int year = 0, month = 0, day = 0, hour = 0, minute = 0;
101 double second = 0.0; 101 double second = 0.0;
102 102
103 char *loc = setlocale(LC_NUMERIC, 0); 103 char *formerLoc = setlocale(LC_NUMERIC, "C"); // avoid strtod expecting ,-separator in DE
104 (void)setlocale(LC_NUMERIC, "C"); // avoid strtod expecting ,-separator in DE
105 104
106 int i = 0; 105 int i = 0;
107 106
108 const char *s = xsdd.c_str(); 107 const char *s = xsdd.c_str();
109 int len = int(xsdd.length()); 108 int len = int(xsdd.length());
167 t = t + RealTime(minute * 60, 0); 166 t = t + RealTime(minute * 60, 0);
168 } 167 }
169 168
170 t = t + fromSeconds(second); 169 t = t + fromSeconds(second);
171 170
172 setlocale(LC_NUMERIC, loc); 171 setlocale(LC_NUMERIC, formerLoc);
173 172
174 if (negative) { 173 if (negative) {
175 return -t; 174 return -t;
176 } else { 175 } else {
177 return t; 176 return t;