From b29e17a4ea70bcabb7d8eeb441bb70fd0c87b185 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 12 Oct 2010 20:05:14 +0000 Subject: Use size_t in SCAN_Name --- src/libstate/scan_name.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/libstate/scan_name.cpp') diff --git a/src/libstate/scan_name.cpp b/src/libstate/scan_name.cpp index 7c2e4b28d..a17dc4ad0 100644 --- a/src/libstate/scan_name.cpp +++ b/src/libstate/scan_name.cpp @@ -16,14 +16,14 @@ namespace Botan { namespace { std::string make_arg( - const std::vector >& name, u32bit start) + const std::vector >& name, size_t start) { std::string output = name[start].second; - u32bit level = name[start].first; + size_t level = name[start].first; - u32bit paren_depth = 0; + size_t paren_depth = 0; - for(u32bit i = start + 1; i != name.size(); ++i) + for(size_t i = start + 1; i != name.size(); ++i) { if(name[i].first <= name[start].first) break; @@ -48,14 +48,14 @@ std::string make_arg( level = name[i].first; } - for(u32bit i = 0; i != paren_depth; ++i) + for(size_t i = 0; i != paren_depth; ++i) output += ')'; return output; } -std::pair -deref_aliases(const std::pair& in) +std::pair +deref_aliases(const std::pair& in) { return std::make_pair(in.first, global_state().deref_alias(in.second)); @@ -67,15 +67,15 @@ SCAN_Name::SCAN_Name(std::string algo_spec) { orig_algo_spec = algo_spec; - std::vector > name; - u32bit level = 0; - std::pair accum = std::make_pair(level, ""); + std::vector > name; + size_t level = 0; + std::pair accum = std::make_pair(level, ""); std::string decoding_error = "Bad SCAN name '" + algo_spec + "': "; algo_spec = global_state().deref_alias(algo_spec); - for(u32bit i = 0; i != algo_spec.size(); ++i) + for(size_t i = 0; i != algo_spec.size(); ++i) { char c = algo_spec[i]; @@ -116,7 +116,7 @@ SCAN_Name::SCAN_Name(std::string algo_spec) bool in_modes = false; - for(u32bit i = 1; i != name.size(); ++i) + for(size_t i = 1; i != name.size(); ++i) { if(name[i].first == 0) { @@ -137,7 +137,7 @@ std::string SCAN_Name::algo_name_and_args() const if(arg_count()) { out += '('; - for(u32bit i = 0; i != arg_count(); ++i) + for(size_t i = 0; i != arg_count(); ++i) { out += arg(i); if(i != arg_count() - 1) @@ -150,21 +150,21 @@ std::string SCAN_Name::algo_name_and_args() const return out; } -std::string SCAN_Name::arg(u32bit i) const +std::string SCAN_Name::arg(size_t i) const { if(i >= arg_count()) throw std::range_error("SCAN_Name::argument - i out of range"); return args[i]; } -std::string SCAN_Name::arg(u32bit i, const std::string& def_value) const +std::string SCAN_Name::arg(size_t i, const std::string& def_value) const { if(i >= arg_count()) return def_value; return args[i]; } -u32bit SCAN_Name::arg_as_u32bit(u32bit i, u32bit def_value) const +size_t SCAN_Name::arg_as_integer(size_t i, size_t def_value) const { if(i >= arg_count()) return def_value; -- cgit v1.2.3