girepository: Remove GI_FUNCTION_THROWS and GI_VFUNC_THROWS flags

These flags were replaced by gi_callable_info_can_throw_error() in
girepository 1.x, but the flags were maintained for backwards
compatibility. No need to hold on to them in the 2.x API.

Note that these flags are also still maintained as separate bits in the
binary format, which is not changing. So, they still need to be read
from FunctionBlob and VFuncBlob if the bit is not set in SignatureBlob.

This is an API break for girepository 2.x, which is OK because the API
has never been released yet.
This commit is contained in:
Philip Chimento 2024-01-15 21:55:36 -08:00
parent 856850ab15
commit ad9cd1762a
4 changed files with 0 additions and 13 deletions

View File

@ -140,9 +140,6 @@ gi_function_info_get_flags (GIFunctionInfo *info)
if (blob->wraps_vfunc) if (blob->wraps_vfunc)
flags = flags | GI_FUNCTION_WRAPS_VFUNC; flags = flags | GI_FUNCTION_WRAPS_VFUNC;
if (blob->throws)
flags = flags | GI_FUNCTION_THROWS;
return flags; return flags;
} }

View File

@ -441,7 +441,6 @@ typedef enum
* @GI_VFUNC_MUST_CHAIN_UP: chains up to the parent type * @GI_VFUNC_MUST_CHAIN_UP: chains up to the parent type
* @GI_VFUNC_MUST_OVERRIDE: overrides * @GI_VFUNC_MUST_OVERRIDE: overrides
* @GI_VFUNC_MUST_NOT_OVERRIDE: does not override * @GI_VFUNC_MUST_NOT_OVERRIDE: does not override
* @GI_VFUNC_THROWS: includes a [type@GLib.Error]
* *
* Flags of a [class@GIRepository.VFuncInfo] struct. * Flags of a [class@GIRepository.VFuncInfo] struct.
* *
@ -452,7 +451,6 @@ typedef enum
GI_VFUNC_MUST_CHAIN_UP = 1 << 0, GI_VFUNC_MUST_CHAIN_UP = 1 << 0,
GI_VFUNC_MUST_OVERRIDE = 1 << 1, GI_VFUNC_MUST_OVERRIDE = 1 << 1,
GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2, GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2,
GI_VFUNC_THROWS = 1 << 3
} GIVFuncInfoFlags; } GIVFuncInfoFlags;
/** /**
@ -462,7 +460,6 @@ typedef enum
* @GI_FUNCTION_IS_GETTER: is a getter of a [class@GIRepository.PropertyInfo]. * @GI_FUNCTION_IS_GETTER: is a getter of a [class@GIRepository.PropertyInfo].
* @GI_FUNCTION_IS_SETTER: is a setter of a [class@GIRepository.PropertyInfo]. * @GI_FUNCTION_IS_SETTER: is a setter of a [class@GIRepository.PropertyInfo].
* @GI_FUNCTION_WRAPS_VFUNC: represents a virtual function. * @GI_FUNCTION_WRAPS_VFUNC: represents a virtual function.
* @GI_FUNCTION_THROWS: the function may throw an error.
* *
* Flags for a [class@GIRepository.FunctionInfo] struct. * Flags for a [class@GIRepository.FunctionInfo] struct.
* *
@ -475,7 +472,6 @@ typedef enum
GI_FUNCTION_IS_GETTER = 1 << 2, GI_FUNCTION_IS_GETTER = 1 << 2,
GI_FUNCTION_IS_SETTER = 1 << 3, GI_FUNCTION_IS_SETTER = 1 << 3,
GI_FUNCTION_WRAPS_VFUNC = 1 << 4, GI_FUNCTION_WRAPS_VFUNC = 1 << 4,
GI_FUNCTION_THROWS = 1 << 5
} GIFunctionInfoFlags; } GIFunctionInfoFlags;
G_END_DECLS G_END_DECLS

View File

@ -104,9 +104,6 @@ gi_vfunc_info_get_flags (GIVFuncInfo *info)
if (blob->must_not_be_implemented) if (blob->must_not_be_implemented)
flags = flags | GI_VFUNC_MUST_NOT_OVERRIDE; flags = flags | GI_VFUNC_MUST_NOT_OVERRIDE;
if (blob->throws)
flags = flags | GI_VFUNC_THROWS;
return flags; return flags;
} }

View File

@ -37,7 +37,6 @@ test_invoke_gerror (RepositoryFixture *fx,
func_info = GI_FUNCTION_INFO (gi_repository_find_by_name (fx->repository, "GLib", "file_read_link")); func_info = GI_FUNCTION_INFO (gi_repository_find_by_name (fx->repository, "GLib", "file_read_link"));
g_assert_nonnull (func_info); g_assert_nonnull (func_info);
g_assert_true (gi_function_info_get_flags (func_info) & GI_FUNCTION_THROWS);
g_assert_true (gi_callable_info_can_throw_gerror (GI_CALLABLE_INFO (func_info))); g_assert_true (gi_callable_info_can_throw_gerror (GI_CALLABLE_INFO (func_info)));
in_arg[0].v_string = g_strdup ("non-existent-file/hope"); in_arg[0].v_string = g_strdup ("non-existent-file/hope");
@ -66,12 +65,10 @@ test_vfunc_can_throw_gerror (RepositoryFixture *fx,
invoker_info = gi_interface_info_find_method (interface_info, "launch"); invoker_info = gi_interface_info_find_method (interface_info, "launch");
g_assert_nonnull (invoker_info); g_assert_nonnull (invoker_info);
g_assert_true (gi_function_info_get_flags (invoker_info) & GI_FUNCTION_THROWS);
g_assert_true (gi_callable_info_can_throw_gerror (GI_CALLABLE_INFO (invoker_info))); g_assert_true (gi_callable_info_can_throw_gerror (GI_CALLABLE_INFO (invoker_info)));
vfunc_info = gi_interface_info_find_vfunc (interface_info, "launch"); vfunc_info = gi_interface_info_find_vfunc (interface_info, "launch");
g_assert_nonnull (vfunc_info); g_assert_nonnull (vfunc_info);
g_assert_true (gi_vfunc_info_get_flags (vfunc_info) & GI_VFUNC_THROWS);
g_assert_true (gi_callable_info_can_throw_gerror (GI_CALLABLE_INFO (vfunc_info))); g_assert_true (gi_callable_info_can_throw_gerror (GI_CALLABLE_INFO (vfunc_info)));
g_clear_pointer (&vfunc_info, gi_base_info_unref); g_clear_pointer (&vfunc_info, gi_base_info_unref);