1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Fix more warnings, disable others

This commit is contained in:
Ted John
2017-01-12 13:00:04 +00:00
parent bd732b99c7
commit ca9c3cc5ee
7 changed files with 14 additions and 25 deletions

View File

@@ -29,11 +29,14 @@
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4091;4100;4201;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<DisableSpecificWarnings>4091;4100;4201;4204;4206;4221;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<!-- Warnings:
C4091: 'keyword': ignored on left of 'type' when no variable is declared
C4100: 'identifier': unreferenced formal parameter
C4201: nonstandard extension used: nameless struct/union
C4204: nonstandard extension used: non-constant aggregate initializer
C4206: nonstandard extension used: translation unit is empty
C4221: nonstandard extension used: 'identifier': cannot be initialized using address of automatic variable 'identifier'
C4244: 'conversion_type': conversion from 'type1' to 'type2', possible loss of data
C4245: 'conversion_type': conversion from 'type1' to 'type2', signed/unsigned mismatch
-->

View File

@@ -14,6 +14,8 @@
*****************************************************************************/
#pragma endregion
#pragma warning(disable : 4611) // interaction between '_setjmp' and C++ object destruction is non-portable
#include <png.h>
#include "core/Exception.hpp"
#include "core/FileStream.hpp"

View File

@@ -222,7 +222,7 @@ namespace String
{
// Try again with bigger buffer
buffer = Memory::Reallocate<utf8>(buffer, bufferSize);
int len = vsnprintf(buffer, bufferSize, format, args);
len = vsnprintf(buffer, bufferSize, format, args);
if (len < 0)
{
Memory::Free(buffer);

View File

@@ -14,6 +14,8 @@
*****************************************************************************/
#pragma endregion
#pragma warning(disable : 4127) // conditional expression is constant
extern "C"
{
#include "drawing.h"

View File

@@ -73,26 +73,6 @@ bool gfx_load_g1()
if (file != NULL) {
rct_g1_header header;
if (SDL_RWread(file, &header, 8, 1) == 1) {
/* We need to load in the data file, which has an `offset` field,
* which is supposed to hold a pointer, but is only 32 bit long.
* We will load a 32 bit version of rct_g1_element and then convert
* pointers to however long our machine wants them.
*/
#pragma pack(push, 1)
// Size: 0x10
typedef struct {
uint32 offset; // 0x00 note: uint32 always!
sint16 width; // 0x04
sint16 height; // 0x06
sint16 x_offset; // 0x08
sint16 y_offset; // 0x0A
uint16 flags; // 0x0C
uint16 zoomed_offset; // 0x0E
} rct_g1_element_32bit;
assert_struct_size(rct_g1_element_32bit, 0x10);
#pragma pack(pop)
/* number of elements is stored in g1.dat, but because the entry
* headers are static, this can't be variable until made into a
* dynamic array.
@@ -547,8 +527,8 @@ void FASTCALL gfx_draw_sprite_raw_masked_software(rct_drawpixelinfo *dpi, int x,
int maskWrap = imgMask->width - width;
int colourWrap = imgColour->width - width;
int dstWrap = ((dpi->width + dpi->pitch) - width);
for (int y = top; y < bottom; y++) {
for (int x = left; x < right; x++) {
for (int yy = top; yy < bottom; yy++) {
for (int xx = left; xx < right; xx++) {
uint8 colour = (*colourSrc) & (*maskSrc);
if (colour != 0) {
*dst = colour;

View File

@@ -181,7 +181,7 @@ int gfx_wrap_string(utf8 *text, int width, int *outNumLines, int *outFontHeight)
utf8 *currentWord = NULL;
// Width of line up to current word
int currentWidth;
int currentWidth = 0;
utf8 *ch = text;
utf8 *firstCh = text;

View File

@@ -14,6 +14,8 @@
*****************************************************************************/
#pragma endregion
#pragma warning(disable : 4706) // assignment within conditional expression
#include <vector>
#include <jansson.h>