mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 14:36:16 +01:00
Fix several signedness warnings in glib/tests/sequence.c
glib/tests/sequence.c: In function ‘check_integrity’: glib/tests/sequence.c:139:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 139 | g_assert (info->n_items == g_queue_get_length (info->queue)); | ^~ glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’ 941 | #define G_LIKELY(expr) (expr) | ^~~~ glib/tests/sequence.c:139:3: note: in expansion of macro ‘g_assert’ 139 | g_assert (info->n_items == g_queue_get_length (info->queue)); | ^~~~~~~~ glib/tests/sequence.c:157:27: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} 157 | g_assert (info->n_items == g_queue_get_length (info->queue)); | ^~ glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’ 941 | #define G_LIKELY(expr) (expr) | ^~~~ glib/tests/sequence.c:157:3: note: in expansion of macro ‘g_assert’ 157 | g_assert (info->n_items == g_queue_get_length (info->queue)); | ^~~~~~~~ glib/tests/sequence.c: In function ‘run_random_tests’: glib/tests/sequence.c:554:55: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} 554 | g_assert (g_queue_get_length (seq->queue) == g_sequence_get_length (seq->sequence)); | ^~ glib/gmacros.h:941:25: note: in definition of macro ‘G_LIKELY’ 941 | #define G_LIKELY(expr) (expr) | ^~~~ glib/tests/sequence.c:554:13: note: in expansion of macro ‘g_assert’ 554 | g_assert (g_queue_get_length (seq->queue) == g_sequence_get_length (seq->sequence)); | ^~~~~~~~ glib/tests/sequence.c: In function ‘main’: glib/tests/sequence.c:1404:17: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ 1404 | for (i = 0; i < G_N_ELEMENTS (seeds); ++i) | ^
This commit is contained in:
parent
82be350f59
commit
89729bcd28
@ -15,7 +15,7 @@ struct _GSequence
|
|||||||
|
|
||||||
struct _GSequenceNode
|
struct _GSequenceNode
|
||||||
{
|
{
|
||||||
gint n_nodes;
|
guint n_nodes;
|
||||||
GSequenceNode * parent;
|
GSequenceNode * parent;
|
||||||
GSequenceNode * left;
|
GSequenceNode * left;
|
||||||
GSequenceNode * right;
|
GSequenceNode * right;
|
||||||
@ -99,7 +99,7 @@ typedef struct SequenceInfo
|
|||||||
{
|
{
|
||||||
GQueue * queue;
|
GQueue * queue;
|
||||||
GSequence * sequence;
|
GSequence * sequence;
|
||||||
int n_items;
|
guint n_items;
|
||||||
} SequenceInfo;
|
} SequenceInfo;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -137,7 +137,7 @@ check_integrity (SequenceInfo *info)
|
|||||||
g_sequence_get_length (info->sequence), info->n_items);
|
g_sequence_get_length (info->sequence), info->n_items);
|
||||||
#endif
|
#endif
|
||||||
g_assert (info->n_items == g_queue_get_length (info->queue));
|
g_assert (info->n_items == g_queue_get_length (info->queue));
|
||||||
g_assert (g_sequence_get_length (info->sequence) == info->n_items);
|
g_assert ((guint) g_sequence_get_length (info->sequence) == info->n_items);
|
||||||
|
|
||||||
iter = g_sequence_get_begin_iter (info->sequence);
|
iter = g_sequence_get_begin_iter (info->sequence);
|
||||||
list = info->queue->head;
|
list = info->queue->head;
|
||||||
@ -155,7 +155,7 @@ check_integrity (SequenceInfo *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_assert (info->n_items == g_queue_get_length (info->queue));
|
g_assert (info->n_items == g_queue_get_length (info->queue));
|
||||||
g_assert (g_sequence_get_length (info->sequence) == info->n_items);
|
g_assert ((guint) g_sequence_get_length (info->sequence) == info->n_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
@ -551,7 +551,7 @@ run_random_tests (gconstpointer d)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
g_assert (g_queue_get_length (seq->queue) == g_sequence_get_length (seq->sequence));
|
g_assert (g_queue_get_length (seq->queue) == (guint) g_sequence_get_length (seq->sequence));
|
||||||
|
|
||||||
for (i = 0; i < 10; ++i)
|
for (i = 0; i < 10; ++i)
|
||||||
{
|
{
|
||||||
@ -1387,7 +1387,7 @@ int
|
|||||||
main (int argc,
|
main (int argc,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
gint i;
|
gsize i;
|
||||||
guint32 seed;
|
guint32 seed;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user