Cleanup: clang-format

This commit is contained in:
Campbell Barton 2019-09-27 12:37:53 +10:00
parent c43018cdc0
commit 7ae85b54d7
3 changed files with 14 additions and 17 deletions

View File

@ -34,8 +34,7 @@
static void ghost_fatal_error_dialog(const char *msg)
{
@autoreleasepool
{
@autoreleasepool {
NSString *message = [NSString stringWithFormat:@"Error opening window:\n%s", msg];
NSAlert *alert = [[NSAlert alloc] init];
@ -338,8 +337,7 @@ static const OSType METAL_CORE_VIDEO_PIXEL_FORMAT = kCVPixelFormatType_32BGRA;
void GHOST_ContextCGL::metalInit()
{
@autoreleasepool
{
@autoreleasepool {
id<MTLDevice> device = m_metalLayer.device;
// Create a command queue for blit/present operation
@ -534,8 +532,7 @@ void GHOST_ContextCGL::metalUpdateFramebuffer()
void GHOST_ContextCGL::metalSwapBuffers()
{
@autoreleasepool
{
@autoreleasepool {
updateDrawingContext();
glFlush();

View File

@ -1362,8 +1362,7 @@ bool GHOST_SystemCocoa::handleOpenDocumentRequest(void *filepathStr)
// Check open windows if some changes are not saved
if (m_windowManager->getAnyModifiedState()) {
@autoreleasepool
{
@autoreleasepool {
NSAlert *alert = [[NSAlert alloc] init];
NSString *title = [NSString stringWithFormat:@"Opening %@", [filepath lastPathComponent]];
NSString *text = @"Current document has not been saved.\nDo you really want to proceed?";

View File

@ -624,15 +624,16 @@ template<typename KeyT, typename ValueT, typename Allocator = GuardedAllocator>
template<typename ForwardKeyT, typename ForwardValueT>
bool add_override__impl(ForwardKeyT &&key, ForwardValueT &&value)
{
return this->add_or_modify(std::forward<ForwardKeyT>(key),
[&](ValueT *dst) {
new (dst) ValueT(std::forward<ForwardValueT>(value));
return true;
},
[&](ValueT *old_value) {
*old_value = std::forward<ForwardValueT>(value);
return false;
});
return this->add_or_modify(
std::forward<ForwardKeyT>(key),
[&](ValueT *dst) {
new (dst) ValueT(std::forward<ForwardValueT>(value));
return true;
},
[&](ValueT *old_value) {
*old_value = std::forward<ForwardValueT>(value);
return false;
});
}
template<typename ForwardKeyT, typename ForwardValueT>