clang-format all the things

This commit is contained in:
Nicole Mazzuca 2019-07-18 16:40:52 -07:00
parent f599f19bad
commit fddebb75da
6 changed files with 27 additions and 23 deletions

View File

@ -186,7 +186,7 @@ namespace vcpkg::Strings
bool contains(StringView haystack, StringView needle);
// base 32 encoding, since base64 encoding requires lowercase letters,
// which are not distinct from uppercase letters on macOS or Windows filesystems.
// follows RFC 4648
// which are not distinct from uppercase letters on macOS or Windows filesystems.
// follows RFC 4648
std::string b32_encode(std::uint64_t x) noexcept;
}

View File

@ -98,8 +98,7 @@ namespace vcpkg
if (!running_workers())
{
m_cv.notify_one();
}
}
}
// wait for all threads to join

View File

@ -3,8 +3,8 @@
#include <vcpkg/base/files.h>
#include <vcpkg/base/strings.h>
#include <iostream>
#include <filesystem> // required for filesystem::create_{directory_}symlink
#include <iostream>
#include <random>
#include <windows.h>
@ -31,11 +31,11 @@ namespace UnitTest1
}
else
{
// if we get a permissions error, we still know that we're in developer mode
// if we get a permissions error, we still know that we're in developer mode
ALLOW_SYMLINKS = true;
}
if (status == ERROR_SUCCESS) RegCloseKey(key);
if (status == ERROR_SUCCESS) RegCloseKey(key);
}
private:
@ -105,13 +105,17 @@ namespace UnitTest1
// if we're at the max depth, we only want to build non-directories
std::uint64_t file_type;
if (depth < max_depth) {
if (depth < max_depth)
{
file_type = uid{directory_min_tag, regular_symlink_tag}(urbg);
} else {
}
else
{
file_type = uid{regular_file_tag, regular_symlink_tag}(urbg);
}
if (!ALLOW_SYMLINKS && file_type > regular_file_tag) {
if (!ALLOW_SYMLINKS && file_type > regular_file_tag)
{
file_type = regular_file_tag;
}

View File

@ -8,8 +8,10 @@
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTest1 {
class StringsTest : public TestClass<StringsTest> {
namespace UnitTest1
{
class StringsTest : public TestClass<StringsTest>
{
TEST_METHOD(b64url_encode)
{
using u64 = std::uint64_t;
@ -29,7 +31,8 @@ namespace UnitTest1 {
map.emplace_back(0xFFFF'FFFF'FFFF'FFFF, "777777777777P");
std::string result;
for (const auto& pr : map) {
for (const auto& pr : map)
{
result = vcpkg::Strings::b32_encode(pr.first);
Assert::AreEqual(result, pr.second);
}

View File

@ -301,7 +301,8 @@ namespace vcpkg::Strings
auto value = static_cast<Unsigned>(x);
// 32 values, plus the implicit \0
constexpr static char map[33] = "ABCDEFGHIJKLMNOP" "QRSTUVWXYZ234567";
constexpr static char map[33] = "ABCDEFGHIJKLMNOP"
"QRSTUVWXYZ234567";
// log2(32)
constexpr static int shift = 5;

View File

@ -363,8 +363,7 @@ namespace vcpkg::Build
const Triplet& triplet = spec.triplet();
const auto& triplet_file_path = paths.get_triplet_file_path(spec.triplet()).u8string();
if (!Strings::case_insensitive_ascii_starts_with(triplet_file_path,
paths.triplets.u8string()))
if (!Strings::case_insensitive_ascii_starts_with(triplet_file_path, paths.triplets.u8string()))
{
System::printf("-- Loading triplet configuration from: %s\n", triplet_file_path);
}
@ -431,12 +430,11 @@ namespace vcpkg::Build
}
command.append(cmd_launch_cmake);
const auto timer = Chrono::ElapsedTimer::create_started();
const int return_code = System::cmd_execute_clean(
command,
{}
const int return_code = System::cmd_execute_clean(command,
{}
#ifdef _WIN32
,
powershell_exe_path.parent_path().u8string() + ";"
,
powershell_exe_path.parent_path().u8string() + ";"
#endif
);
const auto buildtimeus = timer.microseconds();
@ -1020,8 +1018,7 @@ namespace vcpkg::Build
hash += "-";
hash += Hash::get_file_hash(fs, *p, "SHA1");
}
else if (pre_build_info.cmake_system_name.empty() ||
pre_build_info.cmake_system_name == "WindowsStore")
else if (pre_build_info.cmake_system_name.empty() || pre_build_info.cmake_system_name == "WindowsStore")
{
hash += "-";
hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "windows.cmake", "SHA1");