somehow, some tests found their way into compilation, and broke it thanks

to C++11 narrowing issues. Obvious fixes to the code (no bump, didn't build
before)
This commit is contained in:
espie 2018-11-03 09:54:55 +00:00
parent 1587f77a36
commit 0b34289adb
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-tests_spec_ext_framebuffer_multisample_draw-buffers-common_cpp,v 1.1 2018/11/03 09:54:55 espie Exp $
Prevent narrowing errors under C++11
Index: tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
--- tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp.orig
+++ tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
@@ -353,8 +353,8 @@ draw_pattern(bool sample_alpha_to_coverage,
float vertices[4][2] = {
{ 0.0f, 0.0f + i * (pattern_height / num_rects) },
{ 0.0f, (i + 1.0f) * (pattern_height / num_rects) },
- { pattern_width, (i + 1.0f) * (pattern_height / num_rects) },
- { pattern_width, 0.0f + i * (pattern_height / num_rects) } };
+ { static_cast<float>(pattern_width), (i + 1.0f) * (pattern_height / num_rects) },
+ { static_cast<float>(pattern_width), 0.0f + i * (pattern_height / num_rects) } };
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE,
sizeof(vertices[0]),

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-tests_util_piglit-test-pattern_cpp,v 1.1 2018/11/03 09:54:55 espie Exp $
Index: tests/util/piglit-test-pattern.cpp
--- tests/util/piglit-test-pattern.cpp.orig
+++ tests/util/piglit-test-pattern.cpp
@@ -653,12 +653,14 @@ ColorGradientSunburst::draw_with_scale_and_offset(cons
{
switch (out_type) {
case GL_INT: {
- int clear_color[4] = { offset, offset, offset, offset };
+ int ioffset = static_cast<int>(offset);
+ int clear_color[4] = { ioffset, ioffset, ioffset, ioffset };
glClearBufferiv(GL_COLOR, 0, clear_color);
break;
}
case GL_UNSIGNED_INT: {
- unsigned clear_color[4] = { offset, offset, offset, offset };
+ unsigned uoffset = static_cast<unsigned>(offset);
+ unsigned clear_color[4] = { uoffset, uoffset, uoffset, uoffset };
glClearBufferuiv(GL_COLOR, 0, clear_color);
break;
}