Fix encoding / C++11 compliance
- convert text encoding to UTF-8 - C++11 requires a space between literal and identifier
This commit is contained in:
parent
211a4982c8
commit
1cffd2b8c0
1 changed files with 16 additions and 17 deletions
|
@ -42,8 +42,7 @@ using namespace std;
|
||||||
using namespace simgear;
|
using namespace simgear;
|
||||||
|
|
||||||
// text color
|
// text color
|
||||||
#if defined(__linux__) || defined(__sun) || defined(__CYGWIN__) \
|
#if defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined( __FreeBSD__ ) || defined ( sgi )
|
||||||
|| defined( __FreeBSD__ ) || defined ( sgi )
|
|
||||||
# define R "\033[31;1m" // red
|
# define R "\033[31;1m" // red
|
||||||
# define G "\033[32;1m" // green
|
# define G "\033[32;1m" // green
|
||||||
# define Y "\033[33;1m" // yellow
|
# define Y "\033[33;1m" // yellow
|
||||||
|
@ -188,7 +187,7 @@ void printReport(SGMetar *m)
|
||||||
if ((i = m->getWindDir()) == -1)
|
if ((i = m->getWindDir()) == -1)
|
||||||
cout << "from variable directions";
|
cout << "from variable directions";
|
||||||
else
|
else
|
||||||
cout << "from the " << azimuthName(i) << " (" << i << "°)";
|
cout << "from the " << azimuthName(i) << " (" << i << "°)";
|
||||||
cout << " at " << rnd(d, -1) << " km/h";
|
cout << " at " << rnd(d, -1) << " km/h";
|
||||||
|
|
||||||
cout << "\t\t" << rnd(m->getWindSpeed_kt(), -1) << " kt";
|
cout << "\t\t" << rnd(m->getWindSpeed_kt(), -1) << " kt";
|
||||||
|
@ -209,19 +208,19 @@ void printReport(SGMetar *m)
|
||||||
if (from != to) {
|
if (from != to) {
|
||||||
cout << "\t\t\tvariable from " << azimuthName(from);
|
cout << "\t\t\tvariable from " << azimuthName(from);
|
||||||
cout << " to " << azimuthName(to);
|
cout << " to " << azimuthName(to);
|
||||||
cout << " (" << from << "°--" << to << "°)" << endl;
|
cout << " (" << from << "°--" << to << "°)" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// temperature/humidity/air pressure
|
// temperature/humidity/air pressure
|
||||||
if ((d = m->getTemperature_C()) != NaN) {
|
if ((d = m->getTemperature_C()) != NaN) {
|
||||||
cout << "Temperature:\t\t" << d << "°C\t\t\t\t\t";
|
cout << "Temperature:\t\t" << d << "°C\t\t\t\t\t";
|
||||||
cout << rnd(m->getTemperature_F(), -1) << "°F" << endl;
|
cout << rnd(m->getTemperature_F(), -1) << "°F" << endl;
|
||||||
|
|
||||||
if ((d = m->getDewpoint_C()) != NaN) {
|
if ((d = m->getDewpoint_C()) != NaN) {
|
||||||
cout << "Dewpoint:\t\t" << d << "°C\t\t\t\t\t";
|
cout << "Dewpoint:\t\t" << d << "°C\t\t\t\t\t";
|
||||||
cout << rnd(m->getDewpoint_F(), -1) << "°F" << endl;
|
cout << rnd(m->getDewpoint_F(), -1) << "°F" << endl;
|
||||||
cout << "Rel. Humidity:\t\t" << rnd(m->getRelHumidity()) << "%" << endl;
|
cout << "Rel. Humidity:\t\t" << rnd(m->getRelHumidity()) << "%" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,11 +574,11 @@ int main(int argc, char *argv[])
|
||||||
//SGMetar *m = new SGMetar("2004/01/11 01:20\nLOWG 110120Z AUTO VRB01KT 0050 1600N R35/0600 FG M06/M06 Q1019 88//////\n");
|
//SGMetar *m = new SGMetar("2004/01/11 01:20\nLOWG 110120Z AUTO VRB01KT 0050 1600N R35/0600 FG M06/M06 Q1019 88//////\n");
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
cerr << G"INPUT: " << m->getData() << ""N << endl;
|
cerr << G "INPUT: " << m->getData() << "" N << endl;
|
||||||
|
|
||||||
const char *unused = m->getUnusedData();
|
const char *unused = m->getUnusedData();
|
||||||
if (*unused)
|
if (*unused)
|
||||||
cerr << R"UNUSED: " << unused << ""N << endl;
|
cerr << R "UNUSED: " << unused << "" N << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (report)
|
if (report)
|
||||||
|
@ -589,7 +588,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
delete m;
|
delete m;
|
||||||
} catch (const sg_io_exception& e) {
|
} catch (const sg_io_exception& e) {
|
||||||
cerr << R"ERROR: " << e.getFormattedMessage().c_str() << ""N << endl << endl;
|
cerr << R "ERROR: " << e.getFormattedMessage().c_str() << "" N << endl << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue