warnings--

This commit is contained in:
mfranz 2008-06-07 14:45:22 +00:00
parent 7bc37651c3
commit 3b6f47aea1
2 changed files with 13 additions and 17 deletions

View File

@ -1181,7 +1181,7 @@ const struct Token *SGMetar::scanToken(char **str, const struct Token *list)
{ {
const struct Token *longest = 0; const struct Token *longest = 0;
int maxlen = 0, len; int maxlen = 0, len;
char *s; const char *s;
for (int i = 0; (s = list[i].id); i++) { for (int i = 0; (s = list[i].id); i++) {
len = strlen(s); len = strlen(s);
if (!strncmp(s, *str, len) && len > maxlen) { if (!strncmp(s, *str, len) && len > maxlen) {

View File

@ -37,8 +37,8 @@ const double SGMetarNaN = -1E20;
#define NaN SGMetarNaN #define NaN SGMetarNaN
struct Token { struct Token {
char *id; const char *id;
char *text; const char *text;
}; };
@ -130,25 +130,21 @@ protected:
class SGMetarCloud { class SGMetarCloud {
friend class SGMetar; friend class SGMetar;
public: public:
SGMetarCloud() : SGMetarCloud() : _coverage(-1), _altitude(NaN), _type(0), _type_long(0) {}
_coverage(-1),
_altitude(NaN),
_type(0),
_type_long(0) {}
void set(double alt, int cov = -1); void set(double alt, int cov = -1);
inline int getCoverage() const { return _coverage; } inline int getCoverage() const { return _coverage; }
inline double getAltitude_m() const { return _altitude; } inline double getAltitude_m() const { return _altitude; }
inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; } inline double getAltitude_ft() const { return _altitude == NaN ? NaN : _altitude * SG_METER_TO_FEET; }
inline char *getTypeString() const { return _type; } inline const char *getTypeString() const { return _type; }
inline char *getTypeLongString() const { return _type_long; } inline const char *getTypeLongString() const { return _type_long; }
protected: protected:
int _coverage; // quarters: 0 -> clear ... 4 -> overcast int _coverage; // quarters: 0 -> clear ... 4 -> overcast
double _altitude; // 1000 m double _altitude; // 1000 m
char *_type; // CU const char *_type; // CU
char *_type_long; // cumulus const char *_type_long; // cumulus
}; };