[Github-comments] [geany/geany-plugins] lineoperations: fixed -Werror=aggregate-return (#517)

Colomban Wendling notifications at xxxxx
Sun Feb 19 16:31:06 UTC 2017


b4n commented on this pull request.

Looks good apart from the unnecessary allocations.

Also, I'm find with depending on @techee's PR, so you can drop the first commit if you want.

>  	gint   num_chars      = 0;
 	gint   i              = 0;
 	gint   lines_affected = 0;
 
+	struct lo_lines *sel = g_malloc(sizeof(struct lo_lines));

instead of allocating on the heap you could pass `&sel` to the `get_current_sel_lines()` call below

> @@ -223,18 +227,26 @@ action_sci_manip_item(GtkMenuItem *menuitem, gpointer gdata)
 	/* function pointer to gdata -- function to be used */
 	gint (*func)(ScintillaObject *, gint, gint) = gdata;
 	GeanyDocument *doc  = document_get_current();
-	struct lo_lines sel = get_current_sel_lines(doc->editor->sci);
+
+	struct lo_lines *sel = g_malloc(sizeof(struct lo_lines));

ditto

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/517#pullrequestreview-22663334
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20170219/7e01cc83/attachment.html>


More information about the Github-comments mailing list