diff options
author | Julian T <julian@jtle.dk> | 2020-10-12 15:57:56 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-10-12 15:57:56 +0200 |
commit | b7f9cf43c8a9ab3400cbb30d5e1cadb0c6c2cf23 (patch) | |
tree | 958cc101d9b06f2c3d67b34d6922da74ed89a6b1 /clang/sec6 | |
parent | ed4fb2b524ecd3811f3f3035819a41a3efd6c38e (diff) |
Nicer brace style
Diffstat (limited to 'clang/sec6')
-rw-r--r-- | clang/sec6/opg3.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/clang/sec6/opg3.c b/clang/sec6/opg3.c index db2b1fd..981b696 100644 --- a/clang/sec6/opg3.c +++ b/clang/sec6/opg3.c @@ -16,12 +16,14 @@ // Sorted word blacklist char *blacklist[] = {"a", "and", "of", "the"}; -bool checkchar(char c) { +bool checkchar(char c) +{ //return isalpha(c) || c == '\''; return isalpha(c); } -int getword(char *dest, size_t max) { +int getword(char *dest, size_t max) +{ char c; char *w = dest; @@ -47,7 +49,8 @@ exit: return c; } -bool checkword(char *w) { +bool checkword(char *w) +{ int l = 0; int r = BLACKWORDS-1; @@ -81,7 +84,8 @@ typedef struct tree_node { struct tree_node *right; } treenode_t; -occur_t *occur_insert(occur_t *l, unsigned line) { +occur_t *occur_insert(occur_t *l, unsigned line) +{ occur_t *new = (occur_t *) malloc(sizeof(occur_t)); new->next = l ? l->next : new; @@ -106,7 +110,8 @@ void occur_print(occur_t *l) { } } -treenode_t *tree_insert(treenode_t *t, char *word, unsigned line) { +treenode_t *tree_insert(treenode_t *t, char *word, unsigned line) +{ if (!t) { treenode_t *node = (treenode_t *) malloc(sizeof(treenode_t)); @@ -129,7 +134,8 @@ treenode_t *tree_insert(treenode_t *t, char *word, unsigned line) { return t; } -void tree_print_words(treenode_t *t, unsigned longest) { +void tree_print_words(treenode_t *t, unsigned longest) +{ if (!t) { return; } @@ -142,7 +148,8 @@ void tree_print_words(treenode_t *t, unsigned longest) { tree_print_words(t->right, longest); } -int main() { +int main() +{ char word[MAXWORDSIZE]; char c; treenode_t *root = NULL; |