aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-06 08:48:23 +0200
committermarha <marha@users.sourceforge.net>2012-09-06 08:48:23 +0200
commitaa10a08696cae93799fcddae3f0245ceee905e01 (patch)
tree950730c362229584b5e60fc1fe309325b7ba66b1 /mesalib/src/mesa/main/shaderapi.c
parentaf1e359cc622a0c53d5632fb03ef9bd4c17de897 (diff)
downloadvcxsrv-aa10a08696cae93799fcddae3f0245ceee905e01.tar.gz
vcxsrv-aa10a08696cae93799fcddae3f0245ceee905e01.tar.bz2
vcxsrv-aa10a08696cae93799fcddae3f0245ceee905e01.zip
xserver mesa git update 6 sep 2012
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");