Skip to content

Commit

Permalink
reformat-source with clang-format-5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Raab committed Feb 25, 2018
1 parent 827923d commit 28b5898
Show file tree
Hide file tree
Showing 108 changed files with 1,623 additions and 1,558 deletions.
2 changes: 1 addition & 1 deletion benchmarks/opmphm.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static void benchmarkMappingAllSeeds (void)
OpmphmInit init;
init.getName = elektraGetString;
init.data = (void **)(ks->array);
// OPMPHM
// OPMPHM

#ifdef USE_OPENMP
threadI = omp_get_thread_num ();
Expand Down
5 changes: 3 additions & 2 deletions src/bindings/cpp/benchmarks/benchmark_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ class Environment : public ThreadBoolean
: ThreadBoolean (ks, context_, Key ("/test/%layer1%", KEY_CASCADING_NAME, KEY_META, "default", "1", KEY_END)),
nested (ks, context_), person (ks, context_),
profile (ks, context_, Key ("/%layer1%/profile", KEY_CASCADING_NAME, KEY_META, "default", "default", KEY_END)),
bm (ks, context_, Key ("/%layer1%/%layer2%/%layer3%/%layer4%/%layer5%/%layer6%/%layer7%/%layer8%/%layer9%/", KEY_CASCADING_NAME,
KEY_META, "default", s_value, KEY_END))
bm (ks, context_,
Key ("/%layer1%/%layer2%/%layer3%/%layer4%/%layer5%/%layer6%/%layer7%/%layer8%/%layer9%/", KEY_CASCADING_NAME, KEY_META,
"default", s_value, KEY_END))
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/cpp/include/kdbcontext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class Context : public Subject
* @par on_layer is called for every layer in the
* specification.
* @return the evaluated string
*/
*/
std::string evaluate (std::string const & key_name,
std::function<bool(std::string const &, std::string &, bool in_group)> const & on_layer) const
{
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/cpp/include/kdbplugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Delegator

private:
/**This function avoid that every return path need to release the
* configuration. */
* configuration. */
inline static int openHelper (ckdb::Plugin * handle, kdb::KeySet & config, ckdb::Key * errorKey, Builder builder)
{
if (config.lookup ("/module"))
Expand Down
15 changes: 9 additions & 6 deletions src/bindings/cpp/tests/testcpp_contextual_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,9 @@ TYPED_TEST (test_contextual_basic, groups)
KeySet ks;
TypeParam c = this->context;
Value<int, ContextPolicyIs<TypeParam>> i (
ks, c, Key ("/%application%/%version profile thread module%/%manufacturer type family model%/serial_number",
KEY_CASCADING_NAME, KEY_META, "default", s_value, KEY_END));
ks, c,
Key ("/%application%/%version profile thread module%/%manufacturer type family model%/serial_number", KEY_CASCADING_NAME,
KEY_META, "default", s_value, KEY_END));
ASSERT_EQ (i.getName (), "/%/%/%/serial_number");
c.template activate<MainApplicationLayer> ();
String s (ks, c, Key ("/%x%", KEY_CASCADING_NAME, KEY_META, "default", "anonymous", KEY_END));
Expand Down Expand Up @@ -737,10 +738,12 @@ TEST (test_contextual_basic, evaluate)
ASSERT_EQ (c.evaluate ("/%language%%country%%dialect%/test"), "/%%%/test");

KeySet ks;
Integer i (ks, c, Key ("/%application%/%version%/%profile%/%thread%/%module%/%manufacturer%/%type%/%family%/%model%/serial_number",
KEY_CASCADING_NAME, KEY_META, "default", s_value, KEY_END));
Integer j (ks, c, Key ("/%application version profile thread module manufacturer type family model%/serial_number",
KEY_CASCADING_NAME, KEY_META, "default", s_value, KEY_END));
Integer i (ks, c,
Key ("/%application%/%version%/%profile%/%thread%/%module%/%manufacturer%/%type%/%family%/%model%/serial_number",
KEY_CASCADING_NAME, KEY_META, "default", s_value, KEY_END));
Integer j (ks, c,
Key ("/%application version profile thread module manufacturer type family model%/serial_number", KEY_CASCADING_NAME,
KEY_META, "default", s_value, KEY_END));
ASSERT_EQ (i.getName (), "/%/%/%/%/%/%/%/%/%/serial_number");
ASSERT_EQ (j.getName (), "/%/serial_number");
c.activate<MainApplicationLayer> ();
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/glib/gelektra-kdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static void gelektra_kdb_finalize (GObject * object)

/* Always chain up to the parent class; as with dispose(), finalize()
* is guaranteed to exist on the parent's class virtual function table
*/
*/
G_OBJECT_CLASS (gelektra_kdb_parent_class)->finalize (object);
}

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/glib/gelektra-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void gelektra_key_finalize (GObject * object)

