small cleanups
authorAlan Hourihane <alanh@tungstengraphics.com>
Tue, 22 Apr 2008 19:29:42 +0000 (20:29 +0100)
committerAlan Hourihane <alanh@tungstengraphics.com>
Tue, 22 Apr 2008 19:30:38 +0000 (20:30 +0100)
src/mesa/shader/prog_parameter.c
src/mesa/shader/program.c
src/mesa/shader/shader_api.c

index 46d30872e4fb6168a21a197e6e6c5be84bd886b3..3ad7215755d3dacfd79dde4a1f958fb7b54064a7 100644 (file)
@@ -40,8 +40,7 @@
 struct gl_program_parameter_list *
 _mesa_new_parameter_list(void)
 {
-   return (struct gl_program_parameter_list *)
-      _mesa_calloc(sizeof(struct gl_program_parameter_list));
+   return CALLOC_STRUCT(gl_program_parameter_list);
 }
 
 
index d2c9183558f34d1d4071a429cb4f99902a613607..c539b5272041c76d2aca368b98adb1303f6f0f53 100644 (file)
@@ -230,7 +230,6 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
 {
    (void) ctx;
    if (prog) {
-      _mesa_bzero(prog, sizeof(*prog));
       prog->Id = id;
       prog->Target = target;
       prog->Resident = GL_TRUE;
index 01a237c525a231047b0f2d9e2936a0c82c806af4..b0f79c29c1ed63485ca713e7719a56e293514ca4 100644 (file)
@@ -133,6 +133,11 @@ _mesa_free_shader_program_data(GLcontext *ctx,
       _mesa_free(shProg->Shaders);
       shProg->Shaders = NULL;
    }
+
+   if (shProg->InfoLog) {
+      _mesa_free(shProg->InfoLog);
+      shProg->InfoLog = NULL;
+   }
 }
 
 
@@ -143,10 +148,7 @@ void
 _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg)
 {
    _mesa_free_shader_program_data(ctx, shProg);
-   if (shProg->Shaders) {
-      _mesa_free(shProg->Shaders);
-      shProg->Shaders = NULL;
-   }
+
    _mesa_free(shProg);
 }