aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-06 08:49:13 +0200
committermarha <marha@users.sourceforge.net>2012-09-06 08:49:13 +0200
commitccc8a492607df715b08d27c6bb3b9d13b1ff48a2 (patch)
tree4311d252acd49786ceed60cb55343af0a9294a2f /mesalib/src/mesa/main/shaderapi.c
parenta4d007b9b60f2fc7c8de46533e2f47ecb24f3c9c (diff)
parentaa10a08696cae93799fcddae3f0245ceee905e01 (diff)
downloadvcxsrv-ccc8a492607df715b08d27c6bb3b9d13b1ff48a2.tar.gz
vcxsrv-ccc8a492607df715b08d27c6bb3b9d13b1ff48a2.tar.bz2
vcxsrv-ccc8a492607df715b08d27c6bb3b9d13b1ff48a2.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/shaderapi.c')
-rw-r--r--mesalib/src/mesa/main/shaderapi.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index d6acade3d..643ef516f 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -377,7 +377,7 @@ detach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
_mesa_reference_shader(ctx, &shProg->Shaders[i], NULL);
/* alloc new, smaller array */
- newList = (struct gl_shader **)
+ newList =
malloc((n - 1) * sizeof(struct gl_shader *));
if (!newList) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader");
@@ -703,9 +703,7 @@ shader_source(struct gl_context *ctx, GLuint shader, const GLchar *source)
return;
/* free old shader source string and install new one */
- if (sh->Source) {
- free((void *) sh->Source);
- }
+ free((void *)sh->Source);
sh->Source = source;
sh->CompileStatus = GL_FALSE;
#ifdef DEBUG
@@ -1299,7 +1297,7 @@ read_shader(const char *fname)
return NULL;
}
- buffer = (char *) malloc(max);
+ buffer = malloc(max);
len = fread(buffer, 1, max, f);
buffer[len] = 0;
@@ -1336,7 +1334,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
* This array holds offsets of where the appropriate string ends, thus the
* last element will be set to the total length of the source code.
*/
- offsets = (GLint *) malloc(count * sizeof(GLint));
+ offsets = malloc(count * sizeof(GLint));
if (offsets == NULL) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");
return;
@@ -1363,7 +1361,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count,
* valgrind warnings in the parser/grammer code.
*/
totalLength = offsets[count - 1] + 2;
- source = (GLcharARB *) malloc(totalLength * sizeof(GLcharARB));
+ source = malloc(totalLength * sizeof(GLcharARB));
if (source == NULL) {
free((GLvoid *) offsets);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB");