diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-07-28 16:40:09 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-08-07 16:50:35 +0200 |
commit | 1e2f9219883452ef7da37c3c984b3e3d2939656b (patch) | |
tree | d1414af1325ab9f90e37305800e3a748d90ddf9d /src | |
parent | 0220c850a043af46385d6cd6cf4ffa9ceb5696e3 (diff) |
Fix pedantic warnings
Reviewed-by: dogma
Diffstat (limited to 'src')
-rw-r--r-- | src/dialog.cc | 2 | ||||
-rw-r--r-- | src/form.cc | 3 | ||||
-rw-r--r-- | src/gif.c | 8 | ||||
-rw-r--r-- | src/html.cc | 1 | ||||
-rw-r--r-- | src/menu.cc | 4 | ||||
-rw-r--r-- | src/uicmd.cc | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/src/dialog.cc b/src/dialog.cc index da623f98..70771be9 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -184,7 +184,7 @@ const char *a_Dialog_input(const char *title, const char *msg) if (!pm) { int n_it = dList_length(prefs.search_urls); pm = new Fl_Menu_Item[n_it+1]; - memset(pm, '\0', sizeof(Fl_Menu_Item[n_it+1])); + memset(pm, '\0', sizeof(*pm)); for (int i = 0, j = 0; i < n_it; i++) { char *label, *url, *source; source = (char *)dList_nth_data(prefs.search_urls, i); diff --git a/src/form.cc b/src/form.cc index aeaa35bd..8234c0a3 100644 --- a/src/form.cc +++ b/src/form.cc @@ -1720,9 +1720,8 @@ void DilloHtmlInput::activate(DilloHtmlForm *form, int num_entry_fields, case DILLO_HTML_INPUT_PASSWORD: if (!(prefs.enterpress_forces_submit || num_entry_fields == 1)) { break; - } else { - /* fall through */ } + /* fallthrough */ case DILLO_HTML_INPUT_SUBMIT: case DILLO_HTML_INPUT_BUTTON_SUBMIT: case DILLO_HTML_INPUT_IMAGE: @@ -975,7 +975,7 @@ static size_t Gif_process_bytes(DilloGif *gif, const uchar_t *ibuf, ibuf += mysize; if (gif->state != 1) break; - + /* fallthrough */ case 1: mysize = Gif_get_descriptor(gif, Buf, ibuf, tmp_bufsize); if (!mysize) @@ -983,7 +983,7 @@ static size_t Gif_process_bytes(DilloGif *gif, const uchar_t *ibuf, tmp_bufsize -= mysize; ibuf += mysize; gif->state = 2; - + /* fallthrough */ case 2: /* Ok, this loop construction looks weird. It implements the <Data>* of * the GIF grammar. All sorts of stuff is allocated to set up for the @@ -996,7 +996,7 @@ static size_t Gif_process_bytes(DilloGif *gif, const uchar_t *ibuf, ibuf += mysize; if (gif->state != 3) break; - + /* fallthrough */ case 3: /* get an image byte */ /* The users sees all of this stuff */ @@ -1005,7 +1005,7 @@ static size_t Gif_process_bytes(DilloGif *gif, const uchar_t *ibuf, break; ibuf += mysize; tmp_bufsize -= mysize; - + /* fallthrough */ default: /* error - just consume all input */ tmp_bufsize = 0; diff --git a/src/html.cc b/src/html.cc index 4e2b73d1..b667e5a3 100644 --- a/src/html.cc +++ b/src/html.cc @@ -4130,6 +4130,7 @@ static void Html_process_tag(DilloHtml *html, char *tag, int tagsize) html->ReqTagClose = true; /* Don't break! Open tags may also close themselves */ + /* fallthrough */ default: /* Close function */ diff --git a/src/menu.cc b/src/menu.cc index 865b843b..b045bf66 100644 --- a/src/menu.cc +++ b/src/menu.cc @@ -397,7 +397,7 @@ void a_Menu_page_popup(BrowserWindow *bw, const DilloUrl *url, if (cssUrls && cssUrls->size () > 0) { stylesheets = new Fl_Menu_Item[cssUrls->size() + 1]; - memset(stylesheets, '\0', sizeof(Fl_Menu_Item[cssUrls->size() + 1])); + memset(stylesheets, '\0', sizeof(*stylesheets)); for (j = 0; j < cssUrls->size(); j++) { DilloUrl *url = cssUrls->get(j); @@ -638,7 +638,7 @@ void a_Menu_history_popup(BrowserWindow *bw, int x, int y, int direction) ; pm = new Fl_Menu_Item[n + 1]; - memset(pm, '\0', sizeof(Fl_Menu_Item[n + 1])); + memset(pm, '\0', sizeof(*pm)); for (i = 0; i < n; i++) { pm[i].label(FL_NORMAL_LABEL, a_History_get_title(history_list[i], 1)); diff --git a/src/uicmd.cc b/src/uicmd.cc index d289df0c..03d191ad 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -1268,7 +1268,7 @@ void a_UIcmd_view_page_source(BrowserWindow *bw, const DilloUrl *url) Dstr *dstr_url; DilloUrl *vs_url; static int post_id = 0; - char tag[8]; + char tag[16]; const char *content_type = a_Nav_get_content_type(url); a_Misc_parse_content_type(content_type, &major, NULL, NULL); @@ -1281,7 +1281,7 @@ void a_UIcmd_view_page_source(BrowserWindow *bw, const DilloUrl *url) if (URL_FLAGS(url) & URL_Post) { /* append a custom string to differentiate POST URLs */ post_id = (post_id < 9999) ? post_id + 1 : 0; - snprintf(tag, 8, "_%.4d", post_id); + snprintf(tag, 16, "_%.4d", post_id); dStr_append(dstr_url, tag); } vs_url = a_Url_new(dstr_url->str, NULL); |