Skip to content

Commit 1e4474a

Browse files
committed
Fix/cleanup missing includes
1 parent 7bf2740 commit 1e4474a

File tree

165 files changed

+1001
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+1001
-349
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
cpp_include_cleanup_add_missing_error_tag_type = suggestion
5+
cpp_include_cleanup_remove_unused_error_tag_type = dimmed
6+
cpp_include_cleanup_optimize_unused_error_tag_type = suggestion
7+
cpp_include_cleanup_sort_after_edits = false
8+
cpp_sort_includes_error_tag_type = none
9+
cpp_sort_includes_priority_case_sensitive = true
10+
cpp_sort_includes_priority_style = quoted
11+
cpp_includes_style = default
12+
cpp_includes_use_forward_slash = true
13+
cpp_include_cleanup_alternate_files = stddef.h:cstddef, stddef.h:vcruntime.h, stddef.h:vadefs.h, stdint.h:cstdint, stdarg.h:vadefs.h, stdarg.h:cstdarg, deemon/api.h:hybrid/compiler.h, deemon/api.h:compiler/msvc.h, deemon/api.h:__stdinc.h, deemon/system-features.h:string.h, deemon/system-features.h:cstring, deemon/system-features.h:memory.h, deemon/system-features.h:cstring

cpp.hint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@
994994
#define DDATDEF extern
995995
#define DEFAULT_OPDEF extern
996996
#define DEFAULT_OPIMP
997+
#define DEFIMPL(x) 0
997998
#define DCALL_ASSEMBLY_NAME(x,s) x
998999
#define Dee_DOC(x) x
9991000
#define Dee_DOC_DEF(n,x) char const n[]=x

include/deemon/kos-headers/compiler/msvc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,10 @@ void __builtin_va_end(__builtin_va_list &__ap);
552552
#pragma warning(disable: 4201) /* nonstandard extension used: nameless struct/union (they're standard now...) */
553553
#ifdef __cplusplus
554554
#pragma warning(disable: 4644) /* Annoying warning about use of `offsetof' in constant expressions (). */
555+
#pragma warning(disable: 26429)
556+
#pragma warning(disable: 26440)
557+
#pragma warning(disable: 26457)
558+
#pragma warning(disable: 6011) /* TODO: REMOVE THIS ONE */
555559
#define __SYSDECL_BEGIN __DECL_BEGIN
556560
#define __SYSDECL_END __DECL_END
557561
#else /* __cplusplus */

src/deemon/cmdline.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@
2020
#ifndef GUARD_CMDLINE_C
2121
#define GUARD_CMDLINE_C 1
2222

23-
#include "cmdline.h"
24-
2523
#include <deemon/alloc.h>
2624
#include <deemon/api.h>
2725
#include <deemon/error.h>
2826
#include <deemon/system-features.h> /* bcmpc(), ... */
27+
/**/
28+
29+
#include "cmdline.h"
30+
/**/
31+
32+
#include <stdint.h> /* uint16_t */
2933

3034
DECL_BEGIN
3135

@@ -139,9 +143,8 @@ find_long_option(struct cmd_option const *__restrict options,
139143
}
140144

141145

