mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-28 18:16:53 +02:00
girepository: constify iterator arguments
This is an API break, but libgirepository has not been in a stable release yet, so that’s fine. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3155
This commit is contained in:
parent
5fa28d1b7e
commit
825581756a
@ -747,7 +747,7 @@ gi_base_info_get_attribute (GIBaseInfo *info,
|
|||||||
const gchar *name)
|
const gchar *name)
|
||||||
{
|
{
|
||||||
GIAttributeIter iter = { 0, };
|
GIAttributeIter iter = { 0, };
|
||||||
gchar *curname, *curvalue;
|
const char *curname, *curvalue;
|
||||||
while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue))
|
while (gi_base_info_iterate_attributes (info, &iter, &curname, &curvalue))
|
||||||
{
|
{
|
||||||
if (strcmp (name, curname) == 0)
|
if (strcmp (name, curname) == 0)
|
||||||
@ -832,8 +832,8 @@ _attribute_blob_find_first (GIBaseInfo *info,
|
|||||||
* print_attributes (GIBaseInfo *info)
|
* print_attributes (GIBaseInfo *info)
|
||||||
* {
|
* {
|
||||||
* GIAttributeIter iter = { 0, };
|
* GIAttributeIter iter = { 0, };
|
||||||
* char *name;
|
* const char *name;
|
||||||
* char *value;
|
* const char *value;
|
||||||
* while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
|
* while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
|
||||||
* {
|
* {
|
||||||
* g_print ("attribute name: %s value: %s", name, value);
|
* g_print ("attribute name: %s value: %s", name, value);
|
||||||
@ -846,8 +846,8 @@ _attribute_blob_find_first (GIBaseInfo *info,
|
|||||||
gboolean
|
gboolean
|
||||||
gi_base_info_iterate_attributes (GIBaseInfo *info,
|
gi_base_info_iterate_attributes (GIBaseInfo *info,
|
||||||
GIAttributeIter *iterator,
|
GIAttributeIter *iterator,
|
||||||
gchar **name,
|
const gchar **name,
|
||||||
gchar **value)
|
const gchar **value)
|
||||||
{
|
{
|
||||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||||
Header *header = (Header *)rinfo->typelib->data;
|
Header *header = (Header *)rinfo->typelib->data;
|
||||||
@ -864,8 +864,8 @@ gi_base_info_iterate_attributes (GIBaseInfo *info,
|
|||||||
if (next == NULL || next->offset != rinfo->offset || next >= after)
|
if (next == NULL || next->offset != rinfo->offset || next >= after)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
*name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name);
|
*name = gi_typelib_get_string (rinfo->typelib, next->name);
|
||||||
*value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value);
|
*value = gi_typelib_get_string (rinfo->typelib, next->value);
|
||||||
iterator->data = next + 1;
|
iterator->data = next + 1;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -79,8 +79,8 @@ const gchar * gi_base_info_get_attribute (GIBaseInfo *info,
|
|||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
gboolean gi_base_info_iterate_attributes (GIBaseInfo *info,
|
gboolean gi_base_info_iterate_attributes (GIBaseInfo *info,
|
||||||
GIAttributeIter *iterator,
|
GIAttributeIter *iterator,
|
||||||
char **name,
|
const char **name,
|
||||||
char **value);
|
const char **value);
|
||||||
|
|
||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info);
|
GIBaseInfo * gi_base_info_get_container (GIBaseInfo *info);
|
||||||
|
@ -411,7 +411,7 @@ gi_callable_info_get_return_attribute (GICallableInfo *info,
|
|||||||
const gchar *name)
|
const gchar *name)
|
||||||
{
|
{
|
||||||
GIAttributeIter iter = { 0, };
|
GIAttributeIter iter = { 0, };
|
||||||
gchar *curname, *curvalue;
|
const char *curname, *curvalue;
|
||||||
while (gi_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue))
|
while (gi_callable_info_iterate_return_attributes (info, &iter, &curname, &curvalue))
|
||||||
{
|
{
|
||||||
if (g_strcmp0 (name, curname) == 0)
|
if (g_strcmp0 (name, curname) == 0)
|
||||||
@ -443,8 +443,8 @@ gi_callable_info_get_return_attribute (GICallableInfo *info,
|
|||||||
gboolean
|
gboolean
|
||||||
gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
||||||
GIAttributeIter *iterator,
|
GIAttributeIter *iterator,
|
||||||
char **name,
|
const char **name,
|
||||||
char **value)
|
const char **value)
|
||||||
{
|
{
|
||||||
GIRealInfo *rinfo = (GIRealInfo *)info;
|
GIRealInfo *rinfo = (GIRealInfo *)info;
|
||||||
Header *header = (Header *)rinfo->typelib->data;
|
Header *header = (Header *)rinfo->typelib->data;
|
||||||
@ -464,8 +464,8 @@ gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
|||||||
if (next == NULL || next->offset != blob_offset || next >= after)
|
if (next == NULL || next->offset != blob_offset || next >= after)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
*name = (gchar*) gi_typelib_get_string (rinfo->typelib, next->name);
|
*name = gi_typelib_get_string (rinfo->typelib, next->name);
|
||||||
*value = (gchar*) gi_typelib_get_string (rinfo->typelib, next->value);
|
*value = gi_typelib_get_string (rinfo->typelib, next->value);
|
||||||
iterator->data = next + 1;
|
iterator->data = next + 1;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -65,8 +65,8 @@ const gchar * gi_callable_info_get_return_attribute (GICallableInfo *in
|
|||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
gboolean gi_callable_info_iterate_return_attributes (GICallableInfo *info,
|
||||||
GIAttributeIter *iterator,
|
GIAttributeIter *iterator,
|
||||||
char **name,
|
const char **name,
|
||||||
char **value);
|
const char **value);
|
||||||
|
|
||||||
GI_AVAILABLE_IN_ALL
|
GI_AVAILABLE_IN_ALL
|
||||||
GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info);
|
GITransfer gi_callable_info_get_caller_owns (GICallableInfo *info);
|
||||||
|
@ -352,7 +352,7 @@ write_attributes (Xml *file,
|
|||||||
GIBaseInfo *info)
|
GIBaseInfo *info)
|
||||||
{
|
{
|
||||||
GIAttributeIter iter = { 0, };
|
GIAttributeIter iter = { 0, };
|
||||||
char *name, *value;
|
const char *name, *value;
|
||||||
|
|
||||||
while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
|
while (gi_base_info_iterate_attributes (info, &iter, &name, &value))
|
||||||
{
|
{
|
||||||
@ -367,7 +367,7 @@ write_return_value_attributes (Xml *file,
|
|||||||
GICallableInfo *info)
|
GICallableInfo *info)
|
||||||
{
|
{
|
||||||
GIAttributeIter iter = { 0, };
|
GIAttributeIter iter = { 0, };
|
||||||
char *name, *value;
|
const char *name, *value;
|
||||||
|
|
||||||
while (gi_callable_info_iterate_return_attributes (info, &iter, &name, &value))
|
while (gi_callable_info_iterate_return_attributes (info, &iter, &name, &value))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user