diff options
author | David Chisnall <theraven@FreeBSD.org> | 2015-10-25 14:52:16 +0000 |
---|---|---|
committer | David Chisnall <theraven@FreeBSD.org> | 2015-10-25 14:52:16 +0000 |
commit | a0706eb4574932a57e425505e9a3027cd45fce4c (patch) | |
tree | 22d99608196de7e420886ac2b497690c8dda2d6b /usr.bin/dtc/dtb.cc | |
parent | 170a938721f0372732404f002ca93a8e53aa055b (diff) | |
download | src-a0706eb4574932a57e425505e9a3027cd45fce4c.tar.gz src-a0706eb4574932a57e425505e9a3027cd45fce4c.zip |
Lots of improvements to the BSD-licensed dtc
- Various fixes to includes (including recursive includes)
- Lots of testing that the output exactly matches GPL'd dtc
- Lots of bug fixes to merging
- Fix incorrect mmap usage
- Ad-hoc memory management replaced with C++11 unique_ptr and similar
Patrick Wildt has successfully run many (all?) of the GPL dtc test suite.
Notes
Notes:
svn path=/head/; revision=289935
Diffstat (limited to 'usr.bin/dtc/dtb.cc')
-rw-r--r-- | usr.bin/dtc/dtb.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/dtc/dtb.cc b/usr.bin/dtc/dtb.cc index 986ef6f717b5..bbcf76d751aa 100644 --- a/usr.bin/dtc/dtb.cc +++ b/usr.bin/dtc/dtb.cc @@ -44,9 +44,9 @@ namespace dtb void output_writer::write_data(byte_buffer b) { - for (byte_buffer::iterator i=b.begin(), e=b.end(); i!=e ; i++) + for (auto i : b) { - write_data(*i); + write_data(i); } } @@ -277,7 +277,7 @@ header::read_dtb(input_buffer &input) uint32_t string_table::add_string(string str) { - std::map<string, uint32_t>::iterator old = string_offsets.find(str); + auto old = string_offsets.find(str); if (old == string_offsets.end()) { uint32_t start = size; @@ -298,10 +298,9 @@ string_table::write(dtb::output_writer &writer) { writer.write_comment(string("Strings table.")); writer.write_label(string("dt_strings_start")); - for (std::vector<string>::iterator i=strings.begin(), e=strings.end() ; - i!=e ; ++i) + for (auto &i : strings) { - writer.write_string(*i); + writer.write_string(i); } writer.write_label(string("dt_strings_end")); } |