Skip to content

Commit

Permalink
test_librbd_fsx: fix sign-compare gcc warning
Browse files Browse the repository at this point in the history
{read,write}bdy are signed, sizeof returns unsigned, gcc complains.

Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
idryomov committed Jun 12, 2014
1 parent e287f02 commit a290d34
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/test/librbd/fsx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,15 +1382,17 @@ check_clone(int clonenum)
}

good_buf = NULL;
ret = posix_memalign((void **)&good_buf, MAX(writebdy, sizeof(void *)),
ret = posix_memalign((void **)&good_buf,
MAX(writebdy, (int)sizeof(void *)),
file_info.st_size);
if (ret > 0) {
prterrcode("check_clone: posix_memalign(good_buf)", -ret);
exit(96);
}

temp_buf = NULL;
ret = posix_memalign((void **)&temp_buf, MAX(readbdy, sizeof(void *)),
ret = posix_memalign((void **)&temp_buf,
MAX(readbdy, (int)sizeof(void *)),
file_info.st_size);
if (ret > 0) {
prterrcode("check_clone: posix_memalign(temp_buf)", -ret);
Expand Down Expand Up @@ -2064,8 +2066,8 @@ main(int argc, char **argv)
for (i = 0; i < (int)maxfilelen; i++)
original_buf[i] = random() % 256;

ret = posix_memalign((void **)&good_buf, MAX(writebdy, sizeof(void *)),
maxfilelen);
ret = posix_memalign((void **)&good_buf,
MAX(writebdy, (int)sizeof(void *)), maxfilelen);
if (ret > 0) {
if (ret == EINVAL)
prt("writebdy is not a suitable power of two\n");
Expand All @@ -2075,8 +2077,8 @@ main(int argc, char **argv)
}
memset(good_buf, '\0', maxfilelen);

ret = posix_memalign((void **)&temp_buf, MAX(readbdy, sizeof(void *)),
maxfilelen);
ret = posix_memalign((void **)&temp_buf,
MAX(readbdy, (int)sizeof(void *)), maxfilelen);
if (ret > 0) {
if (ret == EINVAL)
prt("readbdy is not a suitable power of two\n");
Expand Down

0 comments on commit a290d34

Please sign in to comment.