[Github-comments] [geany/geany] build.c: Remove g_ptr_array_foreach with gpointer user_data & update HACKING (#2270)

Matthew Brush notifications at xxxxx
Sat Aug 24 00:57:30 UTC 2019


codebrainz commented on this pull request.



> @@ -2577,15 +2565,20 @@ void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
 				g_key_file_remove_key(config, build_grp_name, "error_regex", NULL);
 			if (pj->priv->build_filetypes_list != NULL)
 			{
-				data.config = config;
-				data.ft_names = g_ptr_array_new();
-				g_ptr_array_foreach(pj->priv->build_filetypes_list, foreach_project_filetype, (gpointer)(&data));
-				if (data.ft_names->pdata != NULL)
+				GPtrArray *ft_names = g_ptr_array_new();
+				guint i;
+				
+				foreach_ptr_array(ft, i, pj->priv->build_filetypes_list)

> We should add @deprecated to all the foreach_* macro doc-comments in the API, if they're not supposed to be used in new code, so people have a chance to find out.

:+1: 

I don't think there's been any discussion about it (lately) but my personal opinion is that all macros and functions which obscure what the code does just to save a line or two of code should be deprecated. C is verbose, but it's easy to read if the code is all in sequence.

-- 
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/pull/2270#discussion_r317337996
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190823/0cbf0fb1/attachment.html>


More information about the Github-comments mailing list