Skip to content

Commit

Permalink
Merge pull request ceph#38837 from vbashkirtsev/master
Browse files Browse the repository at this point in the history
common/options.h: use uint64_t for TYPE_SIZE options

Reviewed-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Jan 12, 2021
2 parents d209169 + 2745faa commit 918e2aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct Option {
case TYPE_ADDR: return "entity_addr_t";
case TYPE_ADDRVEC: return "entity_addrvec_t";
case TYPE_UUID: return "uuid_d";
case TYPE_SIZE: return "size_t";
case TYPE_SIZE: return "uint64_t";
case TYPE_SECS: return "secs";
case TYPE_MILLISECS: return "millisecs";
default: return "unknown";
Expand Down Expand Up @@ -127,7 +127,7 @@ struct Option {
};

struct size_t {
std::size_t value;
std::uint64_t value;
operator uint64_t() const {
return static_cast<uint64_t>(value);
}
Expand Down Expand Up @@ -271,7 +271,7 @@ struct Option {
case TYPE_BOOL:
v = bool(new_value); break;
case TYPE_SIZE:
v = size_t{static_cast<std::size_t>(new_value)}; break;
v = size_t{static_cast<std::uint64_t>(new_value)}; break;
case TYPE_SECS:
v = std::chrono::seconds{new_value}; break;
case TYPE_MILLISECS:
Expand Down

0 comments on commit 918e2aa

Please sign in to comment.