Skip to content

Commit

Permalink
Merge pull request #3192 from MirServer/use-calloc-better
Browse files Browse the repository at this point in the history
Fix rawhide FTBFS
  • Loading branch information
hbatagelo authored Jan 19, 2024
2 parents 435dffd + fac5750 commit a5bf64a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/client/wayland_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ int main(int argc, char** argv)
struct wl_pointer* pointer = wl_seat_get_pointer(globals.seat);
wl_pointer_add_listener(pointer, &pointer_listener, NULL);

draw_context* ctx = calloc(sizeof *ctx, 1);
draw_context* ctx = calloc(1, sizeof *ctx);
ctx->display = display;
ctx->surface = wl_compositor_create_surface(globals.compositor);
ctx->width = 400;
Expand Down
12 changes: 6 additions & 6 deletions src/platform/graphics/egl_buffer_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ class GLBulkHandle
public:
GLBulkHandle()
{
(**allocator)(1, &id);
allocator(1, &id);
}

~GLBulkHandle()
{
if (id)
(**deleter)(1, &id);
deleter(1, &id);
}

GLBulkHandle(GLBulkHandle const&) = delete;
Expand Down Expand Up @@ -102,14 +102,14 @@ class GLTypedHandle
{
public:
GLTypedHandle(GLenum type)
: id{(**allocator)(type)}
: id{allocator(type)}
{
}

~GLTypedHandle()
{
if (id)
(**deleter)(id);
deleter(id);
}

GLTypedHandle(GLTypedHandle const&) = delete;
Expand Down Expand Up @@ -139,14 +139,14 @@ class GLHandle
{
public:
GLHandle()
: id{(**allocator)()}
: id{allocator()}
{
}

~GLHandle()
{
if (id)
(**deleter)(id);
deleter(id);
}

GLHandle(GLHandle const&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion src/server/frontend_xwayland/xcb_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void mf::XCBConnection::verify_not_in_error_state() const

auto mf::XCBConnection::query_name(xcb_atom_t atom) const -> std::string
{
std::lock_guard{atom_name_cache_mutex};
std::lock_guard lock{atom_name_cache_mutex};
auto const iter = atom_name_cache.find(atom);

if (iter == atom_name_cache.end())
Expand Down

0 comments on commit a5bf64a

Please sign in to comment.