summaryrefslogtreecommitdiff
path: root/plugins/workflow.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-17 12:52:22 +0400
committerAlexander Gavrilov2012-03-17 12:52:22 +0400
commit58eb199036db3662ec2f7a2d6d301e7f432d5639 (patch)
treec01d46ab4d403cd900ddbf6e0c31c22946c02a7c /plugins/workflow.cpp
parent14d6a62e1d212808623f1a71b3c559ac4a8dada3 (diff)
downloaddfhack-58eb199036db3662ec2f7a2d6d301e7f432d5639.tar.gz
dfhack-58eb199036db3662ec2f7a2d6d301e7f432d5639.tar.bz2
dfhack-58eb199036db3662ec2f7a2d6d301e7f432d5639.tar.xz
Add many new template functions for enums & bitfields.
An incompatible change: ENUM_KEY_STR returns std::string now. The old behavior is available via enum_item_key_str function.
Diffstat (limited to 'plugins/workflow.cpp')
-rw-r--r--plugins/workflow.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp
index b48ce85d..237068b0 100644
--- a/plugins/workflow.cpp
+++ b/plugins/workflow.cpp
@@ -502,7 +502,7 @@ static bool recover_job(color_ostream &out, ProtectedJob *pj)
if (!pj->holder)
{
out.printerr("Forgetting job %d (%s): holder building lost.",
- pj->id, ENUM_KEY_STR(job_type, pj->job_copy->job_type));
+ pj->id, ENUM_KEY_STR(job_type, pj->job_copy->job_type).c_str());
forget_job(out, pj);
return true;
}
@@ -511,7 +511,7 @@ static bool recover_job(color_ostream &out, ProtectedJob *pj)
if (pj->holder->jobs.size() >= 10)
{
out.printerr("Forgetting job %d (%s): holder building has too many jobs.",
- pj->id, ENUM_KEY_STR(job_type, pj->job_copy->job_type));
+ pj->id, ENUM_KEY_STR(job_type, pj->job_copy->job_type).c_str());
forget_job(out, pj);
return true;
}
@@ -534,7 +534,7 @@ static bool recover_job(color_ostream &out, ProtectedJob *pj)
deleteJobStruct(recovered);
out.printerr("Inconsistency: job %d (%s) already in list.",
- pj->id, ENUM_KEY_STR(job_type, pj->job_copy->job_type));
+ pj->id, ENUM_KEY_STR(job_type, pj->job_copy->job_type).c_str());
return true;
}
@@ -1283,7 +1283,7 @@ static void update_jobs_by_constraints(color_ostream &out)
if (ct->material.isValid())
info = ct->material.toString() + " " + info;
else if (ct->mat_mask.whole)
- info = bitfieldToString(ct->mat_mask) + " " + info;
+ info = bitfield_to_string(ct->mat_mask) + " " + info;
if (is_running != ct->is_active)
{
@@ -1337,7 +1337,7 @@ static std::string shortJobDescription(df::job *job)
if (mat.isValid())
rv += " [" + mat.toString() + "]";
else if (mat_mask.whole)
- rv += " [" + bitfieldToString(mat_mask) + "]";
+ rv += " [" + bitfield_to_string(mat_mask) + "]";
return rv;
}