Fix some header #includes with clangd LSP (#1370)

Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
This commit is contained in:
Sylvie
2024-03-21 15:13:10 -04:00
committed by GitHub
parent 32b4a6f284
commit 0300971a17
8 changed files with 17 additions and 21 deletions

View File

@@ -5,6 +5,7 @@
#ifndef RGBDS_ASM_FSTACK_H
#define RGBDS_ASM_FSTACK_H
#include <optional>
#include <stdint.h>
#include <stdio.h>
#include <string>

View File

@@ -5,6 +5,7 @@
#include <deque>
#include <optional>
#include <stdint.h>
#include <string>
#include <variant>
#include <vector>

View File

@@ -1,21 +1,23 @@
/* SPDX-License-Identifier: MIT */
#include "asm/fstack.hpp"
#include <sys/stat.h>
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <new>
#include <optional>
#include <stack>
#include <stdlib.h>
#include <string_view>
#include "error.hpp"
#include "helpers.hpp"
#include "linkdefs.hpp"
#include "platform.hpp" // S_ISDIR (stat macro)
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/macro.hpp"
#include "asm/main.hpp"
#include "asm/symbol.hpp"
@@ -23,14 +25,14 @@
struct Context {
FileStackNode *fileInfo;
LexerState lexerState;
uint32_t uniqueID;
MacroArgs *macroArgs; // Macro args are *saved* here
LexerState lexerState{};
uint32_t uniqueID = 0;
MacroArgs *macroArgs = nullptr; // Macro args are *saved* here
uint32_t nbReptIters = 0;
bool isForLoop = false;
int32_t forValue = 0;
int32_t forStep = 0;
std::string forName;
std::string forName{};
};
static std::stack<Context> contextStack;
@@ -236,9 +238,7 @@ static Context &newContext(FileStackNode &fileInfo) {
fileInfo.parent = contextStack.top().fileInfo;
fileInfo.lineNo = lexer_GetLineNo();
Context &context = contextStack.emplace();
context.fileInfo = &fileInfo;
return context;
return contextStack.emplace(Context{.fileInfo = &fileInfo});
}
void fstk_RunInclude(std::string const &path) {

View File

@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: MIT */
#include "asm/lexer.hpp"
#include <sys/stat.h>
#include <sys/types.h>
@@ -11,7 +13,6 @@
#include <limits.h>
#include <math.h>
#include <new>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -25,7 +26,6 @@
#include "asm/fixpoint.hpp"
#include "asm/format.hpp"
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/macro.hpp"
#include "asm/main.hpp"
#include "asm/rpn.hpp"

View File

@@ -2,10 +2,8 @@
#include "asm/output.hpp"
#include <algorithm>
#include <assert.h>
#include <deque>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -15,8 +13,8 @@
#include "error.hpp"
#include "asm/charmap.hpp"
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/main.hpp"
#include "asm/rpn.hpp"
#include "asm/section.hpp"

View File

@@ -12,9 +12,8 @@
#include <stdlib.h>
#include <string.h>
#include "error.hpp"
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/main.hpp"
#include "asm/output.hpp"
#include "asm/rpn.hpp"

View File

@@ -5,20 +5,17 @@
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <new>
#include <stdio.h>
#include <unordered_map>
#include "error.hpp"
#include "helpers.hpp"
#include "util.hpp"
#include "version.hpp"
#include "asm/fixpoint.hpp"
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/macro.hpp"
#include "asm/main.hpp"
#include "asm/output.hpp"
#include "asm/warning.hpp"

View File

@@ -3,7 +3,6 @@
#include "asm/warning.hpp"
#include <inttypes.h>
#include <limits.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
@@ -14,6 +13,7 @@
#include "itertools.hpp"
#include "asm/fstack.hpp"
#include "asm/lexer.hpp"
#include "asm/main.hpp"
unsigned int nbErrors = 0;