diff --git a/src/ansi-c/literals/convert_character_literal.cpp b/src/ansi-c/literals/convert_character_literal.cpp index 1c56ad18ecd..a6a79f8aef0 100644 --- a/src/ansi-c/literals/convert_character_literal.cpp +++ b/src/ansi-c/literals/convert_character_literal.cpp @@ -32,8 +32,8 @@ exprt convert_character_literal( PRECONDITION(src[1] == '\''); PRECONDITION(src[src.size() - 1] == '\''); - std::basic_string value= - unescape_wide_string(std::string(src, 2, src.size()-3)); + std::basic_string value = + unescape_wide_string(std::string(src, 2, src.size() - 3)); // the parser rejects empty character constants CHECK_RETURN(!value.empty()); diff --git a/src/ansi-c/literals/convert_string_literal.cpp b/src/ansi-c/literals/convert_string_literal.cpp index 874ed680f29..381bb38f95e 100644 --- a/src/ansi-c/literals/convert_string_literal.cpp +++ b/src/ansi-c/literals/convert_string_literal.cpp @@ -18,8 +18,7 @@ Author: Daniel Kroening, kroening@kroening.com #include "unescape_string.h" -std::basic_string convert_one_string_literal( - const std::string &src) +std::basic_string convert_one_string_literal(const std::string &src) { PRECONDITION(src.size() >= 2); @@ -28,8 +27,8 @@ std::basic_string convert_one_string_literal( PRECONDITION(src[src.size() - 1] == '"'); PRECONDITION(src[2] == '"'); - std::basic_string value= - unescape_wide_string(std::string(src, 3, src.size()-4)); + std::basic_string value = + unescape_wide_string(std::string(src, 3, src.size() - 4)); // turn into utf-8 const std::string utf8_value = utf32_native_endian_to_utf8(value); @@ -57,7 +56,7 @@ std::basic_string convert_one_string_literal( unescape_string(std::string(src, 1, src.size()-2)); // pad into wide string - std::basic_string value; + std::basic_string value; value.resize(char_value.size()); for(std::size_t i=0; i value; + std::basic_string value; char wide=0; @@ -101,8 +100,7 @@ exprt convert_string_literal(const std::string &src) INVARIANT(j < src.size(), "non-terminated string constant '" + src + "'"); std::string tmp_src=std::string(src, i, j-i+1); - std::basic_string tmp_value= - convert_one_string_literal(tmp_src); + std::basic_string tmp_value = convert_one_string_literal(tmp_src); value.append(tmp_value); i=j; } diff --git a/src/ansi-c/literals/unescape_string.cpp b/src/ansi-c/literals/unescape_string.cpp index e3d8a21ff28..b8c1dbcea94 100644 --- a/src/ansi-c/literals/unescape_string.cpp +++ b/src/ansi-c/literals/unescape_string.cpp @@ -20,7 +20,7 @@ static void append_universal_char( unsigned int value, std::string &dest) { - std::basic_string value_str(1, value); + std::basic_string value_str(1, value); // turn into utf-8 const std::string utf8_value = utf32_native_endian_to_utf8(value_str); @@ -28,9 +28,8 @@ static void append_universal_char( dest.append(utf8_value); } -static void append_universal_char( - unsigned int value, - std::basic_string &dest) +static void +append_universal_char(unsigned int value, std::basic_string &dest) { dest.push_back(value); } @@ -153,10 +152,9 @@ std::string unescape_string(const std::string &src) return unescape_string_templ(src); } -std::basic_string unescape_wide_string( - const std::string &src) +std::basic_string unescape_wide_string(const std::string &src) { - return unescape_string_templ(src); + return unescape_string_templ(src); } unsigned hex_to_unsigned(const char *hex, std::size_t digits) diff --git a/src/ansi-c/literals/unescape_string.h b/src/ansi-c/literals/unescape_string.h index be6f1a18093..9dcb10dc822 100644 --- a/src/ansi-c/literals/unescape_string.h +++ b/src/ansi-c/literals/unescape_string.h @@ -15,7 +15,7 @@ Author: Daniel Kroening, kroening@kroening.com #include std::string unescape_string(const std::string &); -std::basic_string unescape_wide_string(const std::string &); +std::basic_string unescape_wide_string(const std::string &); unsigned hex_to_unsigned(const char *, std::size_t digits); unsigned octal_to_unsigned(const char *, std::size_t digits); diff --git a/src/ansi-c/scanner.l b/src/ansi-c/scanner.l index ac122dd7612..ad408dbeb31 100644 --- a/src/ansi-c/scanner.l +++ b/src/ansi-c/scanner.l @@ -89,7 +89,7 @@ int make_identifier() for(; *p!=0 && digits>0; digits--, p++); p--; // go back for p++ later - std::basic_string utf32; + std::basic_string utf32; utf32+=letter; // turn into utf-8 diff --git a/src/util/unicode.cpp b/src/util/unicode.cpp index 5679890f9fd..ce13365ed49 100644 --- a/src/util/unicode.cpp +++ b/src/util/unicode.cpp @@ -133,8 +133,7 @@ static void utf8_append_code(unsigned int c, std::string &result) /// \param s: UTF-32 encoded wide string /// \return utf8-encoded string with the same unicode characters as the input. -std::string -utf32_native_endian_to_utf8(const std::basic_string &s) +std::string utf32_native_endian_to_utf8(const std::basic_string &s) { std::string result; diff --git a/src/util/unicode.h b/src/util/unicode.h index 9e9f6f360e0..327b3093d1b 100644 --- a/src/util/unicode.h +++ b/src/util/unicode.h @@ -28,8 +28,7 @@ std::wstring widen(const std::string &s); # define widen_if_needed(s) (s) #endif -std::string -utf32_native_endian_to_utf8(const std::basic_string &s); +std::string utf32_native_endian_to_utf8(const std::basic_string &s); /// \param utf8_str: UTF-8 string /// \return UTF-32 encoding of the string