mesa/tests: Sanity check the ES2 dispatch table
[mesa.git] / src / mesa / swrast / s_context.c
index 055f4cc4ddbdc4e5ab5dd05bff1463cb35e54e5f..31a12dade1a05b2a41cd88aa415cb08c76f0a40d 100644 (file)
@@ -720,7 +720,7 @@ GLboolean
 _swrast_CreateContext( struct gl_context *ctx )
 {
    GLuint i;
-   SWcontext *swrast = (SWcontext *) calloc(1, sizeof(SWcontext));
+   SWcontext *swrast = calloc(1, sizeof(SWcontext));
 #ifdef _OPENMP
    const GLuint maxThreads = omp_get_max_threads();
 #else
@@ -775,9 +775,9 @@ _swrast_CreateContext( struct gl_context *ctx )
     * using multiple threads, it is necessary to have one SpanArrays instance
     * per thread.
     */
-   swrast->SpanArrays = (SWspanarrays *) malloc(maxThreads * sizeof(SWspanarrays));
+   swrast->SpanArrays = malloc(maxThreads * sizeof(SWspanarrays));
    if (!swrast->SpanArrays) {
-      FREE(swrast);
+      free(swrast);
       return GL_FALSE;
    }
    for(i = 0; i < maxThreads; i++) {
@@ -803,10 +803,10 @@ _swrast_CreateContext( struct gl_context *ctx )
 
    ctx->swrast_context = swrast;
 
-   swrast->stencil_temp.buf1 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
-   swrast->stencil_temp.buf2 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
-   swrast->stencil_temp.buf3 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
-   swrast->stencil_temp.buf4 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf1 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf2 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf3 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+   swrast->stencil_temp.buf4 = malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
 
    if (!swrast->stencil_temp.buf1 ||
        !swrast->stencil_temp.buf2 ||
@@ -828,17 +828,16 @@ _swrast_DestroyContext( struct gl_context *ctx )
       _mesa_debug(ctx, "_swrast_DestroyContext\n");
    }
 
-   FREE( swrast->SpanArrays );
-   if (swrast->ZoomedArrays)
-      FREE( swrast->ZoomedArrays );
-   FREE( swrast->TexelBuffer );
+   free( swrast->SpanArrays );
+   free( swrast->ZoomedArrays );
+   free( swrast->TexelBuffer );
 
    free(swrast->stencil_temp.buf1);
    free(swrast->stencil_temp.buf2);
    free(swrast->stencil_temp.buf3);
    free(swrast->stencil_temp.buf4);
 
-   FREE( swrast );
+   free( swrast );
 
    ctx->swrast_context = 0;
 }