aboutsummaryrefslogtreecommitdiff
path: root/src/parse.c
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2017-09-12 12:43:38 +0200
committerkoekeishiya <aasvi93@hotmail.com>2017-09-12 12:43:38 +0200
commit07f864c03ecdfbbc761cdfa8cf54321ba17bec47 (patch)
tree1275e554d48a3e43877843340b9f03cc763932a8 /src/parse.c
parent1723966a65c5fd591aca85ed427e53674bae056e (diff)
downloadskhd-07f864c03ecdfbbc761cdfa8cf54321ba17bec47.tar.gz
skhd-07f864c03ecdfbbc761cdfa8cf54321ba17bec47.zip
code cleanup
Diffstat (limited to 'src/parse.c')
-rw-r--r--src/parse.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/parse.c b/src/parse.c
index 5c3ed6d..56f3c7f 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -18,8 +18,7 @@ read_file(const char *file)
char *buffer = NULL;
FILE *handle = fopen(file, "r");
- if(handle)
- {
+ if(handle) {
fseek(handle, 0, SEEK_END);
length = ftell(handle);
fseek(handle, 0, SEEK_SET);
@@ -105,7 +104,6 @@ parse_key_literal(struct parser *parser)
uint32_t keycode;
struct token key = parser_previous(parser);
- // NOTE(koekeishiya): Might want to replace this mapping with a hashtable
for(int i = 0; i < array_count(literal_keycode_str); ++i) {
if(token_equals(key, literal_keycode_str[i])) {
keycode = literal_keycode_value[i];
@@ -132,7 +130,6 @@ parse_modifier(struct parser *parser)
uint32_t flags = 0;
struct token modifier = parser_previous(parser);
- // NOTE(koekeishiya): Might want to replace this mapping with a hashtable
for(int i = 0; i < array_count(modifier_flags_str); ++i) {
if(token_equals(modifier, modifier_flags_str[i])) {
flags |= modifier_flags_value[i];
@@ -270,7 +267,7 @@ parser_advance(struct parser *parser)
bool parser_check(struct parser *parser, enum token_type type)
{
- if(parser_eof(parser)) return 0;
+ if(parser_eof(parser)) return false;
struct token token = parser_peek(parser);
return token.type == type;
}