From 8f2a974cf2c9b6c00dfac11be4316a7d121dfbb4 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 6 Dec 2010 10:27:39 +0800 Subject: 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. --- src/mapi/mapi/mapi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mapi/mapi/mapi.c') 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; } -- cgit v1.2.3