Skip to content

Commit e5fabf0

Browse files
committed
Explicitly define int types
1 parent d2434fa commit e5fabf0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

source/matplot/backend/opengl_embed.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ namespace matplot::backend {
194194
// Set the vertex attributes pointers
195195
int vertex_attribute_location = 0;
196196
size_t stride = 2 * sizeof(float);
197-
glVertexAttribPointer(vertex_attribute_location, 2, GL_FLOAT, GL_FALSE, stride, (void *)0);
197+
glVertexAttribPointer(vertex_attribute_location, 2, GL_FLOAT, GL_FALSE, static_cast<GLsizei>(stride), (void *)0);
198198
glEnableVertexAttribArray(0);
199199

200200
// Set the color attribute pointers
@@ -223,12 +223,12 @@ namespace matplot::backend {
223223
if (vertexColorLocation == -1) {
224224
throw std::runtime_error("can't find uniform location");
225225
}
226-
glUniform4f(vertexColorLocation, color[1], color[2], color[3], 1.-color[0]);
226+
glUniform4f(vertexColorLocation, color[1], color[2], color[3], 1.f-color[0]);
227227

228228
// Bind element buffer
229229
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
230230
glBindVertexArray(VAO);
231-
glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, 0);
231+
glDrawElements(GL_TRIANGLES, static_cast<GLsizei>(indices.size()), GL_UNSIGNED_INT, nullptr);
232232

233233
// Unbind our vertex array
234234
glBindVertexArray(0);
@@ -239,7 +239,7 @@ namespace matplot::backend {
239239
}
240240

241241
void opengl_embed::draw_background(const std::array<float, 4> &color) {
242-
glClearColor(color[1], color[2], color[3], 1. - color[0]);
242+
glClearColor(color[1], color[2], color[3], 1.f - color[0]);
243243
glClear(GL_COLOR_BUFFER_BIT);
244244
}
245245

@@ -273,7 +273,7 @@ namespace matplot::backend {
273273
// Set the vertex attributes pointers
274274
int vertex_attribute_location = 0;
275275
size_t stride = 2 * sizeof(float);
276-
glVertexAttribPointer(vertex_attribute_location, 2, GL_FLOAT, GL_FALSE, stride, (void *)0);
276+
glVertexAttribPointer(vertex_attribute_location, 2, GL_FLOAT, GL_FALSE, static_cast<GLsizei>(stride), (void *)0);
277277
glEnableVertexAttribArray(0);
278278

279279
// Activate our shader program
@@ -297,11 +297,11 @@ namespace matplot::backend {
297297
if (vertexColorLocation == -1) {
298298
throw std::runtime_error("can't find uniform location");
299299
}
300-
glUniform4f(vertexColorLocation, color[1], color[2], color[3], 1.-color[0]);
300+
glUniform4f(vertexColorLocation, color[1], color[2], color[3], 1.f-color[0]);
301301

302302
// Bind element buffer
303303
glBindVertexArray(VAO);
304-
glDrawArrays(GL_LINE_STRIP, 0, x.size());
304+
glDrawArrays(GL_LINE_STRIP, 0, static_cast<GLsizei>(x.size()));
305305

306306
// Unbind our vertex array
307307
glBindVertexArray(0);

0 commit comments

Comments
 (0)