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

Nick Treleaven notifications at xxxxx
Thu Aug 22 16:16:45 UTC 2019


* HACKING: Avoid untyped pointers & `*_foreach()` with non-NULL `user_data` void pointer where practical.
* build.c: Avoid `g_ptr_array_foreach` with `user_data` void pointer - this also means we can get rid of the singleton `ForEachData`, which simplifies the code quite a bit.

Note: `GPtrArray` is already not typesafe, but it does support external iteration, which allows us to avoid passing the address of typed data to a `user_data` void pointer, which is another violation of type safety.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/2270

-- Commit Summary --

  * build.c: Remove g_ptr_array_foreach with untyped user_data
  * HACKING: Avoid untyped pointers & *_foreach() with non-NULL user_data

-- File Changes --

    M HACKING (4)
    M src/build.c (41)

-- Patch Links --

https://github.com/geany/geany/pull/2270.patch
https://github.com/geany/geany/pull/2270.diff

-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190822/f7e61e57/attachment-0001.html>


More information about the Github-comments mailing list