diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-29 02:42:18 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-29 02:42:18 (EDT) |
commit | 1725f15bc8ce2d5a16d77f482f143ce71c196a8e (patch) | |
tree | d0051123d7d8d05f80a8b5b4490638e92406674a | |
parent | 515b2cec504abec17b31167a78eee08e2a441e67 (diff) | |
download | marquee-1725f15bc8ce2d5a16d77f482f143ce71c196a8e.zip marquee-1725f15bc8ce2d5a16d77f482f143ce71c196a8e.tar.gz marquee-1725f15bc8ce2d5a16d77f482f143ce71c196a8e.tar.bz2 |
MqWebView: Make save file extension non-const in static funcs
Fixes:
CC src/marquee-web-view.o
src/web-view.c: In function ‘save_type_changed_cb’:
src/web-view.c:1010:12: warning: assignment discards ‘const’ qualifier from pointer target type
extension = get_extension(name);
^
src/web-view.c: In function ‘save_response_cb’:
src/web-view.c:1060:14: warning: assignment discards ‘const’ qualifier from pointer target type
extension = get_extension(filename);
^
The "extension" variable of save_type_changed_cb() can't be made const
because the string to which it points is modified:
CC src/marquee-web-view.o
src/web-view.c: In function ‘save_type_changed_cb’:
src/web-view.c:1016:17: error: assignment of read-only location ‘*extension’
extension[0] = '\0'; /* Remove extension. */
^
src/web-view.c:1024:17: error: assignment of read-only location ‘*extension’
extension[0] = '\0'; /* Remove extension. */
^
-rw-r--r-- | src/web-view.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/web-view.c b/src/web-view.c index c5e76e8..74c9da6 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -919,10 +919,10 @@ save_mhtml_cb(WebKitWebView *web_view, GAsyncResult *result) webkit_web_view_save_to_file_finish(web_view, result, NULL); } -static const gchar * -get_extension(const gchar *filename) +static gchar * +get_extension(gchar *filename) { - const gchar *extension; + gchar *extension; extension = strrchr(filename, '.'); if (extension) { |