diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-05-03 22:25:29 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-05 11:07:26 +0100 |
commit | c6c1817419c3dba3534747305d85a868824afbf2 (patch) | |
tree | df41b059c2bf4ccd2a704d3f7843b835082e5005 /meta | |
parent | 9a62bd8d782e63155b1db4c5174b7e00b774a052 (diff) | |
download | poky-c6c1817419c3dba3534747305d85a868824afbf2.tar.gz |
piglit: Fix c++11-narrowing warnings in tests
This is found with clang on 32bit builds
(From OE-Core rev: 844a1f1f593e0b4e4b0949ad78a00aa4ab8657e9)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch | 53 | ||||
-rw-r--r-- | meta/recipes-graphics/piglit/piglit_git.bb | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch b/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch new file mode 100644 index 0000000000..b1bb00e052 --- /dev/null +++ b/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-narrowing-errors-seen-with-clang.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From cd38c91e8c743bfc1841bcdd08e1ab18bf22f0e1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 3 May 2023 21:59:43 -0700 | ||
4 | Subject: [PATCH] tests: Fix narrowing errors seen with clang | ||
5 | |||
6 | Fixes | ||
7 | piglit-test-pattern.cpp:656:26: error: type 'float' cannot be narrowed to 'int' in initiali | ||
8 | zer list [-Wc++11-narrowing] | ||
9 | |||
10 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/807] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | .../spec/ext_framebuffer_multisample/draw-buffers-common.cpp | 4 ++-- | ||
14 | tests/util/piglit-test-pattern.cpp | 4 ++-- | ||
15 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp | ||
18 | index 48e1ad4a5..b36830c45 100644 | ||
19 | --- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp | ||
20 | +++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp | ||
21 | @@ -353,8 +353,8 @@ draw_pattern(bool sample_alpha_to_coverage, | ||
22 | float vertices[4][2] = { | ||
23 | { 0.0f, 0.0f + i * (pattern_height / num_rects) }, | ||
24 | { 0.0f, (i + 1.0f) * (pattern_height / num_rects) }, | ||
25 | - { pattern_width, (i + 1.0f) * (pattern_height / num_rects) }, | ||
26 | - { pattern_width, 0.0f + i * (pattern_height / num_rects) } }; | ||
27 | + { static_cast<float>(pattern_width), (i + 1.0f) * (pattern_height / num_rects) }, | ||
28 | + { static_cast<float>(pattern_width), 0.0f + i * (pattern_height / num_rects) } }; | ||
29 | |||
30 | glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, | ||
31 | sizeof(vertices[0]), | ||
32 | diff --git a/tests/util/piglit-test-pattern.cpp b/tests/util/piglit-test-pattern.cpp | ||
33 | index 43d451d6a..52ee94457 100644 | ||
34 | --- a/tests/util/piglit-test-pattern.cpp | ||
35 | +++ b/tests/util/piglit-test-pattern.cpp | ||
36 | @@ -653,12 +653,12 @@ ColorGradientSunburst::draw_with_scale_and_offset(const float (*proj)[4], | ||
37 | { | ||
38 | switch (out_type) { | ||
39 | case GL_INT: { | ||
40 | - int clear_color[4] = { offset, offset, offset, offset }; | ||
41 | + int clear_color[4] = { static_cast<int>(offset), static_cast<int>(offset), static_cast<int>(offset), static_cast<int>(offset) }; | ||
42 | glClearBufferiv(GL_COLOR, 0, clear_color); | ||
43 | break; | ||
44 | } | ||
45 | case GL_UNSIGNED_INT: { | ||
46 | - unsigned clear_color[4] = { offset, offset, offset, offset }; | ||
47 | + unsigned clear_color[4] = { static_cast<unsigned>(offset), static_cast<unsigned>(offset), static_cast<unsigned>(offset), static_cast<unsigned>(offset) }; | ||
48 | glClearBufferuiv(GL_COLOR, 0, clear_color); | ||
49 | break; | ||
50 | } | ||
51 | -- | ||
52 | 2.40.1 | ||
53 | |||
diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb index 1daeb35b58..116d2f5d81 100644 --- a/meta/recipes-graphics/piglit/piglit_git.bb +++ b/meta/recipes-graphics/piglit/piglit_git.bb | |||
@@ -10,6 +10,7 @@ SRC_URI = "git://gitlab.freedesktop.org/mesa/piglit.git;protocol=https;branch=ma | |||
10 | file://0001-cmake-install-bash-completions-in-the-right-place.patch \ | 10 | file://0001-cmake-install-bash-completions-in-the-right-place.patch \ |
11 | file://0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch \ | 11 | file://0002-cmake-use-proper-WAYLAND_INCLUDE_DIRS-variable.patch \ |
12 | file://0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \ | 12 | file://0003-tests-util-piglit-shader.c-do-not-hardcode-build-pat.patch \ |
13 | file://0001-tests-Fix-narrowing-errors-seen-with-clang.patch \ | ||
13 | " | 14 | " |
14 | UPSTREAM_CHECK_COMMITS = "1" | 15 | UPSTREAM_CHECK_COMMITS = "1" |
15 | 16 | ||