Franklin Zecca wrote:
I had to manually patch OLC in (talk about a nightmare), and there
were a few typos and such I made here and there... but I've rectified
these issues as the make failed. Now I'm at the point where I'm
getting this:
-----------------------------------------------
gcc -c -Wall -O -ggdb -DFIRST_BOOT recycle.c
In file included from recycle.c:131:
allocfunc.h: In function `new_skhash':
allocfunc.h:1: error: dereferencing pointer to incomplete type
allocfunc.h:1: error: dereferencing pointer to incomplete type
allocfunc.h:1: error: dereferencing pointer to incomplete type
allocfunc.h: In function `free_skhash':
allocfunc.h:1: error: dereferencing pointer to incomplete type
make: *** [recycle.o] Error 1
-----------------------------------------------
Originally there was an error with tZero as well, but I changed the
struct line from:
-----------------------------------------------
static type tZero; \
-----------------------------------------------
to:
-----------------------------------------------
static type * tZero; \
-----------------------------------------------
Anyhow, this error has completely confused the hell out of me. My
allocfunc.h file is:
-----------------------------------------------
allocfunc(struct skhash,skhash)
-----------------------------------------------
At the beginning of recycle.c:
-----------------------------------------------
#include "merc.h"
#include "recycle.h"
#define STANDARD_ALLOCMEM(type, name) \
type * name ## _free; \
int name ## _created; \
int name ## _allocated; \
\
type * new_ ## name( void ) \
{ \
type * temp; \
static type * tZero; \
static type tZero; \
\
if ( name ## _free ) \
{ \
temp = name ## _free; \
name ## _free = name ## _free->next; \
} \
else \
{ \
temp = alloc_mem( sizeof(*temp) ); \
name ## _allocated++; \
Should be:
temp = (type*)alloc_mem( sizeof(*temp) ); \
name ## _allocated++; \
} \
\
*temp = tZero; \
\
name ## _created++; \
\
return temp; \
}
#define STANDARD_FREEMEM(type, name) \
int name ## _freed; \
\
void free_ ## name( type * temp ) \
{ \
temp->next = name ## _free; \
name ## _free = temp; \
name ## _freed++; \
}
#define VAL_ALLOCMEM(type, name) \
type * name ## _free; \
int name ## _created; \
int name ## _allocated; \
\
type * new_ ## name( void ) \
{ \
type * temp; \
static type * tZero; \
static type tZero; \
\
if ( name ## _free ) \
{ \
temp = name ## _free; \
name ## _free = name ## _free->next; \
} \
else \
{ \
temp = alloc_mem( sizeof(*temp) ); \
temp = (type*)alloc_mem( sizeof(*temp) ); \
name ## _allocated++; \
} \
\
*temp = tZero; \
\
VALIDATE(temp); \
\
name ## _created++; \
\
return temp; \
}
#define VAL_FREEMEM(type, name) \
int name ## _freed; \
\
void free_ ## name( type * temp ) \
{ \
if (!IS_VALID(temp)) \
return; \
\
INVALIDATE(temp); \
temp->next = name ## _free; \
name ## _free = temp; \
name ## _freed++; \
}
#define allocfunc(a,b) \
STANDARD_ALLOCMEM(a,b) \
STANDARD_FREEMEM(a,b)
#define allocfunc_val(a,b) \
VAL_ALLOCMEM(a,b) \
VAL_FREEMEM(a,b)
#include "allocfunc.h"
#undef allocfunc
#undef allocfunc_val
-----------------------------------------------
Any ideas?
--
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom