From 736181aa72adc055d44007aefe5a29f6f1df05e5 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 5 Apr 2019 14:53:53 +0200 Subject: [PATCH] Fix warnings --- Source/town.cpp | 6 +++--- Source/town.h | 6 +++--- Source/wave.cpp | 2 +- Source/wave.h | 2 +- types.h | 9 ++++++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Source/town.cpp b/Source/town.cpp index f0675ab41..99ee1a7d9 100644 --- a/Source/town.cpp +++ b/Source/town.cpp @@ -167,7 +167,7 @@ void __fastcall town_draw_clipped_e_flag(BYTE *pBuff, int x, int y, int sx, int } // 69CF14: using guessed type int level_cel_block; -void __fastcall town_draw_clipped_town(BYTE *pBuff, int x, int y, int sx, int sy, int some_flag) +void __fastcall town_draw_clipped_town(BYTE *pBuff, int x, int y, int sx, int sy, BOOL some_flag) { int mi, px, py; char bv; @@ -354,7 +354,7 @@ void __fastcall town_draw_clipped_e_flag_2(BYTE *pBuff, int x, int y, int a4, in } // 69CF14: using guessed type int level_cel_block; -void __fastcall town_draw_clipped_town_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy, int some_flag) +void __fastcall town_draw_clipped_town_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy, BOOL some_flag) { int mi, px, py; char bv; @@ -544,7 +544,7 @@ void __fastcall town_draw_e_flag(BYTE *pBuff, int x, int y, int a4, int dir, int } // 69CF14: using guessed type int level_cel_block; -void __fastcall town_draw_town_all(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy, int some_flag) +void __fastcall town_draw_town_all(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy, BOOL some_flag) { int mi, px, py; char bv; diff --git a/Source/town.h b/Source/town.h index fb4f268be..83aff6a76 100644 --- a/Source/town.h +++ b/Source/town.h @@ -5,13 +5,13 @@ void __fastcall town_clear_upper_buf(BYTE *pBuff); void __fastcall town_clear_low_buf(BYTE *pBuff); void __fastcall town_draw_clipped_e_flag(BYTE *pBuff, int x, int y, int sx, int sy); -void __fastcall town_draw_clipped_town(BYTE *pBuff, int x, int y, int sx, int sy, int some_flag); +void __fastcall town_draw_clipped_town(BYTE *pBuff, int x, int y, int sx, int sy, BOOL some_flag); void __fastcall town_draw_lower(int x, int y, int sx, int sy, int a5, int some_flag); void __fastcall town_draw_clipped_e_flag_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy); -void __fastcall town_draw_clipped_town_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy, int some_flag); +void __fastcall town_draw_clipped_town_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy, BOOL some_flag); void __fastcall town_draw_lower_2(int x, int y, int sx, int sy, int a5, int a6, int some_flag); void __fastcall town_draw_e_flag(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy); -void __fastcall town_draw_town_all(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy, int some_flag); +void __fastcall town_draw_town_all(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy, BOOL some_flag); void __fastcall town_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag); void __fastcall T_DrawGame(int x, int y); void __fastcall T_DrawZoom(int x, int y); diff --git a/Source/wave.cpp b/Source/wave.cpp index 146600a31..55ddb524e 100644 --- a/Source/wave.cpp +++ b/Source/wave.cpp @@ -173,7 +173,7 @@ void __fastcall FillMemFile(MEMFILE *pMemFile) pMemFile->bytes_to_read = to_read; } -int __fastcall SeekMemFile(MEMFILE *pMemFile, LONG lDist, DWORD dwMethod) +int __fastcall SeekMemFile(MEMFILE *pMemFile, ULONG lDist, DWORD dwMethod) { if (lDist < pMemFile->bytes_to_read) { pMemFile->bytes_to_read -= lDist; diff --git a/Source/wave.h b/Source/wave.h index c5f93aeee..b38e04d78 100644 --- a/Source/wave.h +++ b/Source/wave.h @@ -14,7 +14,7 @@ void __fastcall FreeMemFile(MEMFILE *pMemFile); BOOL __fastcall ReadWaveFile(MEMFILE *pMemFile, WAVEFORMATEX *pwfx, CKINFO *chunk); BOOL __fastcall ReadMemFile(MEMFILE *pMemFile, void *lpBuf, size_t length); void __fastcall FillMemFile(MEMFILE *pMemFile); -int __fastcall SeekMemFile(MEMFILE *pMemFile, LONG lDist, DWORD dwMethod); +int __fastcall SeekMemFile(MEMFILE *pMemFile, ULONG lDist, DWORD dwMethod); BOOL __fastcall ReadWaveSection(MEMFILE *pMemFile, DWORD id, CKINFO *chunk); BYTE *__fastcall LoadWaveFile(HANDLE hsFile, WAVEFORMATEX *pwfx, CKINFO *chunk); diff --git a/types.h b/types.h index 17f527627..c427ce332 100644 --- a/types.h +++ b/types.h @@ -26,9 +26,16 @@ // tell Visual C++ to shut the hell up #ifdef _MSC_VER +#pragma warning(disable : 4305) // truncation of int +#pragma warning(disable : 4018) // signed/unsigned mismatch +#pragma warning(disable : 4700) // used without having been initialized #pragma warning(disable : 4244) // conversion loss -#pragma warning(disable : 4800) // bool perf +#pragma warning(disable : 4146) // negative unsigned #pragma warning(disable : 4996) // deprecation warning +#pragma warning(disable : 4309) // VC2017: truncation of constant value +#pragma warning(disable : 4267) // VC2017: conversion from 'size_t' to 'char' +#pragma warning(disable : 4302) // VC2017: type cast truncation +#pragma warning(disable : 4334) // VC2017: result of 32-bit shift implicitly converted to 64 bits #endif #include "defs.h"