From 2b7a972e3f36bfcdc6fbe2b59d7ffdcde49c9405 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 3 Sep 2012 19:44:00 -0700 Subject: Don't cast the return value of malloc/realloc This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) ) --- src/mesa/main/version.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/main/version.c') diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index f22118a0d1f..bc7b1fa0e00 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -224,7 +224,7 @@ compute_version(struct gl_context *ctx) override_version(ctx); - ctx->VersionString = (char *) malloc(max); + ctx->VersionString = malloc(max); if (ctx->VersionString) { _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING @@ -256,7 +256,7 @@ compute_version_es1(struct gl_context *ctx) _mesa_problem(ctx, "Incomplete OpenGL ES 1.0 support."); } - ctx->VersionString = (char *) malloc(max); + ctx->VersionString = malloc(max); if (ctx->VersionString) { _mesa_snprintf(ctx->VersionString, max, "OpenGL ES-CM 1.%d Mesa " MESA_VERSION_STRING @@ -289,7 +289,7 @@ compute_version_es2(struct gl_context *ctx) _mesa_problem(ctx, "Incomplete OpenGL ES 2.0 support."); } - ctx->VersionString = (char *) malloc(max); + ctx->VersionString = malloc(max); if (ctx->VersionString) { _mesa_snprintf(ctx->VersionString, max, "OpenGL ES 2.0 Mesa " MESA_VERSION_STRING -- cgit v1.2.3