summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glapi.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <[email protected]>2010-02-27 00:24:58 +0200
committerGeorge Sapountzis <[email protected]>2010-03-01 20:54:18 +0200
commit42f3241e04b6cd74829dfb64b4a154ac8a4e6a48 (patch)
tree5c53ddb71c46a7fdcbbfbf4228db8ff422f03748 /src/mesa/glapi/glapi.c
parent750a7f1f1d6438c3fb460883aa2a626970e4c534 (diff)
glapi.c: split check_table to not_null and get_proc
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r--src/mesa/glapi/glapi.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 2fa673d307d..764f1dba289 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -423,8 +423,9 @@ _glapi_set_dispatch(struct _glapi_table *dispatch)
/* use the no-op functions */
dispatch = (struct _glapi_table *) __glapi_noop_table;
}
-#ifdef DEBUG
+#if 0 /* enable this for extra DEBUG */
else {
+ _glapi_check_table_not_null(dispatch);
_glapi_check_table(dispatch);
}
#endif
@@ -488,19 +489,23 @@ _glapi_get_dispatch_table_size(void)
* Intended for debugging purposes.
*/
void
-_glapi_check_table(const struct _glapi_table *table)
+_glapi_check_table_not_null(const struct _glapi_table *table)
{
-#if 0 /* Enable this for extra DEBUG */
const GLuint entries = _glapi_get_dispatch_table_size();
const void **tab = (const void **) table;
GLuint i;
for (i = 1; i < entries; i++) {
assert(tab[i]);
}
+}
- /* Do some spot checks to be sure that the dispatch table
- * slots are assigned correctly.
- */
+/**
+ * Do some spot checks to be sure that the dispatch table
+ * slots are assigned correctly.
+ */
+void
+_glapi_check_table(const struct _glapi_table *table)
+{
{
GLuint BeginOffset = _glapi_get_proc_offset("glBegin");
char *BeginFunc = (char*) &table->Begin;
@@ -557,7 +562,4 @@ _glapi_check_table(const struct _glapi_table *table)
assert(setFenceOffset == _gloffset_SetFenceNV);
assert(setFenceOffset == offset);
}
-#else
- (void) table;
-#endif
}