giinterfaceinfo: Fix int signedness in APIs

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3155
This commit is contained in:
Philip Withnall 2023-12-12 17:51:07 +00:00
parent 417c42ba21
commit a00389343a
3 changed files with 32 additions and 34 deletions

View File

@ -53,7 +53,7 @@
* *
* Returns: number of prerequisites * Returns: number of prerequisites
*/ */
gint guint
gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info) gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -79,7 +79,7 @@ gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info)
*/ */
GIBaseInfo * GIBaseInfo *
gi_interface_info_get_prerequisite (GIInterfaceInfo *info, gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n) guint n)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
InterfaceBlob *blob; InterfaceBlob *blob;
@ -102,7 +102,7 @@ gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
* *
* Returns: number of properties * Returns: number of properties
*/ */
gint guint
gi_interface_info_get_n_properties (GIInterfaceInfo *info) gi_interface_info_get_n_properties (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -128,7 +128,7 @@ gi_interface_info_get_n_properties (GIInterfaceInfo *info)
*/ */
GIPropertyInfo * GIPropertyInfo *
gi_interface_info_get_property (GIInterfaceInfo *info, gi_interface_info_get_property (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -157,7 +157,7 @@ gi_interface_info_get_property (GIInterfaceInfo *info,
* *
* Returns: number of methods * Returns: number of methods
*/ */
gint guint
gi_interface_info_get_n_methods (GIInterfaceInfo *info) gi_interface_info_get_n_methods (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -183,7 +183,7 @@ gi_interface_info_get_n_methods (GIInterfaceInfo *info)
*/ */
GIFunctionInfo * GIFunctionInfo *
gi_interface_info_get_method (GIInterfaceInfo *info, gi_interface_info_get_method (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -240,7 +240,7 @@ gi_interface_info_find_method (GIInterfaceInfo *info,
* *
* Returns: number of signals * Returns: number of signals
*/ */
gint guint
gi_interface_info_get_n_signals (GIInterfaceInfo *info) gi_interface_info_get_n_signals (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -266,7 +266,7 @@ gi_interface_info_get_n_signals (GIInterfaceInfo *info)
*/ */
GISignalInfo * GISignalInfo *
gi_interface_info_get_signal (GIInterfaceInfo *info, gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -304,11 +304,10 @@ GISignalInfo *
gi_interface_info_find_signal (GIInterfaceInfo *info, gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name) const gchar *name)
{ {
gint n_signals; guint n_signals;
gint i;
n_signals = gi_interface_info_get_n_signals (info); n_signals = gi_interface_info_get_n_signals (info);
for (i = 0; i < n_signals; i++) for (guint i = 0; i < n_signals; i++)
{ {
GISignalInfo *siginfo = gi_interface_info_get_signal (info, i); GISignalInfo *siginfo = gi_interface_info_get_signal (info, i);
@ -331,7 +330,7 @@ gi_interface_info_find_signal (GIInterfaceInfo *info,
* *
* Returns: number of virtual functions * Returns: number of virtual functions
*/ */
gint guint
gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info) gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -357,7 +356,7 @@ gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info)
*/ */
GIVFuncInfo * GIVFuncInfo *
gi_interface_info_get_vfunc (GIInterfaceInfo *info, gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -424,7 +423,7 @@ gi_interface_info_find_vfunc (GIInterfaceInfo *info,
* *
* Returns: number of constants * Returns: number of constants
*/ */
gint guint
gi_interface_info_get_n_constants (GIInterfaceInfo *info) gi_interface_info_get_n_constants (GIInterfaceInfo *info)
{ {
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;
@ -450,7 +449,7 @@ gi_interface_info_get_n_constants (GIInterfaceInfo *info)
*/ */
GIConstantInfo * GIConstantInfo *
gi_interface_info_get_constant (GIInterfaceInfo *info, gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n) guint n)
{ {
gint offset; gint offset;
GIRealInfo *rinfo = (GIRealInfo *)info; GIRealInfo *rinfo = (GIRealInfo *)info;

View File

@ -43,58 +43,58 @@ G_BEGIN_DECLS
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info); guint gi_interface_info_get_n_prerequisites (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info, GIBaseInfo * gi_interface_info_get_prerequisite (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_properties (GIInterfaceInfo *info); guint gi_interface_info_get_n_properties (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info, GIPropertyInfo * gi_interface_info_get_property (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_methods (GIInterfaceInfo *info); guint gi_interface_info_get_n_methods (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info, GIFunctionInfo * gi_interface_info_get_method (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info, GIFunctionInfo * gi_interface_info_find_method (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_signals (GIInterfaceInfo *info); guint gi_interface_info_get_n_signals (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info, GISignalInfo * gi_interface_info_get_signal (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info, GISignalInfo * gi_interface_info_find_signal (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info); guint gi_interface_info_get_n_vfuncs (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info, GIVFuncInfo * gi_interface_info_get_vfunc (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info, GIVFuncInfo * gi_interface_info_find_vfunc (GIInterfaceInfo *info,
const gchar *name); const gchar *name);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
gint gi_interface_info_get_n_constants (GIInterfaceInfo *info); guint gi_interface_info_get_n_constants (GIInterfaceInfo *info);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL
GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info, GIConstantInfo * gi_interface_info_get_constant (GIInterfaceInfo *info,
gint n); guint n);
GI_AVAILABLE_IN_ALL GI_AVAILABLE_IN_ALL

View File

@ -1166,7 +1166,6 @@ write_interface_info (const gchar *ns,
const gchar *type_init; const gchar *type_init;
GIStructInfo *class_struct; GIStructInfo *class_struct;
gboolean deprecated; gboolean deprecated;
gint i;
name = gi_base_info_get_name ((GIBaseInfo *)info); name = gi_base_info_get_name ((GIBaseInfo *)info);
deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info); deprecated = gi_base_info_is_deprecated ((GIBaseInfo *)info);
@ -1191,7 +1190,7 @@ write_interface_info (const gchar *ns,
if (gi_interface_info_get_n_prerequisites (info) > 0) if (gi_interface_info_get_n_prerequisites (info) > 0)
{ {
for (i = 0; i < gi_interface_info_get_n_prerequisites (info); i++) for (guint i = 0; i < gi_interface_info_get_n_prerequisites (info); i++)
{ {
GIBaseInfo *req = gi_interface_info_get_prerequisite (info, i); GIBaseInfo *req = gi_interface_info_get_prerequisite (info, i);
@ -1203,35 +1202,35 @@ write_interface_info (const gchar *ns,
} }
} }
for (i = 0; i < gi_interface_info_get_n_methods (info); i++) for (guint i = 0; i < gi_interface_info_get_n_methods (info); i++)
{ {
GIFunctionInfo *function = gi_interface_info_get_method (info, i); GIFunctionInfo *function = gi_interface_info_get_method (info, i);
write_function_info (ns, function, file); write_function_info (ns, function, file);
gi_base_info_unref ((GIBaseInfo *)function); gi_base_info_unref ((GIBaseInfo *)function);
} }
for (i = 0; i < gi_interface_info_get_n_properties (info); i++) for (guint i = 0; i < gi_interface_info_get_n_properties (info); i++)
{ {
GIPropertyInfo *prop = gi_interface_info_get_property (info, i); GIPropertyInfo *prop = gi_interface_info_get_property (info, i);
write_property_info (ns, prop, file); write_property_info (ns, prop, file);
gi_base_info_unref ((GIBaseInfo *)prop); gi_base_info_unref ((GIBaseInfo *)prop);
} }
for (i = 0; i < gi_interface_info_get_n_signals (info); i++) for (guint i = 0; i < gi_interface_info_get_n_signals (info); i++)
{ {
GISignalInfo *signal = gi_interface_info_get_signal (info, i); GISignalInfo *signal = gi_interface_info_get_signal (info, i);
write_signal_info (ns, signal, file); write_signal_info (ns, signal, file);
gi_base_info_unref ((GIBaseInfo *)signal); gi_base_info_unref ((GIBaseInfo *)signal);
} }
for (i = 0; i < gi_interface_info_get_n_vfuncs (info); i++) for (guint i = 0; i < gi_interface_info_get_n_vfuncs (info); i++)
{ {
GIVFuncInfo *vfunc = gi_interface_info_get_vfunc (info, i); GIVFuncInfo *vfunc = gi_interface_info_get_vfunc (info, i);
write_vfunc_info (ns, vfunc, file); write_vfunc_info (ns, vfunc, file);
gi_base_info_unref ((GIBaseInfo *)vfunc); gi_base_info_unref ((GIBaseInfo *)vfunc);
} }
for (i = 0; i < gi_interface_info_get_n_constants (info); i++) for (guint i = 0; i < gi_interface_info_get_n_constants (info); i++)
{ {
GIConstantInfo *constant = gi_interface_info_get_constant (info, i); GIConstantInfo *constant = gi_interface_info_get_constant (info, i);
write_constant_info (ns, constant, file); write_constant_info (ns, constant, file);