Commit a53d0916 by Copybara-Service

Merge pull request #1409 from georgthegreat:explicit-inserts

PiperOrigin-RevId: 513430584
Change-Id: I944a4868565564f32133dbff8b7a952221bb8b88
parents 02f4b999 f8d47820
...@@ -216,9 +216,9 @@ std::ostream& operator<<(std::ostream& os, uint128 v) { ...@@ -216,9 +216,9 @@ std::ostream& operator<<(std::ostream& os, uint128 v) {
} else if (adjustfield == std::ios::internal && } else if (adjustfield == std::ios::internal &&
(flags & std::ios::showbase) && (flags & std::ios::showbase) &&
(flags & std::ios::basefield) == std::ios::hex && v != 0) { (flags & std::ios::basefield) == std::ios::hex && v != 0) {
rep.insert(2, count, os.fill()); rep.insert(size_t{2}, count, os.fill());
} else { } else {
rep.insert(0, count, os.fill()); rep.insert(size_t{0}, count, os.fill());
} }
} }
...@@ -314,16 +314,16 @@ std::ostream& operator<<(std::ostream& os, int128 v) { ...@@ -314,16 +314,16 @@ std::ostream& operator<<(std::ostream& os, int128 v) {
break; break;
case std::ios::internal: case std::ios::internal:
if (print_as_decimal && (rep[0] == '+' || rep[0] == '-')) { if (print_as_decimal && (rep[0] == '+' || rep[0] == '-')) {
rep.insert(1, count, os.fill()); rep.insert(size_t{1}, count, os.fill());
} else if ((flags & std::ios::basefield) == std::ios::hex && } else if ((flags & std::ios::basefield) == std::ios::hex &&
(flags & std::ios::showbase) && v != 0) { (flags & std::ios::showbase) && v != 0) {
rep.insert(2, count, os.fill()); rep.insert(size_t{2}, count, os.fill());
} else { } else {
rep.insert(0, count, os.fill()); rep.insert(size_t{0}, count, os.fill());
} }
break; break;
default: // std::ios::right default: // std::ios::right
rep.insert(0, count, os.fill()); rep.insert(size_t{0}, count, os.fill());
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment