mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02:00
grel: Fix sign of GRealTuples.width
Thankfully this struct is also internal, so we can happily change the types of any field except the first one (which is in the public `GTuples` prefix). This fixes the remaining `-Wsign-conversion` warnings for `grel.c`. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
@@ -124,7 +124,7 @@ static size_t relation_count_internal (GRelation *relation,
|
|||||||
struct _GRealTuples
|
struct _GRealTuples
|
||||||
{
|
{
|
||||||
guint len;
|
guint len;
|
||||||
gint width;
|
size_t width;
|
||||||
gpointer *data;
|
gpointer *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -622,11 +622,16 @@ g_tuples_index (GTuples *tuples0,
|
|||||||
gint field)
|
gint field)
|
||||||
{
|
{
|
||||||
GRealTuples *tuples = (GRealTuples*) tuples0;
|
GRealTuples *tuples = (GRealTuples*) tuples0;
|
||||||
|
size_t unsigned_index, unsigned_field;
|
||||||
|
|
||||||
g_return_val_if_fail (tuples0 != NULL, NULL);
|
g_return_val_if_fail (tuples0 != NULL, NULL);
|
||||||
g_return_val_if_fail (field < tuples->width, NULL);
|
g_return_val_if_fail (index >= 0, NULL);
|
||||||
|
g_return_val_if_fail (field >= 0 && (size_t) field < tuples->width, NULL);
|
||||||
return tuples->data[index * tuples->width + field];
|
|
||||||
|
unsigned_index = (size_t) index;
|
||||||
|
unsigned_field = (size_t) field;
|
||||||
|
|
||||||
|
return tuples->data[unsigned_index * tuples->width + unsigned_field];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print
|
/* Print
|
||||||
|
Reference in New Issue
Block a user