Skip to content

Commit

Permalink
clean up msvc warning suppression
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ab9rf committed Sep 16, 2024
1 parent e7b9309 commit 517d20b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
32 changes: 4 additions & 28 deletions library/include/Pragma.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,14 @@ distribution.
#ifndef DFHACK_TRANQUILITY
#define DFHACK_TRANQUILITY

// This is here to keep MSVC from spamming the build output with nonsense
// Call it public domain.

#ifdef _MSC_VER
// don't spew nonsense
// don't generate warnings because we're lazy about how we do exports
#pragma warning( disable: 4251 )
// don't display bogus 'deprecation' and 'unsafe' warnings.
// See the idiocy: http://msdn.microsoft.com/en-us/magazine/cc163794.aspx
#define _CRT_SECURE_NO_DEPRECATE
#define _SCL_SECURE_NO_DEPRECATE
#pragma warning( disable: 4996 )
// Let me demonstrate:
/**
* [peterix@peterix dfhack]$ man wcscpy_s
* No manual entry for wcscpy_s
*
* Proprietary extensions.
*/
// disable stupid
#pragma warning( disable: 4800 )
// disable more stupid
// do not issue warning for unknown pragmas (equivalent to gcc -Wno-unknown-pragmas)
#pragma warning( disable: 4068 )
// no signed value outside enum range bs
#pragma warning( disable: 4341)
// just shut up already.
// disable warnings regarding narrowing conversions (equivalent to gcc -Wno-conversion)
#pragma warning( disable: 4244)
#pragma warning( disable: 4018)
// nonstandard extension used: enum 'df::whatever::etc' used in qualified name
#pragma warning( disable: 4482)
// nonstandard extension used: 'extern' before template explicit instantiation
#pragma warning( disable: 4231)
// ignore warnings about putting a vector index into an int
// disable warnings regarding narrowing conversions of size_t
#pragma warning( disable: 4267)
#endif

Expand Down
2 changes: 1 addition & 1 deletion plugins/plant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ command_result df_createplant(color_ostream &out, const df::coord &pos, const pl

auto des = Maps::getTileDesignation(pos);
CHECK_NULL_POINTER(des);
if (des->bits.flow_size > (des->bits.liquid_type == tile_liquid::Magma ? 0 : 3))
if (des->bits.flow_size > (des->bits.liquid_type == tile_liquid::Magma ? 0U : 3U))
{
out.printerr("Can't create plant: Too much liquid!\n");
return CR_FAILURE;
Expand Down
2 changes: 1 addition & 1 deletion plugins/regrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static bool valid_tile(color_ostream &out, regrass_options options, df::map_bloc
TRACE(log, out).print("Invalid tile: Tree\n");
return false; // Not ground tile.
}
else if (des.bits.flow_size > (des.bits.liquid_type == tile_liquid::Magma ? 0 : 3))
else if (des.bits.flow_size > (des.bits.liquid_type == tile_liquid::Magma ? 0U : 3U))
{ // Under water/magma (df::plant_raw::shrub_drown_level is usually 4).
TRACE(log, out).print("Invalid tile: Liquid\n");
return false;
Expand Down

0 comments on commit 517d20b

Please sign in to comment.