GNOME Bugzilla – Bug 756470
Fix up annotations in gdataset.c
Last modified: 2017-09-11 19:33:47 UTC
This hard-to-introspect API still needs some annotation love.
Created attachment 313154 [details] [review] g_datalist_id_replace_data: Annotate the out parameter
Created attachment 313155 [details] [review] gdataset: Correct (nullable) and (transfer none) annotations
Created attachment 313156 [details] [review] gdataset: Annotate the closures Annotate the closure parameters in GDataForeachFunc, GDuplicateFunc, and the functions using them.
Created attachment 313157 [details] [review] gdataset: Skip problematic functions in the introspection The functions with a GDestroyNotify to the data, or other ill-fitting allocation semantics, are not currently introspectable. The effect for the binding user would be that they're unable to create or destroy a GData list, but they might still have an API to poke at some data pointers from it. In fact, none of the functions dealing with GData** or a dataset location pointer are likely to get sensible bindings anyway; the annotations added are mostly to avoid memory unsafety and leaks.
Created attachment 315037 [details] [review] gdataset: Annotate the closures Annotate the closure parameters in GDataForeachFunc, GDuplicateFunc, and the functions using them.
Created attachment 315038 [details] [review] gdataset: Skip problematic functions in the introspection The functions with a GDestroyNotify to the data, or other ill-fitting allocation semantics, are not currently introspectable. The effect for the binding user would be that they're unable to create or destroy a GData list, but they might still have an API to poke at some data pointers from it. In fact, none of the functions dealing with GData** or a dataset location pointer are likely to get sensible bindings anyway; the annotations added are mostly to avoid memory unsafety and leaks.
Review of attachment 313154 [details] [review]: This is partially outdated now, but still makes a valuable fix from (nullable) to (out) (optional). Good to commit after rebasing.
Review of attachment 313155 [details] [review]: Looks good.
Review of attachment 315037 [details] [review]: Looks good.
Review of attachment 315038 [details] [review]: Sounds reasonable.
Thanks for the patches. I’ve rebased and pushed them (the rebase conflicts were trivial). Attachment 313154 [details] pushed as 595a7e3 - g_datalist_id_replace_data: Annotate the out parameter Attachment 313155 [details] pushed as 2a0e1c8 - gdataset: Correct (nullable) and (transfer none) annotations Attachment 315037 [details] pushed as a3ba8ea - gdataset: Annotate the closures Attachment 315038 [details] pushed as 28e8684 - gdataset: Skip problematic functions in the introspection