diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-02-12 13:13:07 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-02-12 13:14:02 +0100 |
commit | c35e4a4b7d7c4da06f0f38f6f669f05d04f4537a (patch) | |
tree | 9ab9e5b23d636edceb6bc4916121e0cb86596d39 | |
parent | 0f72c73b5b6f8ef12da726c5a7229f8076cd98f0 (diff) | |
download | rockbox-c35e4a4.tar.gz rockbox-c35e4a4.zip |
Fix red
Change-Id: Ib64eb3539e33d4336c298612b4508c4611b80c9e
-rw-r--r-- | utils/hwstub/tools/hwstub_shell.cpp | 10 | ||||
-rw-r--r-- | utils/regtools/lib/soc_desc.cpp | 4 | ||||
-rw-r--r-- | utils/regtools/lib/soc_desc.hpp | 2 | ||||
-rw-r--r-- | utils/regtools/qeditor/backend.cpp | 5 |
4 files changed, 12 insertions, 9 deletions
diff --git a/utils/hwstub/tools/hwstub_shell.cpp b/utils/hwstub/tools/hwstub_shell.cpp index 3cc6f8c259..61cb617509 100644 --- a/utils/hwstub/tools/hwstub_shell.cpp +++ b/utils/hwstub/tools/hwstub_shell.cpp @@ -647,13 +647,13 @@ bool my_lua_import_soc(const soc_t& soc) return true; } -bool my_lua_import_soc(const std::list< soc_t >& socs) +bool my_lua_import_soc(const std::vector< soc_t >& socs) { - for(std::list< soc_t >::const_iterator it = socs.begin(); it != socs.end(); ++it) + for(size_t i = 0; i < socs.size(); i++) { if(!g_quiet) - printf("importing %s...\n", it->name.c_str()); - if(!my_lua_import_soc(*it)) + printf("importing %s...\n", socs[i].name.c_str()); + if(!my_lua_import_soc(socs[i])) return false; } return true; @@ -711,7 +711,7 @@ int main(int argc, char **argv) } // load register descriptions - std::list< soc_t > socs; + std::vector< soc_t > socs; for(int i = optind; i < argc; i++) if(!soc_desc_parse_xml(argv[i], socs)) { diff --git a/utils/regtools/lib/soc_desc.cpp b/utils/regtools/lib/soc_desc.cpp index 223a6d8f53..21c2f8acac 100644 --- a/utils/regtools/lib/soc_desc.cpp +++ b/utils/regtools/lib/soc_desc.cpp @@ -252,7 +252,7 @@ bool parse_soc_elem(xmlNode *node, soc_t& soc) return true; } -bool parse_root_elem(xmlNode *node, std::list< soc_t >& soc) +bool parse_root_elem(xmlNode *node, std::vector< soc_t >& soc) { BEGIN_NODE_MATCH(node) MATCH_ELEM_NODE("soc", soc, parse_soc_elem) @@ -260,7 +260,7 @@ bool parse_root_elem(xmlNode *node, std::list< soc_t >& soc) return true; } -bool soc_desc_parse_xml(const std::string& filename, std::list< soc_t >& socs) +bool soc_desc_parse_xml(const std::string& filename, std::vector< soc_t >& socs) { LIBXML_TEST_VERSION diff --git a/utils/regtools/lib/soc_desc.hpp b/utils/regtools/lib/soc_desc.hpp index d1a1f0cb50..0324a90fad 100644 --- a/utils/regtools/lib/soc_desc.hpp +++ b/utils/regtools/lib/soc_desc.hpp @@ -143,6 +143,6 @@ struct soc_t /** Parse a SoC description from a XML file, append it to <soc>. A file * can contain multiple SoC descriptions */ -bool soc_desc_parse_xml(const std::string& filename, std::list< soc_t >& soc); +bool soc_desc_parse_xml(const std::string& filename, std::vector< soc_t >& soc); #endif /* __SOC_DESC__ */
\ No newline at end of file diff --git a/utils/regtools/qeditor/backend.cpp b/utils/regtools/qeditor/backend.cpp index 44430c25da..15867821e3 100644 --- a/utils/regtools/qeditor/backend.cpp +++ b/utils/regtools/qeditor/backend.cpp @@ -33,7 +33,10 @@ bool Backend::GetSocByName(const QString& name, SocRef& s) bool Backend::LoadSocDesc(const QString& filename) { - bool ret = soc_desc_parse_xml(filename.toStdString(), m_socs); + std::vector< soc_t > new_socs; + bool ret = soc_desc_parse_xml(filename.toStdString(), new_socs); + for(size_t i = 0; i < new_socs.size(); i++) + m_socs.push_back(new_socs[i]); emit OnSocListChanged(); return ret; } |