Add back unused-variable warning

This commit is contained in:
Patrick Nicolas
2026-10-16 08:03:21 +02:00
parent 650ca30874
commit 879c50c743
26 changed files with 24 additions and 70 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ constexpr uint32_t target_latency_ms = 5;
void init_pipewire()
{
static bool done = [] {
[[maybe_unused]] static bool done = [] {
int argc = 0;
pw_init(&argc, nullptr);
return true;
-1
View File
@@ -77,7 +77,6 @@ glm::quat cubic_spline(const glm::quat & a, const glm::quat & vb, const glm::qua
template <auto components::node::* Field>
void apply_track(entt::registry & scene, const components::animation_track_impl<Field> & track, float current_time)
{
entt::entity target = track.target;
auto interpolation = track.interpolation;
auto field = track.field;
auto & value = scene.get<components::node>(track.target).*field;
-1
View File
@@ -560,7 +560,6 @@ void imgui_context::initialize_fonts()
std::vector<imgui_context::controller_state> imgui_context::read_controllers_state(XrTime display_time)
{
float scroll_scale = io.DeltaTime * constants::gui::scroll_ratio;
size_t new_focused_controller = focused_controller;
std::vector<controller_state> new_states;
new_states.resize(controllers.size());
-5
View File
@@ -198,7 +198,6 @@ std::vector<glm::dvec4> read_vertex_attribute_aux2(const fastgltf::Asset & asset
std::vector<glm::dvec4> output;
output.resize(accessor.count);
size_t index = 0;
switch (fastgltf::getNumComponents(accessor.type))
{
case 1:
@@ -549,7 +548,6 @@ class loader_context
fastgltf::Asset & gltf;
vk::raii::PhysicalDevice physical_device;
vk::raii::Device & device;
thread_safe<vk::raii::Queue> & queue;
image_loader loader;
const std::map<std::tuple<fastgltf::Category, size_t, std::string>, std::string> & extras;
@@ -581,7 +579,6 @@ public:
gltf(gltf),
physical_device(physical_device),
device(device),
queue(queue),
loader(device, physical_device, queue, queue_family_index),
extras(extras)
{
@@ -1080,7 +1077,6 @@ public:
break;
}
size_t count = time.count;
switch (channel.path)
{
// TODO: templatize the switch
@@ -1264,7 +1260,6 @@ static void write_cache_entry(const std::filesystem::path & path, const cache_en
{
auto mtime = std::chrono::file_clock::to_sys(std::filesystem::last_write_time(entry.filename));
auto timestamp = std::chrono::duration_cast<std::chrono::seconds>(mtime.time_since_epoch()).count();
auto size = entry.size;
json << ",\"timestamp\":" << timestamp;
}
+1 -2
View File
@@ -31,7 +31,6 @@
#include "render/imgui_impl.h"
#include "render/ui_theme.h"
#include "render/ui_widgets.h"
#include "stream.h"
#include "utils/i18n.h"
#include "xr/instance.h"
#include "xr/session.h"
@@ -488,7 +487,7 @@ void settings_post_processing(const settings_context & ctx)
o.push_back(flag_name(f));
return o; },
.title = std::move(title),
.default_int = index(flags, config.openxr_post_processing.*member).value_or(0),
.default_int = index(flags, default_config.openxr_post_processing.*member).value_or(0),
});
};
+2 -1
View File
@@ -21,6 +21,7 @@
#include <cstdint>
#include <functional>
#include <optional>
class configuration;
class imgui_context;
@@ -39,7 +40,7 @@ namespace wivrn::gui
struct settings_context
{
configuration & config;
configuration & default_config;
const configuration & default_config;
xr::instance & instance;
xr::session & session;
xr::system & system;
-1
View File
@@ -1115,7 +1115,6 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> scenes::lobby::draw_gui(XrTi
ImGui::SetNextWindowSize({1400, 900});
ImGui::Begin("WiVRn", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
auto & config = application::get_config();
const float TopBarH = wivrn::ui::metrics::top_bar_height;
// Top bar: logo left, feature toggles / battery / connection status right
-2
View File
@@ -642,8 +642,6 @@ libcurl::curl_handle * scenes::lobby::parse_environment_list()
void scenes::lobby::gui_customize(XrTime predicted_display_time)
{
auto & config = application::get_config();
namespace ui = wivrn::ui;
ui::page_header(_cS("page header title", "Environment"), _cS("page header subtitle", "Choose the environment your panels float in."));
-10
View File
@@ -316,17 +316,7 @@ virtual_keyboard::key_status virtual_keyboard::button_behavior(const ImRect & bb
if (mouse_down)
{
held = true;
float prev_held_duration = held_duration;
held_duration += g.IO.DeltaTime;
// if ((flags & ImGuiButtonFlags_Repeat) and held_duration > g.IO.KeyRepeatDelay)
// {
// int n1 = (prev_held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
// int n2 = (held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
//
// if (n2 != n1)
// pressed = true;
// }
}
else
{
-2
View File
@@ -894,8 +894,6 @@ void scenes::stream::render(const XrFrameState & frame_state)
session.begin_frame();
std::array<int, view_count> image_indices;
#if WIVRN_FEATURE_RENDERDOC
renderdoc_begin(*vk_instance);
#endif
-2
View File
@@ -119,8 +119,6 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
target.layout = vk::raii::PipelineLayout(device, pipeline_layout_info);
const auto & vk_device_extensions = application::get_vk_device_extensions();
// Vertex shader
auto vertex_shader = load_shader(device, "reprojection.vert");
-2
View File
@@ -363,8 +363,6 @@ void scenes::stream::gui_performance_metrics()
void scenes::stream::gui_compact_view()
{
const auto & metrics = global_metrics[(metrics_offset + global_metrics.size() - 1) % global_metrics.size()];
if (ImGui::BeginTable("metrics", 2))
{
auto f = [&](const char * label, float value, const char * unit) {
-1
View File
@@ -280,7 +280,6 @@ void scenes::stream::tracking()
float applied_height_offset = config.get_height_offset();
xr::space height_offset_space = make_height_offset_space(applied_height_offset);
XrTime t0 = instance.now();
from_headset::tracking tracking;
std::vector<from_headset::hand_tracking> hands;
std::vector<std::variant<from_headset::meta_body, from_headset::bd_body, from_headset::htc_body>> body;
-8
View File
@@ -72,14 +72,6 @@ std::shared_ptr<shader> shader_loader::operator()(std::span<const uint32_t> spir
for (SpvReflectSpecializationConstant * variable: enumerate<SpvReflectSpecializationConstant>(spvReflectEnumerateSpecializationConstants, reflect))
specialization_constants.emplace_back(variable->constant_id, variable->name);
for (SpvReflectDescriptorSet * variable: enumerate<SpvReflectDescriptorSet>(spvReflectEnumerateDescriptorSets, reflect))
{
}
for (SpvReflectDescriptorBinding * variable: enumerate<SpvReflectDescriptorBinding>(spvReflectEnumerateDescriptorBindings, reflect))
{
}
spvReflectDestroyShaderModule(&reflect);
}
else