Skip to content

Commit 4ffc7ee

Browse files
committed
removed windows binary runner, fixes to c++ standards, and restructured ci/cd pipeline
1 parent 7461fc9 commit 4ffc7ee

7 files changed

Lines changed: 13 additions & 42 deletions

.clang-tidy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Checks: >
1313
-readability-avoid-unconditional-preprocessor-if,
1414
-readability-use-concise-preprocessor-directives,
1515
-readability-redundant-typename,
16+
-readability-enum-initial-value,
17+
-readability-container-contains,
18+
-readability-container-data-pointer,
1619
clang-analyzer-*,
1720
bugprone-*,
1821
-bugprone-easily-swappable-parameters,
@@ -25,18 +28,18 @@ Checks: >
2528
portability-*,
2629
modernize-*,
2730
-modernize-use-trailing-return-type,
28-
-modernize-use-nullptr,
31+
-modernize-use-nullptr,
2932
-modernize-use-override,
3033
-modernize-use-default-member-init,
3134
-modernize-use-ranges,
35+
-modernize-use-starts-with,
3236
-modernize-use-designated-initializers,
3337
-modernize-use-nodiscard,
3438
-modernize-use-auto,
3539
-modernize-avoid-c-arrays,
3640
-modernize-use-constraints,
3741
-modernize-type-traits,
3842
cppcoreguidelines-*,
39-
-readability-enum-initial-value,
4043
-cppcoreguidelines-avoid-magic-numbers,
4144
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
4245
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,

.github/workflows/build_run_win_32_debug.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ mkdir build
44
cd build
55
cmake -DDEBUG_OUTPUT=ON -G "Visual Studio 17 2022" -A Win32 -S ..
66
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com" "VMAware.sln" /Build "Release|Win32" /Project "vmaware" /ProjectConfig "Release|Win32"
7-
cd Release
8-
vmaware.exe
97
exit /b 0

.github/workflows/build_run_win_32_release.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ mkdir build
44
cd build
55
cmake -G "Visual Studio 17 2022" -A Win32 -S ..
66
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com" "VMAware.sln" /Build "Release|Win32" /Project "vmaware" /ProjectConfig "Release|Win32"
7-
cd Release
8-
vmaware.exe
97
exit /b 0

.github/workflows/build_run_win_64_debug.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ mkdir build
44
cd build
55
cmake -DDEBUG_OUTPUT=ON -G "Visual Studio 17 2022" -A x64 -S ..
66
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com" "VMAware.sln" /Build "Release|x64" /Project "vmaware" /ProjectConfig "Release|x64"
7-
cd Release
8-
vmaware.exe
97
exit /b 0

.github/workflows/build_run_win_64_release.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ mkdir build
44
cd build
55
cmake -G "Visual Studio 17 2022" -A x64 -S ..
66
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com" "VMAware.sln" /Build "Release|x64" /Project "vmaware" /ProjectConfig "Release|x64"
7-
cd Release
8-
vmaware.exe
97
exit /b 0

.github/workflows/cross-platform-build.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,6 @@ jobs:
7979
cmake --build build --config Release
8080
"
8181
82-
- name: Run binary (${{ matrix.arch }})
83-
run: |
84-
docker run --rm \
85-
--platform ${{ matrix.platform }} \
86-
-v ${{ github.workspace }}:/src \
87-
-w /src \
88-
${{ matrix.image }} \
89-
./build/vmaware
90-
9182
- name: Upload binary artifact
9283
uses: actions/upload-artifact@v4
9384
with:
@@ -118,9 +109,6 @@ jobs:
118109
- name: Build
119110
run: cmake --build build --config Release
120111

121-
- name: Run binary
122-
run: build/vmaware
123-
124112
- name: Upload binary artifact
125113
uses: actions/upload-artifact@v4
126114
with:
@@ -213,7 +201,7 @@ jobs:
213201
run: cmake --build build --config Release
214202

215203
all-platforms:
216-
needs: [linux, macos, windows, cli-test, cpp-standard]
204+
needs: [cli-test, cpp-standard]
217205
runs-on: ubuntu-latest
218206
steps:
219207
- run: echo "All platforms built successfully"

src/vmaware.hpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,7 +3639,7 @@ struct VM {
36393639
print_to_stream(ss, std::forward<Args>(message)...);
36403640
std::string msg_content = ss.str();
36413641

3642-
if (!printed_messages.contains(msg_content)) {
3642+
if (printed_messages.find(msg_content) == printed_messages.end()) {
36433643
#if (LINUX || APPLE)
36443644
constexpr const char* black_bg = "\x1B[48;2;0;0;0m";
36453645
constexpr const char* bold = "\033[1m";
@@ -4925,7 +4925,7 @@ struct VM {
49254925
const std::string& brand = cpu::get_brand();
49264926

49274927
// easy shortcut for QEMU
4928-
if (brand.starts_with("QEMU Virtual CPU version")) {
4928+
if (brand.rfind("QEMU Virtual CPU version", 0) == 0) {
49294929
return core::add(brand_enum::QEMU);
49304930
}
49314931

@@ -6859,7 +6859,7 @@ struct VM {
68596859
continue;
68606860
}
68616861

6862-
char* data = content.data();
6862+
char* data = &content[0];
68636863
const size_t len = content.size();
68646864

68656865
for (size_t i = 0; i < len; ++i) {
@@ -7068,7 +7068,7 @@ struct VM {
70687068
bool ppid_match = false;
70697069

70707070
auto parse_number = [&](const std::string& prefix) -> int {
7071-
if (!line.starts_with(prefix)) {
7071+
if (line.rfind(prefix, 0) != 0) {
70727072
return -1;
70737073
}
70747074

@@ -7480,7 +7480,7 @@ struct VM {
74807480
return core::add(brand_enum::AZURE_HYPERV);
74817481
}
74827482
template <typename T, size_t N>
7483-
constexpr bool check_no_nulls(const std::array<T, N>& arr, size_t i = 0) {
7483+
constexpr bool check_no_nulls(const std::array<T, N>& arr, size_t i = 0) const {
74847484
return (i == N)
74857485
? true
74867486
: (arr[i] != nullptr && check_no_nulls(arr, i + 1));
@@ -13209,8 +13209,8 @@ struct VM {
1320913209
};
1321013210

1321113211
// entry for the initialization list
13212-
struct technique_entry {
13213-
enum_flags id = enum_flags::NULL_ARG;
13212+
struct technique_entry { // NOLINT(cppcoreguidelines-pro-type-member-init)
13213+
enum_flags id;
1321413214
technique tech;
1321513215
};
1321613216

@@ -13624,12 +13624,6 @@ struct VM {
1362413624
throw_error("Flag argument must be a technique flag and not a settings flag");
1362513625
}
1362613626

13627-
#if (MSVC && !CLANG)
13628-
__assume(flag_bit < technique_end);
13629-
#elif (VMA_CPP >= 23)
13630-
[[assume(flag_bit < technique_end)]];
13631-
#endif
13632-
1363313627
// if the technique is already cached, return the cached value instead
1363413628
if (memo::is_cached(flag_bit)) {
1363513629
const memo::data_t data = memo::cache_fetch(flag_bit);
@@ -13817,12 +13811,6 @@ struct VM {
1381713811
if (percent > 100) {
1381813812
throw_error("Percentage parameter must be between 0 and 100");
1381913813
}
13820-
13821-
#if (MSVC && !CLANG)
13822-
__assume(percent > 0 && percent <= 100);
13823-
#elif (VMA_CPP >= 23)
13824-
[[assume(percent > 0 && percent <= 100)]];
13825-
#endif
1382613814

1382713815
const size_t current_index = core::custom_table.size();
1382813816

0 commit comments

Comments
 (0)