Skip to content

Commit 517d20b

Browse files
committed
clean up msvc warning suppression
removed C4341 (doesn't exist) removed C4018 (signed/unsigned mismatch in compare) with violating code corrected removed C4482 (doesn't exist) removed C4231 (doesn't exist) for the four remaining, revised editorial comments
1 parent e7b9309 commit 517d20b

3 files changed

Lines changed: 6 additions & 30 deletions

File tree

library/include/Pragma.h

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,14 @@ distribution.
2727
#ifndef DFHACK_TRANQUILITY
2828
#define DFHACK_TRANQUILITY
2929

30-
// This is here to keep MSVC from spamming the build output with nonsense
31-
// Call it public domain.
32-
3330
#ifdef _MSC_VER
34-
// don't spew nonsense
31+
// don't generate warnings because we're lazy about how we do exports
3532
#pragma warning( disable: 4251 )
36-
// don't display bogus 'deprecation' and 'unsafe' warnings.
37-
// See the idiocy: http://msdn.microsoft.com/en-us/magazine/cc163794.aspx
38-
#define _CRT_SECURE_NO_DEPRECATE
39-
#define _SCL_SECURE_NO_DEPRECATE
40-
#pragma warning( disable: 4996 )
41-
// Let me demonstrate:
42-
/**
43-
* [peterix@peterix dfhack]$ man wcscpy_s
44-
* No manual entry for wcscpy_s
45-
*
46-
* Proprietary extensions.
47-
*/
48-
// disable stupid
49-
#pragma warning( disable: 4800 )
50-
// disable more stupid
33+
// do not issue warning for unknown pragmas (equivalent to gcc -Wno-unknown-pragmas)
5134
#pragma warning( disable: 4068 )
52-
// no signed value outside enum range bs
53-
#pragma warning( disable: 4341)
54-
// just shut up already.
35+
// disable warnings regarding narrowing conversions (equivalent to gcc -Wno-conversion)
5536
#pragma warning( disable: 4244)
56-
#pragma warning( disable: 4018)
57-
// nonstandard extension used: enum 'df::whatever::etc' used in qualified name
58-
#pragma warning( disable: 4482)
59-
// nonstandard extension used: 'extern' before template explicit instantiation
60-
#pragma warning( disable: 4231)
61-
// ignore warnings about putting a vector index into an int
37+
// disable warnings regarding narrowing conversions of size_t
6238
#pragma warning( disable: 4267)
6339
#endif
6440

plugins/plant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ command_result df_createplant(color_ostream &out, const df::coord &pos, const pl
150150

151151
auto des = Maps::getTileDesignation(pos);
152152
CHECK_NULL_POINTER(des);
153-
if (des->bits.flow_size > (des->bits.liquid_type == tile_liquid::Magma ? 0 : 3))
153+
if (des->bits.flow_size > (des->bits.liquid_type == tile_liquid::Magma ? 0U : 3U))
154154
{
155155
out.printerr("Can't create plant: Too much liquid!\n");
156156
return CR_FAILURE;

plugins/regrass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static bool valid_tile(color_ostream &out, regrass_options options, df::map_bloc
9292
TRACE(log, out).print("Invalid tile: Tree\n");
9393
return false; // Not ground tile.
9494
}
95-
else if (des.bits.flow_size > (des.bits.liquid_type == tile_liquid::Magma ? 0 : 3))
95+
else if (des.bits.flow_size > (des.bits.liquid_type == tile_liquid::Magma ? 0U : 3U))
9696
{ // Under water/magma (df::plant_raw::shrub_drown_level is usually 4).
9797
TRACE(log, out).print("Invalid tile: Liquid\n");
9898
return false;

0 commit comments

Comments
 (0)