[Commits] [SCM] claws branch, gtk2, updated. 3.19.1-92-g2bf1d9c3d

jonathan at claws-mail.org jonathan at claws-mail.org
Sun Nov 5 05:34:44 UTC 2023


The branch, gtk2 has been updated
       via  2bf1d9c3d26238e409bf032d63fee2bbad4a750b (commit)
      from  92051120e5c4004c777508fce35a152d9202a974 (commit)

Summary of changes:
 src/action.c                          |  4 +---
 src/common/unmime.c                   |  3 +--
 src/common/utils.c                    | 12 ++----------
 src/compose.c                         | 18 ++++--------------
 src/filtering.c                       |  5 +----
 src/folder.c                          |  6 +-----
 src/plugins/gdata/cm_gdata_contacts.c |  3 +--
 src/plugins/pgpcore/sgpgme.c          |  5 +----
 src/prefs_account.c                   |  3 +--
 9 files changed, 13 insertions(+), 46 deletions(-)


- Log -----------------------------------------------------------------
commit 2bf1d9c3d26238e409bf032d63fee2bbad4a750b
Author: Jonathan Boeing <jonathan at claws-mail.org>
Date:   Sat Nov 4 17:27:05 2023 -0700

    Fix -Wunused-result warnings from g_string_free()

diff --git a/src/action.c b/src/action.c
index f134b37cc..98a9754a2 100644
--- a/src/action.c
+++ b/src/action.c
@@ -363,9 +363,7 @@ static gchar *parse_action_cmd(gchar *action, MsgInfo *msginfo,
 		return NULL;
 	}
 
-	p = cmd->str;
-	g_string_free(cmd, FALSE);
-	return p;
+	return g_string_free(cmd, FALSE);
 }
 
 static gboolean parse_append_filename(GString *cmd, MsgInfo *msginfo)
diff --git a/src/common/unmime.c b/src/common/unmime.c
index 65d83ae51..d4ab7b4c7 100644
--- a/src/common/unmime.c
+++ b/src/common/unmime.c
@@ -157,9 +157,8 @@ gchar *unmime_header(const gchar *encoded_str, gboolean addr_field)
 		p = eword_end_p + 2;
 	}
 	
-	out_str = outbuf->str;
 	out_len = outbuf->len;
-	g_string_free(outbuf, FALSE);
+	out_str = g_string_free(outbuf, FALSE);
 
 	return g_realloc(out_str, out_len + 1);
 }
diff --git a/src/common/utils.c b/src/common/utils.c
index 56a6d42ea..076f156aa 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -2474,7 +2474,6 @@ gchar *get_outgoing_rfc2822_str(FILE *fp)
 {
 	gchar buf[BUFFSIZE];
 	GString *str;
-	gchar *ret;
 
 	str = g_string_new(NULL);
 
@@ -2512,10 +2511,7 @@ gchar *get_outgoing_rfc2822_str(FILE *fp)
 		g_string_append(str, "\r\n");
 	}
 
-	ret = str->str;
-	g_string_free(str, FALSE);
-
-	return ret;
+	return g_string_free(str, FALSE);
 }
 
 /*
@@ -4453,7 +4449,6 @@ static gchar *canonical_list_to_file(GSList *list)
 	GString *result = g_string_new(NULL);
 	GSList *pathlist = g_slist_reverse(g_slist_copy(list));
 	GSList *cur;
-	gchar *str;
 
 #ifndef G_OS_WIN32
 	result = g_string_append(result, G_DIR_SEPARATOR_S);
@@ -4476,10 +4471,7 @@ static gchar *canonical_list_to_file(GSList *list)
 	}
 	g_slist_free(pathlist);
 
-	str = result->str;
-	g_string_free(result, FALSE);
-
-	return str;
+	return g_string_free(result, FALSE);
 }
 
 static GSList *cm_split_path(const gchar *filename, int depth)
diff --git a/src/compose.c b/src/compose.c
index b1be57fab..d912c459a 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -3080,7 +3080,6 @@ static gchar *compose_parse_references(const gchar *ref, const gchar *msgid)
 {
 	GSList *ref_id_list, *cur;
 	GString *new_ref;
-	gchar *new_ref_str;
 
 	ref_id_list = references_list_append(NULL, ref);
 	if (!ref_id_list) return NULL;
@@ -3118,10 +3117,7 @@ static gchar *compose_parse_references(const gchar *ref, const gchar *msgid)
 
 	slist_free_strings_full(ref_id_list);
 
-	new_ref_str = new_ref->str;
-	g_string_free(new_ref, FALSE);
-
-	return new_ref_str;
+	return g_string_free(new_ref, FALSE);
 }
 
 static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
@@ -4194,10 +4190,9 @@ static gchar * compose_get_itemized_chars(GtkTextBuffer *buffer,
 	gunichar wc;
 	gint len = 0;
 	GString *item_chars = g_string_new("");
-	gchar *str = NULL;
 
 	if (gtk_text_iter_ends_line(&iter)) {
-		g_string_free(item_chars, FALSE);
+		g_string_free(item_chars, TRUE);
 		return NULL;
 	}
 
@@ -4212,9 +4207,7 @@ static gchar * compose_get_itemized_chars(GtkTextBuffer *buffer,
 		g_string_append_unichar(item_chars, wc);
 	}
 
-	str = item_chars->str;
-	g_string_free(item_chars, FALSE);
-	return str;
+	return g_string_free(item_chars, FALSE);
 }
 
 /* return the number of spaces at a line's start */
