Merge branch 'each-style-tweak' into 'master'

adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

(cherry picked from commit d3b49b6675)

0255a974 revise .clang-format and add a C formatting script in util
e851ed0b apply the modified style
This commit is contained in:
Ondřej Surý
2020-02-14 05:35:17 +00:00
parent c646c20e79
commit cdef20bb66
672 changed files with 36044 additions and 42228 deletions

View File

@@ -28,14 +28,14 @@
#include <isc/timer.h>
#include <isc/util.h>
isc_mem_t * test_mctx = NULL;
isc_log_t * test_lctx = NULL;
isc_taskmgr_t * taskmgr = NULL;
isc_timermgr_t * timermgr = NULL;
isc_mem_t *test_mctx = NULL;
isc_log_t *test_lctx = NULL;
isc_taskmgr_t *taskmgr = NULL;
isc_timermgr_t *timermgr = NULL;
isc_socketmgr_t *socketmgr = NULL;
isc_nm_t * netmgr = NULL;
isc_task_t * maintask = NULL;
int ncpus;
isc_nm_t *netmgr = NULL;
isc_task_t *maintask = NULL;
int ncpus;
static bool test_running = false;
@@ -53,8 +53,7 @@ static isc_logcategory_t categories[] = { { "", 0 },
{ NULL, 0 } };
static void
cleanup_managers(void)
{
cleanup_managers(void) {
if (maintask != NULL) {
isc_task_shutdown(maintask);
isc_task_destroy(&maintask);
@@ -74,10 +73,9 @@ cleanup_managers(void)
}
static isc_result_t
create_managers(unsigned int workers)
{
create_managers(unsigned int workers) {
isc_result_t result;
char * p;
char *p;
if (workers == 0) {
workers = isc_os_ncpus();
@@ -103,8 +101,7 @@ cleanup:
}
isc_result_t
isc_test_begin(FILE *logfile, bool start_managers, unsigned int workers)
{
isc_test_begin(FILE *logfile, bool start_managers, unsigned int workers) {
isc_result_t result;
INSIST(!test_running);
@@ -117,7 +114,7 @@ isc_test_begin(FILE *logfile, bool start_managers, unsigned int workers)
if (logfile != NULL) {
isc_logdestination_t destination;
isc_logconfig_t * logconfig = NULL;
isc_logconfig_t *logconfig = NULL;
INSIST(test_lctx == NULL);
CHECK(isc_log_create(test_mctx, &test_lctx, &logconfig));
@@ -149,8 +146,7 @@ cleanup:
}
void
isc_test_end(void)
{
isc_test_end(void) {
if (maintask != NULL) {
isc_task_detach(&maintask);
}
@@ -174,8 +170,7 @@ isc_test_end(void)
* Sleep for 'usec' microseconds.
*/
void
isc_test_nap(uint32_t usec)
{
isc_test_nap(uint32_t usec) {
#ifdef HAVE_NANOSLEEP
struct timespec ts;