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{ namespace NStream{
CInByte::CInByte(UINT32 aBufferSize): CInByte::CInByte(UINT32 aBufferSize):
m_BufferSize(aBufferSize), m_BufferBase(0),
m_BufferBase(0) m_BufferSize(aBufferSize)
{ {
m_BufferBase = new BYTE[m_BufferSize]; 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 { namespace NLength {
const int kNumPosStatesBitsMax = 4; const UINT32 kNumPosStatesBitsMax = 4;
const int kNumPosStatesMax = (1 << kNumPosStatesBitsMax); const int kNumPosStatesMax = (1 << kNumPosStatesBitsMax);

View File

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

View File

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

View File

@@ -23,6 +23,9 @@
#include "SDL_thread.h" #include "SDL_thread.h"
#include <sys/time.h>
#include <time.h>
typedef unsigned char BYTE; typedef unsigned char BYTE;
typedef unsigned short WORD; typedef unsigned short WORD;
typedef unsigned long DWORD; 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) BOOL sw_start(int width, int height, int req_depth, int FullScreen)
{ {
unsigned int color32, p; //unsigned int color32, p;
int i; //int i;
Uint32 flags = SDL_DOUBLEBUF | SDL_SWSURFACE; Uint32 flags = SDL_DOUBLEBUF | SDL_SWSURFACE;
DWORD GBitMask; DWORD GBitMask;

View File

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