Mir

Merge lp:~vanvugt/mir/make-older-clang-happy into lp:mir

Proposed by Daniel van Vugt on 2017-05-01
Status: Merged
Approved by: Daniel van Vugt on 2017-05-03
Approved revision: 4159
Merged at revision: 4163
Proposed branch: lp:~vanvugt/mir/make-older-clang-happy
Merge into: lp:mir
Diff against target: 104 lines (+30/-12)
3 files modified
src/platforms/mesa/client/client_platform.cpp (+18/-9)
src/platforms/mesa/server/kms/display.cpp (+2/-2)
tests/unit-tests/platforms/nested/test_host_buffer.cpp (+10/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/make-older-clang-happy
Reviewer Review Type Date Requested Status
Andreas Pokorny (community) Approve on 2017-05-03
Mir CI Bot continuous-integration Approve on 2017-05-01
Mir development team 2017-05-01 Pending
Review via email: mp+323456@code.launchpad.net

Commit message

Minor fixes to restore support for legacy clang (3.8) on xenial.

Description of the change

They were reasonable complaints, so worth fixing.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4159
https://mir-jenkins.ubuntu.com/job/mir-ci/3386/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4584
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4712
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4701
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4701
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4616
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4616
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4616
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4616
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/4616/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4616
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4616/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3386/rebuild

review: Approve (continuous-integration)
Andreas Pokorny (andreas-pokorny) wrote :

that should not cause a warning..

review: Abstain
Daniel van Vugt (vanvugt) wrote :

No they shouldn't, but compilers are often imperfect. So it's a choice between what builds and what doesn't :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/platforms/mesa/client/client_platform.cpp'
2--- src/platforms/mesa/client/client_platform.cpp 2017-04-13 07:00:27 +0000
3+++ src/platforms/mesa/client/client_platform.cpp 2017-05-01 09:59:05 +0000
4@@ -151,12 +151,7 @@
5 available_callback, available_context);
6 }
7
8-MirBuffer* allocate_buffer_gbm_sync(
9- MirConnection* connection,
10- uint32_t width, uint32_t height,
11- uint32_t gbm_pixel_format,
12- uint32_t gbm_bo_flags)
13-try
14+namespace
15 {
16 struct BufferSync
17 {
18@@ -177,11 +172,25 @@
19 std::mutex mutex;
20 std::condition_variable cv;
21 MirBuffer* buffer = nullptr;
22- } sync;
23-
24+ };
25+
26+ void allocate_buffer_gbm_sync_cb(MirBuffer* b, void* context)
27+ {
28+ reinterpret_cast<BufferSync*>(context)->set_buffer(b);
29+ }
30+}
31+
32+MirBuffer* allocate_buffer_gbm_sync(
33+ MirConnection* connection,
34+ uint32_t width, uint32_t height,
35+ uint32_t gbm_pixel_format,
36+ uint32_t gbm_bo_flags)
37+try
38+{
39+ BufferSync sync;
40 allocate_buffer_gbm(
41 connection, width, height, gbm_pixel_format, gbm_bo_flags,
42- [](auto* b, auto* context){ reinterpret_cast<BufferSync*>(context)->set_buffer(b); }, &sync);
43+ &allocate_buffer_gbm_sync_cb, &sync);
44 return sync.wait_for_buffer();
45 }
46 catch (...)
47
48=== modified file 'src/platforms/mesa/server/kms/display.cpp'
49--- src/platforms/mesa/server/kms/display.cpp 2017-04-06 05:30:53 +0000
50+++ src/platforms/mesa/server/kms/display.cpp 2017-05-01 09:59:05 +0000
51@@ -557,8 +557,8 @@
52 bounding_rect.size.height.as_uint32_t()};
53
54 auto const physical_size = transformation * logical_size;
55- uint32_t width = abs(physical_size.x);
56- uint32_t height = abs(physical_size.y);
57+ uint32_t width = abs(int(physical_size.x));
58+ uint32_t height = abs(int(physical_size.y));
59
60 for (auto const& group : kms_output_groups)
61 {
62
63=== modified file 'tests/unit-tests/platforms/nested/test_host_buffer.cpp'
64--- tests/unit-tests/platforms/nested/test_host_buffer.cpp 2017-04-13 07:00:27 +0000
65+++ tests/unit-tests/platforms/nested/test_host_buffer.cpp 2017-05-01 09:59:05 +0000
66@@ -36,6 +36,9 @@
67 namespace mcl = mir::client;
68 namespace mtd = mir::test::doubles;
69
70+namespace
71+{
72+
73 std::unique_ptr<mir::Fd> fd = nullptr;
74 int get_fence(MirBuffer*)
75 {
76@@ -44,6 +47,10 @@
77 return -1;
78 }
79
80+void null_connected_callback(MirConnection*, void*)
81+{
82+}
83+
84 struct TestConnectionConfiguration : mir::client::DefaultConnectionConfiguration
85 {
86 public:
87@@ -110,6 +117,8 @@
88 }
89 };
90
91+}
92+
93 struct HostBuffer : Test
94 {
95 HostBuffer()
96@@ -133,7 +142,7 @@
97 fd = std::make_unique<mir::Fd>( fileno(tmpfile()) );
98
99 MirConnection connection{*config};
100- connection.connect("", [](auto*, auto*){}, nullptr)->wait_for_all();
101+ connection.connect("", &null_connected_callback, nullptr)->wait_for_all();
102 mgn::HostBuffer buffer(&connection, mir::geometry::Size{1,1}, mir_pixel_format_abgr_8888);
103 {
104 auto fence = buffer.fence();

Subscribers

People subscribed via source and target branches