Fix some warnings.

This commit is contained in:
theoddone33
2004-11-21 00:34:57 +00:00
parent 5e8f5351cc
commit f8826ffafc
7 changed files with 17 additions and 14 deletions

View File

@@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
namespace NStream{
CInByte::CInByte(UINT32 aBufferSize):
m_BufferSize(aBufferSize),
m_BufferBase(0)
m_BufferBase(0),
m_BufferSize(aBufferSize)
{
m_BufferBase = new BYTE[m_BufferSize];
}

View File

@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
namespace NLength {
const int kNumPosStatesBitsMax = 4;
const UINT32 kNumPosStatesBitsMax = 4;
const int kNumPosStatesMax = (1 << kNumPosStatesBitsMax);

View File

@@ -62,7 +62,7 @@ protected:
m_State.Init();
m_PreviousByte = 0;
m_PeviousIsMatch = false;
for(int i = 0 ; i < kNumRepDistances; i++)
for(UINT32 i = 0 ; i < kNumRepDistances; i++)
m_RepDistances[i] = 0;
}
};

View File

@@ -105,7 +105,7 @@ HRESULT CDecoder::Init(ISequentialInStream *anInStream,
// m_RepMatchLenDecoder.Init();
for (i = 0; i < kNumLenToPosStates; i++)
for (i = 0; (UINT32) i < kNumLenToPosStates; i++)
m_PosSlotDecoder[i].Init();
for(i = 0; i < kNumPosModels; i++)
@@ -133,7 +133,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream,
bool aPeviousIsMatch = false;
BYTE aPreviousByte = 0;
UINT32 aRepDistances[kNumRepDistances];
for(int i = 0 ; i < kNumRepDistances; i++)
for(UINT32 i = 0 ; i < kNumRepDistances; i++)
aRepDistances[i] = 0;
UINT64 aNowPos64 = 0;
@@ -144,7 +144,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream,
while(aNowPos64 < aNext)
{
UINT32 aPosState = UINT32(aNowPos64) & m_PosStateMask;
if (m_MainChoiceDecoders[aState.m_Index][aPosState].Decode(&m_RangeDecoder) == kMainChoiceLiteralIndex)
if (m_MainChoiceDecoders[aState.m_Index][aPosState].Decode(&m_RangeDecoder) == (UINT32) kMainChoiceLiteralIndex)
{
// aCounts[0]++;
aState.UpdateChar();
@@ -166,7 +166,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream,
aPeviousIsMatch = true;
UINT32 aDistance, aLen;
if(m_MatchChoiceDecoders[aState.m_Index].Decode(&m_RangeDecoder) ==
kMatchChoiceRepetitionIndex)
(UINT32) kMatchChoiceRepetitionIndex)
{
if(m_MatchRepChoiceDecoders[aState.m_Index].Decode(&m_RangeDecoder) == 0)
{
@@ -218,10 +218,10 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream,
aState.UpdateMatch();
UINT32 aPosSlot = m_PosSlotDecoder[GetLenToPosState(aLen)].Decode(&m_RangeDecoder);
// aCounts[aPosSlot]++;
if (aPosSlot >= kStartPosModelIndex)
if (aPosSlot >= (UINT32) kStartPosModelIndex)
{
aDistance = kDistStart[aPosSlot];
if (aPosSlot < kEndPosModelIndex)
if (aPosSlot < (UINT32) kEndPosModelIndex)
aDistance += m_PosDecoders[aPosSlot - kStartPosModelIndex].Decode(&m_RangeDecoder);
else
{

View File

@@ -23,6 +23,9 @@
#include "SDL_thread.h"
#include <sys/time.h>
#include <time.h>
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;

View File

@@ -38,8 +38,8 @@ void UpdateVFrame(void);
BOOL sw_start(int width, int height, int req_depth, int FullScreen)
{
unsigned int color32, p;
int i;
//unsigned int color32, p;
//int i;
Uint32 flags = SDL_DOUBLEBUF | SDL_SWSURFACE;
DWORD GBitMask;

View File

@@ -169,9 +169,9 @@ char *generate_filename(void)
for(i=0;i<10000;i++)
{
#ifdef __LINUX__
sprintf(tmp, "_%04d.png\0", i);
sprintf(tmp, "_%04d.png", i);
#else
sprintf(tmp, " %04d.png\0", i);
sprintf(tmp, " %04d.png", i);
#endif
if(stat(filename, &buf)==-1)
break;