Commit b8113788 authored by Johnny Jazeix's avatar Johnny Jazeix

number of colors is dynamic, no need to use a macro for it

parent 014fddd1
......@@ -126,7 +126,8 @@ ParserDefinitionOTF::~ParserDefinitionOTF() {
OTF_HandlerArray_close(_handlers);
// Free the memory used by the colors
for(int i = 0 ; i < NB_COLORS ; ++ i) {
const size_t nb_colors = _default_colors.size();
for(int i = 0 ; i < nb_colors ; ++ i) {
delete _default_colors[i];
_default_colors[i] = NULL;
}
......@@ -448,7 +449,7 @@ uint32_t ParserDefinitionOTF::get_ticks_per_second() {
}
Color *ParserDefinitionOTF::get_color(uint32_t func_id) {
return new Color(*_default_colors[func_id % NB_COLORS]);
return new Color(*_default_colors[func_id % _default_colors.size()]);
}
//
......
......@@ -65,13 +65,6 @@ class Trace;
OTF_HandlerArray_setFirstHandlerArg(handler, data, handler_kind); \
}
/*!
* \def NB_COLORS
* The number of default colors.
* They are created in the constructor, deleted in destructor.
*/
#define NB_COLORS 10
/*!
* \struct Process
* \brief Contains the definition of a process (equivalent in Paje : Container)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment