aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
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/state_tracker
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/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawpixels.c8
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c9
2 files changed, 8 insertions, 9 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
index 9f1b427a9..b2c6327a0 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -875,8 +875,8 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels);
assert(pixels);
- sValues = (GLubyte *) malloc(width * sizeof(GLubyte));
- zValues = (GLuint *) malloc(width * sizeof(GLuint));
+ sValues = malloc(width * sizeof(GLubyte));
+ zValues = malloc(width * sizeof(GLuint));
if (sValues && zValues) {
GLint row;
@@ -1598,7 +1598,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
/* copy image from ptRead surface to ptTex surface */
if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
- GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ GLfloat *buf = malloc(width * height * 4 * sizeof(GLfloat));
enum pipe_format readFormat, drawFormat;
readFormat = util_format_linear(rbRead->texture->format);
drawFormat = util_format_linear(pt->format);
@@ -1610,7 +1610,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
}
else {
/* GL_DEPTH */
- GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ GLuint *buf = malloc(width * height * sizeof(GLuint));
pipe_get_tile_z(pipe, ptRead, 0, 0, readW, readH, buf);
pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
readW, readH, buf);
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index ed3bbc725..518b680f0 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -648,7 +648,7 @@ decompress_with_blit(struct gl_context * ctx,
enum pipe_format pformat = util_format_linear(dst_texture->format);
GLfloat *rgba;
- rgba = (GLfloat *) malloc(width * 4 * sizeof(GLfloat));
+ rgba = malloc(width * 4 * sizeof(GLfloat));
if (!rgba) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage()");
goto end;
@@ -775,7 +775,7 @@ fallback_copy_texsubimage(struct gl_context *ctx,
yStep = 1;
}
- data = (uint *) malloc(width * sizeof(uint));
+ data = malloc(width * sizeof(uint));
if (data) {
/* To avoid a large temp memory allocation, do copy row by row */
@@ -796,7 +796,7 @@ fallback_copy_texsubimage(struct gl_context *ctx,
else {
/* RGBA format */
GLfloat *tempSrc =
- (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
+ malloc(width * height * 4 * sizeof(GLfloat));
if (tempSrc && texDest) {
const GLint dims = 2;
@@ -835,8 +835,7 @@ fallback_copy_texsubimage(struct gl_context *ctx,
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
}
- if (tempSrc)
- free(tempSrc);
+ free(tempSrc);
}
st_texture_image_unmap(st, stImage);