Browse Source

get rid of a few warnings

pull/1024/head
pionere 5 years ago committed by Anders Jenbo
parent
commit
d5a0fa8e85
  1. 2
      3rdParty/Storm/Source/storm.h
  2. 2
      Source/automap.cpp
  3. 2
      Source/encrypt.cpp
  4. 2
      Source/encrypt.h
  5. 6
      Source/engine.cpp
  6. 4
      Source/engine.h
  7. 3
      Source/gendung.cpp
  8. 3
      Source/gmenu.cpp
  9. 6
      Source/interfac.cpp
  10. 1
      Source/mpqapi.cpp
  11. 7
      Source/msg.cpp
  12. 7
      Source/multi.cpp
  13. 2
      Source/nthread.cpp
  14. 2
      Source/render.cpp
  15. 6
      Source/scrollrt.cpp
  16. 4
      Source/sha.cpp
  17. 58
      Source/stores.cpp
  18. 2
      SourceX/dvlnet/abstract_net.h
  19. 2
      SourceX/dvlnet/base.cpp
  20. 2
      SourceX/dvlnet/base.h
  21. 4
      SourceX/dvlnet/cdwrap.h
  22. 2
      SourceX/dvlnet/loopback.cpp
  23. 2
      SourceX/dvlnet/loopback.h
  24. 2
      SourceX/storm/storm_net.cpp

2
3rdParty/Storm/Source/storm.h vendored

@ -109,7 +109,7 @@ SNetGetGameInfo(
BOOL BOOL
STORMAPI STORMAPI
SNetGetTurnsInTransit( SNetGetTurnsInTransit(
int *turns); DWORD *turns);
// Network provider structures // Network provider structures
typedef struct _client_info typedef struct _client_info

2
Source/automap.cpp

@ -72,7 +72,7 @@ void InitAutomap()
DWORD dwTiles; DWORD dwTiles;
int x, y; int x, y;
BYTE *pAFile, *pTmp; BYTE *pAFile, *pTmp;
int i; DWORD i;
memset(automaptype, 0, sizeof(automaptype)); memset(automaptype, 0, sizeof(automaptype));

2
Source/encrypt.cpp

@ -104,7 +104,7 @@ static void PkwareBufferWrite(char *buf, unsigned int *size, void *param)
pInfo->destOffset += *size; pInfo->destOffset += *size;
} }
int PkwareCompress(BYTE *srcData, int size) DWORD PkwareCompress(BYTE *srcData, DWORD size)
{ {
BYTE *destData; BYTE *destData;
char *ptr; char *ptr;

2
Source/encrypt.h

@ -24,7 +24,7 @@ void Decrypt(DWORD *castBlock, DWORD size, DWORD key);
void Encrypt(DWORD *castBlock, DWORD size, DWORD key); void Encrypt(DWORD *castBlock, DWORD size, DWORD key);
DWORD Hash(const char *s, int type); DWORD Hash(const char *s, int type);
void InitHash(); void InitHash();
int PkwareCompress(BYTE *srcData, int size); DWORD PkwareCompress(BYTE *srcData, DWORD size);
void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes); void PkwareDecompress(BYTE *pbInBuff, int recv_size, int dwMaxBytes);
#ifdef __cplusplus #ifdef __cplusplus

6
Source/engine.cpp

@ -616,7 +616,7 @@ void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel,
* @param nCel CEL frame number * @param nCel CEL frame number
* @param nWidth Width of sprite * @param nWidth Width of sprite
*/ */
void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) void CelBlitOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
{ {
int nDataSize, w; int nDataSize, w;
BYTE *src, *dst, *end; BYTE *src, *dst, *end;
@ -1055,7 +1055,7 @@ static void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi
* @param nWidth Width of sprite * @param nWidth Width of sprite
* @param col Color index from current palette * @param col Color index from current palette
*/ */
static void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col) static void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE col)
{ {
int w; int w;
char width; char width;
@ -1246,7 +1246,7 @@ void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
* @param nCel CL2 frame number * @param nCel CL2 frame number
* @param nWidth Width of sprite * @param nWidth Width of sprite
*/ */
void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) void Cl2DrawOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
{ {
int nDataSize; int nDataSize;
BYTE *pRLEBytes; BYTE *pRLEBytes;

4
Source/engine.h

@ -61,7 +61,7 @@ void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *tbl); void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *tbl);
void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light); void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light);
void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth); void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, int nWidth);
void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void CelBlitOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void ENG_set_pixel(int sx, int sy, BYTE col); void ENG_set_pixel(int sx, int sy, BYTE col);
void engine_draw_pixel(int sx, int sy); void engine_draw_pixel(int sx, int sy);
void DrawLine(int x0, int y0, int x1, int y1, BYTE col); void DrawLine(int x0, int y0, int x1, int y1, BYTE col);
@ -77,7 +77,7 @@ BYTE *LoadFileInMem(const char *pszName, DWORD *pdwFileLen);
DWORD LoadFileWithMem(const char *pszName, BYTE *p); DWORD LoadFileWithMem(const char *pszName, BYTE *p);
void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel); void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel);
void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void Cl2DrawOutline(BYTE col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light); void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, char light);
void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth); void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void PlayInGameMovie(const char *pszMovie); void PlayInGameMovie(const char *pszMovie);

