diff --git a/CMakeLists.txt b/CMakeLists.txt index e40c932a0..f8dd5dc86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,12 @@ if("${CMAKE_GENERATOR}" STREQUAL Ninja) endif() endif() +if(NOT("${CMAKE_VERSION}" VERSION_LESS 3.12)) + # make ZLIB_ROOT work in CMake >= 3.12 + # https://cmake.org/cmake/help/git-stage/policy/CMP0074.html + cmake_policy(SET CMP0074 NEW) +endif() + # Set up build types if(CMAKE_CONFIGURATION_TYPES) set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo" CACHE STRING "List of supported configuration types" FORCE) diff --git a/README.md b/README.md index a0499a333..e4bfefb38 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DFHack Readme -[![Build Status](https://github.com/DFHack/dfhack/workflows/Build/badge.svg)](https://github.com/DFHack/dfhack/actions?query=workflow%3ABuild) +[![Build Status](https://github.com/DFHack/dfhack/workflows/Build/badge.svg?event=push)](https://github.com/DFHack/dfhack/actions?query=workflow%3ABuild) [![Documentation Status](https://readthedocs.org/projects/dfhack/badge)](https://dfhack.readthedocs.org) [![License](https://img.shields.io/badge/license-ZLib-blue.svg)](https://en.wikipedia.org/wiki/Zlib_License) diff --git a/dfhack.init-example b/dfhack.init-example index d8cf832c7..0fd445fff 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -245,6 +245,7 @@ enable \ dwarfmonitor \ mousequery \ autogems \ + autodump \ automelt \ autotrade \ buildingplan \ diff --git a/docs/changelog.txt b/docs/changelog.txt index 11734d9f7..47f891cb5 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -45,6 +45,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - `tweak` embark-profile-name: fixed handling of the native shift+space key ## Misc Improvements +- ``dfhack.init-example``: enabled `autodump` - `manipulator`: added intrigue to displayed skills - `search`: added support for the fortress mode justice screen diff --git a/library/DataStatics.cpp b/library/DataStatics.cpp index 61b7b6378..275cae584 100644 --- a/library/DataStatics.cpp +++ b/library/DataStatics.cpp @@ -12,10 +12,11 @@ namespace { template - inline T &_toref(T &r) { return r; } + inline T *_toptr(T &r) { return &r; } template - inline T &_toref(T *&p) { return *p; } + inline T *_toptr(T *&p) { return p; } } +#define _fieldptr(ptr, fn) (ptr) ? _toptr((ptr)->fn) : NULL #define INIT_GLOBAL_FUNCTION_PREFIX \ DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo.get(); \ diff --git a/library/xml b/library/xml index f185d0b22..353caa341 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit f185d0b22acb1daf36b3a017f7a30b48994ee42c +Subproject commit 353caa3413f728938821c8aaccebb389a322bfef diff --git a/plugins/devel/check-structures-sanity/dispatch.cpp b/plugins/devel/check-structures-sanity/dispatch.cpp index fcc6b0b8e..f6342d03c 100644 --- a/plugins/devel/check-structures-sanity/dispatch.cpp +++ b/plugins/devel/check-structures-sanity/dispatch.cpp @@ -67,6 +67,11 @@ bool Checker::queue_item(const QueueItem & item, CheckedStructure cs) auto offset = uintptr_t(item.ptr) - uintptr_t(prev->first); if (!prev->second.second.has_type_at_offset(cs, offset)) { + if (offset == 0 && cs.identity == df::identity_traits::get()) + { + FAIL("unknown pointer is " << prev->second.second.identity->getFullName() << ", previously seen at " << prev->second.first); + return false; + } // TODO FAIL("TODO: handle merging structures: " << item.path << " overlaps " << prev->second.first << " (backward)"); return false; diff --git a/plugins/devel/check-structures-sanity/types.cpp b/plugins/devel/check-structures-sanity/types.cpp index 9e565215a..86d691f1d 100644 --- a/plugins/devel/check-structures-sanity/types.cpp +++ b/plugins/devel/check-structures-sanity/types.cpp @@ -129,7 +129,6 @@ bool CheckedStructure::has_type_at_offset(const CheckedStructure & type, size_t auto st = dynamic_cast(identity); if (!st) { - UNEXPECTED; return false; } diff --git a/plugins/orders.cpp b/plugins/orders.cpp index 045c07a1f..6c6888c0e 100644 --- a/plugins/orders.cpp +++ b/plugins/orders.cpp @@ -800,9 +800,9 @@ static command_result orders_clear_command(color_ostream & out) } if (order->items) { - for (auto anon_1 : *order->items) + for (auto item : *order->items) { - delete anon_1; + delete item; } delete order->items; } diff --git a/scripts b/scripts index b3ce8fa65..1468a773e 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit b3ce8fa650f86c7a1dbd5329d72c3d73dd76d05d +Subproject commit 1468a773e4b56716d94c28cc90a6988739d0c561