summaryrefslogtreecommitdiff
path: root/src/mapi/mapi/mapi.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-12-06 10:27:39 +0800
committerChia-I Wu <olv@lunarg.com>2010-12-06 15:40:37 +0800
commit8f2a974cf2c9b6c00dfac11be4316a7d121dfbb4 (patch)
tree33f4139d4adb57568a9e020a06a696ffdb3922f2 /src/mapi/mapi/mapi.c
parent5ae4b6693a8254236435960ef84701fe405fe59b (diff)
mapi: Rewrite mapi_abi.py to get rid of preprocessor magic.
The preprocessor magic in mapi was nothing but obfuscation. Rewrite mapi_abi.py to generate real C code. This commit removes the hack added in 43121f20866bb89e8dac92bd92ec85a943704b7e.
Diffstat (limited to 'src/mapi/mapi/mapi.c')
-rw-r--r--src/mapi/mapi/mapi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mapi/mapi/mapi.c b/src/mapi/mapi/mapi.c
index 2f1c3fff6c..5476d37fdc 100644
--- a/src/mapi/mapi/mapi.c
+++ b/src/mapi/mapi/mapi.c
@@ -36,8 +36,7 @@
#include "table.h"
/* dynamic stubs will run out before this array */
-#define MAPI_MAX_STUBS (sizeof(struct mapi_table) / sizeof(mapi_func))
-static const struct mapi_stub *mapi_stub_map[MAPI_MAX_STUBS];
+static const struct mapi_stub *mapi_stub_map[MAPI_TABLE_NUM_SLOTS];
static int mapi_num_stubs;
static const struct mapi_stub *
@@ -145,9 +144,9 @@ mapi_table_create(void)
const struct mapi_table *noop = table_get_noop();
struct mapi_table *tbl;
- tbl = malloc(sizeof(*tbl));
+ tbl = malloc(MAPI_TABLE_SIZE);
if (tbl)
- memcpy(tbl, noop, sizeof(*tbl));
+ memcpy(tbl, noop, MAPI_TABLE_SIZE);
return tbl;
}