From 783b546cfa83c555c8fa0907da9f0c3ecf75aa7f Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Wed, 1 Mar 2023 07:27:42 +0000 Subject: [PATCH] Restyled by clang-format --- src/tools/kdb/meta-set.c | 10 ++++++---- src/tools/kdb/meta-show.c | 3 +-- src/tools/kdb/meta.c | 3 +-- src/tools/kdb/set.c | 7 ++++--- src/tools/kdb/set.h | 38 +++++++++++++++++++------------------- 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/tools/kdb/meta-set.c b/src/tools/kdb/meta-set.c index 99505f648f8..a35c7292411 100644 --- a/src/tools/kdb/meta-set.c +++ b/src/tools/kdb/meta-set.c @@ -56,10 +56,11 @@ int execMetaSet (KeySet * options, Key * errorKey) Key * parentKey = keyNew (keyName, KEY_END); - if (keyGetNamespace (parentKey) == KEY_NS_NONE || keyGetNamespace (parentKey) == KEY_NS_CASCADING) { + if (keyGetNamespace (parentKey) == KEY_NS_NONE || keyGetNamespace (parentKey) == KEY_NS_CASCADING) + { ret = 1; ELEKTRA_SET_VALIDATION_SYNTACTIC_ERROR (errorKey, "key does not specify a namespace"); - elektraFree ((void*) keyName); + elektraFree ((void *) keyName); keyDel (parentKey); return ret; } @@ -87,7 +88,8 @@ int execMetaSet (KeySet * options, Key * errorKey) if (kdbSet (handle, conf, parentKey) == -1) { ret = 1; - ELEKTRA_SET_VALIDATION_SEMANTIC_ERRORF (errorKey, "could not set meta-value '%s' for '%s': %s", metaName, keyName, GET_ERR (parentKey)); + ELEKTRA_SET_VALIDATION_SEMANTIC_ERRORF (errorKey, "could not set meta-value '%s' for '%s': %s", metaName, keyName, + GET_ERR (parentKey)); } keyDel (key); @@ -97,7 +99,7 @@ int execMetaSet (KeySet * options, Key * errorKey) { printf ("\n"); } - elektraFree ((void*) keyName); + elektraFree ((void *) keyName); keyDel (parentKey); ksDel (conf); kdbClose (handle, errorKey); diff --git a/src/tools/kdb/meta-show.c b/src/tools/kdb/meta-show.c index dceb056ef50..f4bbdaac5d4 100644 --- a/src/tools/kdb/meta-show.c +++ b/src/tools/kdb/meta-show.c @@ -61,8 +61,7 @@ int execMetaShow (KeySet * options, Key * errorKey) for (elektraCursor it = 0; it < ksGetSize (metaKeys); ++it) { cur = ksAtCursor (metaKeys, it); - CLI_PRINT (CLI_LOG_NONE, "%s -> %s%c", keyName (cur), BOLD(keyString (cur)), nullTerm ? '\0' : '\n'); - + CLI_PRINT (CLI_LOG_NONE, "%s -> %s%c", keyName (cur), BOLD (keyString (cur)), nullTerm ? '\0' : '\n'); } diff --git a/src/tools/kdb/meta.c b/src/tools/kdb/meta.c index c30db2287b9..6f7a46a2890 100644 --- a/src/tools/kdb/meta.c +++ b/src/tools/kdb/meta.c @@ -6,11 +6,11 @@ * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) */ -#include #include #include #include #include +#include #include #include @@ -52,5 +52,4 @@ int execMeta (KeySet * options, Key * errorKey) } // this cannot happen, since not valid sub-commands are already detected when parsing return 1; - } diff --git a/src/tools/kdb/set.c b/src/tools/kdb/set.c index 56c6a97f056..4db76956655 100644 --- a/src/tools/kdb/set.c +++ b/src/tools/kdb/set.c @@ -54,10 +54,11 @@ int execSet (KeySet * options, Key * errorKey) Key * parentKey = keyNew (name, KEY_END); - if (keyGetNamespace (parentKey) == KEY_NS_NONE || keyGetNamespace (parentKey) == KEY_NS_CASCADING) { + if (keyGetNamespace (parentKey) == KEY_NS_NONE || keyGetNamespace (parentKey) == KEY_NS_CASCADING) + { ret = 1; ELEKTRA_SET_VALIDATION_SYNTACTIC_ERROR (errorKey, "key does not specify a namespace"); - elektraFree ((void*) name); + elektraFree ((void *) name); keyDel (parentKey); return ret; } @@ -95,7 +96,7 @@ int execSet (KeySet * options, Key * errorKey) { printf ("\n"); } - elektraFree ((void*) name); + elektraFree ((void *) name); keyDel (parentKey); ksDel (conf); kdbClose (handle, errorKey); diff --git a/src/tools/kdb/set.h b/src/tools/kdb/set.h index 92912c2b238..3af921614ee 100644 --- a/src/tools/kdb/set.h +++ b/src/tools/kdb/set.h @@ -1,10 +1,10 @@ /** -* @file -* -* @brief KDB set subcommand header -* -* @copyright BSD License (see LICENSE.md or https://www.libelektra.org) -*/ + * @file + * + * @brief KDB set subcommand header + * + * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) + */ #ifndef ELEKTRA_KDB_SET_H #define ELEKTRA_KDB_SET_H @@ -12,22 +12,22 @@ #include /** -* Adds options specification of set command to keySet -* -* @param spec the base spec where the commands spec should be added -*/ + * Adds options specification of set command to keySet + * + * @param spec the base spec where the commands spec should be added + */ void addSetSpec (KeySet * spec); /** -* Runs the set command -* -* @param options cli options and arguments as specified in addSetSpec() -* @param errorKey key where errors and warnings should be saved -* -* @retval 0 set command ran without errors -* @retval 1 errors occurred, keySetMeta (errorKey, "error/reason") for info -* -*/ + * Runs the set command + * + * @param options cli options and arguments as specified in addSetSpec() + * @param errorKey key where errors and warnings should be saved + * + * @retval 0 set command ran without errors + * @retval 1 errors occurred, keySetMeta (errorKey, "error/reason") for info + * + */ int execSet (KeySet * options, Key * errorKey); #endif // ELEKTRA_KDB_SET_H