summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorQuietust2012-09-13 14:30:44 -0500
committerQuietust2012-09-13 14:30:44 -0500
commit1d8c9a6a5feadfc03707677588031bf85631a7c6 (patch)
tree6a492801a2ff0f487ab046014d32bbe8517405fd /library
parentcae01250ff5bc3df14677371459ef3b8b6451a08 (diff)
parent24b93ea61fd1cb6ad69c2e3beab182f5f60646c7 (diff)
downloaddfhack-1d8c9a6a5feadfc03707677588031bf85631a7c6.tar.gz
dfhack-1d8c9a6a5feadfc03707677588031bf85631a7c6.tar.bz2
dfhack-1d8c9a6a5feadfc03707677588031bf85631a7c6.tar.xz
Merge https://github.com/danaris/dfhack
Diffstat (limited to 'library')
-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
9 files changed, 12 insertions, 8 deletions
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];
}