Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions
[mesa.git] / src / mesa / drivers / dri / r300 / r300_shader.c
index 3704c1015583aca795fc66c8d8b62ad21ef804c9..9c24166ec5b1f623aa0ccdf70b1763deb731d37f 100644 (file)
@@ -38,8 +38,8 @@ static void freeFragProgCache(GLcontext *ctx, struct r300_fragment_program_cont
 
        while (fp) {
                tmp = fp->next;
-               _mesa_reference_program(ctx, &fp->Base, NULL);
-               _mesa_free(fp);
+               rc_constants_destroy(&fp->code.constants);
+               free(fp);
                fp = tmp;
        }
 }
@@ -50,8 +50,9 @@ static void freeVertProgCache(GLcontext *ctx, struct r300_vertex_program_cont *c
 
        while (vp) {
                tmp = vp->next;
+               rc_constants_destroy(&vp->code.constants);
                _mesa_reference_vertprog(ctx, &vp->Base, NULL);
-               _mesa_free(vp);
+               free(vp);
                vp = tmp;
        }
 }
@@ -97,7 +98,7 @@ static void r300DeleteProgram(GLcontext * ctx, struct gl_program *prog)
        _mesa_delete_program(ctx, prog);
 }
 
-static void
+static GLboolean
 r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog)
 {
        struct r300_vertex_program_cont *vp = (struct r300_vertex_program_cont *)prog;
@@ -115,7 +116,10 @@ r300ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog)
        }
 
        /* need this for tcl fallbacks */
-       _tnl_program_string(ctx, target, prog);
+       (void) _tnl_program_string(ctx, target, prog);
+
+       /* XXX check if program is legal, within limits */
+       return GL_TRUE;
 }
 
 static GLboolean