clang-format: update c/cc coding style

Update all cc code using .clang-format; please do so as well for future PRs
etc.; emacs has a handy 'clang-format' mode to make this automatic.

For comparing old changes with git blame, we can disregard this one using
--ignore-rev

(see https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame )
This commit is contained in:
Dirk-Jan C. Binnema
2021-10-20 12:18:15 +03:00
parent 09935cc4b3
commit 3dd721d5a3
111 changed files with 13851 additions and 14579 deletions

View File

@ -23,37 +23,37 @@
using namespace Mu;
static Option<int>
get_opt_int (bool b)
get_opt_int(bool b)
{
if (b)
return Some(123);
else
return Nothing;
if (b)
return Some(123);
else
return Nothing;
}
static void
test_option()
{
{
const auto oi{get_opt_int(true)};
g_assert_true(!!oi);
g_assert_cmpint(oi.value(),==,123);
}
{
const auto oi{get_opt_int(true)};
g_assert_true(!!oi);
g_assert_cmpint(oi.value(), ==, 123);
}
{
const auto oi{get_opt_int(false)};
g_assert_false(!!oi);
g_assert_false(oi.has_value());
g_assert_cmpint(oi.value_or(456),==,456);
}
{
const auto oi{get_opt_int(false)};
g_assert_false(!!oi);
g_assert_false(oi.has_value());
g_assert_cmpint(oi.value_or(456), ==, 456);
}
}
int
main (int argc, char *argv[])
main(int argc, char* argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_init(&argc, &argv, NULL);
g_test_add_func ("/option/option", test_option);
g_test_add_func("/option/option", test_option);
return g_test_run ();
return g_test_run();
}