1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-28 13:00:45 +00:00

Fixed mixed code and declarations (not allowed in some C standards, like C90)

This commit is contained in:
Nikolas Garofil 2009-07-07 15:38:13 +02:00
parent 59f678ecb6
commit 1070c60768

View File

@ -2804,10 +2804,9 @@ static struct text_object *construct_text_object(const char *s,
argc = sscanf(arg, "%4s %31s %d", icao, data_type, &delay); argc = sscanf(arg, "%4s %31s %d", icao, data_type, &delay);
//icao MUST BE upper-case //icao MUST BE upper-case
char *tmp_p = icao; while (*icao) {
while (*tmp_p) { *icao = toupper(*icao);
*tmp_p = toupper(*tmp_p); icao++;
tmp_p++;
} }
strcpy(uri, "http://weather.noaa.gov/pub/data/observations/metar/stations/"); strcpy(uri, "http://weather.noaa.gov/pub/data/observations/metar/stations/");
@ -4636,14 +4635,14 @@ static void generate_text_internal(char *p, int p_max_size,
} }
#endif #endif
#ifdef WEATHER #ifdef WEATHER
OBJ(weather) {
PWEATHER *data = get_weather_info(obj->data.weather.uri, obj->data.weather.delay);
static const char *wc[18] = static const char *wc[18] =
{"", "drizzle", "rain", "hail", "soft hail", {"", "drizzle", "rain", "hail", "soft hail",
"snow", "snow grains", "fog", "haze", "smoke", "snow", "snow grains", "fog", "haze", "smoke",
"mist", "dust", "sand", "funnel cloud tornado", "mist", "dust", "sand", "funnel cloud tornado",
"dust/sand", "squall", "sand storm", "dust storm"}; "dust/sand", "squall", "sand storm", "dust storm"};
OBJ(weather) {
PWEATHER *data = get_weather_info(obj->data.weather.uri, obj->data.weather.delay);
if (data == NULL) { if (data == NULL) {
strncpy(p, "Error reading weather data", p_max_size); strncpy(p, "Error reading weather data", p_max_size);