From 97e36233fbb87c46372483eb9e0b8f7a65670792 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 31 Aug 2016 09:07:33 +0100 Subject: [PATCH] Remove the to_string(unsigned) (it conflicts with to_string(size_t) on x86) Just cast to int when we pass an unsigned. --- src/normal.cc | 4 ++-- src/string.cc | 7 ------- src/string.hh | 1 - 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/normal.cc b/src/normal.cc index 00250c2c..3d1d05ce 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -716,7 +716,7 @@ void select_regex(Context& context, NormalParams params) { const char reg = to_lower(params.reg ? params.reg : '/'); unsigned capture = (unsigned)params.count; - auto prompt = capture ? format("select (capture {}):", capture) : "select:"_str; + auto prompt = capture ? format("select (capture {}):", (int)capture) : "select:"_str; regex_prompt(context, std::move(prompt), [reg, capture](Regex ex, PromptEvent event, Context& context) { if (ex.empty()) @@ -732,7 +732,7 @@ void split_regex(Context& context, NormalParams params) { const char reg = to_lower(params.reg ? params.reg : '/'); unsigned capture = (unsigned)params.count; - auto prompt = capture ? format("split (on capture {}):", capture) : "split:"_str; + auto prompt = capture ? format("split (on capture {}):", (int)capture) : "split:"_str; regex_prompt(context, std::move(prompt), [reg, capture](Regex ex, PromptEvent event, Context& context) { if (ex.empty()) diff --git a/src/string.cc b/src/string.cc index 69c8f946..edfd4cf6 100644 --- a/src/string.cc +++ b/src/string.cc @@ -307,13 +307,6 @@ InplaceString<15> to_string(int val) return res; } -InplaceString<15> to_string(unsigned val) -{ - InplaceString<15> res; - res.m_length = sprintf(res.m_data, "%u", val); - return res; -} - InplaceString<23> to_string(long int val) { InplaceString<23> res; diff --git a/src/string.hh b/src/string.hh index d1c6aa0e..74fbb51a 100644 --- a/src/string.hh +++ b/src/string.hh @@ -327,7 +327,6 @@ inline Hex hex(size_t val) { return {val}; } InplaceString<15> to_string(int val); InplaceString<23> to_string(long int val); -InplaceString<15> to_string(unsigned val); InplaceString<23> to_string(size_t val); InplaceString<23> to_string(Hex val); InplaceString<23> to_string(float val);