3
Source/gendung.cpp

@ -156,9 +156,8 @@ THEME_LOC themeLoc[MAXTHEMES];
void FillSolidBlockTbls() void FillSolidBlockTbls()
{ {
BYTE bv; BYTE bv;
DWORD dwTiles; DWORD i, dwTiles;
BYTE *pSBFile, *pTmp; BYTE *pSBFile, *pTmp;
int i;
memset(nBlockTable, 0, sizeof(nBlockTable)); memset(nBlockTable, 0, sizeof(nBlockTable));
memset(nSolidTable, 0, sizeof(nSolidTable)); memset(nSolidTable, 0, sizeof(nSolidTable));

3
Source/gmenu.cpp

@ -332,8 +332,7 @@ BOOL gmenu_on_mouse_move()
BOOL gmenu_left_mouse(BOOL isDown) BOOL gmenu_left_mouse(BOOL isDown)
{ {
TMenuItem *pItem; TMenuItem *pItem;
DWORD i, w; int i, w, dummy;
int dummy;
if (!isDown) { if (!isDown) {
if (mouseNavigation) { if (mouseNavigation) {

6
Source/interfac.cpp

@ -8,7 +8,7 @@
DEVILUTION_BEGIN_NAMESPACE DEVILUTION_BEGIN_NAMESPACE
BYTE *sgpBackCel; BYTE *sgpBackCel;
int sgdwProgress; DWORD sgdwProgress;
int progress_id; int progress_id;
/** The colour used for the progress bar as an index into the palette. */ /** The colour used for the progress bar as an index into the palette. */
@ -277,11 +277,11 @@ BOOL IncProgress()
{ {
interface_msg_pump(); interface_msg_pump();
sgdwProgress += 23; sgdwProgress += 23;
if ((DWORD)sgdwProgress > 534) if (sgdwProgress > 534)
sgdwProgress = 534; sgdwProgress = 534;
if (sgpBackCel) if (sgpBackCel)
DrawCutscene(); DrawCutscene();
return (DWORD)sgdwProgress >= 534; return sgdwProgress >= 534;
} }
void ShowProgress(unsigned int uMsg) void ShowProgress(unsigned int uMsg)

1
Source/mpqapi.cpp

@ -651,7 +651,6 @@ BOOL mpqapi_has_file(const char *pszName)
BOOL OpenMPQ(const char *pszArchive, DWORD dwChar) BOOL OpenMPQ(const char *pszArchive, DWORD dwChar)
{ {
DWORD dwFlagsAndAttributes;
DWORD key; DWORD key;
_FILEHEADER fhdr; _FILEHEADER fhdr;

7
Source/msg.cpp

@ -312,10 +312,11 @@ static void DeltaImportJunk(BYTE *src)
} }
} }
static int msg_comp_level(BYTE *buffer, BYTE *end) static DWORD msg_comp_level(BYTE *buffer, BYTE *end)
{ {
int size = end - buffer - 1; DWORD size = end - buffer - 1;
int pkSize = PkwareCompress(buffer + 1, size); DWORD pkSize = PkwareCompress(buffer + 1, size);
*buffer = size != pkSize; *buffer = size != pkSize;
return pkSize + 1; return pkSize + 1;

7
Source/multi.cpp

@ -17,7 +17,7 @@ WORD sgwPackPlrOffsetTbl[MAX_PLRS];
PkPlayerStruct netplr[MAX_PLRS]; PkPlayerStruct netplr[MAX_PLRS];
BOOLEAN sgbPlayerTurnBitTbl[MAX_PLRS]; BOOLEAN sgbPlayerTurnBitTbl[MAX_PLRS];
BOOLEAN sgbPlayerLeftGameTbl[MAX_PLRS]; BOOLEAN sgbPlayerLeftGameTbl[MAX_PLRS];
int sgbSentThisCycle; DWORD sgbSentThisCycle;
BOOL gbShouldValidatePackage; BOOL gbShouldValidatePackage;
BYTE gbActivePlayers; BYTE gbActivePlayers;
BOOLEAN gbGameDestroyed; BOOLEAN gbGameDestroyed;
@ -77,7 +77,7 @@ static void multi_copy_packet(TBuffer *buf, void *packet, BYTE size)
p[size] = 0; p[size] = 0;
} }
static BYTE *multi_recv_packet(TBuffer *pBuf, BYTE *body, int *size) static BYTE *multi_recv_packet(TBuffer *pBuf, BYTE *body, DWORD *size)
{ {
BYTE *src_ptr; BYTE *src_ptr;
size_t chunk_size; size_t chunk_size;
@ -147,9 +147,8 @@ void NetSendHiPri(BYTE *pbMsg, BYTE bLen)
{ {
BYTE *hipri_body; BYTE *hipri_body;
BYTE *lowpri_body; BYTE *lowpri_body;
DWORD len; DWORD size, len;
TPkt pkt; TPkt pkt;
int size;
if (pbMsg && bLen) { if (pbMsg && bLen) {
multi_copy_packet(&sgHiPriBuf, pbMsg, bLen); multi_copy_packet(&sgHiPriBuf, pbMsg, bLen);

2
Source/nthread.cpp

@ -48,7 +48,7 @@ DWORD nthread_send_and_recv_turn(DWORD cur_turn, int turn_delta)
{ {
DWORD new_cur_turn; DWORD new_cur_turn;
int turn, turn_tmp; int turn, turn_tmp;
int curTurnsInTransit; DWORD curTurnsInTransit;
new_cur_turn = cur_turn; new_cur_turn = cur_turn;
if (!SNetGetTurnsInTransit(&curTurnsInTransit)) { if (!SNetGetTurnsInTransit(&curTurnsInTransit)) {

2
Source/render.cpp

@ -579,7 +579,7 @@ RenderTile(BYTE *pBuff)
*/ */
void world_draw_black_tile(int sx, int sy) void world_draw_black_tile(int sx, int sy)
{ {
int i, j, k; int i, j;
BYTE *dst; BYTE *dst;
if (sx >= SCREEN_X + SCREEN_WIDTH || sy >= SCREEN_Y + VIEWPORT_HEIGHT + TILE_WIDTH / 2) if (sx >= SCREEN_X + SCREEN_WIDTH || sy >= SCREEN_Y + VIEWPORT_HEIGHT + TILE_WIDTH / 2)

6
Source/scrollrt.cpp

@ -142,8 +142,9 @@ static void scrollrt_draw_cursor_back_buffer()
*/ */
static void scrollrt_draw_cursor_item() static void scrollrt_draw_cursor_item()
{ {
int i, mx, my, col; int i, mx, my;
BYTE *src, *dst; BYTE *src, *dst;
BYTE col;
assert(!sgdwCursWdt); assert(!sgdwCursWdt);
@ -1339,7 +1340,6 @@ static void DrawFPS()
{ {
DWORD tc, frames; DWORD tc, frames;
char String[12]; char String[12];
HDC hdc;
if (frameflag && gbActive && pPanelText) { if (frameflag && gbActive && pPanelText) {
frameend++; frameend++;
@ -1392,8 +1392,6 @@ static void DoBlitScreen(DWORD dwX, DWORD dwY, DWORD dwWdt, DWORD dwHgt)
static void DrawMain(int dwHgt, BOOL draw_desc, BOOL draw_hp, BOOL draw_mana, BOOL draw_sbar, BOOL draw_btn) static void DrawMain(int dwHgt, BOOL draw_desc, BOOL draw_hp, BOOL draw_mana, BOOL draw_sbar, BOOL draw_btn)
{ {
int ysize; int ysize;
DWORD dwTicks;
BOOL retry;
ysize = dwHgt; ysize = dwHgt;

4
Source/sha.cpp

@ -109,9 +109,9 @@ static void SHA1ProcessMessageBlock(SHA1Context *context)
context->state[4] += E; context->state[4] += E;
} }
static void SHA1Input(SHA1Context *context, const char *message_array, int len) static void SHA1Input(SHA1Context *context, const char *message_array, DWORD len)
{ {
int i, count; DWORD i, count;
count = context->count[0] + 8 * len; count = context->count[0] + 8 * len;
if (count < context->count[0]) if (count < context->count[0])

58
Source/stores.cpp

@ -2428,37 +2428,37 @@ void HealerBuyItem()
void S_BBuyEnter() void S_BBuyEnter()
{ {
BOOL done; if (stextsel != 10) {
int i;
if (stextsel == 10) {
stextshold = STORE_BBOY;
stextvhold = stextsval;
stextlhold = 10;
int price = boyitem._iIvalue;
if (gbIsHellfire)
price -= boyitem._iIvalue >> 2;
else
price += boyitem._iIvalue >> 1;
if (plr[myplr]._pGold < price) {
StartStore(STORE_NOMONEY);
} else {
plr[myplr].HoldItem = boyitem;
plr[myplr].HoldItem._iIvalue = price;
SetCursor_(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM);
done = FALSE;
for (i = 0; i < NUM_INV_GRID_ELEM && !done; i++) {
done = AutoPlace(myplr, i, cursW / 28, cursH / 28, FALSE);
}
if (done)
StartStore(STORE_CONFIRM);
else
StartStore(STORE_NOROOM);
SetCursor_(CURSOR_HAND);
}
} else {
stextflag = STORE_NONE; stextflag = STORE_NONE;
return;
} }
stextshold = STORE_BBOY;
stextvhold = stextsval;
stextlhold = 10;
int price = boyitem._iIvalue;
if (gbIsHellfire)
price -= boyitem._iIvalue >> 2;
else
price += boyitem._iIvalue >> 1;
if (plr[myplr]._pGold < price) {
StartStore(STORE_NOMONEY);
return;
}
plr[myplr].HoldItem = boyitem;
plr[myplr].HoldItem._iIvalue = price;
SetCursor_(plr[myplr].HoldItem._iCurs + CURSOR_FIRSTITEM);
bool done = false;
for (int i = 0; i < NUM_INV_GRID_ELEM && !done; i++) {
done = AutoPlace(myplr, i, cursW / 28, cursH / 28, false);
}
StartStore(done ? STORE_CONFIRM : STORE_NOROOM);
SetCursor_(CURSOR_HAND);
} }
void StoryIdItem() void StoryIdItem()

2
SourceX/dvlnet/abstract_net.h

@ -45,7 +45,7 @@ public:
virtual bool SNetLeaveGame(int type) = 0; virtual bool SNetLeaveGame(int type) = 0;
virtual bool SNetDropPlayer(int playerid, DWORD flags) = 0; virtual bool SNetDropPlayer(int playerid, DWORD flags) = 0;
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns) = 0; virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns) = 0;
virtual bool SNetGetTurnsInTransit(int *turns) = 0; virtual bool SNetGetTurnsInTransit(DWORD *turns) = 0;
virtual void setup_gameinfo(buffer_t info) = 0; virtual void setup_gameinfo(buffer_t info) = 0;
virtual ~abstract_net() = default; virtual ~abstract_net() = default;

2
SourceX/dvlnet/base.cpp

@ -249,7 +249,7 @@ bool base::SNetGetOwnerTurnsWaiting(DWORD *turns)
return true; return true;
} }
bool base::SNetGetTurnsInTransit(int *turns) bool base::SNetGetTurnsInTransit(DWORD *turns)
{ {
*turns = turn_queue[plr_self].size(); *turns = turn_queue[plr_self].size();
return true; return true;

2
SourceX/dvlnet/base.h

@ -32,7 +32,7 @@ public:
virtual bool SNetLeaveGame(int type); virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags); virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns); virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns); virtual bool SNetGetTurnsInTransit(DWORD *turns);
virtual void poll() = 0; virtual void poll() = 0;
virtual void send(packet &pkt) = 0; virtual void send(packet &pkt) = 0;

4
SourceX/dvlnet/cdwrap.h

@ -39,7 +39,7 @@ public:
virtual bool SNetLeaveGame(int type); virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags); virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns); virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns); virtual bool SNetGetTurnsInTransit(DWORD *turns);
virtual void setup_gameinfo(buffer_t info); virtual void setup_gameinfo(buffer_t info);
virtual ~cdwrap() = default; virtual ~cdwrap() = default;
@ -146,7 +146,7 @@ bool cdwrap<T>::SNetGetOwnerTurnsWaiting(DWORD *turns)
} }
template <class T> template <class T>
bool cdwrap<T>::SNetGetTurnsInTransit(int *turns) bool cdwrap<T>::SNetGetTurnsInTransit(DWORD *turns)
{ {
return dvlnet_wrap->SNetGetTurnsInTransit(turns); return dvlnet_wrap->SNetGetTurnsInTransit(turns);
} }

2
SourceX/dvlnet/loopback.cpp

@ -99,7 +99,7 @@ bool loopback::SNetGetOwnerTurnsWaiting(DWORD *turns)
return true; return true;
} }
bool loopback::SNetGetTurnsInTransit(int *turns) bool loopback::SNetGetTurnsInTransit(DWORD *turns)
{ {
*turns = 0; *turns = 0;
return true; return true;

2
SourceX/dvlnet/loopback.h

@ -37,7 +37,7 @@ public:
virtual bool SNetLeaveGame(int type); virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags); virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns); virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns); virtual bool SNetGetTurnsInTransit(DWORD *turns);
virtual void setup_gameinfo(buffer_t info); virtual void setup_gameinfo(buffer_t info);
}; };

2
SourceX/storm/storm_net.cpp

@ -143,7 +143,7 @@ BOOL SNetGetOwnerTurnsWaiting(DWORD *turns)
return dvlnet_inst->SNetGetOwnerTurnsWaiting(turns); return dvlnet_inst->SNetGetOwnerTurnsWaiting(turns);
} }
BOOL SNetGetTurnsInTransit(int *turns) BOOL SNetGetTurnsInTransit(DWORD *turns)
{ {
return dvlnet_inst->SNetGetTurnsInTransit(turns); return dvlnet_inst->SNetGetTurnsInTransit(turns);
} }

Loading…
Cancel
Save