@@ -66,7 +66,8 @@ dplc_file::dplc_file(istream& input, int const version) {
6666 }
6767}
6868
69- void dplc_file::write (ostream& output, int const version, bool const null_first) const {
69+ void dplc_file::write (
70+ ostream& output, int const version, bool const null_first) const {
7071 map<frame_dplc, size_t > map_to_pos;
7172 map<size_t , frame_dplc> pos_to_map;
7273
@@ -78,7 +79,8 @@ void dplc_file::write(ostream& output, int const version, bool const null_first)
7879 pos_to_map.emplace (0 , frames.front ());
7980 }
8081 for (auto const & frame : frames) {
81- if (auto const found = map_to_pos.find (frame); found != map_to_pos.end ()) {
82+ if (auto const found = map_to_pos.find (frame);
83+ found != map_to_pos.end ()) {
8284 BigEndian::Write2 (output, found->second );
8385 } else {
8486 map_to_pos.emplace (frame, size);
@@ -88,10 +90,11 @@ void dplc_file::write(ostream& output, int const version, bool const null_first)
8890 }
8991 }
9092 for (auto const & [position, dplc] : pos_to_map) {
91- if (position == size_t (output.tellp ())) {
93+ auto const fpos = static_cast <size_t >(output.tellp ());
94+ if (position == fpos) {
9295 dplc.write (output, version);
9396 } else if (position != 0U ) {
94- fmt::print (stderr, " Missed write at {}\n " , output. tellp () );
97+ fmt::print (stderr, " Missed write at {}\n " , fpos );
9598 dplc.print ();
9699 }
97100 }
0 commit comments