summaryrefslogtreecommitdiffstats
path: root/src/misc/vec
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/vec')
-rw-r--r--src/misc/vec/vecAtt.h133
-rw-r--r--src/misc/vec/vecFlt.h4
-rw-r--r--src/misc/vec/vecInt.h6
-rw-r--r--src/misc/vec/vecPtr.h4
-rw-r--r--src/misc/vec/vecStr.h4
-rw-r--r--src/misc/vec/vecVec.h4
6 files changed, 27 insertions, 128 deletions
diff --git a/src/misc/vec/vecAtt.h b/src/misc/vec/vecAtt.h
index da7a8445..8d0a034b 100644
--- a/src/misc/vec/vecAtt.h
+++ b/src/misc/vec/vecAtt.h
@@ -60,7 +60,8 @@ struct Vec_Att_t_
{
// storage for attributes
int nCap; // the size of array allocated
- int * pArrayInt; // the integer attribute array
+ // Removed pArrayInt as it's not 64-bit safe, it generates compiler
+ // warnings, and it's unused.
void ** pArrayPtr; // the pointer attribute array
// attribute specific info
void * pMan; // the manager for this attribute
@@ -89,7 +90,7 @@ struct Vec_Att_t_
***********************************************************************/
static inline Vec_Att_t * Vec_AttAlloc(
- int fInteger, int nSize, void * pMan,
+ int nSize, void * pMan,
void (*pFuncFreeMan) (void *),
void*(*pFuncStartObj)(void *),
void (*pFuncFreeObj) (void *, void *) )
@@ -102,16 +103,8 @@ static inline Vec_Att_t * Vec_AttAlloc(
p->pFuncStartObj = pFuncStartObj;
p->pFuncFreeObj = pFuncFreeObj;
p->nCap = nSize? nSize : 16;
- if ( fInteger )
- {
- p->pArrayInt = ALLOC( int, p->nCap );
- memset( p->pArrayInt, 0xff, sizeof(int) * p->nCap );
- }
- else
- {
- p->pArrayPtr = ALLOC( void *, p->nCap );
- memset( p->pArrayPtr, 0, sizeof(void *) * p->nCap );
- }
+ p->pArrayPtr = ALLOC( void *, p->nCap );
+ memset( p->pArrayPtr, 0, sizeof(void *) * p->nCap );
return p;
}
@@ -135,24 +128,14 @@ static inline void * Vec_AttFree( Vec_Att_t * p, int fFreeMan )
if ( p->pFuncFreeObj )
{
int i;
- if ( p->pArrayInt )
- {
- for ( i = 0; i < p->nCap; i++ )
- if ( p->pArrayInt[i] )
- p->pFuncFreeObj( p->pMan, (void *)p->pArrayInt[i] );
- }
- else
- {
- for ( i = 0; i < p->nCap; i++ )
- if ( p->pArrayPtr[i] )
- p->pFuncFreeObj( p->pMan, p->pArrayPtr[i] );
- }
+ for ( i = 0; i < p->nCap; i++ )
+ if ( p->pArrayPtr[i] )
+ p->pFuncFreeObj( p->pMan, p->pArrayPtr[i] );
}
// free the memory manager
pMan = fFreeMan? NULL : p->pMan;
if ( p->pMan && fFreeMan )
p->pFuncFreeMan( p->pMan );
- FREE( p->pArrayInt );
FREE( p->pArrayPtr );
FREE( p );
return pMan;
@@ -175,26 +158,12 @@ static inline void Vec_AttClear( Vec_Att_t * p )
if ( p->pFuncFreeObj )
{
int i;
- if ( p->pArrayInt )
- {
- if ( p->pFuncFreeObj )
- for ( i = 0; i < p->nCap; i++ )
- if ( p->pArrayInt[i] )
- p->pFuncFreeObj( p->pMan, (void *)p->pArrayInt[i] );
- }
- else
- {
- if ( p->pFuncFreeObj )
- for ( i = 0; i < p->nCap; i++ )
- if ( p->pArrayPtr[i] )
- p->pFuncFreeObj( p->pMan, p->pArrayPtr[i] );
- }
+ if ( p->pFuncFreeObj )
+ for ( i = 0; i < p->nCap; i++ )
+ if ( p->pArrayPtr[i] )
+ p->pFuncFreeObj( p->pMan, p->pArrayPtr[i] );
}
- if ( p->pArrayInt )
- memset( p->pArrayInt, 0xff, sizeof(int) * p->nCap );
- else
- memset( p->pArrayPtr, 0, sizeof(void *) * p->nCap );
-
+ memset( p->pArrayPtr, 0, sizeof(void *) * p->nCap );
}
/**Function*************************************************************
@@ -214,15 +183,10 @@ static inline void Vec_AttFreeEntry( Vec_Att_t * p, int i )
return;
if ( p->pMan )
{
- if ( p->pArrayInt[i] && p->pFuncFreeObj )
- p->pFuncFreeObj( p->pMan, (void *)p->pArrayInt[i] );
if ( p->pArrayPtr[i] && p->pFuncFreeObj )
p->pFuncFreeObj( p->pMan, (void *)p->pArrayPtr[i] );
}
- if ( p->pArrayInt )
- p->pArrayInt[i] = ~(unsigned)0;
- else
- p->pArrayPtr[i] = NULL;
+ p->pArrayPtr[i] = NULL;
}
/**Function*************************************************************
@@ -240,16 +204,8 @@ static inline void Vec_AttGrow( Vec_Att_t * p, int nCapMin )
{
if ( p->nCap >= nCapMin )
return;
- if ( p->pArrayInt )
- {
- p->pArrayInt = REALLOC( int, p->pArrayInt, nCapMin );
- memset( p->pArrayInt + p->nCap, 0xff, sizeof(int) * (nCapMin - p->nCap) );
- }
- else
- {
- p->pArrayPtr = REALLOC( void *, p->pArrayPtr, nCapMin );
- memset( p->pArrayPtr + p->nCap, 0, sizeof(void *) * (nCapMin - p->nCap) );
- }
+ p->pArrayPtr = REALLOC( void *, p->pArrayPtr, nCapMin );
+ memset( p->pArrayPtr + p->nCap, 0, sizeof(void *) * (nCapMin - p->nCap) );
p->nCap = nCapMin;
}
@@ -275,26 +231,6 @@ static inline void Vec_AttWriteEntry( Vec_Att_t * p, int i, void * pEntry )
/**Function*************************************************************
- Synopsis [Writes the entry into its place.]
-
- Description [Only works if the manager is not defined.]
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-static inline void Vec_AttWriteEntryInt( Vec_Att_t * p, int i, int Entry )
-{
- assert( p->pArrayInt );
- assert( p->pFuncStartObj == NULL );
- if ( i >= p->nCap )
- Vec_AttGrow( p, (2 * p->nCap > i)? 2 * p->nCap : i + 10 );
- p->pArrayInt[i] = Entry;
-}
-
-/**Function*************************************************************
-
Synopsis [Returns the entry.]
Description []
@@ -325,26 +261,6 @@ static inline void * Vec_AttEntry( Vec_Att_t * p, int i )
SeeAlso []
***********************************************************************/
-static inline int Vec_AttEntryInt( Vec_Att_t * p, int i )
-{
- assert( p->pArrayInt );
- assert( p->pMan == NULL );
- if ( i >= p->nCap )
- Vec_AttGrow( p, (2 * p->nCap > i)? 2 * p->nCap : i + 10 );
- return p->pArrayInt[i];
-}
-
-/**Function*************************************************************
-
- Synopsis [Returns the entry.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
static inline void * Vec_AttMan( Vec_Att_t * p )
{
return p->pMan;
@@ -366,25 +282,8 @@ static inline void ** Vec_AttArray( Vec_Att_t * p )
return p->pArrayPtr;
}
-/**Function*************************************************************
-
- Synopsis [Returns the array of attributes.]
-
- Description []
-
- SideEffects []
-
- SeeAlso []
-
-***********************************************************************/
-static inline int * Vec_AttArrayInt( Vec_Att_t * p )
-{
- return p->pArrayInt;
-}
-
#endif
-
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/misc/vec/vecFlt.h b/src/misc/vec/vecFlt.h
index 6b36ce84..513c7dc6 100644
--- a/src/misc/vec/vecFlt.h
+++ b/src/misc/vec/vecFlt.h
@@ -570,7 +570,7 @@ static inline int Vec_FltRemove( Vec_Flt_t * p, float Entry )
SeeAlso []
***********************************************************************/
-static inline int Vec_FltSortCompare1( float * pp1, float * pp2 )
+static int Vec_FltSortCompare1( float * pp1, float * pp2 )
{
// for some reason commenting out lines (as shown) led to crashing of the release version
if ( *pp1 < *pp2 )
@@ -591,7 +591,7 @@ static inline int Vec_FltSortCompare1( float * pp1, float * pp2 )
SeeAlso []
***********************************************************************/
-static inline int Vec_FltSortCompare2( float * pp1, float * pp2 )
+static int Vec_FltSortCompare2( float * pp1, float * pp2 )
{
// for some reason commenting out lines (as shown) led to crashing of the release version
if ( *pp1 > *pp2 )
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index 082ebe70..430b7b63 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -667,7 +667,7 @@ static inline int Vec_IntRemove( Vec_Int_t * p, int Entry )
SeeAlso []
***********************************************************************/
-static inline int Vec_IntSortCompare1( int * pp1, int * pp2 )
+static int Vec_IntSortCompare1( int * pp1, int * pp2 )
{
// for some reason commenting out lines (as shown) led to crashing of the release version
if ( *pp1 < *pp2 )
@@ -688,7 +688,7 @@ static inline int Vec_IntSortCompare1( int * pp1, int * pp2 )
SeeAlso []
***********************************************************************/
-static inline int Vec_IntSortCompare2( int * pp1, int * pp2 )
+static int Vec_IntSortCompare2( int * pp1, int * pp2 )
{
// for some reason commenting out lines (as shown) led to crashing of the release version
if ( *pp1 > *pp2 )
@@ -731,7 +731,7 @@ static inline void Vec_IntSort( Vec_Int_t * p, int fReverse )
SeeAlso []
***********************************************************************/
-static inline int Vec_IntSortCompareUnsigned( unsigned * pp1, unsigned * pp2 )
+static int Vec_IntSortCompareUnsigned( unsigned * pp1, unsigned * pp2 )
{
if ( *pp1 < *pp2 )
return -1;
diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h
index df06168c..27643043 100644
--- a/src/misc/vec/vecPtr.h
+++ b/src/misc/vec/vecPtr.h
@@ -625,7 +625,7 @@ static inline void Vec_PtrReorder( Vec_Ptr_t * p, int nItems )
SeeAlso []
***********************************************************************/
-static inline void Vec_PtrSort( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() )
+static void Vec_PtrSort( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() )
{
if ( p->nSize < 2 )
return;
@@ -644,7 +644,7 @@ static inline void Vec_PtrSort( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() )
SeeAlso []
***********************************************************************/
-static inline void Vec_PtrUniqify( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() )
+static void Vec_PtrUniqify( Vec_Ptr_t * p, int (*Vec_PtrSortCompare)() )
{
int i, k;
if ( p->nSize < 2 )
diff --git a/src/misc/vec/vecStr.h b/src/misc/vec/vecStr.h
index 47367bc6..863be8bb 100644
--- a/src/misc/vec/vecStr.h
+++ b/src/misc/vec/vecStr.h
@@ -523,7 +523,7 @@ static inline char Vec_StrPop( Vec_Str_t * p )
SeeAlso []
***********************************************************************/
-static inline int Vec_StrSortCompare1( char * pp1, char * pp2 )
+static int Vec_StrSortCompare1( char * pp1, char * pp2 )
{
// for some reason commenting out lines (as shown) led to crashing of the release version
if ( *pp1 < *pp2 )
@@ -544,7 +544,7 @@ static inline int Vec_StrSortCompare1( char * pp1, char * pp2 )
SeeAlso []
***********************************************************************/
-static inline int Vec_StrSortCompare2( char * pp1, char * pp2 )
+static int Vec_StrSortCompare2( char * pp1, char * pp2 )
{
// for some reason commenting out lines (as shown) led to crashing of the release version
if ( *pp1 > *pp2 )
diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h
index 13880c21..0557e9c0 100644
--- a/src/misc/vec/vecVec.h
+++ b/src/misc/vec/vecVec.h
@@ -340,7 +340,7 @@ static inline void Vec_VecPushUnique( Vec_Vec_t * p, int Level, void * Entry )
SeeAlso []
***********************************************************************/
-static inline int Vec_VecSortCompare1( Vec_Ptr_t ** pp1, Vec_Ptr_t ** pp2 )
+static int Vec_VecSortCompare1( Vec_Ptr_t ** pp1, Vec_Ptr_t ** pp2 )
{
if ( Vec_PtrSize(*pp1) < Vec_PtrSize(*pp2) )
return -1;
@@ -360,7 +360,7 @@ static inline int Vec_VecSortCompare1( Vec_Ptr_t ** pp1, Vec_Ptr_t ** pp2 )
SeeAlso []
***********************************************************************/
-static inline int Vec_VecSortCompare2( Vec_Ptr_t ** pp1, Vec_Ptr_t ** pp2 )
+static int Vec_VecSortCompare2( Vec_Ptr_t ** pp1, Vec_Ptr_t ** pp2 )
{
if ( Vec_PtrSize(*pp1) > Vec_PtrSize(*pp2) )
return -1;