From c8e12558cdd3fd0769b81679ad09edf1f29b780f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 01:18:24 +0300 Subject: Clang-ify the code with this styling using Visual Studio Code: { BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup) --- src/hex_functions.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/hex_functions.cpp') diff --git a/src/hex_functions.cpp b/src/hex_functions.cpp index 4a58d2b..63293c1 100644 --- a/src/hex_functions.cpp +++ b/src/hex_functions.cpp @@ -1,18 +1,17 @@ #include "hex_functions.h" -namespace omni -{ - std::string int_to_hex(unsigned int input) - { - if (input > 255) - return "FF"; +namespace omni { + std::string int_to_hex(unsigned int input) + { + if (input > 255) + return "FF"; - std::stringstream stream; - stream << std::setfill('0') << std::setw(sizeof(char)*2) - << std::hex << input; - std::string result(stream.str()); - std::transform(result.begin(), result.end(), result.begin(), ::toupper); + std::stringstream stream; + stream << std::setfill('0') << std::setw(sizeof(char) * 2) + << std::hex << input; + std::string result(stream.str()); + std::transform(result.begin(), result.end(), result.begin(), ::toupper); - return result; - } -} + return result; + } +} // namespace omni -- cgit