From 375607d9969896c894fa2642ce4a0b8b519a2adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 2 Sep 2017 15:34:07 +0200 Subject: Use QString and QVector instead of std ones and more --- qtmips_machine/programloader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qtmips_machine/programloader.cpp') diff --git a/qtmips_machine/programloader.cpp b/qtmips_machine/programloader.cpp index 0b0e294..6eefa6c 100644 --- a/qtmips_machine/programloader.cpp +++ b/qtmips_machine/programloader.cpp @@ -69,13 +69,13 @@ std::uint32_t ProgramLoader::get_address(size_t sec) { return this->phdrs[this->map[sec]].p_vaddr; } -std::vector ProgramLoader::get_data(size_t sec) { +QVector ProgramLoader::get_data(size_t sec) { SANITY_ASSERT(sec > this->get_nsec(), "Requesting too big section"); - std::vector d; + QVector d; char *f = elf_rawfile(this->elf, NULL); size_t phdrs_i = this->map[sec]; for (unsigned i = 0; i < this->phdrs[phdrs_i].p_filesz; i++) { - d.push_back((std::uint8_t) f[this->phdrs[phdrs_i].p_offset + i]); + d << (std::uint8_t) f[this->phdrs[phdrs_i].p_offset + i]; } return d; } -- cgit v1.2.3