diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-08-03 20:05:53 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-08-04 15:57:19 -0700 |
commit | ad98aa9d93646600cc95b3e45a40eec26f18988a (patch) | |
tree | acf5fabf216947bd9529c68edbc0bb3fdaa0f870 /src/glsl/glsl_types.cpp | |
parent | ea3a9eb53a3c9ed99998ead645e2b2e6a3261626 (diff) |
glsl2: Remove uses of deprecated TALLOC_CTX type.
Diffstat (limited to 'src/glsl/glsl_types.cpp')
-rw-r--r-- | src/glsl/glsl_types.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 40a5b6c4827..88f305ac254 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -33,14 +33,14 @@ extern "C" { hash_table *glsl_type::array_types = NULL; hash_table *glsl_type::record_types = NULL; -void *glsl_type::ctx = NULL; +void *glsl_type::mem_ctx = NULL; void glsl_type::init_talloc_type_ctx(void) { - if (glsl_type::ctx == NULL) { - glsl_type::ctx = talloc_init("glsl_type"); - assert(glsl_type::ctx != NULL); + if (glsl_type::mem_ctx == NULL) { + glsl_type::mem_ctx = talloc_init("glsl_type"); + assert(glsl_type::mem_ctx != NULL); } } @@ -55,7 +55,7 @@ glsl_type::glsl_type(GLenum gl_type, length(0) { init_talloc_type_ctx(); - this->name = talloc_strdup(this->ctx, name); + this->name = talloc_strdup(this->mem_ctx, name); /* Neither dimension is zero or both dimensions are zero. */ assert((vector_elements == 0) == (matrix_columns == 0)); @@ -73,7 +73,7 @@ glsl_type::glsl_type(GLenum gl_type, length(0) { init_talloc_type_ctx(); - this->name = talloc_strdup(this->ctx, name); + this->name = talloc_strdup(this->mem_ctx, name); memset(& fields, 0, sizeof(fields)); } @@ -88,8 +88,8 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields, unsigned int i; init_talloc_type_ctx(); - this->name = talloc_strdup(this->ctx, name); - this->fields.structure = talloc_array(this->ctx, + this->name = talloc_strdup(this->mem_ctx, name); + this->fields.structure = talloc_array(this->mem_ctx, glsl_struct_field, length); for (i = 0; i < length; i++) { this->fields.structure[i].type = fields[i].type; @@ -228,9 +228,9 @@ _mesa_glsl_release_types(void) glsl_type::record_types = NULL; } - if (glsl_type::ctx != NULL) { - talloc_free(glsl_type::ctx); - glsl_type::ctx = NULL; + if (glsl_type::mem_ctx != NULL) { + talloc_free(glsl_type::mem_ctx); + glsl_type::mem_ctx = NULL; } } @@ -315,7 +315,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) : * NUL. */ const unsigned name_length = strlen(array->name) + 10 + 3; - char *const n = (char *) talloc_size(this->ctx, name_length); + char *const n = (char *) talloc_size(this->mem_ctx, name_length); if (length == 0) snprintf(n, name_length, "%s[]", array->name); @@ -405,7 +405,7 @@ glsl_type::get_array_instance(const glsl_type *base, unsigned array_size) if (t == NULL) { t = new glsl_type(base, array_size); - hash_table_insert(array_types, (void *) t, talloc_strdup(ctx, key)); + hash_table_insert(array_types, (void *) t, talloc_strdup(mem_ctx, key)); } assert(t->base_type == GLSL_TYPE_ARRAY); |