remove need to ignore warnings for dfhack-dependent targets

develop
Myk Taylor 2023-06-25 17:44:06 -07:00
parent 8f413628c2
commit 8f1efcd8a3
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
11 changed files with 27 additions and 24 deletions

@ -377,9 +377,6 @@ if(WIN32)
set_target_properties(dfhack-client PROPERTIES COMPILE_FLAGS "/FI\"Export.h\"" )
else()
set_target_properties(dfhack PROPERTIES COMPILE_FLAGS "-include Export.h" )
# required because of transitively-included protobuf headers
target_compile_options(dfhack
INTERFACE -Wno-deprecated-declarations -Wno-restrict)
set_target_properties(dfhack-client PROPERTIES COMPILE_FLAGS "-include Export.h" )
add_library(dfhooks SHARED Hooks.cpp)
target_link_libraries(dfhooks dfhack)

@ -26,6 +26,7 @@ redistribute it freely, subject to the following restrictions:
#include "Debug.h"
#include "DebugManager.h"
#include <algorithm>
#include <chrono>
#include <iomanip>
#include <thread>

@ -40,8 +40,6 @@ distribution.
#include <mutex>
#include <thread>
#include "RemoteClient.h"
#define DFH_MOD_SHIFT 1
#define DFH_MOD_CTRL 2
#define DFH_MOD_ALT 4

@ -69,3 +69,17 @@ distribution.
#else
#define Wformat(type, fmtstr, vararg)
#endif
namespace DFHack
{
enum command_result
{
CR_LINK_FAILURE = -3, // RPC call failed due to I/O or protocol error
CR_NEEDS_CONSOLE = -2, // Attempt to call interactive command without console
CR_NOT_IMPLEMENTED = -1, // Command not implemented, or plugin not loaded
CR_OK = 0, // Success
CR_FAILURE = 1, // Failure
CR_WRONG_USAGE = 2, // Wrong arguments or ui state
CR_NOT_FOUND = 3 // Target object not found (for RPC mainly)
};
}

@ -35,8 +35,6 @@ distribution.
#include "Core.h"
#include "DataFuncs.h"
#include "RemoteClient.h"
typedef struct lua_State lua_State;
namespace tthread

@ -39,17 +39,6 @@ namespace DFHack
using dfproto::IntMessage;
using dfproto::StringMessage;
enum command_result
{
CR_LINK_FAILURE = -3, // RPC call failed due to I/O or protocol error
CR_NEEDS_CONSOLE = -2, // Attempt to call interactive command without console
CR_NOT_IMPLEMENTED = -1, // Command not implemented, or plugin not loaded
CR_OK = 0, // Success
CR_FAILURE = 1, // Failure
CR_WRONG_USAGE = 2, // Wrong arguments or ui state
CR_NOT_FOUND = 3 // Target object not found (for RPC mainly)
};
enum DFHackReplyCode : int16_t {
RPC_REPLY_RESULT = -1,
RPC_REPLY_FAIL = -2,

@ -237,7 +237,7 @@ DFHACK_EXPORT std::string getRoomDescription(df::building *building, df::unit *u
* starting at the top left and moving right, row by row,
* the block's items are checked for anything on the ground within that stockpile.
*/
class DFHACK_EXPORT StockpileIterator : public std::iterator<std::input_iterator_tag, df::item>
class DFHACK_EXPORT StockpileIterator
{
df::building_stockpilest* stockpile;
df::map_block* block;
@ -245,6 +245,12 @@ class DFHACK_EXPORT StockpileIterator : public std::iterator<std::input_iterator
df::item *item;
public:
using iterator_category = std::input_iterator_tag;
using value_type = df::item*;
using difference_type = std::ptrdiff_t;
using pointer = df::item**;
using reference = df::item*&;
StockpileIterator() {
stockpile = NULL;
block = NULL;

@ -103,7 +103,7 @@ void ChannelManager::manage_group(const Group &group, bool set_marker_mode, bool
WARN(manager).print(" has %d access\n", access);
cavein_possible = config.riskaverse;
cavein_candidates.emplace(pos, access);
least_access = min(access, least_access);
least_access = std::min(access, least_access);
}
} else if (config.insta_dig && isEntombed(miner_pos, pos)) {
manage_one(pos, true, false);
@ -141,7 +141,7 @@ void ChannelManager::manage_group(const Group &group, bool set_marker_mode, bool
for (df::block_square_event* event: block->block_events) {
if (auto evT = virtual_cast<df::block_square_event_designation_priorityst>(event)) {
// we want to let the user keep some designations free of being managed
auto b = max(0, cavein_candidates[pos] - least_access);
auto b = std::max(0, cavein_candidates[pos] - least_access);
auto v = 1000 + (b * 1700);
DEBUG(manager).print("(" COORD ") 1000+1000(%d) -> %d {least-access: %d}\n",COORDARGS(pos), b, v, least_access);
evT->priority[Coord(local)] = v;

@ -23,7 +23,7 @@ namespace CSP {
inline uint32_t calc_distance(df::coord p1, df::coord p2) {
// calculate chebyshev (chessboard) distance
uint32_t distance = abs(p2.z - p1.z);
distance += max(abs(p2.x - p1.x), abs(p2.y - p1.y));
distance += std::max(abs(p2.x - p1.x), abs(p2.y - p1.y));
return distance;
}

@ -411,7 +411,7 @@ public:
Screen::paintTile(corner_ur, x2, y1);
Screen::paintTile(corner_dl, x1, y2);
Screen::paintTile(corner_dr, x2, y2);
string title = " " + get_title() + " ";
string title = ' ' + get_title() + ' ';
Screen::paintString(Screen::Pen(' ', COLOR_DARKGREY, COLOR_BLACK),
x2 - 6, y1, "DFHack");
Screen::paintString(Screen::Pen(' ', COLOR_BLACK, COLOR_GREY),

@ -103,7 +103,7 @@ static void find_active_keybindings(color_ostream &out, df::viewscreen *screen,
}
for (int i = 1; i <= 12; i++) {
valid_keys.push_back("F" + int_to_string(i));
valid_keys.push_back('F' + int_to_string(i));
}
valid_keys.push_back("`");