Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/core/mir/optional_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class optional_value
}
}

T value_;
T value_{};
bool is_set_{false};
};

Expand Down
7 changes: 6 additions & 1 deletion src/platforms/eglstream-kms/server/egl_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class CPUAddressableFb

gem_handle = params.handle;
pitch_ = params.pitch;
map_size = params.size;

auto ret = drmModeAddFB(drm_fd, width, height, 24, 32, params.pitch, params.handle, &fb_id);
if (ret)
Expand All @@ -76,7 +77,7 @@ class CPUAddressableFb
BOOST_THROW_EXCEPTION((std::system_error{-ret, std::system_category(), "Failed to map KMS dumb buffer"}));
}

auto map = mmap(0, params.size, PROT_READ | PROT_WRITE, MAP_SHARED, drm_fd, map_request.offset);
map = mmap(0, map_size, PROT_READ | PROT_WRITE, MAP_SHARED, drm_fd, map_request.offset);
if (map == MAP_FAILED)
{
BOOST_THROW_EXCEPTION((std::system_error{errno, std::system_category(), "Failed to mmap() buffer"}));
Expand All @@ -86,6 +87,8 @@ class CPUAddressableFb
}
~CPUAddressableFb() noexcept(false)
{
munmap(map, map_size);

struct drm_mode_destroy_dumb params = { gem_handle };

if (ioctl(drm_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &params) != 0)
Expand Down Expand Up @@ -117,6 +120,8 @@ class CPUAddressableFb
uint32_t fb_id;
uint32_t gem_handle;
uint32_t pitch_;
void* map;
size_t map_size;
};

}
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/gbm-kms/server/kms/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void mgg::Display::configure_locked(
{
auto bounding_rect = group.bounding_rectangle();
std::vector<std::shared_ptr<KMSOutput>> kms_outputs;
glm::mat2 transformation;
glm::mat2 transformation{1};
geom::Size current_mode_resolution;

group.for_each_output(
Expand Down
2 changes: 1 addition & 1 deletion src/server/frontend_wayland/desktop_file_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ std::shared_ptr<mf::DesktopFile> mf::DesktopFileManager::resolve_if_flatpak(int
if (!g_key_file_load_from_file(key_file, info_filename, G_KEY_FILE_NONE, NULL))
return nullptr;

char* sandboxed_app_id = g_key_file_get_string(key_file, "Application", "name", NULL);
g_autofree char* sandboxed_app_id = g_key_file_get_string(key_file, "Application", "name", NULL);
if (!sandboxed_app_id)
return nullptr;

Expand Down
7 changes: 3 additions & 4 deletions src/server/shell/decoration/basic_decoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class msd::BasicDecoration::BufferStreams
{
// Must be at top so it can be used by create_buffer_stream() when called in the constructor
std::shared_ptr<scene::Session> const session;
MirPixelFormat const buffer_format;

public:
BufferStreams(std::shared_ptr<scene::Session> const& session, MirPixelFormat buffer_format);
Expand All @@ -115,17 +116,15 @@ class msd::BasicDecoration::BufferStreams
private:
BufferStreams(BufferStreams const&) = delete;
BufferStreams& operator=(BufferStreams const&) = delete;

MirPixelFormat const buffer_format;
};

msd::BasicDecoration::BufferStreams::BufferStreams(std::shared_ptr<scene::Session> const& session, MirPixelFormat buffer_format)
: session{session},
buffer_format{buffer_format},
titlebar{create_buffer_stream()},
left_border{create_buffer_stream()},
right_border{create_buffer_stream()},
bottom_border{create_buffer_stream()},
buffer_format{buffer_format}
bottom_border{create_buffer_stream()}
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/time/alarm_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ auto mir::time::AlarmFactory::create_repeating_alarm(
auto const shared_weak_alarm{std::make_shared<std::weak_ptr<time::Alarm>>()};

std::shared_ptr result = create_alarm(
[swk = shared_weak_alarm, cb = std::move(callback), repeat_delay]()
[swk = shared_weak_alarm, cb = callback, repeat_delay]()
{
cb();

Expand Down
8 changes: 4 additions & 4 deletions src/wayland/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ void mw::Client::register_client(wl_client* raw, std::shared_ptr<Client> const&
void mw::Client::unregister_client(wl_client* raw)
{
auto const map = client_map.lock();
map->erase(remove_if(
begin(*map),
end(*map),
map->erase(std::remove_if(
map->begin(),
map->end(),
[&](auto& item){ return item.first == raw; }),
end(*map));
map->end());
}

auto mw::Client::shared_from(wl_client* client) -> std::shared_ptr<Client>
Expand Down
2 changes: 1 addition & 1 deletion src/wayland/generator/emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class LayoutEmitter : public Emitter::Impl
{
public:
LayoutEmitter(Emitter const& child, bool clear_line_before = true, bool clear_line_after = true, std::string indent="")
: child{std::move(child)},
: child{child},
clear_line_before{clear_line_before},
clear_line_after{clear_line_after},
indent{indent}
Expand Down
Loading