Skip to content

Commit d974559

Browse files
authored
no warnings (#137)
1 parent bc3fe60 commit d974559

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ build:windows --host_platform=@ecsact_runtime//bazel/platforms:windows
1111
build:linux --platforms=@ecsact_runtime//bazel/platforms:linux
1212
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
1313

14+
build:no-warnings --per_file_copt=//.*@-Werror
15+
16+
common:linux:ci --config=no-warnings
1417
common:ci --announce_rc
1518
common:ci --disk_cache=~/.cache/bazel-disk-cache
1619
test:ci --test_output=errors

dylib/dylib-util.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

33
#define ECSACT_DYLIB_UTIL_FN_PTR_DEFN(fn_name, unused) \
4-
decltype(::fn_name)(::fn_name) = nullptr
4+
decltype(fn_name)(fn_name) = nullptr
55

6-
#define ECSACT_DYLIB_UTIL_FN_PTR_ASSIGN(fn_name) (::fn_name) = nullptr
6+
#define ECSACT_DYLIB_UTIL_FN_PTR_ASSIGN(fn_name) (fn_name) = nullptr

dylib/dylib.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ FOR_EACH_ECSACT_SERIALIZE_API_FN(ECSACT_DYLIB_UTIL_FN_PTR_DEFN);
4747
#define HAS_FN_CHECK(fn_name, target_fn_name) \
4848
if(std::strcmp(target_fn_name, #fn_name) == 0) return true
4949

50-
#define ASSIGN_FN_IF(fn_name, target_fn_name, fn_ptr) \
51-
if(std::strcmp(#fn_name, target_fn_name) == 0) { \
52-
::fn_name = reinterpret_cast<decltype(::fn_name)>(fn_ptr); \
53-
} \
50+
#define ASSIGN_FN_IF(fn_name, target_fn_name, fn_ptr) \
51+
if(std::strcmp(#fn_name, target_fn_name) == 0) { \
52+
fn_name = reinterpret_cast<decltype(fn_name)>(fn_ptr); \
53+
} \
5454
static_assert(true, "macro requires ;")
5555

5656
bool ecsact_dylib_has_fn(const char* fn_name) {

reference/async_reference/async_reference.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ void async_reference::execute_systems() {
124124
execution_thread = std::thread([this] {
125125
using namespace std::chrono_literals;
126126
using clock = std::chrono::high_resolution_clock;
127-
using milliseconds = std::chrono::milliseconds;
128127
using nanoseconds = std::chrono::nanoseconds;
129128
using std::chrono::duration_cast;
130129

reference/async_reference/util/util.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ static ecsact_async_error validate_instructions(
2020
for(auto& component : components) {
2121
auto view = std::views::filter(
2222
components_range,
23-
[&components_range,
24-
&component](types::cpp_execution_component other_component) {
23+
[&component](types::cpp_execution_component other_component) {
2524
return component._id == other_component._id;
2625
}
2726
);
@@ -52,8 +51,6 @@ ecsact_async_error validate_merge_instructions(
5251
auto entities = util::get_cpp_entities(components);
5352
auto other_entities = util::get_cpp_entities(other_components);
5453

55-
auto empty_view = std::ranges::empty_view<int>{};
56-
5754
auto has_duplicates =
5855
util::check_entity_merge_duplicates(entities, other_entities);
5956

@@ -64,8 +61,7 @@ ecsact_async_error validate_merge_instructions(
6461
for(auto& component : components) {
6562
auto component_view = std::views::filter(
6663
other_components,
67-
[&other_components,
68-
&component](types::cpp_execution_component other_component) {
64+
[&component](types::cpp_execution_component other_component) {
6965
return component._id == other_component._id;
7066
}
7167
);

reference/async_reference/util/util.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ bool check_entity_duplicates(auto entities_view) {
5050
return entity_id == other_entity;
5151
});
5252
int same_entity_count = 0;
53-
for(auto _ : duplicate_view) {
53+
for([[maybe_unused]] auto _ : duplicate_view) {
5454
same_entity_count++;
5555
if(same_entity_count > 1) {
5656
return true;
@@ -71,7 +71,7 @@ bool check_entity_merge_duplicates(
7171
});
7272

7373
int same_entity_count = 0;
74-
for(auto _ : duplicate_view) {
74+
for([[maybe_unused]] auto _ : duplicate_view) {
7575
same_entity_count++;
7676
if(same_entity_count > 0) {
7777
return true;

0 commit comments

Comments
 (0)