/* Always chain up to the parent class; as with dispose(), finalize()
* is guaranteed to exist on the parent's class virtual function table
*/
*/
G_OBJECT_CLASS (gelektra_key_parent_class)->finalize (object);
}

Expand Down
2 changes: 1 addition & 1 deletion src/bindings/glib/gelektra-keyset.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void gelektra_keyset_finalize (GObject * object)

/* Always chain up to the parent class; as with dispose(), finalize()
* is guaranteed to exist on the parent's class virtual function table
*/
*/
G_OBJECT_CLASS (gelektra_keyset_parent_class)->finalize (object);
}

Expand Down
14 changes: 7 additions & 7 deletions src/bindings/gsettings/elektrasettingsbackend.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ static gboolean elektra_settings_write_string (GSettingsBackend * backend, const
static GVariant * elektra_settings_backend_read (GSettingsBackend * backend, const gchar * key, const GVariantType * expected_type,
gboolean default_value)
{
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s %s %.*s %s %s%s", "function read:", key, "expected_type is:",
(int)(g_variant_type_get_string_length (expected_type) & INT_MAX), g_variant_type_peek_string (expected_type), "and we",
(default_value ? "" : "do not "), "want the default_value");
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s %s %.*s %s %s%s", "function read:", key,
"expected_type is:", (int)(g_variant_type_get_string_length (expected_type) & INT_MAX),
g_variant_type_peek_string (expected_type), "and we", (default_value ? "" : "do not "), "want the default_value");
if (default_value)
{
return elektra_settings_read_string (backend, g_strconcat (G_ELEKTRA_SETTINGS_SYSTEM, G_ELEKTRA_SETTINGS_PATH, key, NULL),
Expand Down Expand Up @@ -200,8 +200,8 @@ static GVariant * elektra_settings_backend_read (GSettingsBackend * backend, con
static GVariant * elektra_settings_backend_read_user_value (GSettingsBackend * backend, const gchar * key,
const GVariantType * expected_type)
{
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s. %s %s.", "Function read_user_value:", key, "Expected_type is:",
g_variant_type_peek_string (expected_type));
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s. %s %s.", "Function read_user_value:", key,
"Expected_type is:", g_variant_type_peek_string (expected_type));
return elektra_settings_read_string (backend, g_strconcat (G_ELEKTRA_SETTINGS_USER, G_ELEKTRA_SETTINGS_PATH, key, NULL),
expected_type);
}
Expand Down Expand Up @@ -375,8 +375,8 @@ static void elektra_settings_key_changed (GDBusConnection * connection G_GNUC_UN
GElektraKeySet * ks = gelektra_keyset_dup (esb->subscription_gks);
gelektra_keyset_rewind (ks);
GElektraKey * key = gelektra_key_new (keypathname, KEY_VALUE, "", KEY_END);
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s!", "GSEttings Path: ",
(g_strstr_len (g_strstr_len (keypathname, -1, "/") + 1, -1, "/")));
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s %s!",
"GSEttings Path: ", (g_strstr_len (g_strstr_len (keypathname, -1, "/") + 1, -1, "/")));
gelektra_keyset_next (ks);
do
{
Expand Down
12 changes: 6 additions & 6 deletions src/bindings/intercept/env/benchmarks/benchmark_getenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ __attribute__ ((noinline)) void benchmark_kslookup ()
using namespace kdb; // needed for KS_END
kdb::KeySet ks (100,
/*
*kdb::Key("user/env/override/some", KEY_END),
*kdb::Key("user/env/override/a/key", KEY_END),
*kdb::Key("user/env/override/b/key", KEY_END),
*kdb::Key("user/env/override/c/key", KEY_END),
*kdb::Key("user/env/override/d/key", KEY_END),
*/
*kdb::Key("user/env/override/some", KEY_END),
*kdb::Key("user/env/override/a/key", KEY_END),
*kdb::Key("user/env/override/b/key", KEY_END),
*kdb::Key("user/env/override/c/key", KEY_END),
*kdb::Key("user/env/override/d/key", KEY_END),
*/
KS_END);
for (int i = 0; i < nr_keys; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/io/doc/testio_doc.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file
*
*
* @brief Tests for I/O doc binding.
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
Expand Down
2 changes: 1 addition & 1 deletion src/include/kdbopmphm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <stdlib.h>

/**
* For usage look in [datastructures.md](/doc/dev/datastructures.md)
* For usage look in [datastructures.md](/doc/dev/datastructures.md)
*
*/

Expand Down
2 changes: 1 addition & 1 deletion src/include/kdbos.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ typedef int elektraNamespace;
#define KDB_PATH_SEPARATOR '/'

/**@brief Escape symbol for special characters in the key name.
*
*
* @see @link keyname here @endlink.
* */
#define KDB_PATH_ESCAPE '\\'
Expand Down
36 changes: 18 additions & 18 deletions src/include/kdbplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
#define ELEKTRA_PLUGIN_FUNCTION3(module, variant, function) libelektra_##module##_##variant##_LTX_elektraPlugin##function
#else
/**
* @brief Declare a plugin's function name suitable for
* compilation variants (see doc/tutorials).
*
* It can be used in the same way as elektraPluginExport().
* @see ELEKTRA_PLUGIN_EXPORT
*
* @ingroup plugin
*
* @param plugin the name of the plugin
* @param function which function it is (open, close, get, set, error)
*/
* @brief Declare a plugin's function name suitable for
* compilation variants (see doc/tutorials).
*
* It can be used in the same way as elektraPluginExport().
* @see ELEKTRA_PLUGIN_EXPORT
*
* @ingroup plugin
*
* @param plugin the name of the plugin
* @param function which function it is (open, close, get, set, error)
*/
#define ELEKTRA_PLUGIN_FUNCTION(module, function) libelektra_##module##_LTX_elektraPlugin##function
#endif

Expand All @@ -55,13 +55,13 @@
#define ELEKTRA_README3(module, variant) ELEKTRA_QUOTE (readme_##module##_##variant.c)
#else
/**
* @brief The filename for inclusion of the readme for
* compilation variants (see doc/tutorials).
*
* @ingroup plugin
*
* @param plugin the name of the plugin
*/
* @brief The filename for inclusion of the readme for
* compilation variants (see doc/tutorials).
*
* @ingroup plugin
*
* @param plugin the name of the plugin
*/
#define ELEKTRA_README(module) ELEKTRA_README2 (module)
#define ELEKTRA_README2(module) ELEKTRA_QUOTE (readme_##module.c)
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/libs/elektra/exportsymbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main (int argc, char ** argv)

"extern kdblib_symbol kdb_exported_syms[];\n\n"

);
);

