aboutsummaryrefslogtreecommitdiffstats
path: root/libglitter_enable_acceleration.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-28 09:19:05 +0100
committerMattias Andrée <maandree@kth.se>2023-01-28 09:31:28 +0100
commit575e3ad31dd8ccf2afdd5c8a8d2dbf8d57241c5d (patch)
tree45b154e54eb7caa0300e5176237cb84257da138e /libglitter_enable_acceleration.c
parentlibglitter.7: add application usage section (diff)
downloadlibglitter-575e3ad31dd8ccf2afdd5c8a8d2dbf8d57241c5d.tar.gz
libglitter-575e3ad31dd8ccf2afdd5c8a8d2dbf8d57241c5d.tar.bz2
libglitter-575e3ad31dd8ccf2afdd5c8a8d2dbf8d57241c5d.tar.xz
Fix warnings, add restrict, and add function attributes1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libglitter_enable_acceleration.c')
-rw-r--r--libglitter_enable_acceleration.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libglitter_enable_acceleration.c b/libglitter_enable_acceleration.c
index 5539116..bfa7929 100644
--- a/libglitter_enable_acceleration.c
+++ b/libglitter_enable_acceleration.c
@@ -45,31 +45,33 @@ callback_null(int ret, int err, void *user)
int
main(void)
{
+#define ALL (~UINT64_C(0))
+
char data = 'u';
ASSERT(!libglitter_enable_acceleration(0, 0, NULL, NULL, NULL));
ASSERT(!libglitter_enable_acceleration(0, 1, NULL, NULL, NULL));
- ASSERT(!libglitter_enable_acceleration(~0, 0, NULL, NULL, NULL));
- ASSERT(!libglitter_enable_acceleration(~0, 1, NULL, NULL, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 0, NULL, NULL, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 1, NULL, NULL, NULL));
ASSERT(!libglitter_enable_acceleration(0, 0, NULL, &data, NULL));
ASSERT(!libglitter_enable_acceleration(0, 1, NULL, &data, NULL));
- ASSERT(!libglitter_enable_acceleration(~0, 0, NULL, &data, NULL));
- ASSERT(!libglitter_enable_acceleration(~0, 1, NULL, &data, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 0, NULL, &data, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 1, NULL, &data, NULL));
ASSERT(callback_calls == 0);
ASSERT(!libglitter_enable_acceleration(0, 0, callback, &data, NULL));
ASSERT(callback_calls == 1);
ASSERT(!libglitter_enable_acceleration(0, 1, callback, &data, NULL));
ASSERT(callback_calls == 2);
- ASSERT(!libglitter_enable_acceleration(~0, 0, callback, &data, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 0, callback, &data, NULL));
ASSERT(callback_calls == 3);
- ASSERT(!libglitter_enable_acceleration(~0, 1, callback, &data, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 1, callback, &data, NULL));
ASSERT(callback_calls == 4);
ASSERT(!libglitter_enable_acceleration(0, 0, callback_null, NULL, NULL));
ASSERT(callback_calls == 5);
ASSERT(!libglitter_enable_acceleration(0, 1, callback_null, NULL, NULL));
ASSERT(callback_calls == 6);
- ASSERT(!libglitter_enable_acceleration(~0, 0, callback_null, NULL, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 0, callback_null, NULL, NULL));
ASSERT(callback_calls == 7);
- ASSERT(!libglitter_enable_acceleration(~0, 1, callback_null, NULL, NULL));
+ ASSERT(!libglitter_enable_acceleration(ALL, 1, callback_null, NULL, NULL));
ASSERT(callback_calls == 8);
return 0;
}