From 1725f15bc8ce2d5a16d77f482f143ce71c196a8e Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 29 Oct 2017 02:42:18 -0400 Subject: 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. */ ^ --- 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) { -- cgit v0.9.1