From a67330d157ffe05602a3163c946aa97e29cb6bb5 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 16 May 2006 10:01:07 +0000 Subject: Cleanup code. Change constructor prototype. --- src/mesa/shader/slang/slang_compile_struct.c | 31 ++++++++++------------------ 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'src/mesa/shader/slang/slang_compile_struct.c') diff --git a/src/mesa/shader/slang/slang_compile_struct.c b/src/mesa/shader/slang/slang_compile_struct.c index c8f851b4ad..15585a62af 100644 --- a/src/mesa/shader/slang/slang_compile_struct.c +++ b/src/mesa/shader/slang/slang_compile_struct.c @@ -31,14 +31,16 @@ #include "imports.h" #include "slang_compile.h" -/* slang_struct_scope */ +/* + * slang_struct_scope + */ -int slang_struct_scope_construct (slang_struct_scope *scope) +GLvoid +_slang_struct_scope_ctr (slang_struct_scope *self) { - scope->structs = NULL; - scope->num_structs = 0; - scope->outer_scope = NULL; - return 1; + self->structs = NULL; + self->num_structs = 0; + self->outer_scope = NULL; } void slang_struct_scope_destruct (slang_struct_scope *scope) @@ -56,8 +58,7 @@ int slang_struct_scope_copy (slang_struct_scope *x, const slang_struct_scope *y) slang_struct_scope z; unsigned int i; - if (!slang_struct_scope_construct (&z)) - return 0; + _slang_struct_scope_ctr (&z); z.structs = (slang_struct *) slang_alloc_malloc (y->num_structs * sizeof (slang_struct)); if (z.structs == NULL) { @@ -102,11 +103,7 @@ int slang_struct_construct (slang_struct *stru) stru->fields = (slang_variable_scope *) slang_alloc_malloc (sizeof (slang_variable_scope)); if (stru->fields == NULL) return 0; - if (!slang_variable_scope_construct (stru->fields)) - { - slang_alloc_free (stru->fields); - return 0; - } + _slang_variable_scope_ctr (stru->fields); stru->structs = (slang_struct_scope *) slang_alloc_malloc (sizeof (slang_struct_scope)); if (stru->structs == NULL) { @@ -114,13 +111,7 @@ int slang_struct_construct (slang_struct *stru) slang_alloc_free (stru->fields); return 0; } - if (!slang_struct_scope_construct (stru->structs)) - { - slang_variable_scope_destruct (stru->fields); - slang_alloc_free (stru->fields); - slang_alloc_free (stru->structs); - return 0; - } + _slang_struct_scope_ctr (stru->structs); return 1; } -- cgit v1.2.3