@@ -75,9 +75,9 @@ #define http _http "lang=" ds_lang " HTTP/1.1\r\nHost: api.darksky.net\r\n\r\n" #define start "GET /forecast/" ds_apikey "/" #define min(x,y) (x>y?y:x) -#define len(x) (sizeof(x)/sizeof(*x)) +#define len(x) (sizeof(x)/sizeof(x)[0]) typedef enum bool { false, true } bool; SSL_CTX* sc; @@ -189,9 +189,15 @@ key += *key + 1; }; printf("\n"); } */ -void pplt(const char* str, const char* const end, const char** keys, const char** const keyend, jsv* values) { +void pplt +( const char* str, + const char* const end, + const char** keys, + const char** const keyend, + jsv* values +) { // initialize parser state size_t depth = 0; const char* fld = NULL; const char* path[32]; @@ -368,11 +374,11 @@ temp = values[2].f, windspd = values[3].f; printf("%.1f° %%{F#ff9bbb}%.*s\n", - summary.sz, - summary.a, - temp); + temp, + (int /*throwing table emoji*/)summary.sz, + summary.a); } // dark sky's API allows us to make 1000 free requests a day. // let's try not to get too near that. // hours in day 24 - minutes in day 24 * 60 = 1440