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

@@ -29,16 +29,15 @@
#include <isc/types.h>
#include <isc/util.h>
ISC_PLATFORM_NORETURN_PRE void
_fail(const char *const file, const int line) ISC_PLATFORM_NORETURN_POST;
ISC_PLATFORM_NORETURN_PRE void _fail(const char *const file,
const int line) ISC_PLATFORM_NORETURN_POST;
#include <ns/hooks.h>
#include "nstest.h"
static int
_setup(void **state)
{
_setup(void **state) {
isc_result_t result;
UNUSED(state);
@@ -50,8 +49,7 @@ _setup(void **state)
}
static int
_teardown(void **state)
{
_teardown(void **state) {
if (*state != NULL) {
isc_mem_free(mctx, *state);
}
@@ -65,22 +63,22 @@ _teardown(void **state)
* Structure containing parameters for run_full_path_test().
*/
typedef struct {
const ns_test_id_t id; /* libns test identifier */
const char * input; /* source string - plugin name or path
* */
size_t output_size; /* size of target char array to
* allocate */
isc_result_t result; /* expected return value */
const char * output; /* expected output string */
const ns_test_id_t id; /* libns test identifier */
const char *input; /* source string - plugin name or path
* */
size_t output_size; /* size of target char array to
* allocate */
isc_result_t result; /* expected return value */
const char *output; /* expected output string */
} ns_plugin_expandpath_test_params_t;
/*%
* Perform a single ns_plugin_expandpath() check using given parameters.
*/
static void
run_full_path_test(const ns_plugin_expandpath_test_params_t *test, void **state)
{
char ** target = (char **)state;
run_full_path_test(const ns_plugin_expandpath_test_params_t *test,
void **state) {
char **target = (char **)state;
isc_result_t result;
REQUIRE(test != NULL);
@@ -125,8 +123,7 @@ run_full_path_test(const ns_plugin_expandpath_test_params_t *test, void **state)
/* test ns_plugin_expandpath() */
static void
ns_plugin_expandpath_test(void **state)
{
ns_plugin_expandpath_test(void **state) {
size_t i;
const ns_plugin_expandpath_test_params_t tests[] = {
@@ -189,8 +186,7 @@ ns_plugin_expandpath_test(void **state)
}
int
main(void)
{
main(void) {
const struct CMUnitTest tests[] = {
cmocka_unit_test_setup_teardown(ns_plugin_expandpath_test,
_setup, _teardown),
@@ -203,8 +199,7 @@ main(void)
#include <stdio.h>
int
main(void)
{
main(void) {
printf("1..0 # Skipped: cmocka not available\n");
return (0);
}