# HG changeset patch # User Chris Cannam # Date 1480344105 0 # Node ID 9d443c13c5d15b1bb7500471bfed93425fd9b1ba # Parent 6681027ff2ff55089bdd1dd46db19c40b679988b# Parent 4a2bc07ec0fb2d4415fb2eb69db2f652404eef3d Merge diff -r 6681027ff2ff -r 9d443c13c5d1 base/Debug.cpp --- a/base/Debug.cpp Mon Nov 28 14:40:45 2016 +0000 +++ b/base/Debug.cpp Mon Nov 28 14:41:45 2016 +0000 @@ -82,7 +82,7 @@ << "Failed to open debug log file " << fileName << " for writing"; } else { - cerr << m_prefix << ": Log file is " << fileName << endl; +// cerr << m_prefix << ": Log file is " << fileName << endl; m_ok = true; } } diff -r 6681027ff2ff -r 9d443c13c5d1 base/RealTimeSV.cpp --- a/base/RealTimeSV.cpp Mon Nov 28 14:40:45 2016 +0000 +++ b/base/RealTimeSV.cpp Mon Nov 28 14:41:45 2016 +0000 @@ -85,6 +85,9 @@ int year = 0, month = 0, day = 0, hour = 0, minute = 0; double second = 0.0; + char *loc = setlocale(LC_NUMERIC, 0); + (void)setlocale(LC_NUMERIC, "C"); // avoid strtod expecting ,-separator in DE + int i = 0; const char *s = xsdd.c_str(); @@ -151,6 +154,8 @@ t = t + fromSeconds(second); + setlocale(LC_NUMERIC, loc); + if (negative) { return -t; } else { diff -r 6681027ff2ff -r 9d443c13c5d1 transform/CSVFeatureWriter.cpp --- a/transform/CSVFeatureWriter.cpp Mon Nov 28 14:40:45 2016 +0000 +++ b/transform/CSVFeatureWriter.cpp Mon Nov 28 14:41:45 2016 +0000 @@ -276,7 +276,20 @@ } for (unsigned int j = 0; j < f.values.size(); ++j) { - stream << m_separator << QString("%1").arg(f.values[j], 0, 'g', m_digits); + + QString number = QString("%1").arg(f.values[j], 0, 'g', m_digits); + + // Qt pre-5.6 zero pads single-digit exponents to two digits; + // Qt 5.7+ doesn't by default. But we want both to produce the + // same output. Getting the new behaviour from standard APIs + // in Qt 5.6 isn't possible I think; getting the old behaviour + // from Qt 5.7 is possible but fiddly, involving setting up an + // appropriate locale and using the %L specifier. We could + // doubtless do it with sprintf but Qt is a known quantity at + // this point. Let's just convert the old format to the new. + number.replace("e-0", "e-"); + + stream << m_separator << number; } if (f.label != "") {