From 41e15ecd4427bf38cc76103432c65c2d585f8ede Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 13 Jan 2017 19:31:30 +0000 Subject: [PATCH] tests: change SAMPLE_SIZE type to libc_off_t As ftruncate libc function and our create_sample function that calls ftruncate both take size argument of type libc_off_t, change the type of SAMPLE_SIZE constant to libc_off_t. * tests/fstat.c (SAMPLE_SIZE): Cast to libc_off_t. * tests/lstat.c (SAMPLE_SIZE): Likewise. * tests/oldfstat.c (SAMPLE_SIZE): Likewise. * tests/oldlstat.c (SAMPLE_SIZE): Likewise. * tests/oldstat.c (SAMPLE_SIZE): Likewise. * tests/stat.c (SAMPLE_SIZE): Likewise. * tests/xstatx.c (SAMPLE_SIZE): Likewise. --- tests/fstat.c | 2 +- tests/lstat.c | 2 +- tests/oldfstat.c | 2 +- tests/oldlstat.c | 2 +- tests/oldstat.c | 2 +- tests/stat.c | 2 +- tests/xstatx.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/fstat.c b/tests/fstat.c index 8a6c8531..12df3e19 100644 --- a/tests/fstat.c +++ b/tests/fstat.c @@ -32,7 +32,7 @@ # define TEST_SYSCALL_NR __NR_fstat # define TEST_SYSCALL_STR "fstat" -# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418ULL) +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) # include "fstatx.c" #else diff --git a/tests/lstat.c b/tests/lstat.c index 34a0e1d8..3754f766 100644 --- a/tests/lstat.c +++ b/tests/lstat.c @@ -32,7 +32,7 @@ # define TEST_SYSCALL_NR __NR_lstat # define TEST_SYSCALL_STR "lstat" -# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418ULL) +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) # include "lstatx.c" #else diff --git a/tests/oldfstat.c b/tests/oldfstat.c index 18d48f73..f5a94416 100644 --- a/tests/oldfstat.c +++ b/tests/oldfstat.c @@ -39,7 +39,7 @@ # define STRUCT_STAT struct __old_kernel_stat # define STRUCT_STAT_STR "struct __old_kernel_stat" # define STRUCT_STAT_IS_STAT64 0 -# define SAMPLE_SIZE ((kernel_ulong_t) 23147718418U) +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) # include "fstatx.c" #else diff --git a/tests/oldlstat.c b/tests/oldlstat.c index 9d3cb59f..66132370 100644 --- a/tests/oldlstat.c +++ b/tests/oldlstat.c @@ -39,7 +39,7 @@ # define STRUCT_STAT struct __old_kernel_stat # define STRUCT_STAT_STR "struct __old_kernel_stat" # define STRUCT_STAT_IS_STAT64 0 -# define SAMPLE_SIZE ((kernel_ulong_t) 23147718418U) +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 23147718418U) # include "lstatx.c" #else diff --git a/tests/oldstat.c b/tests/oldstat.c index 37da4809..d06e2bc6 100644 --- a/tests/oldstat.c +++ b/tests/oldstat.c @@ -39,7 +39,7 @@ # define STRUCT_STAT struct __old_kernel_stat # define STRUCT_STAT_STR "struct __old_kernel_stat" # define STRUCT_STAT_IS_STAT64 0 -# define SAMPLE_SIZE ((kernel_ulong_t) 131478418U) +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 131478418U) # include "lstatx.c" #else diff --git a/tests/stat.c b/tests/stat.c index 332a66fa..d4ca7b0b 100644 --- a/tests/stat.c +++ b/tests/stat.c @@ -32,7 +32,7 @@ # define TEST_SYSCALL_NR __NR_stat # define TEST_SYSCALL_STR "stat" -# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418ULL) +# define SAMPLE_SIZE ((libc_off_t) (kernel_ulong_t) 43147718418ULL) # include "lstatx.c" #else diff --git a/tests/xstatx.c b/tests/xstatx.c index 23f11e5c..53381066 100644 --- a/tests/xstatx.c +++ b/tests/xstatx.c @@ -74,7 +74,7 @@ print_time(const time_t t) # define STRUCT_STAT_IS_STAT64 0 # endif # ifndef SAMPLE_SIZE -# define SAMPLE_SIZE 43147718418ULL +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) # endif typedef off_t libc_off_t; -- 2.40.0