diff --git a/src/emu/pv/pcf.h b/src/emu/pv/pcf.h index 512c12d..263e279 100644 --- a/src/emu/pv/pcf.h +++ b/src/emu/pv/pcf.h @@ -10,6 +10,10 @@ #define MAX_PCF_LABEL 512 +enum pcf_values { + PCF_RESERVED = 1000, +}; + struct pcf_value { int value; char label[MAX_PCF_LABEL]; diff --git a/src/emu/task.c b/src/emu/task.c index 0bf4458..197307d 100644 --- a/src/emu/task.c +++ b/src/emu/task.c @@ -6,6 +6,7 @@ #include #include #include "thread.h" +#include "pv/pcf.h" #include "utlist.h" struct task * @@ -232,14 +233,15 @@ task_get_type_gid(const char *label) HASH_VALUE(label, strlen(label), gid); - /* Use non-negative values */ - gid &= 0x7FFFFFFF; - /* Avoid bad colors for "Unlabeled0" and "main" */ gid += 666; - if (gid == 0) - gid++; + /* Use non-negative values */ + gid &= 0x7FFFFFFF; + + /* Avoid reserved values */ + if (gid < PCF_RESERVED) + gid += PCF_RESERVED; return gid; }