aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
authorNicole Mazzuca <t-nimaz@microsoft.com>2019-07-18 16:40:52 -0700
committerNicole Mazzuca <t-nimaz@microsoft.com>2019-07-18 19:03:46 -0700
commitfddebb75da034752fb267ba121497ba58157bb79 (patch)
tree799f42da4546c6b9eb9fd18d187d63ab69826f6b /toolsrc
parentf599f19bad8fd97b60f41063537be2e4ecef3ca7 (diff)
downloadvcpkg-fddebb75da034752fb267ba121497ba58157bb79.tar.gz
vcpkg-fddebb75da034752fb267ba121497ba58157bb79.zip
clang-format all the things
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/include/vcpkg/base/strings.h4
-rw-r--r--toolsrc/include/vcpkg/base/work_queue.h3
-rw-r--r--toolsrc/src/tests.files.cpp16
-rw-r--r--toolsrc/src/tests.strings.cpp9
-rw-r--r--toolsrc/src/vcpkg/base/strings.cpp3
-rw-r--r--toolsrc/src/vcpkg/build.cpp15
6 files changed, 27 insertions, 23 deletions
diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h
index aa4c4d690..d7de9b0b2 100644
--- a/toolsrc/include/vcpkg/base/strings.h
+++ b/toolsrc/include/vcpkg/base/strings.h
@@ -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;
}
diff --git a/toolsrc/include/vcpkg/base/work_queue.h b/toolsrc/include/vcpkg/base/work_queue.h
index 69ca387f3..70142e110 100644
--- a/toolsrc/include/vcpkg/base/work_queue.h
+++ b/toolsrc/include/vcpkg/base/work_queue.h
@@ -98,8 +98,7 @@ namespace vcpkg
if (!running_workers())
{
m_cv.notify_one();
-
- }
+ }
}
// wait for all threads to join
diff --git a/toolsrc/src/tests.files.cpp b/toolsrc/src/tests.files.cpp
index e60662fd9..482675c34 100644
--- a/toolsrc/src/tests.files.cpp
+++ b/toolsrc/src/tests.files.cpp
@@ -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;
}
diff --git a/toolsrc/src/tests.strings.cpp b/toolsrc/src/tests.strings.cpp
index 6301ea05d..f541a203d 100644
--- a/toolsrc/src/tests.strings.cpp
+++ b/toolsrc/src/tests.strings.cpp
@@ -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);
}
diff --git a/toolsrc/src/vcpkg/base/strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp
index 7970e1b46..46e78a363 100644
--- a/toolsrc/src/vcpkg/base/strings.cpp
+++ b/toolsrc/src/vcpkg/base/strings.cpp
@@ -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;
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index c50acce7e..66d8dae2c 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -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");