summaryrefslogtreecommitdiffhomepage
path: root/dev
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-08 21:07:27 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-03-08 21:07:27 +0100
commite8420f8dc420210406a394685703c7a0333eb2f3 (patch)
treec53cd16d56faae5f9744ef0614bbcad0f570601b /dev
parent4017e6408c162b0ab1b54a0427d443b56df5237e (diff)
ADD: Better if conditions in DynamicLinkerPEF.cc
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev')
-rw-r--r--dev/LibC++/lc_runtime+unreachable.cc3
-rw-r--r--dev/LibCompiler/src/CCompilerPower64.cc4
-rw-r--r--dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc2
-rw-r--r--dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc2
-rw-r--r--dev/LibCompiler/src/DynamicLinkerELF.cc2
-rw-r--r--dev/LibCompiler/src/DynamicLinkerPEF.cc6
-rw-r--r--dev/LibDebugger/IDebuggerEngine.h6
-rw-r--r--dev/LibDebugger/src/DebuggerEnginePOSIX.cc2
8 files changed, 13 insertions, 14 deletions
diff --git a/dev/LibC++/lc_runtime+unreachable.cc b/dev/LibC++/lc_runtime+unreachable.cc
index e0e7730..e4ce7bc 100644
--- a/dev/LibC++/lc_runtime+unreachable.cc
+++ b/dev/LibC++/lc_runtime+unreachable.cc
@@ -8,5 +8,6 @@
extern "C" void __libcompiler_unreachable(void)
{
- while (true);
+ while (true)
+ ;
} \ No newline at end of file
diff --git a/dev/LibCompiler/src/CCompilerPower64.cc b/dev/LibCompiler/src/CCompilerPower64.cc
index a4a6793..02c1ee3 100644
--- a/dev/LibCompiler/src/CCompilerPower64.cc
+++ b/dev/LibCompiler/src/CCompilerPower64.cc
@@ -388,7 +388,7 @@ bool CompilerFrontendPower64::Compile(std::string text_, const std::string file)
"r10, r11";
syntax_leaf.fUserValue += "\n\tbeq extern_segment " + kIfFunction +
- " \ndword public_segment .code64 " + kIfFunction + "\n";
+ " \ndword public_segment .code64 " + kIfFunction + "\n";
kState.fSyntaxTree->fLeafList.push_back(syntax_leaf);
@@ -759,7 +759,7 @@ bool CompilerFrontendPower64::Compile(std::string text_, const std::string file)
syntax_leaf.fUserValue.clear();
}
- auto syntax_leaf = LibCompiler::SyntaxLeafList::SyntaxLeaf();
+ auto syntax_leaf = LibCompiler::SyntaxLeafList::SyntaxLeaf();
syntax_leaf.fUserValue = "\n";
kState.fSyntaxTree->fLeafList.push_back(syntax_leaf);
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
index 580e646..6705db4 100644
--- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
+++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc
@@ -810,7 +810,7 @@ Boolean CompilerFrontendCPlusPlus::Compile(std::string text,
syntax_tree.fUserValue = "__LIBCOMPILER_LOCAL_RETURN_STRING: db " + subText + ", 0\nmov rcx, __LIBCOMPILER_LOCAL_RETURN_STRING\n";
syntax_tree.fUserValue += "mov rax, rcx\nret\n";
kOrigin += 1UL;
-
+
break;
}
diff --git a/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc b/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc
index 6ef2797..3aa07d5 100644
--- a/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc
+++ b/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc
@@ -924,7 +924,7 @@ LIBCOMPILER_MODULE(CPlusPlusPreprocessorMain)
Detail::bpp_macro macro_unreachable;
- macro_unreachable.fName = "__unreachable";
+ macro_unreachable.fName = "__unreachable";
macro_unreachable.fValue = "__libcompiler_unreachable";
kMacros.push_back(macro_unreachable);
diff --git a/dev/LibCompiler/src/DynamicLinkerELF.cc b/dev/LibCompiler/src/DynamicLinkerELF.cc
index dca7efb..6645219 100644
--- a/dev/LibCompiler/src/DynamicLinkerELF.cc
+++ b/dev/LibCompiler/src/DynamicLinkerELF.cc
@@ -55,7 +55,7 @@ namespace Detail
{
struct DynamicLinkerBlob final
{
- std::vector<CharType> mBlob{}; // ELF code/bss/data blob.
+ std::vector<CharType> mBlob{}; // ELF code/bss/data blob.
UIntPtr mOffset{0UL}; // the offset of the ELF container header...
};
} // namespace Detail
diff --git a/dev/LibCompiler/src/DynamicLinkerPEF.cc b/dev/LibCompiler/src/DynamicLinkerPEF.cc
index 084e94f..4a7bb49 100644
--- a/dev/LibCompiler/src/DynamicLinkerPEF.cc
+++ b/dev/LibCompiler/src/DynamicLinkerPEF.cc
@@ -58,7 +58,7 @@ namespace Detail
{
struct DynamicLinkerBlob final
{
- std::vector<CharType> mBlob{}; // PEF code/bss/data blob.
+ std::vector<CharType> mBlob{}; // PEF code/bss/data blob.
UIntPtr mOffset{0UL}; // the offset of the PEF container header...
};
} // namespace Detail
@@ -218,9 +218,7 @@ LIBCOMPILER_MODULE(DynamicLinker64PEF)
kStdOut << "no output filename set." << std::endl;
return LIBCOMPILER_EXEC_ERROR;
}
-
- // sanity check.
- if (kObjectList.empty())
+ else if (kObjectList.empty())
{
kStdOut << "no input files." << std::endl;
return LIBCOMPILER_EXEC_ERROR;
diff --git a/dev/LibDebugger/IDebuggerEngine.h b/dev/LibDebugger/IDebuggerEngine.h
index ad35dfe..45b7da3 100644
--- a/dev/LibDebugger/IDebuggerEngine.h
+++ b/dev/LibDebugger/IDebuggerEngine.h
@@ -33,8 +33,8 @@ namespace LibDebugger
class IDebuggerEngine final
{
public:
- explicit IDebuggerEngine() = default;
- ~IDebuggerEngine() = default;
+ explicit IDebuggerEngine() = default;
+ ~IDebuggerEngine() = default;
public:
IDebuggerEngine& operator=(const IDebuggerEngine&) = default;
@@ -113,7 +113,7 @@ namespace LibDebugger
}
private:
- pid_t m_pid;
+ pid_t m_pid;
std::unordered_map<uintptr_t, uintptr_t> m_breakpoints;
};
} // namespace LibDebugger
diff --git a/dev/LibDebugger/src/DebuggerEnginePOSIX.cc b/dev/LibDebugger/src/DebuggerEnginePOSIX.cc
index e8a394e..b8695fb 100644
--- a/dev/LibDebugger/src/DebuggerEnginePOSIX.cc
+++ b/dev/LibDebugger/src/DebuggerEnginePOSIX.cc
@@ -10,7 +10,7 @@
LIBCOMPILER_MODULE(DebuggerPOSIX)
{
LibDebugger::IDebuggerEngine debugger;
- pid_t pid = 0L;
+ pid_t pid = 0L;
if (argc >= 3 && std::string(argv[1]) == "-p" &&
argv[2] != nullptr)