Commit 534ebbc7 by Alan Mishchenko

Compiler warnings.

parent 16ac0466
...@@ -220,7 +220,7 @@ static inline void Ndr_DataPushString( Ndr_Data_t * p, int Type, char * pFunc ) ...@@ -220,7 +220,7 @@ static inline void Ndr_DataPushString( Ndr_Data_t * p, int Type, char * pFunc )
{ {
if ( !pFunc ) if ( !pFunc )
return; 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 ) ...@@ -457,8 +457,8 @@ static inline void * Ndr_ModuleRead( char * pFileName )
p->nSize = p->nCap = nFileSize / 5; p->nSize = p->nCap = nFileSize / 5;
p->pHead = malloc( p->nCap ); p->pHead = malloc( p->nCap );
p->pBody = malloc( p->nCap * 4 ); p->pBody = malloc( p->nCap * 4 );
RetValue = fread( p->pBody, 4, p->nCap, pFile ); RetValue = (int)fread( p->pBody, 4, p->nCap, pFile );
RetValue = fread( p->pHead, 1, p->nCap, pFile ); RetValue = (int)fread( p->pHead, 1, p->nCap, pFile );
assert( p->nSize == (int)p->pBody[0] ); assert( p->nSize == (int)p->pBody[0] );
fclose( pFile ); fclose( pFile );
return p; return p;
...@@ -468,8 +468,8 @@ static inline void Ndr_ModuleWrite( char * pFileName, void * pModule ) ...@@ -468,8 +468,8 @@ static inline void Ndr_ModuleWrite( char * pFileName, void * pModule )
Ndr_Data_t * p = (Ndr_Data_t *)pModule; int RetValue; Ndr_Data_t * p = (Ndr_Data_t *)pModule; int RetValue;
FILE * pFile = fopen( pFileName, "wb" ); FILE * pFile = fopen( pFileName, "wb" );
if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ); return; } if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ); return; }
RetValue = fwrite( p->pBody, 4, p->pBody[0], pFile ); RetValue = (int)fwrite( p->pBody, 4, p->pBody[0], pFile );
RetValue = fwrite( p->pHead, 1, p->pBody[0], pFile ); RetValue = (int)fwrite( p->pHead, 1, p->pBody[0], pFile );
fclose( pFile ); fclose( pFile );
} }
......
...@@ -120,7 +120,7 @@ static inline void Vec_SetAlloc_( Vec_Set_t * p, int nPageSize ) ...@@ -120,7 +120,7 @@ static inline void Vec_SetAlloc_( Vec_Set_t * p, int nPageSize )
p->uPageMask = (unsigned)((1 << nPageSize) - 1); p->uPageMask = (unsigned)((1 << nPageSize) - 1);
p->nPagesAlloc = 256; p->nPagesAlloc = 256;
p->pPages = ABC_CALLOC( word *, p->nPagesAlloc ); 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][0] = ~0;
p->pPages[0][1] = ~0; p->pPages[0][1] = ~0;
Vec_SetWriteLimit( p->pPages[0], 2 ); Vec_SetWriteLimit( p->pPages[0], 2 );
...@@ -195,7 +195,7 @@ static inline double Vec_ReportMemory( Vec_Set_t * p ) ...@@ -195,7 +195,7 @@ static inline double Vec_ReportMemory( Vec_Set_t * p )
{ {
double Mem = sizeof(Vec_Set_t); double Mem = sizeof(Vec_Set_t);
Mem += p->nPagesAlloc * sizeof(void *); 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; return Mem;
} }
...@@ -224,7 +224,7 @@ static inline int Vec_SetAppend( Vec_Set_t * p, int * pArray, int nSize ) ...@@ -224,7 +224,7 @@ static inline int Vec_SetAppend( Vec_Set_t * p, int * pArray, int nSize )
p->nPagesAlloc *= 2; p->nPagesAlloc *= 2;
} }
if ( p->pPages[p->iPage] == NULL ) 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 ); Vec_SetWriteLimit( p->pPages[p->iPage], 2 );
p->pPages[p->iPage][1] = ~0; p->pPages[p->iPage][1] = ~0;
} }
...@@ -252,7 +252,7 @@ static inline void * Vec_SetFetch( Vec_Set_t * p, int nBytes ) ...@@ -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 ) 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 ); strcpy( pStr, pName );
return pStr; return pStr;
} }
......
...@@ -199,8 +199,8 @@ static inline void Sat_MemAlloc_( Sat_Mem_t * p, int nPageSize ) ...@@ -199,8 +199,8 @@ static inline void Sat_MemAlloc_( Sat_Mem_t * p, int nPageSize )
p->uPageMask = (unsigned)((1 << nPageSize) - 1); p->uPageMask = (unsigned)((1 << nPageSize) - 1);
p->nPagesAlloc = 256; p->nPagesAlloc = 256;
p->pPages = ABC_CALLOC( int *, p->nPagesAlloc ); p->pPages = ABC_CALLOC( int *, p->nPagesAlloc );
p->pPages[0] = 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)(1 << p->nPageSize) ); p->pPages[1] = ABC_ALLOC( int, (int)(((word)1) << p->nPageSize) );
p->iPage[0] = 0; p->iPage[0] = 0;
p->iPage[1] = 1; p->iPage[1] = 1;
Sat_MemWriteLimit( p->pPages[0], 2 ); 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 ...@@ -315,7 +315,7 @@ static inline int Sat_MemAppend( Sat_Mem_t * p, int * pArray, int nSize, int lrn
p->nPagesAlloc *= 2; p->nPagesAlloc *= 2;
} }
if ( p->pPages[p->iPage[lrn]] == NULL ) 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]]; pPage = p->pPages[p->iPage[lrn]];
Sat_MemWriteLimit( pPage, 2 ); Sat_MemWriteLimit( pPage, 2 );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment