Update brace style.

Add braces around single-line blocks, and remove line breaks before
function-opening braces.

This resolves #537.
This commit is contained in:
Jason Evans
2017-01-15 16:56:30 -08:00
parent 5154ff32ee
commit c4c2592c83
119 changed files with 2971 additions and 3572 deletions

View File

@@ -6,8 +6,7 @@ const char *malloc_conf = "prof:true,prof_active:false";
static void
mallctl_thread_name_get_impl(const char *thread_name_expected, const char *func,
int line)
{
int line) {
const char *thread_name_old;
size_t sz;
@@ -24,8 +23,7 @@ mallctl_thread_name_get_impl(const char *thread_name_expected, const char *func,
static void
mallctl_thread_name_set_impl(const char *thread_name, const char *func,
int line)
{
int line) {
assert_d_eq(mallctl("thread.prof.name", NULL, NULL,
(void *)&thread_name, sizeof(thread_name)), 0,
"%s():%d: Unexpected mallctl failure reading thread.prof.name",
@@ -35,8 +33,7 @@ mallctl_thread_name_set_impl(const char *thread_name, const char *func,
#define mallctl_thread_name_set(a) \
mallctl_thread_name_set_impl(a, __func__, __LINE__)
TEST_BEGIN(test_prof_thread_name_validation)
{
TEST_BEGIN(test_prof_thread_name_validation) {
const char *thread_name;
test_skip_if(!config_prof);
@@ -78,8 +75,7 @@ TEST_END
#define NTHREADS 4
#define NRESET 25
static void *
thd_start(void *varg)
{
thd_start(void *varg) {
unsigned thd_ind = *(unsigned *)varg;
char thread_name[16] = "";
unsigned i;
@@ -101,8 +97,7 @@ thd_start(void *varg)
return (NULL);
}
TEST_BEGIN(test_prof_thread_name_threaded)
{
TEST_BEGIN(test_prof_thread_name_threaded) {
thd_t thds[NTHREADS];
unsigned thd_args[NTHREADS];
unsigned i;
@@ -113,16 +108,16 @@ TEST_BEGIN(test_prof_thread_name_threaded)
thd_args[i] = i;
thd_create(&thds[i], thd_start, (void *)&thd_args[i]);
}
for (i = 0; i < NTHREADS; i++)
for (i = 0; i < NTHREADS; i++) {
thd_join(thds[i], NULL);
}
}
TEST_END
#undef NTHREADS
#undef NRESET
int
main(void)
{
main(void) {
return (test(
test_prof_thread_name_validation,
test_prof_thread_name_threaded));