summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuietust2012-09-13 14:30:44 -0500
committerQuietust2012-09-13 14:30:44 -0500
commit1d8c9a6a5feadfc03707677588031bf85631a7c6 (patch)
tree6a492801a2ff0f487ab046014d32bbe8517405fd
parentcae01250ff5bc3df14677371459ef3b8b6451a08 (diff)
parent24b93ea61fd1cb6ad69c2e3beab182f5f60646c7 (diff)
downloaddfhack-1d8c9a6a5feadfc03707677588031bf85631a7c6.tar.gz
dfhack-1d8c9a6a5feadfc03707677588031bf85631a7c6.tar.bz2
dfhack-1d8c9a6a5feadfc03707677588031bf85631a7c6.tar.xz
Merge https://github.com/danaris/dfhack
m---------depends/clsocket0
-rw-r--r--depends/protobuf/CMakeLists.txt6
-rw-r--r--library/CMakeLists.txt4
-rw-r--r--library/RemoteClient.cpp2
-rw-r--r--library/RemoteServer.cpp2
-rw-r--r--library/RemoteTools.cpp2
-rw-r--r--library/include/DataDefs.h2
-rw-r--r--library/include/RemoteTools.h2
-rw-r--r--library/modules/Job.cpp2
-rw-r--r--library/modules/Units.cpp2
-rw-r--r--library/modules/kitchen.cpp2
-rwxr-xr-xpackage/darwin/dfhack-run3
-rwxr-xr-xpackage/darwin/fix-libs.sh21
-rw-r--r--plugins/cleaners.cpp4
-rw-r--r--plugins/cleanowned.cpp14
-rw-r--r--plugins/jobutils.cpp2
m---------plugins/stonesense0
-rw-r--r--plugins/tiletypes.cpp2
-rw-r--r--plugins/workflow.cpp2
-rw-r--r--plugins/zone.cpp4
20 files changed, 51 insertions, 27 deletions
diff --git a/depends/clsocket b/depends/clsocket
-Subproject d0b2d0750dc2d529a152eba4f3f519f69ff7eab
+Subproject 3808a8ac4fc1bbc0422492cb042099c47a312b5
diff --git a/depends/protobuf/CMakeLists.txt b/depends/protobuf/CMakeLists.txt
index 24c4b275..5034f00f 100644
--- a/depends/protobuf/CMakeLists.txt
+++ b/depends/protobuf/CMakeLists.txt
@@ -7,10 +7,10 @@ IF(CMAKE_COMPILER_IS_GNUCC)
STRING(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
LIST(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
LIST(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)
- IF(GCC_MAJOR LESS 4 OR (GCC_MAJOR EQUAL 4 AND GCC_MINOR LESS 2))
+ #IF(GCC_MAJOR LESS 4 OR (GCC_MAJOR EQUAL 4 AND GCC_MINOR LESS 2))
#GCC is too old
- SET(STL_HASH_OLD_GCC 1)
- ENDIF()
+ # SET(STL_HASH_OLD_GCC 1)
+ #ENDIF()
#SET(CMAKE_CXX_FLAGS "-std=c++0x")
SET(HAVE_HASH_MAP 0)
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 109a97e7..536f4d34 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -286,6 +286,10 @@ SET_TARGET_PROPERTIES(dfhack PROPERTIES LINK_INTERFACE_LIBRARIES "")
TARGET_LINK_LIBRARIES(dfhack-client protobuf-lite clsocket)
TARGET_LINK_LIBRARIES(dfhack-run dfhack-client)
+if(APPLE)
+ add_custom_command(TARGET dfhack-run COMMAND ${dfhack_SOURCE_DIR}/package/darwin/fix-libs.sh WORKING_DIRECTORY ../ COMMENT "Fixing library dependencies...")
+endif()
+
IF(UNIX)
if (APPLE)
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/darwin/dfhack
diff --git a/library/RemoteClient.cpp b/library/RemoteClient.cpp
index 4d30988c..09861ad5 100644
--- a/library/RemoteClient.cpp
+++ b/library/RemoteClient.cpp
@@ -394,7 +394,7 @@ command_result RemoteFunctionBase::execute(color_ostream &out,
//out.print("Received %d:%d\n", header.id, header.size);
- if (header.id == RPC_REPLY_FAIL)
+ if ((DFHack::DFHackReplyCode)header.id == RPC_REPLY_FAIL)
return header.size == CR_OK ? CR_FAILURE : command_result(header.size);
if (header.size < 0 || header.size > RPCMessageHeader::MAX_MESSAGE_SIZE)
diff --git a/library/RemoteServer.cpp b/library/RemoteServer.cpp
index 53428f2b..06a9f859 100644
--- a/library/RemoteServer.cpp
+++ b/library/RemoteServer.cpp
@@ -250,7 +250,7 @@ void ServerConnection::threadFn()
break;
}
- if (header.id == RPC_REQUEST_QUIT)
+ if ((DFHack::DFHackReplyCode)header.id == RPC_REQUEST_QUIT)
break;
if (header.size < 0 || header.size > RPCMessageHeader::MAX_MESSAGE_SIZE)
diff --git a/library/RemoteTools.cpp b/library/RemoteTools.cpp
index 95c495e9..b371d60f 100644
--- a/library/RemoteTools.cpp
+++ b/library/RemoteTools.cpp
@@ -287,7 +287,7 @@ void DFHack::describeUnit(BasicUnitInfo *info, df::unit *unit,
if (mask && mask->profession())
{
- if (unit->profession >= 0)
+ if (unit->profession >= (df::profession)0)
info->set_profession(unit->profession);
if (!unit->custom_profession.empty())
info->set_custom_profession(unit->custom_profession);
diff --git a/library/include/DataDefs.h b/library/include/DataDefs.h
index 591a0c3f..61d5dec4 100644
--- a/library/include/DataDefs.h
+++ b/library/include/DataDefs.h
@@ -518,7 +518,7 @@ namespace DFHack {
template<class T>
inline const char *enum_item_raw_key(T val) {
typedef df::enum_traits<T> traits;
- return traits::is_valid(val) ? traits::key_table[val - traits::first_item_value] : NULL;
+ return traits::is_valid(val) ? traits::key_table[(short)val - traits::first_item_value] : NULL;
}
/**
diff --git a/library/include/RemoteTools.h b/library/include/RemoteTools.h
index 65884bad..e87e8026 100644
--- a/library/include/RemoteTools.h
+++ b/library/include/RemoteTools.h
@@ -88,7 +88,7 @@ namespace DFHack
{
typedef df::enum_traits<T> traits;
int base = traits::first_item;
- int size = traits::last_item - base + 1;
+ int size = (int)traits::last_item - base + 1;
describeEnum(pf, base, size, traits::key_table);
}
diff --git a/library/modules/Job.cpp b/library/modules/Job.cpp
index 54b4eb27..b74a4b73 100644
--- a/library/modules/Job.cpp
+++ b/library/modules/Job.cpp
@@ -181,7 +181,7 @@ void DFHack::Job::printItemDetails(color_ostream &out, df::job_item *item, int i
out << " reaction class: " << item->reaction_class << endl;
if (!item->has_material_reaction_product.empty())
out << " reaction product: " << item->has_material_reaction_product << endl;
- if (item->has_tool_use >= 0)
+ if (item->has_tool_use >= (df::tool_uses)0)
out << " tool use: " << ENUM_KEY_STR(tool_uses, item->has_tool_use) << endl;
}
diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp
index 28c34b02..01b7b50f 100644
--- a/library/modules/Units.cpp
+++ b/library/modules/Units.cpp
@@ -1311,7 +1311,7 @@ std::string DFHack::Units::getCasteProfessionName(int race, int casteid, df::pro
{
std::string prof, race_prefix;
- if (pid < 0 || !is_valid_enum_item(pid))
+ if (pid < (df::profession)0 || !is_valid_enum_item(pid))
return "";
bool use_race_prefix = (race >= 0 && race != df::global::ui->race_id);
diff --git a/library/modules/kitchen.cpp b/library/modules/kitchen.cpp
index 4300d63d..aa235780 100644
--- a/library/modules/kitchen.cpp
+++ b/library/modules/kitchen.cpp
@@ -114,7 +114,7 @@ void Kitchen::fillWatchMap(std::map<t_materialIndex, unsigned int>& watchMap)
watchMap.clear();
for(std::size_t i = 0; i < size(); ++i)
{
- if(ui->kitchen.item_subtypes[i] == limitType && ui->kitchen.item_subtypes[i] == limitSubtype && ui->kitchen.exc_types[i] == limitExclusion)
+ if(ui->kitchen.item_subtypes[i] == (short)limitType && ui->kitchen.item_subtypes[i] == (short)limitSubtype && ui->kitchen.exc_types[i] == limitExclusion)
{
watchMap[ui->kitchen.mat_indices[i]] = (unsigned int) ui->kitchen.mat_types[i];
}
diff --git a/package/darwin/dfhack-run b/package/darwin/dfhack-run
index 865c8bd2..cc69db96 100755
--- a/package/darwin/dfhack-run
+++ b/package/darwin/dfhack-run
@@ -3,7 +3,6 @@
DF_DIR=$(dirname "$0")
cd "${DF_DIR}"
-export DYLD_LIBRARY_PATH=${PWD}/hack:${PWD}/libs
-export DYLD_FRAMEWORK_PATH=${PWD}/hack${PWD}/libs
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./stonesense/deplibs":"./hack"
exec hack/dfhack-run "$@"
diff --git a/package/darwin/fix-libs.sh b/package/darwin/fix-libs.sh
new file mode 100755
index 00000000..cff98b6a
--- /dev/null
+++ b/package/darwin/fix-libs.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+BUILD_DIR=`pwd`
+
+echo "Fixing library dependencies in $BUILD_DIR/library"
+
+install_name_tool -change $BUILD_DIR/library/libdfhack.1.0.0.dylib @executable_path/hack/libdfhack.1.0.0.dylib library/libdfhack.1.0.0.dylib
+install_name_tool -change $BUILD_DIR/library/libdfhack-client.dylib @executable_path/hack/libdfhack-client.dylib library/libdfhack-client.dylib
+install_name_tool -change $BUILD_DIR/library/libdfhack-client.dylib @executable_path/hack/libdfhack-client.dylib library/dfhack-run
+install_name_tool -change $BUILD_DIR/depends/protobuf/libprotobuf-lite.dylib @executable_path/hack/libprotobuf-lite.dylib library/libdfhack.1.0.0.dylib
+install_name_tool -change $BUILD_DIR/depends/protobuf/libprotobuf-lite.dylib @executable_path/hack/libprotobuf-lite.dylib library/libdfhack-client.dylib
+install_name_tool -change $BUILD_DIR/depends/protobuf/libprotobuf-lite.dylib @executable_path/hack/libprotobuf-lite.dylib library/dfhack-run
+install_name_tool -change $BUILD_DIR/depends/lua/liblua.dylib @executable_path/hack/liblua.dylib library/libdfhack.1.0.0.dylib
+install_name_tool -change @executable_path/../Frameworks/SDL.framework/Versions/A/SDL @executable_path/libs/SDL.framework/Versions/A/SDL library/libdfhack.1.0.0.dylib
+install_name_tool -change /usr/local/lib/libstdc++.6.dylib @executable_path/libs/libstdc++.6.dylib library/libdfhack.1.0.0.dylib
+install_name_tool -change /opt/local/lib/i386/libstdc++.6.dylib @executable_path/libs/libstdc++.6.dylib library/libdfhack.1.0.0.dylib
+install_name_tool -change /opt/local/lib/i386/libstdc++.6.dylib @executable_path/libs/libstdc++.6.dylib library/libdfhack-client.dylib
+install_name_tool -change /opt/local/lib/i386/libstdc++.6.dylib @executable_path/libs/libstdc++.6.dylib library/dfhack-run
+install_name_tool -change /opt/local/lib/i386/libgcc_s.1.dylib @executable_path/libs/libgcc_s.1.dylib library/libdfhack.1.0.0.dylib
+install_name_tool -change /opt/local/lib/i386/libgcc_s.1.dylib @executable_path/libs/libgcc_s.1.dylib library/libdfhack-client.dylib
+install_name_tool -change /opt/local/lib/i386/libgcc_s.1.dylib @executable_path/libs/libgcc_s.1.dylib library/dfhack-run \ No newline at end of file
diff --git a/plugins/cleaners.cpp b/plugins/cleaners.cpp
index de204f61..c0301de7 100644
--- a/plugins/cleaners.cpp
+++ b/plugins/cleaners.cpp
@@ -50,12 +50,12 @@ command_result cleanmap (color_ostream &out, bool snow, bool mud)
// filter snow
if(!snow
&& spatter->mat_type == builtin_mats::WATER
- && spatter->mat_state == matter_state::Powder)
+ && spatter->mat_state == (short)matter_state::Powder)
continue;
// filter mud
if(!mud
&& spatter->mat_type == builtin_mats::MUD
- && spatter->mat_state == matter_state::Solid)
+ && spatter->mat_state == (short)matter_state::Solid)
continue;
delete evt;
diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp
index c1521b8d..a9d461d2 100644
--- a/plugins/cleanowned.cpp
+++ b/plugins/cleanowned.cpp
@@ -117,13 +117,13 @@ command_result df_cleanowned (color_ostream &out, vector <string> & parameters)
else if (item->flags.bits.on_ground)
{
int32_t type = item->getType();
- if(type == item_type::MEAT ||
- type == item_type::FISH ||
- type == item_type::VERMIN ||
- type == item_type::PET ||
- type == item_type::PLANT ||
- type == item_type::CHEESE ||
- type == item_type::FOOD
+ if((df::enums::item_type::item_type)type == item_type::MEAT ||
+ (df::enums::item_type::item_type)type == item_type::FISH ||
+ (df::enums::item_type::item_type)type == item_type::VERMIN ||
+ (df::enums::item_type::item_type)type == item_type::PET ||
+ (df::enums::item_type::item_type)type == item_type::PLANT ||
+ (df::enums::item_type::item_type)type == item_type::CHEESE ||
+ (df::enums::item_type::item_type)type == item_type::FOOD
)
{
confiscate = true;
diff --git a/plugins/jobutils.cpp b/plugins/jobutils.cpp
index 24ad4170..dbfe26b9 100644
--- a/plugins/jobutils.cpp
+++ b/plugins/jobutils.cpp
@@ -372,7 +372,7 @@ static command_result job_cmd(color_ostream &out, vector <string> & parameters)
out << "Job item updated." << endl;
- if (item->item_type < 0 && minfo.isValid())
+ if (item->item_type < (df::item_type)0 && minfo.isValid())
out.printerr("WARNING: Due to a probable bug, creature & plant material subtype\n"
" is ignored unless the item type is also specified.\n");
diff --git a/plugins/stonesense b/plugins/stonesense
-Subproject 2a62ba5ed2607f4dbf0473e77502d4e19c19678
+Subproject 37a823541538023b9f3d0d1e8039cf32851de68
diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp
index 190bda7c..6af94f2e 100644
--- a/plugins/tiletypes.cpp
+++ b/plugins/tiletypes.cpp
@@ -767,7 +767,7 @@ command_result executePaintJob(color_ostream &out)
}
// Remove liquid from walls, etc
- if (type != -1 && !DFHack::FlowPassable(type))
+ if (type != (df::tiletype)-1 && !DFHack::FlowPassable(type))
{
des.bits.flow_size = 0;
//des.bits.liquid_type = DFHack::liquid_water;
diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp
index 639e7c56..98258682 100644
--- a/plugins/workflow.cpp
+++ b/plugins/workflow.cpp
@@ -828,7 +828,7 @@ static void compute_custom_job(ProtectedJob *pj, df::job *job)
using namespace df::enums::reaction_product_item_flags;
VIRTUAL_CAST_VAR(prod, df::reaction_product_itemst, r->products[i]);
- if (!prod || (prod->item_type < 0 && !prod->flags.is_set(CRAFTS)))
+ if (!prod || (prod->item_type < (df::item_type)0 && !prod->flags.is_set(CRAFTS)))
continue;
MaterialInfo mat(prod);
diff --git a/plugins/zone.cpp b/plugins/zone.cpp
index fc89fecc..c496f49b 100644
--- a/plugins/zone.cpp
+++ b/plugins/zone.cpp
@@ -792,7 +792,7 @@ void unitInfo(color_ostream & out, df::unit* unit, bool verbose = false)
bool isActivityZone(df::building * building)
{
if( building->getType() == building_type::Civzone
- && building->getSubtype() == civzone_type::ActivityZone)
+ && building->getSubtype() == (short)civzone_type::ActivityZone)
return true;
else
return false;
@@ -1603,7 +1603,7 @@ void zoneInfo(color_ostream & out, df::building* building, bool verbose)
if(building->getType()!= building_type::Civzone)
return;
- if(building->getSubtype() != civzone_type::ActivityZone)
+ if(building->getSubtype() != (short)civzone_type::ActivityZone)
return;
string name;