]> granicus.if.org Git - strace/commitdiff
tests: add suffix and cast to 64-bit constants in aio test
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 6 Sep 2016 09:02:44 +0000 (12:02 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 6 Sep 2016 09:06:24 +0000 (09:06 +0000)
This helps to avoid warnings like
"integer constant is too large for ‘long’ type"
reported by some versions of gcc on 32-bit platforms.

* tests/aio.c (main): Add ULL suffix to 64-bit constants
and cast them to unsigned long.

tests/aio.c

index 8c5bfa7dae834a2f53f167a344b3b4c1727eeb93..3f18de8975a77be09674f299a4c38d830c08b055 100644 (file)
@@ -51,17 +51,17 @@ main(void)
 
        const struct iocb proto_cb[] = {
                {
-                       .aio_data = 0xfeedface11111111,
+                       .aio_data = (unsigned long) 0xfeedface11111111ULL,
                        .aio_reqprio = 11,
                        .aio_buf = (unsigned long) data0,
-                       .aio_offset = 0xdeface1facefeed,
+                       .aio_offset = (unsigned long) 0xdeface1facefeedULL,
                        .aio_nbytes = sizeof_data0
                },
                {
-                       .aio_data = 0xfeedface22222222,
+                       .aio_data = (unsigned long) 0xfeedface22222222ULL,
                        .aio_reqprio = 22,
                        .aio_buf = (unsigned long) data1,
-                       .aio_offset = 0xdeface2cafef00d,
+                       .aio_offset = (unsigned long) 0xdeface2cafef00dULL,
                        .aio_nbytes = sizeof_data1
                }
        };
@@ -93,26 +93,26 @@ main(void)
 
        const struct iocb proto_cbv[] = {
                {
-                       .aio_data = 0xfeed11111111face,
+                       .aio_data = (unsigned long) 0xfeed11111111faceULL,
                        .aio_lio_opcode = 7,
                        .aio_reqprio = 111,
                        .aio_buf = (unsigned long) iov0,
-                       .aio_offset = 0xdeface1facefeed,
+                       .aio_offset = (unsigned long) 0xdeface1facefeedULL,
                        .aio_nbytes = ARRAY_SIZE(proto_iov0)
                },
                {
-                       .aio_data = 0xfeed22222222face,
+                       .aio_data = (unsigned long) 0xfeed22222222faceULL,
                        .aio_lio_opcode = 7,
                        .aio_reqprio = 222,
                        .aio_buf = (unsigned long) iov1,
-                       .aio_offset = 0xdeface2cafef00d,
+                       .aio_offset = (unsigned long) 0xdeface2cafef00dULL,
                        .aio_nbytes = ARRAY_SIZE(proto_iov1)
                }
        };
        const struct iocb *cbv = tail_memdup(proto_cbv, sizeof(proto_cbv));
 
        const struct iocb proto_cbc = {
-               .aio_data = 0xdeadbeefbadc0ded,
+               .aio_data = (unsigned long) 0xdeadbeefbadc0dedULL,
                .aio_reqprio = 99,
                .aio_fildes = -42
        };