summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-11-27 21:42:12 +0000
committerBrian Paul <[email protected]>1999-11-27 21:42:12 +0000
commitcdc62309b425da7809375a25ca2709351704c090 (patch)
treedbf566a264f0b964b12868e3531a5dd7002e9e4e /src/mesa/main
parentf25e1ac31f4912babb75d55c7ea86467dedf0a41 (diff)
move dispatch table size check into _mesa_init_no_op_table()
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dispatch.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c
index e6c91b97744..ba65193941a 100644
--- a/src/mesa/main/dispatch.c
+++ b/src/mesa/main/dispatch.c
@@ -1,4 +1,4 @@
-/* $Id: dispatch.c,v 1.4 1999/11/27 21:40:28 brianp Exp $ */
+/* $Id: dispatch.c,v 1.5 1999/11/27 21:42:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -86,11 +86,17 @@ generic_noop(void)
void
_mesa_init_no_op_table(struct _glapi_table *exec)
{
- const GLuint n = _glapi_get_dispatch_table_size();
- GLuint i;
- void **dispatch = (void **) exec;
- for (i = 0; i < n; i++) {
- dispatch[i] = (void *) generic_noop;
+ /* Check to be sure the dispatcher's table is at least as big as Mesa's. */
+ const GLuint size = sizeof(struct _glapi_table) / sizeof(void *);
+ assert(_glapi_get_dispatch_table_size() >= size);
+
+ {
+ const GLuint n = _glapi_get_dispatch_table_size();
+ GLuint i;
+ void **dispatch = (void **) exec;
+ for (i = 0; i < n; i++) {
+ dispatch[i] = (void *) generic_noop;
+ }
}
}
@@ -102,11 +108,6 @@ _mesa_init_no_op_table(struct _glapi_table *exec)
void
_mesa_init_exec_table(struct _glapi_table *exec)
{
- /* Check to be sure the dispatcher's table is at least as big as Mesa's. */
- const GLuint size = sizeof(struct _glapi_table) / sizeof(void *);
- assert(_glapi_get_dispatch_table_size() >= size);
-
-
/* first initialize all dispatch slots to no-op */
_mesa_init_no_op_table(exec);