Skip to content

Commit

Permalink
fix warning with valid_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Jan 31, 2022
1 parent 4f1ac3a commit 8aa10ee
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/mmap_disk_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ namespace {
if (!(j->flags & disk_interface::sequential_access)) ret |= aux::open_mode::random_access;
return ret;
}

#if TORRENT_USE_ASSERTS
bool valid_flags(disk_job_flags_t const flags)
{
return (flags & ~(disk_interface::force_copy
| disk_interface::sequential_access
| disk_interface::volatile_read
| disk_interface::v1_hash))
== disk_job_flags_t{};
}
#endif
} // anonymous namespace

using jobqueue_t = tailqueue<aux::disk_io_job>;
Expand Down Expand Up @@ -694,17 +705,6 @@ TORRENT_EXPORT std::unique_ptr<disk_interface> mmap_disk_io_constructor(
? status_t::fatal_disk_error : status_t::no_error;
}

#if TORRENT_USE_ASSERTS
bool valid_flags(disk_job_flags_t const flags)
{
return (flags & ~(disk_interface::force_copy
| disk_interface::sequential_access
| disk_interface::volatile_read
| disk_interface::v1_hash))
== disk_job_flags_t{};
}
#endif

void mmap_disk_io::async_read(storage_index_t storage, peer_request const& r
, std::function<void(disk_buffer_holder, storage_error const&)> handler
, disk_job_flags_t const flags)
Expand Down

0 comments on commit 8aa10ee

Please sign in to comment.