commit 754622a2476761309d8b1a65ef3695c61cc43992 from: Omar Polo date: Mon Mar 15 19:34:51 2021 UTC fix various warnings, no functional changes now that we have a bounch of -Wxxx flags during compilation, let's fix everything. commit - e18a9f1429efc0aff81d06fbaffcc44ce2c1d7b2 commit + 754622a2476761309d8b1a65ef3695c61cc43992 blob - bd119ecb712192bbcc512815692a08ebb2db55fe blob + 4bef3c890fb6df6ded60bc904986713de9b7566e --- gemini.c +++ gemini.c @@ -59,8 +59,6 @@ static void write_request(int, short, void*); static void read_reply(int, short, void*); static void parse_reply(struct req*); static void copy_body(int, short, void*); - -static void check_special_page(struct req*, const char*); static void handle_get(struct imsg*, size_t); static void handle_cert_status(struct imsg*, size_t); blob - e709cac2efc709636a8779ee056ead5ce41ddc49 blob + b75c3a3be55471aae44fd6d9ef2375970503d9bb --- gemtext.c +++ gemtext.c @@ -293,8 +293,6 @@ parse_pre_end(struct parser *p, enum line_type t, cons static inline enum line_type detect_line_type(const char *buf, size_t len, int in_pre) { - size_t i; - if (len == 0) return LINE_TEXT; blob - d2b6ccc26dfcecea5982c7885fe3254231d9784f blob + 62d1abff1022bd444ca228e603e046d35fb568e7 --- keymap.c +++ keymap.c @@ -23,8 +23,8 @@ #define CTRL(n) ((n)&0x1F) static struct keytable { - char *p; - int k; + const char *p; + int k; } keytable[] = { { "", KEY_UP }, { "", KEY_DOWN }, blob - 8835c67c5e9a1b2e9022463a13f0412b27ebacda blob + 66aeacb2feb7350e257478046420fc263c58f08b --- sandbox.c +++ sandbox.c @@ -14,7 +14,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "compat.h" +#include "telescope.h" #ifdef __OpenBSD__ blob - 21547939e0c28d01e393d3693bb503e67d988ea8 blob + ab42757ef107f8dfba32453dfe47be2b3fd4547f --- telescope.c +++ telescope.c @@ -285,6 +285,8 @@ load_gemini_url(struct tab *tab, const char *url) const char *err; char *p; size_t len; + + len = sizeof(tab->hist_cur->h)-1; if (has_prefix(url, "gemini:")) { if (!url_parse(url, &tab->url, &err)) @@ -294,7 +296,6 @@ load_gemini_url(struct tab *tab, const char *url) goto err; } - len = sizeof(tab->hist_cur->h)-1; url_unparse(&tab->url, tab->hist_cur->h, len); imsg_compose(netibuf, IMSG_GET, tab->id, 0, -1, tab->hist_cur->h, len+1); blob - 8a0c4bf77dadc993d14ae53f7423151323641856 blob + 5669655068abe2e1efc285f48d0d063d06ec4370 --- ui.c +++ ui.c @@ -434,7 +434,6 @@ static void cmd_scroll_line_down(struct tab *tab) { struct vline *vl; - size_t n; if (tab->s.line_max == 0 || tab->s.line_off == tab->s.line_max-1) return; @@ -442,7 +441,7 @@ cmd_scroll_line_down(struct tab *tab) tab->s.line_off++; wscrl(body, 1); - if (tab->s.line_max - tab->s.line_off < body_lines) + if (tab->s.line_max - tab->s.line_off < (size_t)body_lines) return; vl = nth_line(tab, tab->s.line_off + body_lines-1); @@ -489,7 +488,7 @@ cmd_end_of_buffer(struct tab *tab) off = MAX(0, off); tab->s.line_off = off; - tab->s.curs_y = MIN(body_lines, tab->s.line_max); + tab->s.curs_y = MIN((size_t)body_lines, tab->s.line_max); redraw_body(tab); } @@ -954,7 +953,6 @@ current_tab(void) static void dispatch_stdio(int fd, short ev, void *d) { - struct tab *tab; struct keymap *k; const char *keyname; char tmp[2] = {0}; @@ -1090,7 +1088,7 @@ wrap_page(struct tab *tab) return 1; } -static inline void +static void print_vline(struct vline *vl) { const char *text = vl->line; @@ -1157,7 +1155,7 @@ redraw_modeline(struct tab *tab) pct = (tab->s.line_off + tab->s.curs_y) * 100.0 / tab->s.line_max; - if (tab->s.line_max <= body_lines) + if (tab->s.line_max <= (size_t)body_lines) wprintw(modeline, "All "); else if (tab->s.line_off == 0) wprintw(modeline, "Top "); @@ -1196,7 +1194,7 @@ redraw_minibuffer(void) getyx(minibuf, off_y, off_x); - while (ministate.off - skip > COLS / 2) { + while (ministate.off - skip > (size_t)COLS / 2) { skip += MIN(ministate.off/4, 1); } @@ -1403,7 +1401,7 @@ switch_to_tab(struct tab *tab) static struct tab * new_tab(void) { - struct tab *tab, *t; + struct tab *tab; const char *url = "about:new"; if ((tab = calloc(1, sizeof(*tab))) == NULL) blob - 785a759348d324ef376f1ece3a0daf32115351da blob + 085df61ba454ddeb68b9da4c8f1fa8d0956d5366 --- wrap.c +++ wrap.c @@ -123,7 +123,7 @@ emitline(struct tab *tab, size_t zero, size_t *off, co void wrap_text(struct tab *tab, const char *prfx, struct line *l, size_t width) { - size_t zero, off, len, split; + size_t zero, off, len; int cont = 0; const char *endword, *endspc, *line, *linestart;