nvme_disk: Add missing cast to off_t.

Should fix the 64-bit build.
This commit is contained in:
Augustin Cavalier
2019-08-28 23:36:52 -04:00
parent cca88a8133
commit 06f4ddb09c
@@ -424,7 +424,7 @@ nvme_disk_read(void* cookie, off_t pos, void* buffer, size_t* length)
// The "rounded_len" will be the actual transferred length, but
// of course it will contain the padding.
*length = std::min(*length, (size_t)std::max((off_t)0,
rounded_len - (off_t)(pos - rounded_pos)));
(off_t)rounded_len - (off_t)(pos - rounded_pos)));
if (*length == 0)
return status;
}
@@ -499,7 +499,7 @@ nvme_disk_write(void* cookie, off_t pos, const void* buffer, size_t* length)
&rounded_len, true);
if (status != B_OK) {
*length = std::min(*length, (size_t)std::max((off_t)0,
rounded_len - (off_t)(pos - rounded_pos)));
(off_t)rounded_len - (off_t)(pos - rounded_pos)));
}
return status;
}