mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-03 07:15:42 -04:00
tests: Fix signedness warnings
This commit is contained in:
parent
fa5f7b1191
commit
ac06144cc9
3 changed files with 8 additions and 8 deletions
|
|
@ -45,16 +45,16 @@ TEST(array_init)
|
||||||
TEST(array_add)
|
TEST(array_add)
|
||||||
{
|
{
|
||||||
struct mydata {
|
struct mydata {
|
||||||
int a;
|
unsigned int a;
|
||||||
unsigned b;
|
unsigned int b;
|
||||||
double c;
|
double c;
|
||||||
double d;
|
double d;
|
||||||
};
|
};
|
||||||
|
|
||||||
const int iterations = 1321; /* this is arbitrary */
|
const unsigned int iterations = 1321; /* this is arbitrary */
|
||||||
const int datasize = sizeof(struct mydata);
|
const int datasize = sizeof(struct mydata);
|
||||||
struct wl_array array;
|
struct wl_array array;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
wl_array_init(&array);
|
wl_array_init(&array);
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ TEST(array_add)
|
||||||
assert((i + 1) * datasize == array.size);
|
assert((i + 1) * datasize == array.size);
|
||||||
|
|
||||||
ptr->a = i * 3;
|
ptr->a = i * 3;
|
||||||
ptr->b = -i;
|
ptr->b = 20000 - i;
|
||||||
ptr->c = (double)(i);
|
ptr->c = (double)(i);
|
||||||
ptr->d = (double)(i / 2.);
|
ptr->d = (double)(i / 2.);
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +75,7 @@ TEST(array_add)
|
||||||
struct mydata* check = (struct mydata*)(array.data + index);
|
struct mydata* check = (struct mydata*)(array.data + index);
|
||||||
|
|
||||||
assert(check->a == i * 3);
|
assert(check->a == i * 3);
|
||||||
assert(check->b == -i);
|
assert(check->b == 20000 - i);
|
||||||
assert(check->c == (double)(i));
|
assert(check->c == (double)(i));
|
||||||
assert(check->d == (double)(i/2.));
|
assert(check->d == (double)(i/2.));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ static void
|
||||||
marshal(struct marshal_data *data, const char *format, int size, ...)
|
marshal(struct marshal_data *data, const char *format, int size, ...)
|
||||||
{
|
{
|
||||||
struct wl_closure *closure;
|
struct wl_closure *closure;
|
||||||
static const int opcode = 4444;
|
static const uint32_t opcode = 4444;
|
||||||
static struct wl_object sender = { NULL, NULL, 1234 };
|
static struct wl_object sender = { NULL, NULL, 1234 };
|
||||||
struct wl_message message = { "test", format, NULL };
|
struct wl_message message = { "test", format, NULL };
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ TEST(list_iterator)
|
||||||
struct wl_list list;
|
struct wl_list list;
|
||||||
struct element e1, e2, e3, e4, *e;
|
struct element e1, e2, e3, e4, *e;
|
||||||
int reference[] = { 708090, 102030, 5588, 12 };
|
int reference[] = { 708090, 102030, 5588, 12 };
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
e1.i = 708090;
|
e1.i = 708090;
|
||||||
e2.i = 102030;
|
e2.i = 102030;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue