diff options
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | src/gui/GraphCanvas.cpp | 12 | ||||
-rw-r--r-- | src/gui/GraphView.cpp | 9 | ||||
-rw-r--r-- | src/server/Buffer.cpp | 4 | ||||
-rw-r--r-- | src/server/BufferFactory.cpp | 4 | ||||
-rw-r--r-- | src/server/RunContext.cpp | 2 | ||||
-rw-r--r-- | src/server/UndoStack.cpp | 2 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 6 | ||||
-rw-r--r-- | src/server/internals/Controller.cpp | 2 |
9 files changed, 23 insertions, 19 deletions
diff --git a/.clang-tidy b/.clang-tidy index e535a880..859cb534 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -25,7 +25,6 @@ Checks: > -clang-analyzer-core.CallAndMessage, -clang-analyzer-optin.cplusplus.VirtualCall, -clang-analyzer-valist.Uninitialized, - -cppcoreguidelines-init-variables, -cppcoreguidelines-macro-usage, -cppcoreguidelines-no-malloc, -cppcoreguidelines-owning-memory, diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index 18fd1a39..b6a8e5a2 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -324,8 +324,8 @@ GraphCanvas::remove_plugin(const URI& uri) void GraphCanvas::add_block(const SPtr<const BlockModel>& bm) { - SPtr<const GraphModel> pm = dynamic_ptr_cast<const GraphModel>(bm); - NodeModule* module; + SPtr<const GraphModel> pm = dynamic_ptr_cast<const GraphModel>(bm); + NodeModule* module = nullptr; if (pm) { module = SubgraphModule::create(*this, pm, _human_names); } else { @@ -485,8 +485,8 @@ GraphCanvas::auto_menu_position(int& x, int& y, bool& push_in) *_app.window_factory()->graph_window(_graph), 64, 64, _menu_x, _menu_y); - int origin_x; - int origin_y; + int origin_x = 0; + int origin_y = 0; widget().get_window()->get_origin(origin_x, origin_y); _menu_x += origin_x; _menu_y += origin_y; @@ -865,8 +865,8 @@ GraphCanvas::load_plugin(const WPtr<PluginModel>& weak_plugin) void GraphCanvas::get_new_module_location(double& x, double& y) { - int scroll_x; - int scroll_y; + int scroll_x = 0; + int scroll_y = 0; get_scroll_offsets(scroll_x, scroll_y); x = scroll_x + 20; y = scroll_y + 20; diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp index a4bc1400..4f76f798 100644 --- a/src/gui/GraphView.cpp +++ b/src/gui/GraphView.cpp @@ -100,9 +100,14 @@ GraphView::set_graph(const SPtr<const GraphModel>& graph) SPtr<GraphView> GraphView::create(App& app, const SPtr<const GraphModel>& graph) { - GraphView* result = nullptr; - Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win"); + GraphView* result = nullptr; + Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win"); + xml->get_widget_derived("graph_view_box", result); + if (!result) { + return nullptr; + } + result->init(app); result->set_graph(graph); return SPtr<GraphView>(result); diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index 5df57ce7..dfcd0a71 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -250,7 +250,7 @@ Buffer::peak(const RunContext& context) const vpeak = _mm_max_ps(vpeak, tmp); // peak = vpeak[0] - float peak; + float peak = 0.0f; _mm_store_ss(&peak, vpeak); return peak; @@ -448,7 +448,7 @@ Buffer::dump_cv(const RunContext& context) const void* Buffer::aligned_alloc(size_t size) { #ifdef HAVE_POSIX_MEMALIGN - void* buf; + void* buf = nullptr; if (!posix_memalign(static_cast<void**>(&buf), 16, size)) { memset(buf, 0, size); return buf; diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp index 657484d8..e7bb146a 100644 --- a/src/server/BufferFactory.cpp +++ b/src/server/BufferFactory.cpp @@ -116,7 +116,7 @@ BufferFactory::try_get_buffer(LV2_URID type) { std::atomic<Buffer*>& head_ptr = free_list(type); Buffer* head = nullptr; - Buffer* next; + Buffer* next = nullptr; do { head = head_ptr.load(); if (!head) { @@ -183,7 +183,7 @@ void BufferFactory::recycle(Buffer* buf) { std::atomic<Buffer*>& head_ptr = free_list(buf->type()); - Buffer* try_head; + Buffer* try_head = nullptr; do { try_head = head_ptr.load(); buf->_next = try_head; diff --git a/src/server/RunContext.cpp b/src/server/RunContext.cpp index b4b8156e..41d383cc 100644 --- a/src/server/RunContext.cpp +++ b/src/server/RunContext.cpp @@ -194,7 +194,7 @@ void RunContext::run() { while (_engine.wait_for_tasks()) { - for (Task* t; (t = _engine.steal_task(0));) { + for (Task* t = nullptr; (t = _engine.steal_task(0));) { t->run(*this); } } diff --git a/src/server/UndoStack.cpp b/src/server/UndoStack.cpp index d9e00075..40951468 100644 --- a/src/server/UndoStack.cpp +++ b/src/server/UndoStack.cpp @@ -40,7 +40,7 @@ int UndoStack::start_entry() { if (_depth == 0) { - time_t now; + time_t now = {}; time(&now); _stack.emplace_back(Entry(now)); } diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 03bebe80..a33fd482 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -768,9 +768,9 @@ ingen_restore(LV2_Handle instance, } LV2_URID ingen_file = plugin->map->map(plugin->map->handle, INGEN__file); - size_t size; - uint32_t type; - uint32_t valflags; + size_t size = 0; + uint32_t type = 0; + uint32_t valflags = 0; // Get abstract path to graph file const char* path = static_cast<const char*>( diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp index 4c253cc1..d40fc431 100644 --- a/src/server/internals/Controller.cpp +++ b/src/server/internals/Controller.cpp @@ -154,7 +154,7 @@ ControllerNode::control(RunContext& context, uint8_t control_num, uint8_t val, F const Sample max_port_val = _max_port->buffer(0)->value_at(offset); const Sample log_port_val = _log_port->buffer(0)->value_at(offset); - Sample scaled_value; + Sample scaled_value = 0.0f; if (log_port_val > 0.0f) { // haaaaack, stupid negatives and logarithms Sample log_offset = 0; |