diff --git a/src/debug.c b/src/debug.c index bde5fb2599..9c4fee2045 100644 --- a/src/debug.c +++ b/src/debug.c @@ -20,6 +20,7 @@ #include "compiled.h" #include "fibhash.h" #include "hookintrprtr.h" +#include "vec8bit.h" #ifdef HPCGAP #include "hpc/guards.h" diff --git a/src/vec8bit.h b/src/vec8bit.h index bfc6a786fe..ebec9d252a 100644 --- a/src/vec8bit.h +++ b/src/vec8bit.h @@ -11,7 +11,8 @@ #ifndef GAP_VEC8BIT_H #define GAP_VEC8BIT_H -#include "system.h" +#include "objects.h" +#include "opers.h" /**************************************************************************** ** @@ -19,25 +20,27 @@ ** convert a GF(2) vector into a GF(2^k) vector in place ** */ - void RewriteGF2Vec(Obj vec, UInt q); + /**************************************************************************** ** *F CopyVec8Bit( , ) . . . . . . . . . . . . . . copying function ** */ - Obj CopyVec8Bit(Obj list, UInt mut); + /**************************************************************************** ** *F IS_VEC8BIT_REP( ) . . . check that is in 8bit GFQ vector rep */ extern Obj IsVec8bitRep; -#define IS_VEC8BIT_REP(obj) \ - (TNUM_OBJ(obj) == T_DATOBJ && True == DoFilter(IsVec8bitRep, obj)) +EXPORT_INLINE int IS_VEC8BIT_REP(Obj obj) +{ + return TNUM_OBJ(obj) == T_DATOBJ && True == DoFilter(IsVec8bitRep, obj); +} /**************************************************************************** @@ -48,6 +51,7 @@ extern Obj IsVec8bitRep; */ void PlainVec8Bit(Obj list); + /**************************************************************************** ** *F ASS_VEC8BIT( , , ) . . . . set an elm of an 8bit vector @@ -63,12 +67,12 @@ void ASS_VEC8BIT(Obj list, Obj pos, Obj elm); */ Obj ZeroVec8Bit(UInt q, UInt len, UInt mut); + /**************************************************************************** ** ** Low-level access, needed for meataxe64 package ** */ - Obj GetFieldInfo8Bit(UInt q); @@ -78,11 +82,12 @@ Obj GetFieldInfo8Bit(UInt q); ** ** 'LEN_VEC8BIT' returns the logical length of the 8bit GFQ vector , ** as a C integer. -** -** Note that 'LEN_VEC8BIT' is a macro, so do not call it with arguments that -** have side effects. */ -#define LEN_VEC8BIT(list) ((Int)(CONST_ADDR_OBJ(list)[1])) +EXPORT_INLINE UInt LEN_VEC8BIT(Obj list) +{ + return (UInt)CONST_ADDR_OBJ(list)[1]; +} + /**************************************************************************** ** @@ -92,7 +97,11 @@ Obj GetFieldInfo8Bit(UInt q); ** to the C integer . ** */ -#define SET_LEN_VEC8BIT(list, len) ((ADDR_OBJ(list)[1] = (Obj)(len))) +EXPORT_INLINE void SET_LEN_VEC8BIT(Obj list, UInt len) +{ + ADDR_OBJ(list)[1] = (Obj)len; +} + /**************************************************************************** ** @@ -100,12 +109,12 @@ Obj GetFieldInfo8Bit(UInt q); ** ** 'FIELD_VEC8BIT' returns the field size Q of the 8bit GFQ vector , ** as a C integer. -** -** Note that 'FIELD_VEC8BIT' is a macro, so do not call it with arguments -** that have side effects. */ +EXPORT_INLINE UInt FIELD_VEC8BIT(Obj list) +{ + return (UInt)CONST_ADDR_OBJ(list)[2]; +} -#define FIELD_VEC8BIT(list) ((Int)(CONST_ADDR_OBJ(list)[2])) /**************************************************************************** ** @@ -113,9 +122,11 @@ Obj GetFieldInfo8Bit(UInt q); ** ** 'SET_FIELD_VEC8BIT' sets the field size of the 8bit GFQ vector , ** to the C integer . -** */ -#define SET_FIELD_VEC8BIT(list, q) ((ADDR_OBJ(list)[2] = (Obj)(q))) +EXPORT_INLINE void SET_FIELD_VEC8BIT(Obj list, UInt q) +{ + ADDR_OBJ(list)[2] = (Obj)q; +} /**************************************************************************** @@ -124,8 +135,15 @@ Obj GetFieldInfo8Bit(UInt q); ** ** returns a pointer to the start of the data of the 8bit GFQ vector */ -#define BYTES_VEC8BIT(list) ((UInt1 *)(ADDR_OBJ(list) + 3)) -#define CONST_BYTES_VEC8BIT(list) ((const UInt1 *)(CONST_ADDR_OBJ(list) + 3)) +EXPORT_INLINE UInt1 * BYTES_VEC8BIT(Obj list) +{ + return (UInt1 *)(ADDR_OBJ(list) + 3); +} + +EXPORT_INLINE const UInt1 * CONST_BYTES_VEC8BIT(Obj list) +{ + return (const UInt1 *)(CONST_ADDR_OBJ(list) + 3); +} /****************************************************************************