[Mesa-dev] [PATCH 08/13] mesa: make _mesa_extension_override_*ables static
Emil Velikov
emil.l.velikov at gmail.com
Tue Nov 7 11:54:48 UTC 2017
From: Emil Velikov <emil.velikov at collabora.com>
The symbols are used only locally, thus we can drop the prefix and make
them static.
With that done, we can remove the no longer needed memset.
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
src/mesa/main/extensions.c | 17 +++++++----------
src/mesa/main/extensions.h | 3 ---
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2468e19bf99..6069ebccaab 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -37,8 +37,8 @@
#include "macros.h"
#include "mtypes.h"
-struct gl_extensions _mesa_extension_override_enables;
-struct gl_extensions _mesa_extension_override_disables;
+static struct gl_extensions extension_override_enables;
+static struct gl_extensions extension_override_disables;
static char *extra_extensions = NULL;
@@ -74,16 +74,16 @@ name_to_index(const char* name)
/**
* Overrides extensions in \c ctx based on the values in
- * _mesa_extension_override_enables and _mesa_extension_override_disables.
+ * extension_override_enables and extension_override_disables.
*/
void
_mesa_override_extensions(struct gl_context *ctx)
{
unsigned i;
const GLboolean *enables =
- (GLboolean*) &_mesa_extension_override_enables;
+ (GLboolean*) &extension_override_enables;
const GLboolean *disables =
- (GLboolean*) &_mesa_extension_override_disables;
+ (GLboolean*) &extension_override_disables;
GLboolean *ctx_ext = (GLboolean*)&ctx->Extensions;
for (i = 0; i < MESA_EXTENSION_COUNT; ++i) {
@@ -247,9 +247,6 @@ _mesa_one_time_init_extension_overrides(void)
atexit(free_unknown_extensions_strings);
- memset(&_mesa_extension_override_enables, 0, sizeof(struct gl_extensions));
- memset(&_mesa_extension_override_disables, 0, sizeof(struct gl_extensions));
-
if (env_const == NULL) {
return;
}
@@ -286,8 +283,8 @@ _mesa_one_time_init_extension_overrides(void)
}
i = name_to_index(ext);
- offset = set_extension(&_mesa_extension_override_enables, i, enable);
- offset = set_extension(&_mesa_extension_override_disables, i, !enable);
+ offset = set_extension(&extension_override_enables, i, enable);
+ offset = set_extension(&extension_override_disables, i, !enable);
if (offset != 0)
recognized = true;
else
diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h
index ebed8fa4fc0..2f49faa4757 100644
--- a/src/mesa/main/extensions.h
+++ b/src/mesa/main/extensions.h
@@ -106,9 +106,6 @@ _mesa_has_##name_str(const struct gl_context *ctx) \
#include "extensions_table.h"
#undef EXT
-extern struct gl_extensions _mesa_extension_override_enables;
-extern struct gl_extensions _mesa_extension_override_disables;
-
#ifdef __cplusplus
}
#endif
--
2.14.1
More information about the mesa-dev
mailing list