for (i = 1; i < argc; ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion src/libs/elektra/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ char * elektraUnescapeKeyNamePart (const char * source, size_t size, char * dest
*
* May only need half the storage than the source string.
* It is not safe to use the same string for source and dest.
**/
**/
size_t elektraUnescapeKeyName (const char * source, char * dest)
{
const char * sp = source;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/elektra/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ ssize_t keyDecRef (Key * key)
*
* You can even add the key to more KeySets:
*
* @snippet keyNew.c Ref in multiple KeySets
* @snippet keyNew.c Ref in multiple KeySets
*
* If you increment only by one with keyIncRef() the same as said above
* is valid:
Expand Down
6 changes: 3 additions & 3 deletions src/libs/elektra/keymeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

/***************************************************************************
keymeta.c - Methods for Key manipulation
-------------------
keymeta.c - Methods for Key manipulation
-------------------
begin : Fri Sep 26 2008
copyright : (C) 2008 by Markus Raab
email : elektra@markus-raab.org
Expand Down Expand Up @@ -182,7 +182,7 @@ int keyRewindMeta (Key * key)
*
* @see ksNext() for pedant in iterator interface of KeySet
* @ingroup keymeta
**/
**/
const Key * keyNextMeta (Key * key)
{
Key * ret;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/elektra/keyvalue.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
*/


/*******************************************
/*******************************************
* General value manipulation methods *
*******************************************/

Expand Down Expand Up @@ -127,7 +127,7 @@ kdbGetByName(handle,ks,"system/sw/my",KDB_O_SORT|KDB_O_RECURSIVE);
ksRewind(ks);
while (current=ksNext(ks)) {
size_t size=0;
if (keyIsBin(current)) {
size=keyGetValueSize(current);
printf("Key %s has a value of size %d bytes. Value: <BINARY>\nComment: %s",
Expand Down
4 changes: 2 additions & 2 deletions src/libs/elektra/split.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @return a fresh allocated split object
* @ingroup split
* @see splitDel()
**/
**/
Split * splitNew (void)
{
Split * ret = elektraCalloc (sizeof (Split));
Expand Down Expand Up @@ -696,7 +696,7 @@ int splitMerge (Split * split, KeySet * dest)
* @param split the split object to work with
* @ingroup split
*
**/
**/
int splitSync (Split * split)
{
int needsSync = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/libs/elektra/trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ Trie * trieInsert (Trie * trie, const char * name, Backend * value)
}


/******************
* Private static declarations
******************/
/******************
* Private static declarations
******************/


#if 0
Expand Down
2 changes: 1 addition & 1 deletion src/libs/invoke/invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ KeySet * elektraInvokeGetPluginConfig (ElektraInvokeHandle * handle)
*
* @pre handle must be as returned from elektraInvokeOpen()
*
* @return the name of the plugin
* @return the name of the plugin
*/
const char * elektraInvokeGetPluginName (ElektraInvokeHandle * handle)
{
Expand Down
10 changes: 5 additions & 5 deletions src/libs/meta/meta.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,11 @@ void elektraMetaArrayAdd (Key * key, const char * metaName, const char * value)
*
* @code
elektraMetaArrayToKS(
keyNew ("/a", KEY_VALUE, "b, c",
KEY_META, "dep", "#1",
KEY_META, "dep/#0", "/b",
KEY_META, "dep/#1", "/c", KEY_END),
"dep");
keyNew ("/a", KEY_VALUE, "b, c",
KEY_META, "dep", "#1",
KEY_META, "dep/#0", "/b",
KEY_META, "dep/#1", "/c", KEY_END),
"dep");
* @endcode
*
* returns a `KeySet` containing the keys `"dep/#0"` with value `"/b"` and
Expand Down
8 changes: 4 additions & 4 deletions src/libs/tools/benchmarks/benchmark_crypto_comparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ __attribute__ ((noinline)) void benchmark_crypto_get (int iteration)
Key mp = getMountpointForIteration<VARIANT> (iteration);

/***************************************************************************
* start of measurement
**************************************************************************/
* start of measurement
**************************************************************************/
t.start ();
kdb.get (ks, mp);
t.stop ();
/***************************************************************************
* end of measurement
**************************************************************************/
* end of measurement
**************************************************************************/

kdb.close ();
std::cout << t;
Expand Down
Loading

0 comments on commit 28b5898

Please sign in to comment.