commit 0d877486d2b85f6e333e50765e1f2cf8119da67c from: Omar Polo date: Thu Feb 24 18:26:14 2022 UTC const-ify some tables commit - 364730f45d4ccc77ec080e287723104cee560cd0 commit + 0d877486d2b85f6e333e50765e1f2cf8119da67c blob - a01c8522f771678381c7403b2105b8363ad9f0f2 blob + 9774cd2d627ecdd5300f75a8b1add9ca0d456326 --- mime.c +++ mime.c @@ -26,7 +26,7 @@ static int check_for_utf8(char*); -static struct parser_table { +static const struct parser_table { const char *mediatype; void (*parserinit)(struct parser*); } ptable[] = { @@ -68,8 +68,8 @@ check_for_utf8(char *b) int setup_parser_for(struct tab *tab) { - char *b, buf[GEMINI_URL_LEN] = {0}; - struct parser_table *t; + char *b, buf[GEMINI_URL_LEN] = {0}; + const struct parser_table *t; memcpy(buf, tab->meta, sizeof(tab->meta)); blob - 61f4fec2fae4c283a874d775710363ada79f4885 blob + 57eae92163eb02e3d31328a530e52eb16e554360 --- telescope.c +++ telescope.c @@ -39,7 +39,7 @@ #include "ui.h" #include "utils.h" -static struct option longopts[] = { +static const struct option longopts[] = { {"colors", no_argument, NULL, 'C'}, {"colours", no_argument, NULL, 'C'}, {"help", no_argument, NULL, 'h'}, @@ -140,7 +140,7 @@ static int do_load_url(struct tab *, const char *, c static pid_t start_child(enum telescope_process, const char *, int); static void send_url(const char *); -static struct proto { +static const struct proto { const char *schema; const char *port; int (*loadfn)(struct tab *, const char *); @@ -930,8 +930,8 @@ load_page_from_str(struct tab *tab, const char *page) static int do_load_url(struct tab *tab, const char *url, const char *base, int mode) { + const struct proto *p; struct phos_uri uri; - struct proto *p; struct proxy *proxy; int nocache = mode & LU_MODE_NOCACHE; char *t;