Change clang-format to not add spaces before parens

This commit is contained in:
Charles Giessen 2021-02-18 11:43:20 -07:00 committed by Charles Giessen
parent 3ebe53bdfe
commit cf8df11a0a
3 changed files with 620 additions and 632 deletions

View File

@ -31,7 +31,6 @@ PenaltyExcessCharacter: 1
PenaltyReturnTypeOnItsOwnLine: 20
PointerBindsToType: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Always
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false

View File

@ -373,17 +373,13 @@ const PhysicalDeviceErrorCategory physical_device_error_category;
struct QueueErrorCategory : std::error_category {
const char* name() const noexcept override { return "vkb_queue"; }
std::string message (int err) const override {
return to_string (static_cast<QueueError> (err));
}
std::string message(int err) const override { return to_string(static_cast<QueueError>(err)); }
};
const QueueErrorCategory queue_error_category;
struct DeviceErrorCategory : std::error_category {
const char* name() const noexcept override { return "vkb_device"; }
std::string message (int err) const override {
return to_string (static_cast<DeviceError> (err));
}
std::string message(int err) const override { return to_string(static_cast<DeviceError>(err)); }
};
const DeviceErrorCategory device_error_category;
@ -518,9 +514,8 @@ SystemInfo::SystemInfo () {
if (strcmp(layer.layerName, detail::validation_layer_name) == 0)
validation_layers_available = true;
auto available_extensions_ret = detail::get_vector<VkExtensionProperties> (this->available_extensions,
detail::vulkan_functions ().fp_vkEnumerateInstanceExtensionProperties,
nullptr);
auto available_extensions_ret = detail::get_vector<VkExtensionProperties>(
this->available_extensions, detail::vulkan_functions().fp_vkEnumerateInstanceExtensionProperties, nullptr);
if (available_extensions_ret != VK_SUCCESS) {
this->available_extensions.clear();
}
@ -619,8 +614,7 @@ detail::Result<Instance> InstanceBuilder::build () const {
if (!info.headless_context) {
auto check_add_window_ext = [&](const char* name) -> bool {
if (!detail::check_extension_supported (system.available_extensions, name))
return false;
if (!detail::check_extension_supported(system.available_extensions, name)) return false;
extensions.push_back(name);
return true;
};
@ -688,8 +682,7 @@ detail::Result<Instance> InstanceBuilder::build () const {
if (info.disabled_validation_checks.size() != 0) {
checks.sType = VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT;
checks.pNext = nullptr;
checks.disabledValidationCheckCount =
static_cast<uint32_t> (info.disabled_validation_checks.size ());
checks.disabledValidationCheckCount = static_cast<uint32_t>(info.disabled_validation_checks.size());
checks.pDisabledValidationChecks = info.disabled_validation_checks.data();
pNext_chain.push_back(reinterpret_cast<VkBaseOutStructure*>(&checks));
}
@ -1069,8 +1062,7 @@ PhysicalDeviceSelector::Suitable PhysicalDeviceSelector::is_device_suitable (Phy
return Suitable::no;
}
bool required_features_supported =
detail::supports_features (pd.device_features, criteria.required_features);
bool required_features_supported = detail::supports_features(pd.device_features, criteria.required_features);
if (!required_features_supported) return Suitable::no;
bool has_required_memory = false;
@ -1453,8 +1445,7 @@ std::error_code make_error_code (SurfaceSupportError surface_support_error) {
}
Result<SurfaceSupportDetails> query_surface_support_details(VkPhysicalDevice phys_device, VkSurfaceKHR surface) {
if (surface == VK_NULL_HANDLE)
return make_error_code (SurfaceSupportError::surface_handle_null);
if (surface == VK_NULL_HANDLE) return make_error_code(SurfaceSupportError::surface_handle_null);
VkSurfaceCapabilitiesKHR capabilities;
VkResult res = detail::vulkan_functions().fp_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
@ -1509,8 +1500,7 @@ VkPresentModeKHR find_present_mode (std::vector<VkPresentModeKHR> const& availab
template <typename T> T minimum(T a, T b) { return a < b ? a : b; }
template <typename T> T maximum(T a, T b) { return a > b ? a : b; }
VkExtent2D find_extent (
VkSurfaceCapabilitiesKHR const& capabilities, uint32_t desired_width, uint32_t desired_height) {
VkExtent2D find_extent(VkSurfaceCapabilitiesKHR const& capabilities, uint32_t desired_width, uint32_t desired_height) {
if (capabilities.currentExtent.width != UINT32_MAX) {
return capabilities.currentExtent;
} else {
@ -1573,8 +1563,7 @@ SwapchainBuilder::SwapchainBuilder (VkPhysicalDevice const physical_device,
if (graphics_queue_index == detail::QUEUE_INDEX_MAX_VALUE)
info.graphics_queue_index = detail::get_graphics_queue_index(queue_families);
if (present_queue_index == detail::QUEUE_INDEX_MAX_VALUE)
info.present_queue_index =
detail::get_present_queue_index (physical_device, surface, queue_families);
info.present_queue_index = detail::get_present_queue_index(physical_device, surface, queue_families);
}
}
detail::Result<Swapchain> SwapchainBuilder::build() const {

View File

@ -475,7 +475,7 @@ enum class QueueType { present, graphics, compute, transfer };
namespace detail {
// Sentinel value, used in implementation only
const int QUEUE_INDEX_MAX_VALUE = 65536;
const uint32_t QUEUE_INDEX_MAX_VALUE = 65536;
} // namespace detail
// ---- Device ---- //