last-svn-commit-535-g2b45fa1 Handle 64-bit hosts properly.

* src/function_loader.cc (dyn::foreach_path_in_paths) (dyn::function_loader_t::gen_cxx): Use std::string::size_type to store lengths and positions in std::string's. --- extatica/ChangeLog | 9 +++++++++ extatica/src/function_loader.cc | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/extatica/ChangeLog b/extatica/ChangeLog index 698676e..a94bfce 100644 --- a/extatica/ChangeLog +++ b/extatica/ChangeLog @@ -1,5 +1,14 @@ 2010-11-03 Roland Levillain <roland@lrde.epita.fr> + Handle 64-bit hosts properly. + + * src/function_loader.cc (dyn::foreach_path_in_paths) + (dyn::function_loader_t::gen_cxx): + Use std::string::size_type to store lengths and positions in + std::string's. + +2010-11-03 Roland Levillain <roland@lrde.epita.fr> + Fix the stream junction operation. * src/function_loader.cc (join): Take care not to increment a diff --git a/extatica/src/function_loader.cc b/extatica/src/function_loader.cc index 4ace3b0..35e5270 100644 --- a/extatica/src/function_loader.cc +++ b/extatica/src/function_loader.cc @@ -84,7 +84,7 @@ namespace dyn { foreach_path_in_paths(const std::string& header_paths, Fun& fun) { std::list<std::string>::const_iterator it; - unsigned last = 0, pos; + std::string::size_type last = 0, pos; while (true) { pos = header_paths.find(":", last); @@ -98,6 +98,8 @@ namespace dyn { fun(sub); if (pos >= std::string::npos) break; last = pos + 1; + // Invariant. + assert(pos < header_paths.size()); } } @@ -203,10 +205,10 @@ namespace dyn { // Check if the first type is a pointer to choose the good // operator (`.' or `->'). str stripped_type(type); - unsigned pos; + str::size_type pos; while ((pos = stripped_type.find(" ")) != str::npos) stripped_type.erase(pos, 1); - unsigned len = stripped_type.length(); + std::string::size_type len = stripped_type.length(); first_type_is_ptr = ((stripped_type.compare(len - 7, 7, "*const>") == 0) || (stripped_type.compare(len - 2, 2, "*>") == 0)); -- 1.5.6.5
participants (1)
-
Roland Levillain