mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 11:42:10 +01:00
Fixing signedness warning in sindent():gtester.c
../glib.git/glib/gtester.c: In function ‘sindent’: ../glib.git/glib/gmacros.h:351:26: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare] #define MIN(a, b) (((a) < (b)) ? (a) : (b)) ^ ../glib.git/glib/gtester.c:73:7: note: in expansion of macro ‘MIN’ n = MIN (n, l); ^~~ ../glib.git/glib/gmacros.h:351:41: error: operand of ?: changes signedness from ‘int’ to ‘guint’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare] #define MIN(a, b) (((a) < (b)) ? (a) : (b)) ^~~ ../glib.git/glib/gtester.c:73:7: note: in expansion of macro ‘MIN’ n = MIN (n, l); ^~~
This commit is contained in:
parent
140b82083f
commit
9402940919
@ -69,7 +69,7 @@ static const char*
|
||||
sindent (guint n)
|
||||
{
|
||||
static const char spaces[] = " ";
|
||||
int l = sizeof (spaces) - 1;
|
||||
gsize l = sizeof (spaces) - 1;
|
||||
n = MIN (n, l);
|
||||
return spaces + l - n;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user