142-
INTERN int DCALL
143-
cmd_parse(int *__restrict p_argc,
144-
char ***__restrict p_argv,
146+
INTERN WUNUSED NONNULL((1, 2, 3)) int DCALL
147+
cmd_parse(int *__restrict p_argc, char ***__restrict p_argv,
145148
struct cmd_option const *__restrict options,
146149
bool exec_all) {
147150
struct cmd_option const *opt;

src/deemon/cmdline.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#define GUARD_CMDLINE_H 1
2222

2323
#include <deemon/api.h>
24-
#include <deemon/object.h>
24+
/**/
25+
26+
#include <stdint.h>
2527

2628
DECL_BEGIN
2729

@@ -111,9 +113,8 @@ struct cmd_option {
111113
* @return: -1: An error was thrown.
112114
* NOTE: Options are always searched in ascending order, meaning that lower
113115
* indices have a greater priority and may out-weigh greater indices. */
114-
INTDEF int DCALL
115-
cmd_parse(int *__restrict p_argc,
116-
char ***__restrict p_argv,
116+
INTDEF WUNUSED NONNULL((1, 2, 3)) int DCALL
117+
cmd_parse(int *__restrict p_argc, char ***__restrict p_argv,
117118
struct cmd_option const *__restrict options,
118119
bool exec_all);
119120

src/deemon/compiler/asm/parseasm.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,31 @@
2020
#ifndef GUARD_DEEMON_COMPILER_ASM_PARSEASM_C
2121
#define GUARD_DEEMON_COMPILER_ASM_PARSEASM_C 1
2222

23+
#include <deemon/api.h>
24+
/**/
25+
2326
#include <deemon/compiler/compiler.h>
2427

2528
#include <deemon/alloc.h>
26-
#include <deemon/api.h>
27-
#include <deemon/bool.h>
2829
#include <deemon/compiler/assembler.h>
2930
#include <deemon/compiler/ast.h>
31+
#include <deemon/compiler/lexer.h>
3032
#include <deemon/compiler/optimize.h>
3133
#include <deemon/compiler/tpp.h>
32-
#include <deemon/dict.h>
3334
#include <deemon/error.h>
34-
#include <deemon/hashset.h>
35-
#include <deemon/int.h>
36-
#include <deemon/list.h>
3735
#include <deemon/module.h>
3836
#include <deemon/none.h>
37+
#include <deemon/object.h>
3938
#include <deemon/string.h>
4039
#include <deemon/system-features.h>
41-
#include <deemon/tuple.h>
4240

43-
#include <stdint.h> /* UINT16_MAX, ... */
41+
#include <hybrid/sequence/list.h>
42+
/**/
4443

4544
#include "../../runtime/strings.h"
45+
/**/
46+
47+
#include <stdint.h> /* UINT16_MAX, ... */
4648

4749
#ifndef CONFIG_LANGUAGE_NO_ASM
4850
DECL_BEGIN

src/deemon/execute/code.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <deemon/format.h>
3232
#include <deemon/gc.h>
3333
#include <deemon/int.h>
34+
#include <deemon/seq.h>
3435
#include <deemon/map.h>
3536
#include <deemon/module.h>
3637
#include <deemon/none.h>

src/deemon/main.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <deemon/code.h>
3737
#include <deemon/compiler/assembler.h>
3838
#include <deemon/compiler/dec.h>
39+
#include <deemon/compiler/error.h>
3940
#include <deemon/compiler/lexer.h>
4041
#include <deemon/compiler/optimize.h>
4142
#include <deemon/compiler/tpp.h>
@@ -44,7 +45,9 @@
4445
#include <deemon/exec.h>
4546
#include <deemon/file.h>
4647
#include <deemon/filetypes.h>
48+
#include <deemon/format.h>
4749
#include <deemon/gc.h>
50+
#include <deemon/int.h>
4851
#include <deemon/list.h>
4952
#include <deemon/module.h>
5053
#include <deemon/none.h>
@@ -57,10 +60,16 @@
5760
#include <deemon/tuple.h>
5861

5962
#include <hybrid/byteorder.h>
63+
#include <hybrid/debug-alignment.h>
64+
#include <hybrid/host.h>
6065

6166
#include "cmdline.h"
6267
#include "runtime/runtime_error.h"
6368

69+
/**/
70+
#include <stddef.h> /* offsetof */
71+
#include <stdint.h> /* uint8_t */
72+
6473
DECL_BEGIN
6574

6675
#ifndef CONFIG_HAVE_strcmp
@@ -287,7 +296,8 @@ PRIVATE WUNUSED NONNULL((1)) int DCALL cmd_O(char *arg) {
287296
ASM_FPEEPHOLE | ASM_FOPTIMIZE |
288297
ASM_FOPTIMIZE_SIZE);
289298
} else {
290-
level = atoi(arg);
299+
if (Dee_TAtoi(int, arg, strlen(arg), 0, &level))
300+
goto err;
291301
/* Level #4: Disable features that hinder optimization (i.e. debug info) */
292302
if (level >= 4) {
293303
script_options.co_assembler |= ASM_FNODDI;
@@ -333,6 +343,8 @@ PRIVATE WUNUSED NONNULL((1)) int DCALL cmd_O(char *arg) {
333343
}
334344
}
335345
return 0;
346+
err:
347+
return -1;
336348
}
337349

338350
PRIVATE WUNUSED int DCALL cmd_i(char *UNUSED(arg)) {
@@ -432,8 +444,7 @@ PRIVATE WUNUSED int DCALL cmd_pp(char *UNUSED(arg)) {
432444
}
433445

434446
PRIVATE WUNUSED NONNULL((1)) int DCALL cmd_ftabstop(char *arg) {
435-
script_options.co_tabwidth = (uint16_t)atoi(arg);
436-
return 0;
447+
return Dee_TAtoi(uint16_t, arg, strlen(arg), 0, &script_options.co_tabwidth);
437448
}
438449

439450
PRIVATE WUNUSED int TPPCALL emitpp_reemit_pragma(void);

src/deemon/objects/attribute.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,26 @@ __pragma_GCC_diagnostic_ignored(Wmaybe_uninitialized)
5353
#include <deemon/computed-operators.h>
5454
#include <deemon/error.h>
5555
#include <deemon/format.h>
56-
#include <deemon/module.h>
57-
#include <deemon/mro.h>
5856
#include <deemon/none.h>
5957
#include <deemon/object.h>
6058
#include <deemon/seq.h>
6159
#include <deemon/string.h>
6260
#include <deemon/super.h>
6361
#include <deemon/system-features.h>
62+
#include <deemon/system-sjlj.h>
6463
#include <deemon/util/atomic.h>
64+
#include <deemon/util/lock.h>
6565

6666
#include <hybrid/spcall.h>
67+
/**/
6768

6869
#include "../runtime/kwlist.h"
6970
#include "../runtime/runtime_error.h"
7071
#include "../runtime/strings.h"
72+
/**/
73+
74+
#include <stddef.h> /* offsetof */
75+
#include <stdint.h> /* uint16_t */
7176

7277
DECL_BEGIN
7378

src/deemon/objects/bool.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
#include <deemon/object.h>
3030
#include <deemon/string.h>
3131

32+
#include <hybrid/typecore.h>
33+
3234
#include "../runtime/runtime_error.h"
3335
#include "../runtime/strings.h"
36+
/**/
37+
38+
#include <stdint.h> /* int32_t */
3439

3540
DECL_BEGIN
3641

0 commit comments

Comments
 (0)