Skip to content

Commit 18990b0

Browse files
authored
C: Remove unused imports and fix signatures (#1191)
This PR cleans up two issues flagged by `clangd`: 1. Unused `#import` statements. 2. Signature mismatches between header and implementation files. Note that I generally went with the names from the implementations, as they are more explicit and from what I've seen that's the style you prefer. I also fixed a typo in a function argument I noticed: `anlayzed` -> `analyzed`
1 parent ad2cf7a commit 18990b0

File tree

15 files changed

+4
-21
lines changed

15 files changed

+4
-21
lines changed

src/analyze.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
#include "include/location.h"
1111
#include "include/parser.h"
1212
#include "include/position.h"
13-
#include "include/pretty_print.h"
1413
#include "include/prism_helpers.h"
1514
#include "include/token_struct.h"
16-
#include "include/util.h"
1715
#include "include/util/hb_array.h"
18-
#include "include/util/hb_buffer.h"
1916
#include "include/util/hb_string.h"
2017
#include "include/util/string.h"
2118
#include "include/visitor.h"

src/analyze_conditional_elements.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "include/analyze_conditional_elements.h"
2-
#include "include/ast_node.h"
32
#include "include/ast_nodes.h"
43
#include "include/element_source.h"
54
#include "include/errors.h"

src/analyze_helpers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ bool has_then_keyword(analyzed_ruby_T* analyzed) {
8181
return analyzed->then_keyword_count > 0;
8282
}
8383

84-
bool has_error_message(analyzed_ruby_T* anlayzed, const char* message) {
85-
for (const pm_diagnostic_t* error = (const pm_diagnostic_t*) anlayzed->parser.error_list.head; error != NULL;
84+
bool has_error_message(analyzed_ruby_T* analyzed, const char* message) {
85+
for (const pm_diagnostic_t* error = (const pm_diagnostic_t*) analyzed->parser.error_list.head; error != NULL;
8686
error = (const pm_diagnostic_t*) error->node.next) {
8787
if (string_equals(error->message, message)) { return true; }
8888
}

src/ast_node.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "include/ast_nodes.h"
33
#include "include/errors.h"
44
#include "include/position.h"
5-
#include "include/token.h"
65
#include "include/util.h"
76
#include "include/visitor.h"
87

src/extract.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "include/herb.h"
22
#include "include/io.h"
3-
#include "include/lexer.h"
43
#include "include/util/hb_array.h"
54
#include "include/util/hb_buffer.h"
65
#include "include/util/string.h"

src/html_util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "include/html_util.h"
2-
#include "include/util.h"
32
#include "include/util/hb_buffer.h"
43
#include "include/util/hb_string.h"
54

src/include/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
int is_newline(int character);
99
int is_whitespace(int character);
10-
const char* skip_whitespace(const char* ptr);
10+
const char* skip_whitespace(const char* pointer);
1111

1212
hb_string_T escape_newlines(hb_string_T input);
1313
hb_string_T quoted_string(hb_string_T input);

src/include/util/hb_arena.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void* hb_arena_alloc(hb_arena_T* allocator, size_t size);
2525
size_t hb_arena_position(hb_arena_T* allocator);
2626
size_t hb_arena_capacity(hb_arena_T* allocator);
2727
void hb_arena_reset(hb_arena_T* allocator);
28-
void hb_arena_reset_to(hb_arena_T* allocator, size_t new_position);
28+
void hb_arena_reset_to(hb_arena_T* allocator, size_t target_position);
2929
void hb_arena_free(hb_arena_T* allocator);
3030

3131
#endif

src/lexer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "include/token.h"
33
#include "include/utf8.h"
44
#include "include/util.h"
5-
#include "include/util/hb_buffer.h"
65
#include "include/util/hb_string.h"
76

87
#include <ctype.h>

src/parser_helpers.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#include "include/parser_helpers.h"
2-
#include "include/ast_node.h"
32
#include "include/ast_nodes.h"
43
#include "include/errors.h"
5-
#include "include/html_util.h"
64
#include "include/lexer.h"
75
#include "include/parser.h"
86
#include "include/token.h"
9-
#include "include/token_matchers.h"
107
#include "include/util/hb_array.h"
118
#include "include/util/hb_buffer.h"
129
#include "include/util/hb_string.h"

0 commit comments

Comments
 (0)