Unify coding style

@sjaeckel integrated clang-format with formal coding style. Run his
script and commit changes.

There are pros and cons of this commit.

Mixed coding style is a "broken window". A good single style simplifies
reading and writing code.

On the other hand, this is a big change which will lead to conflicts.
This commit is contained in:
Dmitry Podgorny
2020-01-03 22:02:22 +02:00
parent eef07cef36
commit 562a06425b
62 changed files with 3972 additions and 3746 deletions

View File

@@ -23,11 +23,11 @@
/* strtok_s() has appeared in visual studio 2005.
Use own implementation for older versions. */
#ifdef _MSC_VER
# if (_MSC_VER >= 1400)
# define strtok_r strtok_s
# else
# define strtok_r xmpp_strtok_r
# endif
#if (_MSC_VER >= 1400)
#define strtok_r strtok_s
#else
#define strtok_r xmpp_strtok_r
#endif
#endif /* _MSC_VER */
static int test_strtok_r(void)
@@ -75,8 +75,8 @@ static int test_strdup_one(xmpp_ctx_t *ctx, const char *s)
if (!s1 || !s2 || strcmp(s1, s2) != 0) {
rc = -1;
printf("strdup: '%s', xmpp_strdup: '%s'\n",
s1 ? s1 : "<NULL>", s2 ? s2 : "<NULL>");
printf("strdup: '%s', xmpp_strdup: '%s'\n", s1 ? s1 : "<NULL>",
s2 ? s2 : "<NULL>");
}
free(s1);
@@ -92,7 +92,7 @@ static int test_strdup(void)
size_t i;
int rc = 0;
static const char *tests[] = { "", "\0", "test", "s p a c e", "\n\r" };
static const char *tests[] = {"", "\0", "test", "s p a c e", "\n\r"};
ctx = xmpp_ctx_new(NULL, NULL);
assert(ctx != NULL);