Commit 6a80ca4
authored
C: Fix
This pull request address the following `hb_string_T` casting warnings
when running `bundle exec rake compile`
```
compiling ../../../../ext/herb/../../src/parser.c
../../../../ext/herb/../../src/parser.c:322:31: warning: initializing 'char *' with an expression of type 'const char[1]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
322 | ast_html_text_node_init(HB_STRING_EMPTY, start, parser->current_token->location.start, errors, parser->allocator);
| ^~~~~~~~~~~~~~~
../../../../ext/herb/../../src/include/analyze/../util/hb_string.h:18:50: note: expanded from macro 'HB_STRING_EMPTY'
18 | #define HB_STRING_EMPTY ((hb_string_T) { .data = "", .length = 0 })
| ^~
1 warning generated.
compiling ../../../../ext/herb/../../src/parser_helpers.c
../../../../ext/herb/../../src/parser_helpers.c:75:21: warning: initializing 'char *' with an expression of type 'const char[1]' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
75 | default: return HB_STRING_EMPTY;
| ^~~~~~~~~~~~~~~
../../../../ext/herb/../../src/include/analyze/../util/hb_string.h:18:50: note: expanded from macro 'HB_STRING_EMPTY'
18 | #define HB_STRING_EMPTY ((hb_string_T) { .data = "", .length = 0 })
| ^~
1 warning generated.
```
```
compiling ../../../../ext/herb/../../src/analyze/action_view/tag_helpers.c
../../../../ext/herb/../../src/analyze/action_view/tag_helpers.c:698:63: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]
698 | hb_string_T raw_content = { .data = raw_copy, .length = content_length };
| ~ ^~~~~~~~~~~~~~
1 warning generated.
```hb_string_T compiler warnings (#1427)1 parent 18a9956 commit 6a80ca4
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
| 698 | + | |
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments