summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/aig/miniaig/ndr.h10
-rw-r--r--src/misc/vec/vecSet.h8
-rw-r--r--src/sat/bsat/satClause.h6
3 files changed, 12 insertions, 12 deletions
diff --git a/src/aig/miniaig/ndr.h b/src/aig/miniaig/ndr.h
index 4450d22c..9e85c870 100644
--- a/src/aig/miniaig/ndr.h
+++ b/src/aig/miniaig/ndr.h
@@ -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 );
}
diff --git a/src/misc/vec/vecSet.h b/src/misc/vec/vecSet.h
index ac3dd95c..e2ae337f 100644
--- a/src/misc/vec/vecSet.h
+++ b/src/misc/vec/vecSet.h
@@ -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;
}
diff --git a/src/sat/bsat/satClause.h b/src/sat/bsat/satClause.h
index a4b6200c..3a6afa20 100644
--- a/src/sat/bsat/satClause.h
+++ b/src/sat/bsat/satClause.h
@@ -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 );
}