summaryrefslogtreecommitdiffhomepage
path: root/src/CompilerKit
diff options
context:
space:
mode:
Diffstat (limited to 'src/CompilerKit')
-rw-r--r--src/CompilerKit/AST.h2
-rw-r--r--src/CompilerKit/Config.h11
-rw-r--r--src/CompilerKit/ErrorOr.h6
-rw-r--r--src/CompilerKit/Ref.h6
-rw-r--r--src/CompilerKit/StringKit.h2
-rw-r--r--src/CompilerKit/src/AST.cc2
-rw-r--r--src/CompilerKit/src/Backend/AssemblerAMD64.cc2
-rw-r--r--src/CompilerKit/src/Backend/AssemblerARM64.cc2
-rw-r--r--src/CompilerKit/src/Backend/AssemblerPowerPC.cc2
-rw-r--r--src/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc12
-rw-r--r--src/CompilerKit/src/Linker/DynamicLinker64PEF.cc7
-rw-r--r--src/CompilerKit/utils/CompilerUtils.h2
12 files changed, 25 insertions, 31 deletions
diff --git a/src/CompilerKit/AST.h b/src/CompilerKit/AST.h
index fb38ac8..2489176 100644
--- a/src/CompilerKit/AST.h
+++ b/src/CompilerKit/AST.h
@@ -95,7 +95,7 @@ struct SyntaxLeafList final {
/// \param needle the string we search for.
/// \return if we found it or not.
/// =========================================================== ///
-Bool find_word(STLString haystack, STLString needle) noexcept;
+bool find_word(STLString haystack, STLString needle) noexcept;
/// =========================================================== ///
/// find a word within strict conditions and returns a range of it.
diff --git a/src/CompilerKit/Config.h b/src/CompilerKit/Config.h
index 637d56e..691d51c 100644
--- a/src/CompilerKit/Config.h
+++ b/src/CompilerKit/Config.h
@@ -42,8 +42,6 @@
#define Int32 int
#define UInt32 unsigned
-#define Bool bool
-
#define Int16 int16_t
#define UInt16 uint16_t
@@ -51,14 +49,13 @@
#define UInt8 uint8_t
#define Char char
-#define Boolean bool
#include <signal.h>
+#include <stdint.h>
+#include <time.h>
#include <unistd.h>
#include <cassert>
-#include <time.h>
#include <string>
-#include <stdint.h>
#define kDistVersion "v0.0.7-compilerkit"
#define kDistVersionBCD 0x0002
@@ -78,9 +75,7 @@
#define kDistRelease ToString(kDistReleaseBranch)
-#endif // !kDistRelease
-
-#define nullPtr std::nullptr_t
+#endif // !kDistRelease
#define MUST_PASS(E) assert(E)
diff --git a/src/CompilerKit/ErrorOr.h b/src/CompilerKit/ErrorOr.h
index 9e1e801..9ab86fb 100644
--- a/src/CompilerKit/ErrorOr.h
+++ b/src/CompilerKit/ErrorOr.h
@@ -30,17 +30,17 @@ class ErrorOr final {
public:
explicit ErrorOr(ErrorT err) : mId(err) {}
- explicit ErrorOr(nullPtr null) {}
+ explicit ErrorOr(std::nullptr_t null) {}
explicit ErrorOr(T klass) : mRef(klass) {}
ErrorOr& operator=(const ErrorOr&) = default;
ErrorOr(const ErrorOr&) = default;
- Ref<T> Leak() { return mRef; }
+ Ref<T>& Leak() { return mRef; }
ErrorT Error() { return mId; }
- Bool HasError() { return mId != NECTI_SUCCESS; }
+ bool HasError() { return mId != NECTI_SUCCESS; }
explicit operator bool() { return mRef; }
diff --git a/src/CompilerKit/Ref.h b/src/CompilerKit/Ref.h
index 703fde8..58e5ffd 100644
--- a/src/CompilerKit/Ref.h
+++ b/src/CompilerKit/Ref.h
@@ -31,7 +31,7 @@ class Ref final {
NECTI_COPY_DEFAULT(Ref);
public:
- explicit Ref(T* cls, const Bool& strong = false) : m_Class(cls), m_Strong(strong) {}
+ explicit Ref(T* cls, const bool& strong = false) : m_Class(cls), m_Strong(strong) {}
Ref& operator=(T ref) {
*m_Class = ref;
@@ -45,13 +45,13 @@ class Ref final {
T operator*() { return *m_Class; }
- Bool IsStrong() const { return m_Strong; }
+ bool IsStrong() const { return m_Strong; }
explicit operator bool() { return *m_Class; }
private:
T* m_Class{nullptr};
- Bool m_Strong{false};
+ bool m_Strong{false};
};
// @author Amlal El Mahrouss
diff --git a/src/CompilerKit/StringKit.h b/src/CompilerKit/StringKit.h
index 4f07a07..253c6ce 100644
--- a/src/CompilerKit/StringKit.h
+++ b/src/CompilerKit/StringKit.h
@@ -84,7 +84,7 @@ struct NEStringBuilder final {
static NEString FromInt(const char* fmt, int n);
static NEString FromBool(const char* fmt, bool n);
static NEString Format(const char* fmt, const char* from);
- static Bool Equals(const char* lhs, const char* rhs);
+ static bool Equals(const char* lhs, const char* rhs);
};
using NEStringOr = ErrorOr<NEString>;
diff --git a/src/CompilerKit/src/AST.cc b/src/CompilerKit/src/AST.cc
index 5106a26..764fa71 100644
--- a/src/CompilerKit/src/AST.cc
+++ b/src/CompilerKit/src/AST.cc
@@ -21,7 +21,7 @@ namespace CompilerKit {
/// \param haystack base string
/// \param needle the string we search for.
/// \return if we found it or not.
-Bool find_word(STLString haystack, STLString needle) noexcept {
+bool find_word(STLString haystack, STLString needle) noexcept {
auto index = haystack.find(needle);
// check for needle validity.
diff --git a/src/CompilerKit/src/Backend/AssemblerAMD64.cc b/src/CompilerKit/src/Backend/AssemblerAMD64.cc
index 7523d05..823a1c7 100644
--- a/src/CompilerKit/src/Backend/AssemblerAMD64.cc
+++ b/src/CompilerKit/src/Backend/AssemblerAMD64.cc
@@ -966,7 +966,7 @@ bool CompilerKit::EncoderAMD64::WriteLine(std::string line, std::string file) {
{.fName = "si", .fModRM = 0x6}, {.fName = "di", .fModRM = 7},
};
- Bool foundInstruction = false;
+ bool foundInstruction = false;
for (auto& opcodeAMD64 : kOpcodesAMD64) {
// strict check here
diff --git a/src/CompilerKit/src/Backend/AssemblerARM64.cc b/src/CompilerKit/src/Backend/AssemblerARM64.cc
index 2114fe6..bad841b 100644
--- a/src/CompilerKit/src/Backend/AssemblerARM64.cc
+++ b/src/CompilerKit/src/Backend/AssemblerARM64.cc
@@ -21,9 +21,9 @@
#include <CompilerKit/AE.h>
#include <CompilerKit/AST.h>
+#include <CompilerKit/Config.h>
#include <CompilerKit/ErrorID.h>
#include <CompilerKit/PEF.h>
-#include <CompilerKit/Config.h>
#include <CompilerKit/impl/Aarch64.h>
#include <CompilerKit/utils/AsmUtils.h>
#include <algorithm>
diff --git a/src/CompilerKit/src/Backend/AssemblerPowerPC.cc b/src/CompilerKit/src/Backend/AssemblerPowerPC.cc
index 5da36cf..71b41be 100644
--- a/src/CompilerKit/src/Backend/AssemblerPowerPC.cc
+++ b/src/CompilerKit/src/Backend/AssemblerPowerPC.cc
@@ -21,9 +21,9 @@
#include <CompilerKit/AE.h>
#include <CompilerKit/AST.h>
+#include <CompilerKit/Config.h>
#include <CompilerKit/ErrorID.h>
#include <CompilerKit/PEF.h>
-#include <CompilerKit/Config.h>
#include <CompilerKit/impl/PowerPC.h>
#include <CompilerKit/utils/AsmUtils.h>
#include <algorithm>
diff --git a/src/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc b/src/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc
index 8cc5af0..c3f6197 100644
--- a/src/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc
+++ b/src/CompilerKit/src/Frontend/CPlusPlusCompilerAMD64.cc
@@ -115,10 +115,10 @@ static std::vector<CompilerKit::CompilerKeyword> kKeywords;
/////////////////////////////////////////
static CompilerKit::AssemblyFactory kAssembler;
-static Boolean kInStruct = false;
-static Boolean kOnWhileLoop = false;
-static Boolean kOnForLoop = false;
-static Boolean kInBraces = false;
+static bool kInStruct = false;
+static bool kOnWhileLoop = false;
+static bool kOnForLoop = false;
+static bool kInBraces = false;
static size_t kBracesCount = 0UL;
/* @brief C++ compiler backend for the NeKernel C++ driver */
@@ -429,7 +429,7 @@ CompilerKit::SyntaxLeafList::SyntaxLeaf CompilerFrontendCPlusPlusAMD64::Compile(
varName.erase(varName.find(";"));
}
- static Boolean typeFound = false;
+ static bool typeFound = false;
for (auto& keyword : kKeywords) {
if (keyword.keyword_kind == CompilerKit::kKeywordKindType) {
@@ -766,7 +766,7 @@ class AssemblyCPlusPlusInterfaceAMD64 final CK_ASSEMBLY_INTERFACE {
#define kExtListCxx {".cpp", ".cxx", ".cc", ".c++", ".cp"}
NECTI_MODULE(CompilerCPlusPlusAMD64) {
- Boolean skip = false;
+ bool skip = false;
kKeywords.emplace_back("if", CompilerKit::kKeywordKindIf);
kKeywords.emplace_back("else", CompilerKit::kKeywordKindElse);
diff --git a/src/CompilerKit/src/Linker/DynamicLinker64PEF.cc b/src/CompilerKit/src/Linker/DynamicLinker64PEF.cc
index 8c49601..7d3cfee 100644
--- a/src/CompilerKit/src/Linker/DynamicLinker64PEF.cc
+++ b/src/CompilerKit/src/Linker/DynamicLinker64PEF.cc
@@ -19,7 +19,6 @@
#include <CompilerKit/ErrorID.h>
#include <CompilerKit/PEF.h>
#include <CompilerKit/UUID.h>
-#include <CompilerKit/Config.h>
#include <CompilerKit/utils/CompilerUtils.h>
#include <filesystem>
@@ -54,9 +53,9 @@ static CompilerKit::STLString kOutput = "a" kPefExt;
static Int32 kAbi = kABITypeNE;
static Int32 kSubArch = kPefNoSubCpu;
static Int32 kArch = CompilerKit::kPefArchInvalid;
-static Bool kFatBinaryEnable = false;
-static Bool kStartFound = false;
-static Bool kDuplicateSymbols = false;
+static bool kFatBinaryEnable = false;
+static bool kStartFound = false;
+static bool kDuplicateSymbols = false;
/* ld64 is to be found, mld is to be found at runtime. */
static const Char* kLdDefineSymbol = ":UndefinedSymbol:";
diff --git a/src/CompilerKit/utils/CompilerUtils.h b/src/CompilerKit/utils/CompilerUtils.h
index e24ee37..1494250 100644
--- a/src/CompilerKit/utils/CompilerUtils.h
+++ b/src/CompilerKit/utils/CompilerUtils.h
@@ -8,8 +8,8 @@
#include <CompilerKit/AST.h>
#include <CompilerKit/CodeGenerator.h>
-#include <CompilerKit/ErrorID.h>
#include <CompilerKit/Config.h>
+#include <CompilerKit/ErrorID.h>
#include <ThirdParty/Dialogs.h>
#include <iostream>