Update .clang-format

Align with wlroots style
This commit is contained in:
Johan Malm 2020-09-28 20:41:41 +01:00
parent 96b5ab1fc1
commit 96e05057a3
32 changed files with 669 additions and 515 deletions

View file

@ -14,7 +14,8 @@ static char *current_buffer_position;
static struct token *tokens;
static int nr_tokens, alloc_tokens;
static void add_token(enum token_type token_type)
static void
add_token(enum token_type token_type)
{
if (nr_tokens == alloc_tokens) {
alloc_tokens = (alloc_tokens + 16) * 2;
@ -26,13 +27,15 @@ static void add_token(enum token_type token_type)
token->type = token_type;
}
static void get_identifier_token()
static void
get_identifier_token()
{
struct token *token = tokens + nr_tokens - 1;
token->name[token->pos] = current_buffer_position[0];
token->pos++;
if (token->pos == MAX_TOKEN_SIZE - 1)
if (token->pos == MAX_TOKEN_SIZE - 1) {
return;
}
current_buffer_position++;
switch (current_buffer_position[0]) {
case '\0':
@ -49,13 +52,15 @@ static void get_identifier_token()
}
}
static void get_number_token()
static void
get_number_token()
{
struct token *token = tokens + nr_tokens - 1;
token->name[token->pos] = current_buffer_position[0];
token->pos++;
if (token->pos == MAX_TOKEN_SIZE - 1)
if (token->pos == MAX_TOKEN_SIZE - 1) {
return;
}
current_buffer_position++;
switch (current_buffer_position[0]) {
case '\0':
@ -71,14 +76,16 @@ static void get_number_token()
}
}
static void get_special_char_token()
static void
get_special_char_token()
{
struct token *token = tokens + nr_tokens - 1;
token->name[0] = current_buffer_position[0];
current_buffer_position++;
}
struct token *tokenize_xbm(char *buffer)
struct token *
tokenize_xbm(char *buffer)
{
tokens = NULL;
nr_tokens = 0;