X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fmetar_main.cxx;h=04edbcab15b5cfa4c060c929f5c4a4fe8eeaee28;hb=f467ba360902e4395d23b35481c55844a3946b91;hp=36567ffb30b640fcc9f9636ae46ceaed130546f5;hpb=f057fd0d4897ef65c4d36159af37ba3fdd544798;p=flightgear.git diff --git a/src/Main/metar_main.cxx b/src/Main/metar_main.cxx index 36567ffb3..04edbcab1 100644 --- a/src/Main/metar_main.cxx +++ b/src/Main/metar_main.cxx @@ -16,13 +16,16 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // $Id$ #include #include +#include #include +#include +#include #include #include @@ -75,11 +78,11 @@ const char *azimuthName(double d) double rnd(double r, int g = 0) { double f = pow(10.0, g); - return f * rint(r / f); + return f * floor(r / f + 0.5); } -ostream& operator<<(ostream& s, SGMetarVisibility& v) +ostream& operator<<(ostream& s, const SGMetarVisibility& v) { ostringstream buf; int m = v.getModifier(); @@ -154,7 +157,7 @@ void printReport(SGMetar *m) // directed visibility - SGMetarVisibility *dirvis = m->getDirVisibility(); + const SGMetarVisibility *dirvis = m->getDirVisibility(); for (i = 0; i < 8; i++, dirvis++) if (dirvis->getVisibility_m() != NaN) cout << "\t\t\t" << *dirvis << endl; @@ -269,7 +272,7 @@ void printReport(SGMetar *m) if ((s = rwy.getExtentString()) && strlen(s)) surface.push_back(s); if ((d = rwy.getDepth()) != NaN) { - sprintf(buf, "%.0lf mm", d * 1000.0); + sprintf(buf, "%.1lf mm", d * 1000.0); surface.push_back(buf); } if ((s = rwy.getFrictionString()) && strlen(s)) @@ -484,7 +487,6 @@ void usage() ); } - int main(int argc, char *argv[]) { bool report = true;