::close(fd);
};
- for (int i = 0; i < specs.size(); i++) {
+ for (size_t i = 0; i < specs.size(); i++) {
auto buf = allocateAligned(specs[i].size);
op.pread(fd, buf.get(), specs[i].size, specs[i].start);
aioReader.submit(&op);
if (multithreaded) {
threads.reserve(specs.size());
}
- for (int i = 0; i < specs.size(); i++) {
+ for (size_t i = 0; i < specs.size(); i++) {
bufs.push_back(allocateAligned(specs[i].size));
}
- auto submit = [&] (int i) {
+ auto submit = [&] (size_t i) {
ops[i].pread(fd, bufs[i].get(), specs[i].size, specs[i].start);
aioReader.submit(&ops[i]);
};
- for (int i = 0; i < specs.size(); i++) {
+ for (size_t i = 0; i < specs.size(); i++) {
if (multithreaded) {
threads.emplace_back([&submit, i] { submit(i); });
} else {
EXPECT_NE(nrRead, 0);
remaining -= nrRead;
- for (int i = 0; i < nrRead; i++) {
+ for (size_t i = 0; i < nrRead; i++) {
int id = completed[i] - ops.get();
EXPECT_GE(id, 0);
EXPECT_LT(id, specs.size());
EXPECT_EQ(specs.size(), aioReader.totalSubmits());
EXPECT_EQ(aioReader.pending(), 0);
- for (int i = 0; i < pending.size(); i++) {
+ for (size_t i = 0; i < pending.size(); i++) {
EXPECT_FALSE(pending[i]);
}
}
SCOPE_EXIT {
::close(fd);
};
- for (int i = 0; i < specs.size(); i++) {
+ for (size_t i = 0; i < specs.size(); i++) {
bufs.push_back(allocateAligned(specs[i].size));
ops[i].pread(fd, bufs[i].get(), specs[i].size, specs[i].start);
aioQueue.submit(&ops[i]);
EXPECT_NE(nrRead, 0);
remaining -= nrRead;
- for (int i = 0; i < nrRead; i++) {
+ for (size_t i = 0; i < nrRead; i++) {
int id = completed[i] - ops.get();
EXPECT_GE(id, 0);
EXPECT_LT(id, specs.size());
EXPECT_EQ(specs.size(), aioReader.totalSubmits());
EXPECT_EQ(aioReader.pending(), 0);
EXPECT_EQ(aioQueue.queued(), 0);
- for (int i = 0; i < pending.size(); i++) {
+ for (size_t i = 0; i < pending.size(); i++) {
EXPECT_FALSE(pending[i]);
}
}