From 3b6f47aea1147cc7e1dad9fb6cdb1cd8fcf59fad Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 7 Jun 2008 14:45:22 +0000 Subject: [PATCH] warnings-- --- simgear/environment/metar.cxx | 2 +- simgear/environment/metar.hxx | 28 ++++++++++++---------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/simgear/environment/metar.cxx b/simgear/environment/metar.cxx index a19e48bf..ecda2c9b 100644 --- a/simgear/environment/metar.cxx +++ b/simgear/environment/metar.cxx @@ -1181,7 +1181,7 @@ const struct Token *SGMetar::scanToken(char **str, const struct Token *list) { const struct Token *longest = 0; int maxlen = 0, len; - char *s; + const char *s; for (int i = 0; (s = list[i].id); i++) { len = strlen(s); if (!strncmp(s, *str, len) && len > maxlen) { diff --git a/simgear/environment/metar.hxx b/simgear/environment/metar.hxx index 3db6f4d8..f255e103 100644 --- a/simgear/environment/metar.hxx +++ b/simgear/environment/metar.hxx @@ -37,8 +37,8 @@ const double SGMetarNaN = -1E20; #define NaN SGMetarNaN struct Token { - char *id; - char *text; + const char *id; + const char *text; }; @@ -130,25 +130,21 @@ protected: class SGMetarCloud { friend class SGMetar; public: - SGMetarCloud() : - _coverage(-1), - _altitude(NaN), - _type(0), - _type_long(0) {} + SGMetarCloud() : _coverage(-1), _altitude(NaN), _type(0), _type_long(0) {} void set(double alt, int cov = -1); - inline int getCoverage() const { return _coverage; } - inline double getAltitude_m() const { return _altitude; } - inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; } - inline char *getTypeString() const { return _type; } - inline char *getTypeLongString() const { return _type_long; } + inline int getCoverage() const { return _coverage; } + inline double getAltitude_m() const { return _altitude; } + inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; } + inline const char *getTypeString() const { return _type; } + inline const char *getTypeLongString() const { return _type_long; } protected: - int _coverage; // quarters: 0 -> clear ... 4 -> overcast - double _altitude; // 1000 m - char *_type; // CU - char *_type_long; // cumulus + int _coverage; // quarters: 0 -> clear ... 4 -> overcast + double _altitude; // 1000 m + const char *_type; // CU + const char *_type_long; // cumulus };