diff --git a/library/include/Pragma.h b/library/include/Pragma.h index 00472e7329..2dd5132b19 100644 --- a/library/include/Pragma.h +++ b/library/include/Pragma.h @@ -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 diff --git a/plugins/plant.cpp b/plugins/plant.cpp index a0b2525d96..4f7ca00f73 100644 --- a/plugins/plant.cpp +++ b/plugins/plant.cpp @@ -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; diff --git a/plugins/regrass.cpp b/plugins/regrass.cpp index d9f858bf7e..dd4ec9788c 100644 --- a/plugins/regrass.cpp +++ b/plugins/regrass.cpp @@ -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;