Commit f8d47820 by Yuriy Chernyshov

Fix compiling int128.cc against certain STLs

parent f2b52372
...@@ -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(1u, 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