Remove runtime warnings, add doxygen deprecation notices

This commit is contained in:
Cimbali
2021-11-01 22:03:26 +01:00
committed by Emmanuele Bassi
parent b03c3d0a16
commit d991e197de

View File

@@ -451,7 +451,9 @@ g_callable_info_destroy_closure (GICallableInfo *callable_info,
* @callback: the ffi callback * @callback: the ffi callback
* @user_data: data to be passed into the callback * @user_data: data to be passed into the callback
* *
* Prepares a callback for ffi invocation. Deprecated * Prepares a callback for ffi invocation.
*
* Deprecated: 1.72: Use g_callable_info_create_closure() instead
* *
* Returns: the native address of the closure or `NULL` on error. The return value * Returns: the native address of the closure or `NULL` on error. The return value
* should be freed by calling g_callable_info_free_closure(). * should be freed by calling g_callable_info_free_closure().
@@ -470,8 +472,6 @@ g_callable_info_prepare_closure (GICallableInfo *callable_info,
return NULL; return NULL;
} }
g_warning ("g_callable_info_prepare_closure is deprecated, use g_callable_info_create_closure instead\n");
/* Return the native pointer which, on some systems and ffi versions without static exec trampolines, /* Return the native pointer which, on some systems and ffi versions without static exec trampolines,
* points to the same underlying memory as closure, but via an executable-non-writable mapping. * points to the same underlying memory as closure, but via an executable-non-writable mapping.
* Deprecated, and kept for backwards compatibility only. Risks segfaults on freeing the closure. * Deprecated, and kept for backwards compatibility only. Risks segfaults on freeing the closure.
@@ -484,18 +484,18 @@ g_callable_info_prepare_closure (GICallableInfo *callable_info,
* @callable_info: a callable info from a typelib * @callable_info: a callable info from a typelib
* @closure: ffi closure * @closure: ffi closure
* *
* Does nothing. (Leaks memory!) Use g_callable_info_destroy_closure() instead, * Deprecated: 1.72: Use g_callable_info_destroy_closure() instead, in
* in conjunction with g_callable_info_create_closure(). * conjunction with g_callable_info_create_closure().
* *
* Should free a ffi_closure returned from g_callable_info_prepare_closure(), * Should free a ffi_closure returned from g_callable_info_prepare_closure(),
* which may cause a segfault because the native address is returned instead * which may cause a segfault because the native address is returned instead of
* of the closure address. * the closure address. May do nothing and leak memory instead of freeing to
* avoid segfaults.
*/ */
void void
g_callable_info_free_closure (GICallableInfo *callable_info, g_callable_info_free_closure (GICallableInfo *callable_info,
ffi_closure *closure) ffi_closure *closure)
{ {
g_warning ("g_callable_info_free_closure is deprecated and leaks memory\n");
#ifdef LEGACY_GIRFFI_FREE #ifdef LEGACY_GIRFFI_FREE
g_callable_info_destroy_closure(callable_info, closure); g_callable_info_destroy_closure(callable_info, closure);
#endif #endif