@@ -7001,10 +6994,7 @@ static gchar *compose_get_header(Compose *compose)
 		g_free(headername_wcolon);		
 	}
 
-	str = header->str;
-	g_string_free(header, FALSE);
-
-	return str;
+	return g_string_free(header, FALSE);
 }
 
 #undef IS_IN_CUSTOM_HEADER
diff --git a/src/filtering.c b/src/filtering.c
index 3ac0082dc..7b6b42fdb 100644
--- a/src/filtering.c
+++ b/src/filtering.c
@@ -990,7 +990,6 @@ gchar *filteringaction_to_string(FilteringAction *action)
 	gchar * quoted_dest;
 	gchar * quoted_header;
 	GString *dest = g_string_new("");
-	gchar *deststr = NULL;
 
 	command_str = get_matchparser_tab_str(action->type);
 
@@ -1056,9 +1055,7 @@ gchar *filteringaction_to_string(FilteringAction *action)
 		g_string_free(dest, TRUE);
 		return NULL;
 	}
-	deststr = dest->str;
-	g_string_free(dest, FALSE);
-	return deststr;
+	return g_string_free(dest, FALSE);
 }
 
 gchar * filteringaction_list_to_string(GSList * action_list)
diff --git a/src/folder.c b/src/folder.c
index 97c71390e..46856d39a 100644
--- a/src/folder.c
+++ b/src/folder.c
@@ -1187,7 +1187,6 @@ gchar *folder_get_status(GPtrArray *folders, gboolean full)
 	guint new, unread, total;
 	GString *str;
 	gint i;
-	gchar *ret;
 
 	new = unread = total = 0;
 
@@ -1222,10 +1221,7 @@ gchar *folder_get_status(GPtrArray *folders, gboolean full)
 	else
 		g_string_append_printf(str, "%d %d %d\n", new, unread, total);
 
-	ret = str->str;
-	g_string_free(str, FALSE);
- 
-	return ret;
+	return g_string_free(str, FALSE);
 }
 
 void folder_count_total_msgs(guint *new_msgs, guint *unread_msgs, 
diff --git a/src/plugins/gdata/cm_gdata_contacts.c b/src/plugins/gdata/cm_gdata_contacts.c
index fc85a2403..fa09c718d 100644
--- a/src/plugins/gdata/cm_gdata_contacts.c
+++ b/src/plugins/gdata/cm_gdata_contacts.c
@@ -402,8 +402,7 @@ static void cm_gdata_query_groups_ready(GDataContactsService *service, GAsyncRes
         g_string_append(str, "/base/");
         g_string_append(str, id+off+strlen("/full/"));
         g_string_append_c(str, '\0');
-        contacts_group_id = str->str;
-        g_string_free(str, FALSE);
+        contacts_group_id = g_string_free(str, FALSE);
       }
       else
         contacts_group_id = g_strdup(id);
diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index 610a74603..68030090c 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -506,7 +506,6 @@ gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 {
 	gint i = 0;
-	gchar *ret;
 	GString *siginfo;
 	gpgme_signature_t sig = NULL;
 
@@ -635,9 +634,7 @@ gchar *sgpgme_sigstat_info_full(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 		gpgme_key_unref(key);
 	}
 bail:
-	ret = siginfo->str;
-	g_string_free(siginfo, FALSE);
-	return ret;
+	return g_string_free(siginfo, FALSE);
 }
 
 gpgme_data_t sgpgme_data_from_mimeinfo(MimeInfo *mimeinfo)
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 2d06a369b..7ca19cb30 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -4620,8 +4620,7 @@ void prefs_account_write_config_all(GList *account_list)
         
 		str = g_string_sized_new(32);
 		g_hash_table_foreach(tmp_ac_prefs.privacy_prefs, create_privacy_prefs, str);
-		privacy_prefs = str->str;		    
-		g_string_free(str, FALSE);
+		privacy_prefs = g_string_free(str, FALSE);
 
 		WRITE_PARAM(basic_param)
 		WRITE_PARAM(receive_param)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list