Commit d7a891c8 authored by Mathieu Faverge's avatar Mathieu Faverge

Apply patch 6 from issue #13 - clang performance

parent 18589100
...@@ -104,7 +104,7 @@ const string Error::VITE_ERR_FIELD_NOT_ALLOWED = "This type is not all ...@@ -104,7 +104,7 @@ const string Error::VITE_ERR_FIELD_NOT_ALLOWED = "This type is not all
const string Error::VITE_ERR_EVENT_NOT_CORRECT = "The definition of this event is not correct : "; const string Error::VITE_ERR_EVENT_NOT_CORRECT = "The definition of this event is not correct : ";
void Error::set(const string kind_of_error, const int priority){ void Error::set(const string &kind_of_error, const int priority){
Error::_content = kind_of_error; Error::_content = kind_of_error;
switch(priority){ switch(priority){
...@@ -117,18 +117,18 @@ void Error::set(const string kind_of_error, const int priority){ ...@@ -117,18 +117,18 @@ void Error::set(const string kind_of_error, const int priority){
} }
} }
void Error::set(const string kind_of_error, const unsigned int line_number, const int priority){ void Error::set(const string &kind_of_error, const unsigned int line_number, const int priority){
char line[sizeof(line_number)*3+3+1]; char line[sizeof(line_number)*3+3+1];
snprintf(line, sizeof(line), "%d : ", line_number); snprintf(line, sizeof(line), "%d : ", line_number);
set(line + kind_of_error, priority); set(line + kind_of_error, priority);
} }
void Error::set_and_print(const string kind_of_error, const int priority){ void Error::set_and_print(const string &kind_of_error, const int priority){
set(kind_of_error, priority); set(kind_of_error, priority);
print(priority); print(priority);
} }
void Error::set_and_print(const string kind_of_error, const unsigned int line_number, const int priority){ void Error::set_and_print(const string &kind_of_error, const unsigned int line_number, const int priority){
char line[sizeof(line_number)*3+1]; char line[sizeof(line_number)*3+1];
snprintf(line, sizeof(line), "%d", line_number); snprintf(line, sizeof(line), "%d", line_number);
set(kind_of_error + " on line " + line, priority); set(kind_of_error + " on line " + line, priority);
...@@ -136,7 +136,7 @@ void Error::set_and_print(const string kind_of_error, const unsigned int line_nu ...@@ -136,7 +136,7 @@ void Error::set_and_print(const string kind_of_error, const unsigned int line_nu
} }
bool Error::set_if(bool condition, const string kind_of_error, const unsigned int line_number, const int priority){ bool Error::set_if(bool condition, const string &kind_of_error, const unsigned int line_number, const int priority){
if(condition){ if(condition){
char line[sizeof(line_number)*3+1]; char line[sizeof(line_number)*3+1];
snprintf(line, sizeof(line), "%d", line_number); snprintf(line, sizeof(line), "%d", line_number);
...@@ -159,7 +159,7 @@ void Error::print(const int priority) { ...@@ -159,7 +159,7 @@ void Error::print(const int priority) {
} }
} }
void Error::print(const string content, const int priority) { void Error::print(const string &content, const int priority) {
*Message::get_instance() << content; *Message::get_instance() << content;
switch(priority){ switch(priority){
case VITE_ERRCODE_WARNING: case VITE_ERRCODE_WARNING:
......
...@@ -205,38 +205,38 @@ public: ...@@ -205,38 +205,38 @@ public:
const static std::string VITE_ERR_EVENT_NOT_CORRECT; const static std::string VITE_ERR_EVENT_NOT_CORRECT;
/*! /*!
* \fn set(const std::string kind_of_error, const int priority) static void * \fn set(const std::string &kind_of_error, const int priority) static void
* \brief raise an error or a warning * \brief raise an error or a warning
* \param kind_of_error : content of error * \param kind_of_error : content of error
* \param priority : _ERROR or _WARNING * \param priority : _ERROR or _WARNING
*/ */
static void set(const std::string kind_of_error, const int priority); static void set(const std::string &kind_of_error, const int priority);
/*! /*!
* \fn set(const std::string kind_of_error, const unsigned int line_number, const int priority) static void * \fn set(const std::string &kind_of_error, const unsigned int line_number, const int priority) static void
* \brief raise an error or a warning * \brief raise an error or a warning
* \param kind_of_error : content of error * \param kind_of_error : content of error
* \param line_number : the line in the trace file where the error occurs. * \param line_number : the line in the trace file where the error occurs.
* \param priority : _ERROR or _WARNING * \param priority : _ERROR or _WARNING
*/ */
static void set(const std::string kind_of_error, const unsigned int line_number, const int priority); static void set(const std::string &kind_of_error, const unsigned int line_number, const int priority);
/*! /*!
* \fn set_and_print(const std::string kind_of_error, const int priority) static void * \fn set_and_print(const std::string &kind_of_error, const int priority) static void
* \brief raise and throw to the interface an error or a warning * \brief raise and throw to the interface an error or a warning
* \param kind_of_error : content of error * \param kind_of_error : content of error
* \param priority : _ERROR or _WARNING * \param priority : _ERROR or _WARNING
*/ */
static void set_and_print(const std::string kind_of_error, const int priority); static void set_and_print(const std::string &kind_of_error, const int priority);
/*! /*!
* \fn set_and_print(const std::string kind_of_error, const unsigned int line_number, const int priority) static void * \fn set_and_print(const std::string &kind_of_error, const unsigned int line_number, const int priority) static void
* \brief raise and throw to the interface an error or a warning and the line when it occurs * \brief raise and throw to the interface an error or a warning and the line when it occurs
* \param kind_of_error : content of error * \param kind_of_error : content of error
* \param line_number : position of the error in the trace * \param line_number : position of the error in the trace
* \param priority : _ERROR or _WARNING * \param priority : _ERROR or _WARNING
*/ */
static void set_and_print(const std::string kind_of_error, const unsigned int line_number, const int priority); static void set_and_print(const std::string &kind_of_error, const unsigned int line_number, const int priority);
/*! /*!
* \fn print(const int priority) static void * \fn print(const int priority) static void
...@@ -246,15 +246,15 @@ public: ...@@ -246,15 +246,15 @@ public:
static void print(const int priority); static void print(const int priority);
/*! /*!
* \fn print(const std::string content, const int priority) static void * \fn print(const std::string &content, const int priority) static void
* \brief print the current error * \brief print the current error
* \param content : the string we want to print * \param content : the string we want to print
* \param priority : _ERROR or _WARNING * \param priority : _ERROR or _WARNING
*/ */
static void print(const std::string content, const int priority); static void print(const std::string &content, const int priority);
/*! /*!
* \fn set_if(bool condition, const std::string kind_of_error, const unsigned int line_number, const int priority) static bool * \fn set_if(bool condition, const std::string &kind_of_error, const unsigned int line_number, const int priority) static bool
* \brief raise an error or a warning and the line when it occurs if the condition is satisfied * \brief raise an error or a warning and the line when it occurs if the condition is satisfied
* \param condition : a condition * \param condition : a condition
* \param kind_of_error : content of error * \param kind_of_error : content of error
...@@ -262,7 +262,7 @@ public: ...@@ -262,7 +262,7 @@ public:
* \param priority : _ERROR or _WARNING * \param priority : _ERROR or _WARNING
* \return true if the condition is satisfied * \return true if the condition is satisfied
*/ */
static bool set_if(bool condition, const std::string kind_of_error, const unsigned int line_number, const int priority); static bool set_if(bool condition, const std::string &kind_of_error, const unsigned int line_number, const int priority);
/*! /*!
* \fn print_numbers() static void * \fn print_numbers() static void
......
...@@ -251,12 +251,12 @@ void Session::save_plugin_directories(const QStringList &list) { ...@@ -251,12 +251,12 @@ void Session::save_plugin_directories(const QStringList &list) {
} }
/*** States color ***/ /*** States color ***/
void Session::set_use_palette(const std::string type, bool use) { void Session::set_use_palette(const std::string &type, bool use) {
S->setValue(QString::fromStdString(type+"/is_used"), use); S->setValue(QString::fromStdString(type+"/is_used"), use);
_use_palettes = use; _use_palettes = use;
} }
bool Session::get_use_palette(const std::string type) { bool Session::get_use_palette(const std::string &type) {
//quick way, if we use the palettes, we don't need to check each time that we use them in the _settings file, only the first time //quick way, if we use the palettes, we don't need to check each time that we use them in the _settings file, only the first time
if(_use_palettes_is_set) if(_use_palettes_is_set)
return _use_palettes; return _use_palettes;
...@@ -267,25 +267,25 @@ bool Session::get_use_palette(const std::string type) { ...@@ -267,25 +267,25 @@ bool Session::get_use_palette(const std::string type) {
} }
} }
std::string Session::get_current_palette(const std::string type) { std::string Session::get_current_palette(const std::string &type) {
std::string tmp = S->value(QString::fromStdString(type+CUR_PALETTE)).toString().toStdString(); std::string tmp = S->value(QString::fromStdString(type+CUR_PALETTE)).toString().toStdString();
if(tmp == "") if(tmp == "")
tmp = "default"; tmp = "default";
return tmp; return tmp;
} }
void Session::set_current_palette(const std::string type, const std::string &name) { void Session::set_current_palette(const std::string &type, const std::string &name) {
S->setValue(QString::fromStdString(type+CUR_PALETTE), QString::fromStdString(name)); S->setValue(QString::fromStdString(type+CUR_PALETTE), QString::fromStdString(name));
} }
void Session::get_palettes_name(const std::string type, QStringList &list) { void Session::get_palettes_name(const std::string &type, QStringList &list) {
list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList(); list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList();
if(!list.contains("default")) { if(!list.contains("default")) {
list.append("default"); list.append("default");
} }
} }
Palette *Session::get_palette(const std::string type, const std::string &palette_name) { Palette *Session::get_palette(const std::string &type, const std::string &palette_name) {
Palette *p, **where_from; Palette *p, **where_from;
if( type == "palette" ) { if( type == "palette" ) {
p = _palettes_state; p = _palettes_state;
...@@ -317,13 +317,13 @@ Palette *Session::get_palette(const std::string type, const std::string &palette ...@@ -317,13 +317,13 @@ Palette *Session::get_palette(const std::string type, const std::string &palette
return p; return p;
} }
void Session::create_palette(const std::string type, const std::string &name) { void Session::create_palette(const std::string &type, const std::string &name) {
QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList(); QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList();
list.append(QString::fromStdString(name)); list.append(QString::fromStdString(name));
S->setValue(QString::fromStdString(type+PALETTE_NAMES), list); S->setValue(QString::fromStdString(type+PALETTE_NAMES), list);
} }
void Session::remove_palette(const std::string type, const std::string &name) { void Session::remove_palette(const std::string &type, const std::string &name) {
QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList(); QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList();
list.removeOne(QString::fromStdString(name)); list.removeOne(QString::fromStdString(name));
S->setValue(QString::fromStdString(type+PALETTE_NAMES), list); S->setValue(QString::fromStdString(type+PALETTE_NAMES), list);
...@@ -332,7 +332,7 @@ void Session::remove_palette(const std::string type, const std::string &name) { ...@@ -332,7 +332,7 @@ void Session::remove_palette(const std::string type, const std::string &name) {
S->setValue(_name, QMap <QString, QVariant>()); S->setValue(_name, QMap <QString, QVariant>());
} }
void Session::copy_palette(const std::string type, const std::string &src, const std::string &dest) { void Session::copy_palette(const std::string &type, const std::string &src, const std::string &dest) {
// Save the palette // Save the palette
QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList(); QStringList list = S->value(QString::fromStdString(type+PALETTE_NAMES)).toStringList();
list.append(QString::fromStdString(dest)); list.append(QString::fromStdString(dest));
...@@ -348,7 +348,7 @@ void Session::copy_palette(const std::string type, const std::string &src, const ...@@ -348,7 +348,7 @@ void Session::copy_palette(const std::string type, const std::string &src, const
} }
void void
Session::add_state_to_palette(const std::string type, Session::add_state_to_palette(const std::string &type,
const std::string &palette_name, const std::string &palette_name,
const std::string &state_name, const std::string &state_name,
const Color &c, bool visible) const Color &c, bool visible)
...@@ -363,7 +363,7 @@ Session::add_state_to_palette(const std::string type, ...@@ -363,7 +363,7 @@ Session::add_state_to_palette(const std::string type,
} }
void void
Session::remove_state_to_palette(const std::string type, Session::remove_state_to_palette(const std::string &type,
const std::string &palette_name, const std::string &palette_name,
const std::string &state_name) const std::string &state_name)
{ {
......
...@@ -279,51 +279,51 @@ public: ...@@ -279,51 +279,51 @@ public:
* \brief Set if we use the current palette when we load a trace. * \brief Set if we use the current palette when we load a trace.
* \param use : true if we use the current palette. * \param use : true if we use the current palette.
*/ */
static void set_use_palette(const std::string type, bool use); static void set_use_palette(const std::string &type, bool use);
/*! /*!
* \fn get_use_palette() * \fn get_use_palette()
* \brief Get if we use the current palette when we load a trace. * \brief Get if we use the current palette when we load a trace.
*/ */
static bool get_use_palette(const std::string type); static bool get_use_palette(const std::string &type);
/*! /*!
* \fn get_palettes_name(QStringList &list) * \fn get_palettes_name(QStringList &list)
* \brief Fill the list with all the existing palettes name. * \brief Fill the list with all the existing palettes name.
* \param list : the list filled * \param list : the list filled
*/ */
static void get_palettes_name(const std::string type, QStringList &list); static void get_palettes_name(const std::string &type, QStringList &list);
/*! /*!
* \fn get_palette(const std::string &name) * \fn get_palette(const std::string &name)
* \brief Create and return the palette with the name passed in parameter. * \brief Create and return the palette with the name passed in parameter.
* \param name : the name of the required palette * \param name : the name of the required palette
*/ */
static Palette *get_palette(const std::string type, const std::string &name = "default"); static Palette *get_palette(const std::string &type, const std::string &name = "default");
/*! /*!
* \fn get_current_palette() * \fn get_current_palette()
* \brief return the name of the current palette (last used) * \brief return the name of the current palette (last used)
*/ */
static std::string get_current_palette(const std::string type); static std::string get_current_palette(const std::string &type);
/*! /*!
* \fn set_current_palette(const std::string &name) * \fn set_current_palette(const std::string &name)
* \brief set the name of the current palette * \brief set the name of the current palette
* \param name : the name of the palette * \param name : the name of the palette
*/ */
static void set_current_palette(const std::string type, const std::string &name); static void set_current_palette(const std::string &type, const std::string &name);
/*! /*!
* \fn create_palette(const std::string &name) * \fn create_palette(const std::string &name)
* \brief Create an empty palette named name. * \brief Create an empty palette named name.
* \param name : the name of the palette * \param name : the name of the palette
*/ */
static void create_palette(const std::string type, const std::string &name); static void create_palette(const std::string &type, const std::string &name);
/*! /*!
* \fn remove_palette(const std::string &name) * \fn remove_palette(const std::string &name)
* \brief Remove the palette named name. * \brief Remove the palette named name.
* \param name : the name of the palette * \param name : the name of the palette
*/ */
static void remove_palette(const std::string type, const std::string &name); static void remove_palette(const std::string &type, const std::string &name);
/*! /*!
* \fn copy_palette(const std::string &src, const std::string &dest) * \fn copy_palette(const std::string &src, const std::string &dest)
...@@ -331,7 +331,7 @@ public: ...@@ -331,7 +331,7 @@ public:
* \param src : the name of the source palette * \param src : the name of the source palette
* \param dest : the name of the destination palette * \param dest : the name of the destination palette
*/ */
static void copy_palette(const std::string type, const std::string &src, const std::string &dest); static void copy_palette(const std::string &type, const std::string &src, const std::string &dest);
/*! /*!
* \fn add_state_to_palette(const std::string &palette_name, const std::string &state_name, const Color &c) * \fn add_state_to_palette(const std::string &palette_name, const std::string &state_name, const Color &c)
* \brief Add the state with its color of the palette. * \brief Add the state with its color of the palette.
...@@ -339,14 +339,14 @@ public: ...@@ -339,14 +339,14 @@ public:
* \param state_name : the state name * \param state_name : the state name
* \param c : the state color * \param c : the state color
*/ */
static void add_state_to_palette(const std::string type, const std::string &palette_name, const std::string &state_name, const Color &c, bool visible); static void add_state_to_palette(const std::string &type, const std::string &palette_name, const std::string &state_name, const Color &c, bool visible);
/*! /*!
* \fn remove_state_to_palette(const std::string &palette_name, const std::string &state_name) * \fn remove_state_to_palette(const std::string &palette_name, const std::string &state_name)
* \brief Remove the state of the palette. * \brief Remove the state of the palette.
* \param palette_name : the palette name * \param palette_name : the palette name
* \param state_name : the state name * \param state_name : the state name
*/ */
static void remove_state_to_palette(const std::string type, const std::string &palette_name, const std::string &state_name); static void remove_state_to_palette(const std::string &type, const std::string &palette_name, const std::string &state_name);
}; };
#endif #endif
...@@ -366,7 +366,7 @@ void Node_select::reassign_children_rec(QTreeWidgetItem* item, QFlags<Qt::Check ...@@ -366,7 +366,7 @@ void Node_select::reassign_children_rec(QTreeWidgetItem* item, QFlags<Qt::Check
void Node_select::set_filename(string filename){ void Node_select::set_filename(string filename){
_file_viewed = filename; _file_viewed = std::move(filename);
} }
......
...@@ -76,7 +76,7 @@ Settings_tab::Settings_tab(Core *core, std::string ecname) ...@@ -76,7 +76,7 @@ Settings_tab::Settings_tab(Core *core, std::string ecname)
{ {
_changed = false; _changed = false;
_core = core; _core = core;
_ecname = ecname; _ecname = std::move(ecname);
// Create the header // Create the header
hdr_label = new QLabel(this); hdr_label = new QLabel(this);
...@@ -315,7 +315,7 @@ Settings_tab::fill_table( bool used ) ...@@ -315,7 +315,7 @@ Settings_tab::fill_table( bool used )
} }
void void
Settings_tab::update_table_from_palette( string pname ) Settings_tab::update_table_from_palette( const string &pname )
{ {
Session &S = Session::getSession(); Session &S = Session::getSession();
Palette *p = S.get_palette(_ecname, pname); Palette *p = S.get_palette(_ecname, pname);
......
...@@ -105,7 +105,7 @@ private: ...@@ -105,7 +105,7 @@ private:
EntityValue *ev, EntityValue *ev,
bool used ); bool used );
void fill_table( bool used=true ); void fill_table( bool used=true );
void update_table_from_palette( std::string ); void update_table_from_palette(const std::string &);
public slots: public slots:
void on_btn_apply_clicked(); void on_btn_apply_clicked();
......
...@@ -71,8 +71,8 @@ ParsingThread::ParsingThread(Parser *p, ...@@ -71,8 +71,8 @@ ParsingThread::ParsingThread(Parser *p,
void ParsingThread::run() void ParsingThread::run()
{ {
try { try {
/* Do not finish the build inside the parser, /* Do not finish the build inside the parser,
* we will do this after, if we don't want to * we will do this after, if we don't want to
* just dump the trace * just dump the trace
*/ */
_parser->parse(*_trace,false); _parser->parse(*_trace,false);
...@@ -83,14 +83,14 @@ void ParsingThread::run() ...@@ -83,14 +83,14 @@ void ParsingThread::run()
_parser->finish(); _parser->finish();
} }
/* Locks the mutex and automatically unlocks /* Locks the mutex and automatically unlocks
* it when going out of scope */ * it when going out of scope */
QMutexLocker locker(_mutex); QMutexLocker locker(_mutex);
_finished->wakeAll(); _finished->wakeAll();
} }
void ParsingThread::finish_build(bool finish_trace_after_parse) void ParsingThread::finish_build(bool finish_trace_after_parse)
{ {
//we receive an order to quit parsing to close the program //we receive an order to quit parsing to close the program
if( !finish_trace_after_parse ) if( !finish_trace_after_parse )
_is_killed = true; _is_killed = true;
...@@ -100,17 +100,17 @@ void ParsingThread::finish_build(bool finish_trace_after_parse) ...@@ -100,17 +100,17 @@ void ParsingThread::finish_build(bool finish_trace_after_parse)
_trace->finish(); _trace->finish();
_parser->finish(); _parser->finish();
} }
_is_finished = true; _is_finished = true;
//locks the mutex and automatically unlocks it when going out of scope //locks the mutex and automatically unlocks it when going out of scope
QMutexLocker locker(_mutex); QMutexLocker locker(_mutex);
_closed->wakeAll(); _closed->wakeAll();
} }
void ParsingThread::dump(std::string path, void ParsingThread::dump(const std::string &path,
std::string filename) const std::string &filename)
{ {
_is_finished = true; _is_finished = true;
#if defined(USE_ITC) && defined(BOOST_SERIALIZE) #if defined(USE_ITC) && defined(BOOST_SERIALIZE)
if(! _is_killed)_trace->dump(path, filename); if(! _is_killed)_trace->dump(path, filename);
......
...@@ -104,10 +104,10 @@ protected slots: ...@@ -104,10 +104,10 @@ protected slots:
void finish_build(bool f); void finish_build(bool f);
/*! /*!
* \fn dump(std::string path) * \fn dump(const std::string &path, const std::string &filename)
* \brief dumps the remaining IntervalOfContainer at path path * \brief dumps the remaining IntervalOfContainer at path path
*/ */
void dump(std::string path, void dump(const std::string &path,
std::string filename); const std::string &filename);
}; };
#endif // PARSING_THREAD_HPP #endif // PARSING_THREAD_HPP
...@@ -135,7 +135,7 @@ void Plugin_window::load_shared_plugins() { ...@@ -135,7 +135,7 @@ void Plugin_window::load_shared_plugins() {
QFileInfoList list = dir.entryInfoList(); QFileInfoList list = dir.entryInfoList();
for (int i = 0 ; i < list.size() ; ++ i) { for (int i = 0 ; i < list.size() ; ++ i) {
QFileInfo fileInfo = list.at(i); const QFileInfo &fileInfo = list.at(i);
QString filename = fileInfo.absoluteFilePath(); QString filename = fileInfo.absoluteFilePath();
if(!QLibrary::isLibrary(filename)) { if(!QLibrary::isLibrary(filename)) {
......
...@@ -201,7 +201,7 @@ public: ...@@ -201,7 +201,7 @@ public:
* *
* This function stores text in a list. This list will be display each time the render area need to be updated. * This function stores text in a list. This list will be display each time the render area need to be updated.
*/ */
inline void draw_container_text(const Element_pos x, const Element_pos y, const std::string value) inline void draw_container_text(const Element_pos x, const Element_pos y, const std::string &value)
{ {
return; return;
} }
......
...@@ -245,7 +245,7 @@ for(int i = 32; i < 128; i++) { ...@@ -245,7 +245,7 @@ for(int i = 32; i < 128; i++) {
} }
void Render_alternate::render_text(QString text, float x, float y, float w, float h){ void Render_alternate::render_text(const QString &text, float x, float y, float w, float h){
/* Code trying to create text on QImage and create a texture from this. Then render the text thanks to this texture. Not working yet, the texture seems to be empty*/ /* Code trying to create text on QImage and create a texture from this. Then render the text thanks to this texture. Not working yet, the texture seems to be empty*/
GLuint texture; GLuint texture;
checkGlError(); checkGlError();
...@@ -955,7 +955,7 @@ void Render_alternate::start_draw_containers(){ ...@@ -955,7 +955,7 @@ void Render_alternate::start_draw_containers(){
void Render_alternate::draw_container(const Element_pos , const Element_pos , const Element_pos , const Element_pos ){ void Render_alternate::draw_container(const Element_pos , const Element_pos , const Element_pos , const Element_pos ){
} }
void Render_alternate::draw_container_text(const Element_pos , const Element_pos , const std::string ){ void Render_alternate::draw_container_text(const Element_pos , const Element_pos , const std::string &){
} }
void Render_alternate::end_draw_containers(){ void Render_alternate::end_draw_containers(){
...@@ -1302,7 +1302,7 @@ Render_alternate::update_ev( EntityValue *ev ) ...@@ -1302,7 +1302,7 @@ Render_alternate::update_ev( EntityValue *ev )
} }
/* Change the shader associated to entityType entity */ /* Change the shader associated to entityType entity */
void Render_alternate::change_color(std::string entity, void Render_alternate::change_color(const std::string &entity,
Element_col r, Element_col r,
Element_col g, Element_col g,
Element_col b) Element_col b)
...@@ -1327,7 +1327,7 @@ void Render_alternate::change_color(std::string entity, ...@@ -1327,7 +1327,7 @@ void Render_alternate::change_color(std::string entity,
} }
/*Same operating mode as change_color */ /*Same operating mode as change_color */
void Render_alternate::change_event_color(std::string event, Element_col r, Element_col g, Element_col b){ void Render_alternate::change_event_color(const std::string &event, Element_col r, Element_col g, Element_col b){
std::map<EntityValue*, std::pair<Vbo*, Vbo*> >::iterator it; std::map<EntityValue*, std::pair<Vbo*, Vbo*> >::iterator it;
it = _events.begin(); it = _events.begin();
while(it != _events.end()){ while(it != _events.end()){
...@@ -1346,7 +1346,7 @@ void Render_alternate::change_event_color(std::string event, Element_col r, Elem ...@@ -1346,7 +1346,7 @@ void Render_alternate::change_event_color(std::string event, Element_col r, Elem
} }
} }
/*Same operating mode as change_color */ /*Same operating mode as change_color */
void Render_alternate::change_link_color(std::string link, Element_col r, Element_col g, Element_col b){ void Render_alternate::change_link_color(const std::string &link, Element_col r, Element_col g, Element_col b){
std::map<EntityValue*, std::pair<Vbo*, Vbo*> >::iterator it; std::map<EntityValue*, std::pair<Vbo*, Vbo*> >::iterator it;
it = _arrows.begin(); it = _arrows.begin();
while(it != _arrows.end()){ while(it != _arrows.end()){
...@@ -1366,7 +1366,7 @@ void Render_alternate::change_link_color(std::string link, Element_col r, Elemen ...@@ -1366,7 +1366,7 @@ void Render_alternate::change_link_color(std::string link, Element_col r, Elemen
} }
} }
void Render_alternate::change_visible(std::string entity, bool visible){ void Render_alternate::change_visible(const std::string &entity, bool visible){
std::map<EntityValue*, Vbo*>::iterator it; std::map<EntityValue*, Vbo*>::iterator it;
it = _states.begin(); it = _states.begin();
while(it != _states.end()){ while(it != _states.end()){
...@@ -1379,7 +1379,7 @@ void Render_alternate::change_visible(std::string entity, bool visible){ ...@@ -1379,7 +1379,7 @@ void Render_alternate::change_visible(std::string entity, bool visible){
} }
} }