Style, Analyze

This commit is contained in:
Kilian Hofmann 2022-09-04 03:06:09 +02:00
parent 3b2f146679
commit 0fe7335987
17 changed files with 216 additions and 184 deletions

View File

@ -25,6 +25,7 @@ ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerBinding: false
ExperimentalAutoDetectBinPacking: false
IndentAccessModifiers: true
IndentCaseLabels: true
IndentFunctionDeclarationAfterType: true
IndentWidth: 2

17
.vscode/cmake-kits.json vendored Normal file
View File

@ -0,0 +1,17 @@
[{
"name": "Clang 13.0.0 Mac",
"toolchainFile": "${workspaceFolder}/toolchain-mac.cmake"
},
{
"name": "Clang 13.0.0 Linux",
"toolchainFile": "${workspaceFolder}/toolchain-lin.cmake"
},
{
"name": "Clang 13.0.0 Windows 32",
"toolchainFile": "${workspaceFolder}/toolchain-win-32.cmake"
},
{
"name": "Clang 13.0.0 Windows 64",
"toolchainFile": "${workspaceFolder}/toolchain-win-64.cmake"
}
]

View File

@ -1,8 +1,5 @@
{
"cmake.generator": "Unix Makefiles",
"cmake.configureArgs": [
"-DIBM=ON"
],
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"files.associations": {
"cmath": "cpp"

View File

@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
set(PLUGIN_NAME GAConnector)
option(DEBUG "Debug symbols" OFF)

6
Jenkinsfile vendored
View File

@ -17,7 +17,9 @@ pipeline {
}
steps {
sh 'bash ./build.sh win32'
sh 'analyze-build --verbose --cdb build/compile_commands.json --output build/Analysis/win32'
sh 'bash ./build.sh win64'
sh 'analyze-build --verbose --cdb build/compile_commands.json --output build/Analysis/win64'
}
}
stage('Build Linux Debug') {
@ -36,7 +38,9 @@ pipeline {
}
steps {
sh 'bash ./build.sh lin32'
sh 'analyze-build --verbose --cdb build/compile_commands.json --output build/Analysis/lin32'
sh 'bash ./build.sh lin64'
sh 'analyze-build --verbose --cdb build/compile_commands.json --output build/Analysis/lin64'
}
}
stage('Build MacOSX Debug') {
@ -55,6 +59,7 @@ pipeline {
}
steps {
sh 'bash ./build.sh mac'
sh 'analyze-build --verbose --cdb build/compile_commands.json --output build/Analysis/mac'
}
}
stage('Archive Debug') {
@ -63,6 +68,7 @@ pipeline {
}
steps {
zip zipFile: 'Debug.zip', archive: true, dir: 'build/Plugin'
zip zipFile: 'Analysis.zip', archive: true, dir: 'build/Analysis'
sh 'rm -rf build'
}
}

View File

@ -49,7 +49,8 @@ class PathSegment
friend bool operator==(const PathSegment &lhs, const PathSegment &rhs)
{
return lhs.altitude == rhs.altitude && lhs.groundSpeed == rhs.groundSpeed &&
return lhs.altitude == rhs.altitude &&
lhs.groundSpeed == rhs.groundSpeed &&
lhs.latitude == rhs.latitude && lhs.longitude == rhs.longitude;
}
friend bool operator!=(const PathSegment &lhs, const PathSegment &rhs)

View File

@ -6,7 +6,7 @@ add_library(makerwysxp SHARED
target_include_directories(makerwysxp PRIVATE
${CMAKE_SOURCE_DIR}/makerwysxp/include
${CMAKE_SOURCE_DIR}/file
${CMAKE_SOURCE_DIR}/utilities/include
)
set_target_properties(makerwysxp PROPERTIES

View File

@ -42,7 +42,8 @@ class Gate
sizeof(std::uint8_t));
bufPtr++; // Designator length
memcpy(bufPtr, this->designator.c_str(), this->designator.length());
bufPtr += this->designator.length() + 1; // Designator plus null termination
bufPtr +=
this->designator.length() + 1; // Designator plus null termination
memcpy(bufPtr, &this->latitude, sizeof(this->latitude));
bufPtr += 8; // Latitude
memcpy(bufPtr, &this->longitude, sizeof(this->longitude));

View File

@ -49,7 +49,8 @@ class Runway
latitudeEnd,
longitudeEnd);
this->length = (std::uint16_t)std::round(util::to_feet(dist));
this->trueHeading = (std::uint16_t)std::round(util::bearing(latitudeStart,
this->trueHeading =
(std::uint16_t)std::round(util::bearing(latitudeStart,
longitudeStart,
latitudeEnd,
longitudeEnd));

View File

@ -10,8 +10,9 @@ add_library(germanairlinesva_xplugin SHARED
target_include_directories(germanairlinesva_xplugin PRIVATE
${CMAKE_SOURCE_DIR}/makerwysxp/include
${CMAKE_SOURCE_DIR}/socket/include
${CMAKE_SOURCE_DIR}/utilities/include
${CMAKE_SOURCE_DIR}/nlohmann/include
${CMAKE_SOURCE_DIR}/XPSDK/CHeaders
${CMAKE_SOURCE_DIR}/nlohmann
${CMAKE_SOURCE_DIR}/file
)

View File

@ -151,6 +151,12 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
recordingThread = std::thread(&recordingWorker);
toLog("Workers started");
for (int i = 0; i < 10000; i++) {
char *t = (char *)calloc(sizeof(char), 11);
memcpy(t, "Take 10Bit", 10);
toLog(t);
}
return 1;
}