Add type conversion for calloc

This commit is contained in:
Infinity_X 2019-07-10 19:32:36 +08:00 committed by GitHub
parent 5fa99df235
commit 15e4dae107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ nk_glfw3_device_create()
GLint len = 0;
glGetShaderiv(dev->vert_shdr, GL_INFO_LOG_LENGTH, &len);
if (len > 1) {
char *log = calloc((size_t)len, sizeof(char));
char *log = (char*)calloc((size_t)len, sizeof(char));
glGetShaderInfoLog(dev->vert_shdr, len, NULL, log);
fprintf(stdout, "[GL]: failed to compile shader: %s", log);
free(log);
@ -167,7 +167,7 @@ nk_glfw3_device_create()
glGetShaderiv(dev->frag_shdr, GL_INFO_LOG_LENGTH, &len);
if (len > 1) {
char *log = calloc((size_t)len, sizeof(char));
char *log = (char*)calloc((size_t)len, sizeof(char));
glGetShaderInfoLog(dev->frag_shdr, len, NULL, log);
fprintf(stdout, "[GL]: failed to compile shader: %s", log);
free(log);