version 1.1, 2012/05/30 22:47:39
|
version 1.4, 2015/04/20 18:19:53
|
|
|
#include <stdio.h> | #include <stdio.h> |
#include <assert.h> | #include <assert.h> |
#include <string.h> | #include <string.h> |
#include <base/strings.h> |
#include <pal/strings.h> |
#include <base/io.h> |
#include <pal/format.h> |
|
#include <pal/file.h> |
#include "heap.h" | #include "heap.h" |
#include "strids.h" | #include "strids.h" |
|
#include "instancedecl.h" |
| |
#define MOF_TRACE printf("MOF_TRACE: %s(%u)\n", __FILE__, __LINE__) | #define MOF_TRACE printf("MOF_TRACE: %s(%u)\n", __FILE__, __LINE__) |
| |
|
|
#define MOF_ASSERT(COND) assert(COND) | #define MOF_ASSERT(COND) assert(COND) |
| |
/* Type-aware forms of memory allocation functions */ | /* Type-aware forms of memory allocation functions */ |
#define CALLOC_T(T, N) ((T*)MOF_Calloc(&state.heap, N, sizeof(T))) |
#define CALLOC_T(ZT, N) ((ZT*)MOF_Calloc(&state.heap, N, sizeof(ZT))) |
#define MALLOC_T(T, N) ((T*)MOF_Malloc(&state.heap, N * sizeof(T))) |
#define MALLOC_T(ZT, N) ((ZT*)MOF_Malloc(&state.heap, N * sizeof(ZT))) |
#define REALLOC_T(T, PTR, N) ((T*)MOF_Realloc(&state.heap,PTR,(N)*sizeof(T))) |
#define REALLOC_T(ZT, PTR, N) ((ZT*)MOF_Realloc(&state.heap,PTR,(N)*sizeof(ZT))) |
| |
/* | /* |
**============================================================================== | **============================================================================== |
|
|
**============================================================================== | **============================================================================== |
*/ | */ |
| |
/* Convert this initializer to a Statik value of the given type */ |
/* Convert this initializer to a static value of the given type */ |
int InitializerToValue( | int InitializerToValue( |
MOF_Initializer* self, | MOF_Initializer* self, |
MI_Uint32 /*MI_Type*/ type, | MI_Uint32 /*MI_Type*/ type, |