mirror of https://github.com/YosysHQ/abc.git
Compiler warnings.
This commit is contained in:
parent
16ac046679
commit
534ebbc7e5
|
|
@ -220,7 +220,7 @@ static inline void Ndr_DataPushString( Ndr_Data_t * p, int Type, char * pFunc )
|
|||
{
|
||||
if ( !pFunc )
|
||||
return;
|
||||
Ndr_DataPushArray( p, Type, (strlen(pFunc) + 4) / 4, (int *)pFunc );
|
||||
Ndr_DataPushArray( p, Type, ((int)strlen(pFunc) + 4) / 4, (int *)pFunc );
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -457,8 +457,8 @@ static inline void * Ndr_ModuleRead( char * pFileName )
|
|||
p->nSize = p->nCap = nFileSize / 5;
|
||||
p->pHead = malloc( p->nCap );
|
||||
p->pBody = malloc( p->nCap * 4 );
|
||||
RetValue = fread( p->pBody, 4, p->nCap, pFile );
|
||||
RetValue = fread( p->pHead, 1, p->nCap, pFile );
|
||||
RetValue = (int)fread( p->pBody, 4, p->nCap, pFile );
|
||||
RetValue = (int)fread( p->pHead, 1, p->nCap, pFile );
|
||||
assert( p->nSize == (int)p->pBody[0] );
|
||||
fclose( pFile );
|
||||
return p;
|
||||
|
|
@ -468,8 +468,8 @@ static inline void Ndr_ModuleWrite( char * pFileName, void * pModule )
|
|||
Ndr_Data_t * p = (Ndr_Data_t *)pModule; int RetValue;
|
||||
FILE * pFile = fopen( pFileName, "wb" );
|
||||
if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ); return; }
|
||||
RetValue = fwrite( p->pBody, 4, p->pBody[0], pFile );
|
||||
RetValue = fwrite( p->pHead, 1, p->pBody[0], pFile );
|
||||
RetValue = (int)fwrite( p->pBody, 4, p->pBody[0], pFile );
|
||||
RetValue = (int)fwrite( p->pHead, 1, p->pBody[0], pFile );
|
||||
fclose( pFile );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ static inline void Vec_SetAlloc_( Vec_Set_t * p, int nPageSize )
|
|||
p->uPageMask = (unsigned)((1 << nPageSize) - 1);
|
||||
p->nPagesAlloc = 256;
|
||||
p->pPages = ABC_CALLOC( word *, p->nPagesAlloc );
|
||||
p->pPages[0] = ABC_ALLOC( word, (1 << p->nPageSize) );
|
||||
p->pPages[0] = ABC_ALLOC( word, (int)(((word)1) << p->nPageSize) );
|
||||
p->pPages[0][0] = ~0;
|
||||
p->pPages[0][1] = ~0;
|
||||
Vec_SetWriteLimit( p->pPages[0], 2 );
|
||||
|
|
@ -195,7 +195,7 @@ static inline double Vec_ReportMemory( Vec_Set_t * p )
|
|||
{
|
||||
double Mem = sizeof(Vec_Set_t);
|
||||
Mem += p->nPagesAlloc * sizeof(void *);
|
||||
Mem += sizeof(word) * (1 << p->nPageSize) * (1 + p->iPage);
|
||||
Mem += sizeof(word) * (int)(((word)1) << p->nPageSize) * (1 + p->iPage);
|
||||
return Mem;
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ static inline int Vec_SetAppend( Vec_Set_t * p, int * pArray, int nSize )
|
|||
p->nPagesAlloc *= 2;
|
||||
}
|
||||
if ( p->pPages[p->iPage] == NULL )
|
||||
p->pPages[p->iPage] = ABC_ALLOC( word, (1 << p->nPageSize) );
|
||||
p->pPages[p->iPage] = ABC_ALLOC( word, (int)(((word)1) << p->nPageSize) );
|
||||
Vec_SetWriteLimit( p->pPages[p->iPage], 2 );
|
||||
p->pPages[p->iPage][1] = ~0;
|
||||
}
|
||||
|
|
@ -252,7 +252,7 @@ static inline void * Vec_SetFetch( Vec_Set_t * p, int nBytes )
|
|||
}
|
||||
static inline char * Vec_SetStrsav( Vec_Set_t * p, char * pName )
|
||||
{
|
||||
char * pStr = (char *)Vec_SetFetch( p, strlen(pName) + 1 );
|
||||
char * pStr = (char *)Vec_SetFetch( p, (int)strlen(pName) + 1 );
|
||||
strcpy( pStr, pName );
|
||||
return pStr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ static inline void Sat_MemAlloc_( Sat_Mem_t * p, int nPageSize )
|
|||
p->uPageMask = (unsigned)((1 << nPageSize) - 1);
|
||||
p->nPagesAlloc = 256;
|
||||
p->pPages = ABC_CALLOC( int *, p->nPagesAlloc );
|
||||
p->pPages[0] = ABC_ALLOC( int, (int)(1 << p->nPageSize) );
|
||||
p->pPages[1] = ABC_ALLOC( int, (int)(1 << p->nPageSize) );
|
||||
p->pPages[0] = ABC_ALLOC( int, (int)(((word)1) << p->nPageSize) );
|
||||
p->pPages[1] = ABC_ALLOC( int, (int)(((word)1) << p->nPageSize) );
|
||||
p->iPage[0] = 0;
|
||||
p->iPage[1] = 1;
|
||||
Sat_MemWriteLimit( p->pPages[0], 2 );
|
||||
|
|
@ -315,7 +315,7 @@ static inline int Sat_MemAppend( Sat_Mem_t * p, int * pArray, int nSize, int lrn
|
|||
p->nPagesAlloc *= 2;
|
||||
}
|
||||
if ( p->pPages[p->iPage[lrn]] == NULL )
|
||||
p->pPages[p->iPage[lrn]] = ABC_ALLOC( int, (int)(1 << p->nPageSize) );
|
||||
p->pPages[p->iPage[lrn]] = ABC_ALLOC( int, (int)(((word)1) << p->nPageSize) );
|
||||
pPage = p->pPages[p->iPage[lrn]];
|
||||
Sat_MemWriteLimit( pPage, 2 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue