From e44f95820ee182460bee2e7569ab4ecb1d444112 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 16 Mar 2017 23:08:10 +0000 Subject: Fixes some clang-tidy warning and add a few missing meta.hh include --- src/assert.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/assert.cc') diff --git a/src/assert.cc b/src/assert.cc index 1e5542ee..5f8a3f9d 100644 --- a/src/assert.cc +++ b/src/assert.cc @@ -28,21 +28,12 @@ private: bool notify_fatal_error(StringView msg) { #if defined(__CYGWIN__) - int res = MessageBox(NULL, msg.zstr(), "Kakoune: fatal error", - MB_OKCANCEL | MB_ICONERROR); - switch (res) - { - case IDCANCEL: - return false; - case IDOK: - return true; - } + return MessageBox(NULL, msg.zstr(), "Kakoune: fatal error", + MB_OKCANCEL | MB_ICONERROR) == IDOK; #elif defined(__linux__) auto cmd = format("xmessage -buttons 'quit:0,ignore:1' '{}'", msg); - if (system(cmd.c_str()) == 1) - return true; + return system(cmd.c_str()) == 1; #endif - return false; } void on_assert_failed(const char* message) -- cgit v1.2.3