Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 16 Nov 2023 09:55:34 UTC Commit: 910a7e651fb102fae18e788080da2666f31bd6c4 https://github.com/geany/geany/commit/910a7e651fb102fae18e788080da2666f31bd6...
Log Message: ----------- Add casts for irrelevant -Wwrite-strings warnings
Unfortunately GtkTargetEntry and GtkStockItem string members are not declared `const`, although they are used as so. This requires adding casts when using literals together with -Wwrite-strings.
Modified Paths: -------------- src/notebook.c src/toolbar.c src/ui_utils.c src/vte.c
Modified: src/notebook.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -45,14 +45,14 @@
static const GtkTargetEntry drag_targets[] = { - {GEANY_DND_NOTEBOOK_TAB_TYPE, GTK_TARGET_SAME_APP | GTK_TARGET_SAME_WIDGET, 0} + { (gchar *) GEANY_DND_NOTEBOOK_TAB_TYPE, GTK_TARGET_SAME_APP | GTK_TARGET_SAME_WIDGET, 0 } };
-static GtkTargetEntry files_drop_targets[] = { - { "STRING", 0, 0 }, - { "UTF8_STRING", 0, 0 }, - { "text/plain", 0, 0 }, - { "text/uri-list", 0, 0 } +static const GtkTargetEntry files_drop_targets[] = { + { (gchar *) "STRING", 0, 0 }, + { (gchar *) "UTF8_STRING", 0, 0 }, + { (gchar *) "text/plain", 0, 0 }, + { (gchar *) "text/uri-list", 0, 0 } };
static const gsize MAX_MRU_DOCS = 20;
Modified: src/toolbar.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -601,7 +601,7 @@ typedef struct
static const GtkTargetEntry tb_editor_dnd_targets[] = { - { "GEANY_TB_EDITOR_ROW", 0, 0 } + { (gchar *) "GEANY_TB_EDITOR_ROW", 0, 0 } }; static const gint tb_editor_dnd_targets_len = G_N_ELEMENTS(tb_editor_dnd_targets);
Modified: src/ui_utils.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -2256,11 +2256,11 @@ static void add_stock_icons(const GtkStockItem *items, gsize count)
void ui_init_stock_items(void) { - GtkStockItem items[] = + const GtkStockItem items[] = { - { GEANY_STOCK_SAVE_ALL, N_("Save All"), 0, 0, GETTEXT_PACKAGE }, - { GEANY_STOCK_CLOSE_ALL, N_("Close All"), 0, 0, GETTEXT_PACKAGE }, - { GEANY_STOCK_BUILD, N_("Build"), 0, 0, GETTEXT_PACKAGE } + { (gchar *) GEANY_STOCK_SAVE_ALL, (gchar *) N_("Save All"), 0, 0, (gchar *) GETTEXT_PACKAGE }, + { (gchar *) GEANY_STOCK_CLOSE_ALL, (gchar *) N_("Close All"), 0, 0, (gchar *) GETTEXT_PACKAGE }, + { (gchar *) GEANY_STOCK_BUILD, (gchar *) N_("Build"), 0, 0, (gchar *) GETTEXT_PACKAGE } };
gtk_stock_add(items, G_N_ELEMENTS(items));
Modified: src/vte.c 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -169,11 +169,11 @@ enum
static const GtkTargetEntry dnd_targets[] = { - { "UTF8_STRING", 0, TARGET_UTF8_STRING }, - { "TEXT", 0, TARGET_TEXT }, - { "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT }, - { "STRING", 0, TARGET_STRING }, - { "text/plain", 0, TARGET_TEXT_PLAIN }, + { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING }, + { (gchar *) "TEXT", 0, TARGET_TEXT }, + { (gchar *) "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT }, + { (gchar *) "STRING", 0, TARGET_STRING }, + { (gchar *) "text/plain", 0, TARGET_TEXT_PLAIN }, };
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).