diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85f4713b1205b2a215342433d562425fc18148d8..26e4e1d7e98bfc4a8536374978b582ccad0d2956 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,4 +36,3 @@ sonar_vite: - ./analysis.sh only: - master@solverstack/vite - diff --git a/plugins/Distribution/Distribution.cpp b/plugins/Distribution/Distribution.cpp index 6fc0b0ec09b9427320a1dd4a828dd19829372e3f..fc3535f4d554110a4ceff08b6c7a449d1f7ae1c9 100644 --- a/plugins/Distribution/Distribution.cpp +++ b/plugins/Distribution/Distribution.cpp @@ -404,7 +404,7 @@ private: double start = (i * (max_val - min_val))/nbreaks + min_val; double end = ((i+1) * (max_val - min_val))/nbreaks + min_val; - printf("BIN[%d] = %d / %d - [ %lf, %lf [\n", i, cnt[i], total_cnt, start, end); + printf("BIN[%u] = %u / %u - [ %lf, %lf [\n", i, cnt[i], total_cnt, start, end); } /* Start from a blank canva */ diff --git a/plugins/MatrixVisualizer/Parsers/Parser.hpp b/plugins/MatrixVisualizer/Parsers/Parser.hpp index a9e59f6b540d1e460d3ec6c141e8f4541d84fb8e..68a37658c13482f75ded10a5bc0cf341d27201e9 100644 --- a/plugins/MatrixVisualizer/Parsers/Parser.hpp +++ b/plugins/MatrixVisualizer/Parsers/Parser.hpp @@ -19,8 +19,8 @@ public: virtual void finish() = 0; protected: - bool m_is_finished; - bool m_is_canceled; + bool m_is_finished = false; + bool m_is_canceled = false; }; #endif diff --git a/plugins/MatrixVisualizer/Windows/MatrixGLWidget.hpp b/plugins/MatrixVisualizer/Windows/MatrixGLWidget.hpp index 126e079b325f4d4388bb4160b5048ed8251925d0..9b6519230380f29423e0bdf708e5cd0505b8a226 100644 --- a/plugins/MatrixVisualizer/Windows/MatrixGLWidget.hpp +++ b/plugins/MatrixVisualizer/Windows/MatrixGLWidget.hpp @@ -57,7 +57,7 @@ private: QTime m_time; QLabel* m_label; - char m_fpsString[256]; + char m_fpsString[256] = { '\0' }; double m_qtToGLWidthCoeff; double m_qtToGLHeightCoeff; @@ -68,11 +68,11 @@ private: int m_mouseYClicked; CameraPosition m_camera; - int m_drawTempSelection; - int m_tempSelectionX; - int m_tempSelectionY; - int m_tempSelectionDx; - int m_tempSelectionDy; + int m_drawTempSelection = 0; + int m_tempSelectionX = 0; + int m_tempSelectionY = 0; + int m_tempSelectionDx = 0; + int m_tempSelectionDy = 0; // Zoom stack std::stack<CameraPosition> m_savedPositions; diff --git a/src/common/Session.cpp b/src/common/Session.cpp index c42130970c86838db144eebaa3deab75596f85ec..47364076f6cd126180961c10742cb7662f788549 100644 --- a/src/common/Session.cpp +++ b/src/common/Session.cpp @@ -286,18 +286,16 @@ void Session::get_palettes_name(const std::string &type, QStringList &list) { } Palette *Session::get_palette(const std::string &type, const std::string &palette_name) { - Palette *p, **where_from; + Palette *p = NULL; + if( type == "palette" ) { p = _palettes_state; - where_from = &_palettes_state; } else if( type == "link_types" ) { p = _palettes_link; - where_from = &_palettes_link; } else if( type == "event_types" ) { p = _palettes_event; - where_from = &_palettes_event; } if(!p || p->get_name() != palette_name) { @@ -306,7 +304,6 @@ Palette *Session::get_palette(const std::string &type, const std::string &palett QMap <QString, QVariant> qmap = S->value(QString::fromStdString(type+"/"+palette_name+"/map")).toMap(); p = new Palette(string(type+"/"+palette_name)); - *where_from = p; for(QMap<QString, QVariant>::const_iterator it = qmap.constBegin() ; it != qmap.constEnd() ; ++ it) { const QColor qc = it.value().value<QColor>(); diff --git a/src/common/Tools.cpp b/src/common/Tools.cpp index 3b5537acb7a79d8ba6ce1d05227c7e2b24a3593e..a2c399ca1768bc376b264d39a7f6ec93c73ef4ba 100644 --- a/src/common/Tools.cpp +++ b/src/common/Tools.cpp @@ -59,7 +59,7 @@ using namespace std; bool convert_to_double(const std::string &arg, double *val) { unsigned int nb_read; // Try to convert first in the current locale - sscanf(arg.c_str(), "%lf%n", val, &nb_read); + sscanf(arg.c_str(), "%lf%u", val, &nb_read); if(nb_read == arg.size()) { return true; // It is the good format @@ -88,7 +88,7 @@ bool convert_to_double(const std::string &arg, double *val) { } // Reads the value in the new locale - sscanf(arg.c_str(), "%lf%n", val, &nb_read); + sscanf(arg.c_str(), "%lf%u", val, &nb_read); return nb_read == arg.size(); } } diff --git a/src/core/Core.cpp b/src/core/Core.cpp index 1b639198ba30c3d194f61ea75038c506d830363a..559e53307932b2c970dcc8c6b7f8fda3e9c27122 100644 --- a/src/core/Core.cpp +++ b/src/core/Core.cpp @@ -972,33 +972,46 @@ void Core::launch_action(int state, void* arg) { //printf("we ask to switch %s and %s \n", container->get_name().to_string().c_str(), container2->get_name().to_string().c_str()); - const std::list<Container*>* children=nullptr; + const std::list<Container*>* children = nullptr; + bool children_allocated = false; - if(parent==nullptr){//we switch top level containers + if( parent == nullptr ) {//we switch top level containers children = _trace->get_view_root_containers(); - if(children->empty()) children = _trace->get_root_containers(); - }else{ + if( children->empty() ) + children = _trace->get_root_containers(); + } else { children = new std::list<Container*>(*parent->get_view_children()); - if(children->empty()) children = parent->get_children(); + if( children->empty() ) { + delete children; + children = parent->get_children(); + } + else { + children_allocated = true; + } } std::list<Container*>::const_iterator it= children->begin(); const std::list<Container*>::const_iterator it_end= children->end(); - if(parent!=nullptr){ + if( parent != nullptr ) { parent->clear_view_children(); for(; it!=it_end; it++){ - if((*it)==container) parent->add_view_child(const_cast<Container*>(container2)); - else if((*it)==container2) parent->add_view_child(const_cast<Container*>(container)); - else parent->add_view_child(*it); + if( (*it) == container ) + parent->add_view_child(const_cast<Container*>(container2)); + else if( (*it) == container2 ) + parent->add_view_child(const_cast<Container*>(container)); + else + parent->add_view_child(*it); } - }else{//for root containers we have to build a new list and fill it + } else {//for root containers we have to build a new list and fill it std::list<Container*>* new_list= new std::list<Container*> (); for(; it!=it_end; it++){ - if((*it)==container){ + if( (*it) == container ) { new_list->push_back(const_cast<Container*>(container2)); } - else if((*it)==container2) new_list->push_back(const_cast<Container*>(container)); - else new_list->push_back(*it); + else if( (*it) == container2 ) + new_list->push_back(const_cast<Container*>(container)); + else + new_list->push_back(*it); } _trace->set_view_root_containers(*new_list); } @@ -1015,6 +1028,10 @@ void Core::launch_action(int state, void* arg) { launch_action(Core:: _STATE_ZOOM_IN_AN_INTERVAL, &zoom); launch_action(Core:: _STATE_RENDER_UPDATE); + if ( children_allocated ) { + delete children; + } + break; } diff --git a/src/interface/Settings_window.cpp b/src/interface/Settings_window.cpp index 752467307edfeb415539af035a3a1e0ec20508d5..ecfcb78545156430673b6d4a9734dbad4015e62b 100644 --- a/src/interface/Settings_window.cpp +++ b/src/interface/Settings_window.cpp @@ -664,11 +664,13 @@ void Settings_window::on_cb_nolinks_stateChanged(int index) { _c->launch_action(Core::_STATE_RENDER_UPDATE); + (void)index; } void Settings_window::on_cb_noevents_stateChanged(int index) { _c->launch_action(Core::_STATE_RENDER_UPDATE); + (void)index; } diff --git a/src/main.cpp b/src/main.cpp index 7d83917ce199908efedb9d35bba792977bf0e0f3..000e7cb28a0342f9a12d49b40f78fd93061d435b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -108,8 +108,8 @@ int main(int argc, char **argv) { trace_finish(file, (clockGet()-timestamp), 0, -1); memAllocUntrace(); #endif - fprintf(stdout, "Max Memory allocated : %ld\n", memAllocGetMax()); - fprintf(stdout, "Memory still allocated : %ld\n", memAllocGetCurrent()); + fprintf(stdout, "Max Memory allocated : %lu\n", memAllocGetMax()); + fprintf(stdout, "Memory still allocated : %lu\n", memAllocGetCurrent()); #endif return EXIT_SUCCESS; diff --git a/src/parser/OTF2Parser/ParserDefinitionOTF2.cpp b/src/parser/OTF2Parser/ParserDefinitionOTF2.cpp index 4f9a196070122c20560ade567007e9c4b697815b..c21f1caca074a08a9c8a9e3c92e59d1eb8422bf1 100644 --- a/src/parser/OTF2Parser/ParserDefinitionOTF2.cpp +++ b/src/parser/OTF2Parser/ParserDefinitionOTF2.cpp @@ -73,14 +73,14 @@ /* -- */ using namespace std; -map<OTF2_SystemTreeNodeRef, OTF2_SystemTreeNode* > ParserDefinitionOTF2::_system_tree_node; -map<OTF2_LocationGroupRef, OTF2_LocationGroup* > ParserDefinitionOTF2::_location_group; -map<OTF2_LocationRef, OTF2_Location* > ParserDefinitionOTF2::_location; +map<OTF2_SystemTreeNodeRef, OTF2_SystemTreeNode* > ParserDefinitionOTF2::_system_tree_node; +map<OTF2_LocationGroupRef, OTF2_LocationGroup* > ParserDefinitionOTF2::_location_group; +map<OTF2_LocationRef, OTF2_Location* > ParserDefinitionOTF2::_location; map<OTF2_MetricMemberRef, OTF2_MetricMember > ParserDefinitionOTF2::_metric_member; -map<OTF2_MetricRef, OTF2_MetricClass > ParserDefinitionOTF2::_metric_class; +map<OTF2_MetricRef, OTF2_MetricClass > ParserDefinitionOTF2::_metric_class; -map<uint32_t, OTF2_Function > ParserDefinitionOTF2::_functions; +map<uint32_t, OTF2_Function > ParserDefinitionOTF2::_functions; map<uint32_t, const char * > ParserDefinitionOTF2::_strings; @@ -131,20 +131,21 @@ ParserDefinitionOTF2::~ParserDefinitionOTF2() { void ParserDefinitionOTF2::set_handlers(Trace *t) { - OTF2_GlobalDefReaderCallbacks_SetSystemTreeNodeCallback(_global_def_callbacks, &handler_DefSystemTreeNode); - OTF2_GlobalDefReaderCallbacks_SetLocationCallback(_global_def_callbacks, &handler_DefLocation); - OTF2_GlobalDefReaderCallbacks_SetLocationGroupCallback(_global_def_callbacks, handler_DefLocationGroup); - OTF2_GlobalDefReaderCallbacks_SetStringCallback(_global_def_callbacks, &handler_DefString); - OTF2_GlobalDefReaderCallbacks_SetClockPropertiesCallback(_global_def_callbacks, &handler_DefTimerResolution); - OTF2_GlobalDefReaderCallbacks_SetRegionCallback(_global_def_callbacks, &handler_DefState); + OTF2_GlobalDefReaderCallbacks_SetSystemTreeNodeCallback ( _global_def_callbacks, &handler_DefSystemTreeNode ); + OTF2_GlobalDefReaderCallbacks_SetLocationCallback ( _global_def_callbacks, &handler_DefLocation ); + OTF2_GlobalDefReaderCallbacks_SetLocationGroupCallback ( _global_def_callbacks, handler_DefLocationGroup ); + OTF2_GlobalDefReaderCallbacks_SetStringCallback ( _global_def_callbacks, &handler_DefString ); + OTF2_GlobalDefReaderCallbacks_SetClockPropertiesCallback( _global_def_callbacks, &handler_DefTimerResolution ); + OTF2_GlobalDefReaderCallbacks_SetRegionCallback ( _global_def_callbacks, &handler_DefState ); // SetGroupCallback to get containerType, stateType... ? - OTF2_GlobalDefReaderCallbacks_SetGroupCallback(_global_def_callbacks, &handler_DefGroup); + OTF2_GlobalDefReaderCallbacks_SetGroupCallback ( _global_def_callbacks, &handler_DefGroup ); - OTF2_GlobalDefReaderCallbacks_SetMetricMemberCallback(_global_def_callbacks, &handler_DefMetricMember ); - OTF2_GlobalDefReaderCallbacks_SetMetricClassCallback(_global_def_callbacks, &handler_DefMetricClass ); - OTF2_GlobalDefReaderCallbacks_SetMetricInstanceCallback(_global_def_callbacks, &handler_DefMetricInstance ); + OTF2_GlobalDefReaderCallbacks_SetMetricMemberCallback (_global_def_callbacks, &handler_DefMetricMember ); + OTF2_GlobalDefReaderCallbacks_SetMetricClassCallback (_global_def_callbacks, &handler_DefMetricClass ); + OTF2_GlobalDefReaderCallbacks_SetMetricInstanceCallback (_global_def_callbacks, &handler_DefMetricInstance ); OTF2_GlobalDefReaderCallbacks_SetMetricClassRecorderCallback(_global_def_callbacks, &handler_DefMetricClassRecorder); + (void)t; } /* @@ -172,38 +173,41 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefString(void */*userData */, return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefSystemTreeNode(void */*userData */, +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefSystemTreeNode(void * /*userData */, OTF2_SystemTreeNodeRef tree_node_id, OTF2_StringRef name_id, - OTF2_StringRef class_id, + OTF2_StringRef /*class_id*/, OTF2_SystemTreeNodeRef parent_node_id) { OTF2_SystemTreeNode* temp = new OTF2_SystemTreeNode(); - temp->_node_id=tree_node_id; - temp->_name_id=name_id; - temp->_parent=parent_node_id; + temp->_node_id = tree_node_id; + temp->_name_id = name_id; + temp->_parent = parent_node_id; generate_string_id(temp); struct OTF2_SystemTreeNode *tree_node = ParserDefinitionOTF2::get_system_tree_node_by_id(parent_node_id); - if(tree_node != NULL) { + if( tree_node != NULL ) { tree_node->_child_nodes[tree_node_id] = temp; } _system_tree_node[tree_node_id] = temp; -#if DEBUG +#if defined(OTF2_DEBUG) cout<<"DefSystemTreeNode(node_id="<<tree_node_id<<", name="<<temp->_id_string<<", parent="; - if(tree_node) - cout<<tree_node->_id_string; - else - cout<<"(none)"; + if( tree_node ) { + cout << tree_node->_id_string; + } + else { + cout << "(none)"; + } cout<<"\n"; -#endif // DEBUG +#endif + return OTF2_CALLBACK_SUCCESS; } OTF2_CallbackCode ParserDefinitionOTF2::handler_DefLocationGroup(void */*userdata*/, OTF2_LocationGroupRef location_group_identifier, OTF2_StringRef name, - OTF2_LocationGroupType type, + OTF2_LocationGroupType /*type*/, OTF2_SystemTreeNodeRef system_tree_parent) { OTF2_LocationGroup *temp = new OTF2_LocationGroup(); temp->_group_id = location_group_identifier; @@ -217,24 +221,25 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefLocationGroup(void */*userdat } _location_group[location_group_identifier] = temp; -#if DEBUG +#if defined(OTF2_DEBUG) cout<<"DefLocationGroup(group_id="<<location_group_identifier<<", name="<<temp->_id_string<<", parent="; if(tree_node) cout<<tree_node->_id_string; else cout<<"(none)"; cout<<"\n"; -#endif // DEBUG +#endif // defined(OTF2_DEBUG) return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefLocation(void *userData, - OTF2_LocationRef locationIdentifier, - OTF2_StringRef name_id, - OTF2_LocationType location_type, - uint64_t numberOfEvents, - OTF2_LocationGroupRef locationGroup) { +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefLocation(void * userData, + OTF2_LocationRef locationIdentifier, + OTF2_StringRef name_id, + OTF2_LocationType /*location_type*/, + uint64_t numberOfEvents, + OTF2_LocationGroupRef locationGroup) +{ OTF2_Reader* reader = (OTF2_Reader *) userData; OTF2_EvtReader* evt_reader = OTF2_Reader_GetEvtReader(reader, locationIdentifier); OTF2_DefReader* def_reader = OTF2_Reader_GetDefReader(reader, locationIdentifier); @@ -254,18 +259,20 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefLocation(void *userData, } _location[locationIdentifier] = temp; -#if DEBUG +#if defined(OTF2_DEBUG) cout<<"DefLocation(id="<<locationIdentifier<<", name="<<temp->_id_string<<", parent="; if(location_group) cout<<location_group->_id_string; else cout<<"(none)"; cout<<"\n"; -#endif // DEBUG +#endif // defined(OTF2_DEBUG) + + (void)evt_reader; return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefState(void *userData, +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefState(void */*userData*/, OTF2_RegionRef self, OTF2_StringRef name, OTF2_StringRef canonicalName, @@ -282,14 +289,14 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefState(void *userData, return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefGroup(void *userData, - OTF2_GroupRef group_id, - OTF2_StringRef name_id, - OTF2_GroupType type, - OTF2_Paradigm paradigm, - OTF2_GroupFlag flags, - uint32_t numberOfMembers, - const uint64_t *members) { +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefGroup(void * /*userData*/, + OTF2_GroupRef group_id, + OTF2_StringRef name_id, + OTF2_GroupType type, + OTF2_Paradigm /*paradigm*/, + OTF2_GroupFlag /*flags*/, + uint32_t /*numberOfMembers*/, + const uint64_t */*members*/) { switch(type) { case OTF2_GROUP_TYPE_UNKNOWN: break; @@ -318,7 +325,7 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefGroup(void *userData, return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricMember( void* userData, +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricMember( void* /*userData*/, OTF2_MetricMemberRef self, OTF2_StringRef name, OTF2_StringRef description, @@ -345,7 +352,7 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricMember( void* return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricClass( void* userData, +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricClass( void* /*userData*/, OTF2_MetricRef self, uint8_t numberOfMetrics, const OTF2_MetricMemberRef* metricMembers, @@ -365,20 +372,20 @@ OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricClass( void* return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricInstance( void* userData, - OTF2_MetricRef self, - OTF2_MetricRef metricClass, - OTF2_LocationRef recorder, - OTF2_MetricScope metricScope, - uint64_t scope ) +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricInstance( void* /*userData*/, + OTF2_MetricRef /*self*/, + OTF2_MetricRef /*metricClass*/, + OTF2_LocationRef /*recorder*/, + OTF2_MetricScope /*metricScope*/, + uint64_t /*scope*/ ) { cout<<__FUNCTION__<<" not implemented\n"; return OTF2_CALLBACK_SUCCESS; } -OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricClassRecorder( void* userData, - OTF2_MetricRef metric, - OTF2_LocationRef recorder ) +OTF2_CallbackCode ParserDefinitionOTF2::handler_DefMetricClassRecorder( void* /*userData*/, + OTF2_MetricRef /*metric*/, + OTF2_LocationRef /*recorder*/ ) { cout<<__FUNCTION__<<" not implemented\n"; return OTF2_CALLBACK_SUCCESS; @@ -546,7 +553,6 @@ void ParserDefinitionOTF2::create_system_tree_node(Trace *t, OTF2_SystemTreeNode } void ParserDefinitionOTF2::create_container_types(Trace *t) { - unsigned int i; std::map<OTF2_SystemTreeNodeRef, OTF2_SystemTreeNode* >::const_iterator it_tree, end_tree; end_tree = _system_tree_node.end(); @@ -602,7 +608,9 @@ void ParserDefinitionOTF2::create_metric_member(Trace *t, OTF2_MetricMember m) { } } -void ParserDefinitionOTF2::create_metric_class(Trace *t, OTF2_MetricClass m) { +void ParserDefinitionOTF2::create_metric_class(Trace * /*t*/, + OTF2_MetricClass /*m*/) +{ // Nothing to do ? } diff --git a/src/parser/OTF2Parser/ParserDefinitionOTF2.hpp b/src/parser/OTF2Parser/ParserDefinitionOTF2.hpp index daa0d6f6123dce675f1be90f2f53fa1630b0aea1..b0de4edf1b908ba7a4179c1f82bdcdcd2d7e2faa 100644 --- a/src/parser/OTF2Parser/ParserDefinitionOTF2.hpp +++ b/src/parser/OTF2Parser/ParserDefinitionOTF2.hpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** use, modify and/or redistribute the software under the terms of the -** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following -** URL: "http://www.cecill.info". -** -** As a counterpart to the access to the source code and rights to copy, -** modify and redistribute granted by the license, users are provided -** only with a limited warranty and the software's author, the holder of -** the economic rights, and the successive licensors have only limited -** liability. -** -** In this respect, the user's attention is drawn to the risks associated -** with loading, using, modifying and/or developing or reproducing the -** software by the user in light of its specific status of free software, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** their requirements in conditions enabling the security of their -** systems and/or data to be ensured and, more generally, to use and -** operate it in the same conditions as regards security. -** -** The fact that you are presently reading this means that you have had -** knowledge of the CeCILL-A license and that you accept its terms. -** -** -** ViTE developers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** use, modify and/or redistribute the software under the terms of the + ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following + ** URL: "http://www.cecill.info". + ** + ** As a counterpart to the access to the source code and rights to copy, + ** modify and redistribute granted by the license, users are provided + ** only with a limited warranty and the software's author, the holder of + ** the economic rights, and the successive licensors have only limited + ** liability. + ** + ** In this respect, the user's attention is drawn to the risks associated + ** with loading, using, modifying and/or developing or reproducing the + ** software by the user in light of its specific status of free software, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** their requirements in conditions enabling the security of their + ** systems and/or data to be ensured and, more generally, to use and + ** operate it in the same conditions as regards security. + ** + ** The fact that you are presently reading this means that you have had + ** knowledge of the CeCILL-A license and that you accept its terms. + ** + ** + ** ViTE developers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ /** * @file ParserDefinitionOTF2.hpp * @@ -126,24 +126,24 @@ struct OTF2_Location { * \brief Contains the definition of a function (equivalent in Paje : State) */ struct OTF2_Function { - /*! \brief Name of the state */ - OTF2_StringRef _name_id; - /*! \brief Alternative name of the region (e.g. mangled name */ - OTF2_StringRef _canonicalName; - /*! \brief A more detailed description of this region */ - OTF2_StringRef _region_description; - /*! \brief Region role. */ - OTF2_RegionRole _regionRole; - /*! \brief Paradigm. */ - OTF2_Paradigm _paradigm; - /*! \brief Region flags. */ - OTF2_RegionFlag _regionFlags; - /*! \brief The source file where this region was declared */ - OTF2_StringRef _sourceFile; - /*! \brieg Starting line number of this region in the source file. */ - uint32_t _begin_line_number; - /*! \brieg Ending line number of this region in the source file. */ - uint32_t _end_line_number; + /*! \brief Name of the state */ + OTF2_StringRef _name_id; + /*! \brief Alternative name of the region (e.g. mangled name */ + OTF2_StringRef _canonicalName; + /*! \brief A more detailed description of this region */ + OTF2_StringRef _region_description; + /*! \brief Region role. */ + OTF2_RegionRole _regionRole; + /*! \brief Paradigm. */ + OTF2_Paradigm _paradigm; + /*! \brief Region flags. */ + OTF2_RegionFlag _regionFlags; + /*! \brief The source file where this region was declared */ + OTF2_StringRef _sourceFile; + /*! \brieg Starting line number of this region in the source file. */ + uint32_t _begin_line_number; + /*! \brieg Ending line number of this region in the source file. */ + uint32_t _end_line_number; }; struct OTF2_MetricMember { diff --git a/src/parser/OTF2Parser/ParserEventOTF2.cpp b/src/parser/OTF2Parser/ParserEventOTF2.cpp index 7f89811b14c9187e65c83c5464ab26115387914f..23753c6ec3dcec9ce6deea3fdf9d37c51210968f 100644 --- a/src/parser/OTF2Parser/ParserEventOTF2.cpp +++ b/src/parser/OTF2Parser/ParserEventOTF2.cpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** use, modify and/or redistribute the software under the terms of the -** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following -** URL: "http://www.cecill.info". -** -** As a counterpart to the access to the source code and rights to copy, -** modify and redistribute granted by the license, users are provided -** only with a limited warranty and the software's author, the holder of -** the economic rights, and the successive licensors have only limited -** liability. -** -** In this respect, the user's attention is drawn to the risks associated -** with loading, using, modifying and/or developing or reproducing the -** software by the user in light of its specific status of free software, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** their requirements in conditions enabling the security of their -** systems and/or data to be ensured and, more generally, to use and -** operate it in the same conditions as regards security. -** -** The fact that you are presently reading this means that you have had -** knowledge of the CeCILL-A license and that you accept its terms. -** -** -** ViTE developers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** use, modify and/or redistribute the software under the terms of the + ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following + ** URL: "http://www.cecill.info". + ** + ** As a counterpart to the access to the source code and rights to copy, + ** modify and redistribute granted by the license, users are provided + ** only with a limited warranty and the software's author, the holder of + ** the economic rights, and the successive licensors have only limited + ** liability. + ** + ** In this respect, the user's attention is drawn to the risks associated + ** with loading, using, modifying and/or developing or reproducing the + ** software by the user in light of its specific status of free software, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** their requirements in conditions enabling the security of their + ** systems and/or data to be ensured and, more generally, to use and + ** operate it in the same conditions as regards security. + ** + ** The fact that you are presently reading this means that you have had + ** knowledge of the CeCILL-A license and that you accept its terms. + ** + ** + ** ViTE developers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ /** * @file ParserEventOTF2.cpp * @@ -165,16 +165,16 @@ void ParserEventOTF2::set_handlers(OTF2_Reader *reader, Trace *trace) { } -#ifdef DEBUG -#define ENTER_CALLBACK(timestamp, locationID) do { \ - Date d = ParserDefinitionOTF2::get_timestamp(time); \ - OTF2_Location *temp_location = ParserDefinitionOTF2::get_location_by_id(locationID); \ - const String proc_name = String(ParserDefinitionOTF2::get_string_id(temp_location)); \ - cout<<d.to_string()<<" - "<<proc_name.to_string()<<" - "<<__FUNCTION__<<"\n"; \ - } while(0) +#if defined(OTF2_DEBUG) +static inline void ENTER_CALLBACK( OTF2_TimeStamp time, OTF2_LocationRef locationID ) { + Date d = ParserDefinitionOTF2::get_timestamp(time); + OTF2_Location *temp_location = ParserDefinitionOTF2::get_location_by_id(locationID); + const String proc_name = String(ParserDefinitionOTF2::get_string_id(temp_location)); + cout<<d.to_string()<<" - "<<proc_name.to_string()<<" - "<<__FUNCTION__<<"\n"; +} #else -#define ENTER_CALLBACK(timestamp, locationID) do { \ - } while(0) +static inline void ENTER_CALLBACK( OTF2_TimeStamp, OTF2_LocationRef ) { +} #endif #define NOT_IMPLEMENTED_YET(timestamp) do { \ @@ -183,13 +183,13 @@ void ParserEventOTF2::set_handlers(OTF2_Reader *reader, Trace *trace) { return OTF2_CALLBACK_SUCCESS; \ } while(0) -OTF2_CallbackCode ParserEventOTF2::callback_ProgramBegin(OTF2_LocationRef locationID, - OTF2_TimeStamp time, - void *userData, - OTF2_AttributeList *attributeList, - OTF2_StringRef programName, - uint32_t numberOfArguments, - const OTF2_StringRef *programArguments) +OTF2_CallbackCode ParserEventOTF2::callback_ProgramBegin(OTF2_LocationRef locationID, + OTF2_TimeStamp time, + void * /*userData*/, + OTF2_AttributeList * /*attributeList*/, + OTF2_StringRef /*programName*/, + uint32_t /*numberOfArguments*/, + const OTF2_StringRef * /*programArguments*/ ) { ENTER_CALLBACK(time, locationID); // make sure get_timestamp is called anyway since it initialize the first timestamp @@ -198,10 +198,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_ProgramBegin(OTF2_LocationRef locat } OTF2_CallbackCode ParserEventOTF2::callback_ProgramEnd(OTF2_LocationRef locationID, - OTF2_TimeStamp time, - void *userData, - OTF2_AttributeList *attributeList, - int64_t exitStatus) + OTF2_TimeStamp time, + void * /*userData*/, + OTF2_AttributeList * /*attributeList*/, + int64_t /*exitStatus*/ ) { ENTER_CALLBACK(time, locationID); return OTF2_CALLBACK_SUCCESS; @@ -210,11 +210,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_ProgramEnd(OTF2_LocationRef locatio // // Start definition of handlers for OTF2 event records // -OTF2_CallbackCode ParserEventOTF2::callback_Enter(OTF2_LocationRef locationID, - OTF2_TimeStamp time, - void *userData, - OTF2_AttributeList *attributes, - OTF2_RegionRef regionID) +OTF2_CallbackCode ParserEventOTF2::callback_Enter(OTF2_LocationRef locationID, + OTF2_TimeStamp time, + void *userData, + OTF2_AttributeList */*attributes*/, + OTF2_RegionRef regionID) { ENTER_CALLBACK(time, locationID); Trace *t = (Trace *)userData; @@ -228,9 +228,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_Enter(OTF2_LocationRef locationID, const String proc_name = String(ParserDefinitionOTF2::get_string_id(temp_location)); Container* temp_container = temp_location->container; -#if DEBUG +#if defined(OTF2_DEBUG) cout<<d.to_string()<<" Enter_print(location="<<proc_name.to_string()<<", region="<<regionID<<", fname="<<function_name.to_string()<<")\n"; -#endif // DEBUG +#endif // defined(OTF2_DEBUG) // get the state type String state_type_string("Function"); @@ -263,7 +263,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_Enter(OTF2_LocationRef locationID, OTF2_CallbackCode ParserEventOTF2::callback_Leave(OTF2_LocationRef locationID, OTF2_TimeStamp time, void *userData, - OTF2_AttributeList *attributes, + OTF2_AttributeList */*attributes*/, OTF2_RegionRef regionID) { ENTER_CALLBACK(time, locationID); @@ -279,9 +279,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_Leave(OTF2_LocationRef locationID, const String proc_name = String(ParserDefinitionOTF2::get_string_id(temp_location)); Container* temp_container = temp_location->container; -#if DEBUG +#if defined(OTF2_DEBUG) cout<<d.to_string()<<" Leave_print(location="<<proc_name.to_string()<<", region="<<regionID<<", fname="<<function_name.to_string()<<")\n"; -#endif // DEBUG +#endif // defined(OTF2_DEBUG) // get the state type String state_type_string("Function"); @@ -302,7 +302,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_Leave(OTF2_LocationRef locationID, OTF2_CallbackCode ParserEventOTF2::callback_MpiSend(OTF2_LocationRef sender, OTF2_TimeStamp time, void *userData, - OTF2_AttributeList *attributes, + OTF2_AttributeList */*attributes*/, uint32_t receiver, OTF2_CommRef communicator, uint32_t msgTag, @@ -323,7 +323,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiSend(OTF2_LocationRef sender, String ancestor_string = String(ParserDefinitionOTF2::get_string_id(temp_ancestor)); String receiver_string = String(ParserDefinitionOTF2::get_string_id(temp_receiver)); -#if DEBUG +#if defined(OTF2_DEBUG) cout<<d.to_string()<<" start_link(src="<<sender_string.to_string()<<", dest="<<receiver_string.to_string()<<")\n"; #endif String sender_type_string = String(ParserDefinitionOTF2::get_string_by_id(temp_sender->_name_id)); @@ -348,8 +348,6 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiSend(OTF2_LocationRef sender, ContainerType *destination_type = t->search_container_type(receiver_type_string); ContainerType *ancestor_type = t->search_container_type(ancestor_type_string); - EntityValue *value; - map<string, Value *> opt; if(_containers.find(sender_string) != _containers.end()) { @@ -374,7 +372,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiSend(OTF2_LocationRef sender, // receiver not found ancestor_container = t->search_container(ancestor_string); if(ancestor_container) { - _containers[ancestor_string] = ancestor_container; + _containers[ancestor_string] = ancestor_container; } } @@ -395,8 +393,6 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiSend(OTF2_LocationRef sender, assert(link_type != NULL); } - value = t->search_entity_value(name_string, link_type); - /* Creation of the optional fields */ if(length != 0) { Integer *length_int = new Integer(length); @@ -417,7 +413,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiIsend(OTF2_LocationRef locationID OTF2_CommRef communicator, uint32_t msgTag, uint64_t msgLength, - uint64_t requestID) + uint64_t /*requestID*/) { ENTER_CALLBACK(time, locationID); return callback_MpiSend(locationID, time, userData, attributeList, receiver, communicator, msgTag, msgLength); @@ -426,12 +422,12 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiIsend(OTF2_LocationRef locationID OTF2_CallbackCode ParserEventOTF2::callback_MpiRecv(OTF2_LocationRef receiver, OTF2_TimeStamp time, void *userData, - OTF2_AttributeList *attributes, + OTF2_AttributeList */*attributes*/, uint32_t sender, OTF2_CommRef communicator, uint32_t msgTag, uint64_t length) - { +{ ENTER_CALLBACK(time, receiver); Trace *t = (Trace *)userData; Date d = ParserDefinitionOTF2::get_timestamp(time); @@ -465,8 +461,6 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiRecv(OTF2_LocationRef receiver, ContainerType *ancestor_type = t->search_container_type(ancestor_string); ContainerType *sender_type = t->search_container_type(sender_string); - EntityValue *value; - map<string, Value *> opt; if(_containers.find(receiver_string) != _containers.end()) { @@ -487,7 +481,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiRecv(OTF2_LocationRef receiver, else { ancestor_cont = t->search_container(ancestor_string); if(ancestor_cont) - _containers[ancestor_string] = ancestor_cont; + _containers[ancestor_string] = ancestor_cont; } if(ancestor_type == 0) { @@ -507,8 +501,6 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiRecv(OTF2_LocationRef receiver, assert(link_type != NULL); } - value = t->search_entity_value(name_string, link_type); - /* Creation of the optional fields */ if(length != 0) { Integer *length_int = new Integer(length); @@ -529,7 +521,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiIrecv(OTF2_LocationRef locationID OTF2_CommRef communicator, uint32_t msgTag, uint64_t msgLength, - uint64_t requestID) { + uint64_t /*requestID*/) { ENTER_CALLBACK(time, locationID); // A MpiIrecv record indicates that a MPI message was received (MPI_IRECV). return callback_MpiRecv(locationID, time, userData, attributeList, sender, communicator, msgTag, msgLength); @@ -537,26 +529,26 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiIrecv(OTF2_LocationRef locationID OTF2_CallbackCode ParserEventOTF2::callback_Unknown( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_BufferFlush( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_TimeStamp stopTime ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_TimeStamp /*stopTime*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_MeasurementOnOff( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_MeasurementMode measurementMode ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_MeasurementMode /*measurementMode*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -564,9 +556,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_MeasurementOnOff( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_MpiIsendComplete( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t requestID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*requestID*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -574,9 +566,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiIsendComplete( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_MpiIrecvRequest( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t requestID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*requestID*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -584,9 +576,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiIrecvRequest( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_MpiRequestTest( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t requestID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*requestID*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -594,9 +586,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiRequestTest( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_MpiRequestCancelled( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t requestID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*requestID*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -604,8 +596,8 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiRequestCancelled( OTF2_LocationRe OTF2_CallbackCode ParserEventOTF2::callback_MpiCollectiveBegin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -614,13 +606,13 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiCollectiveBegin( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_MpiCollectiveEnd( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CollectiveOp collectiveOp, - OTF2_CommRef communicator, - uint32_t root, - uint64_t sizeSent, - uint64_t sizeReceived ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CollectiveOp /*collectiveOp*/, + OTF2_CommRef /*communicator*/, + uint32_t /*root*/, + uint64_t /*sizeSent*/, + uint64_t /*sizeReceived*/ ) { ENTER_CALLBACK(time, locationID); // NOT_IMPLEMENTED_YET(time); // Nothing to do here @@ -630,64 +622,64 @@ OTF2_CallbackCode ParserEventOTF2::callback_MpiCollectiveEnd( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_OmpFork( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint32_t numberOfRequestedThreads ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint32_t /*numberOfRequestedThreads*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_OmpJoin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_OmpAcquireLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint32_t lockID, - uint32_t acquisitionOrder ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint32_t /*lockID*/, + uint32_t /*acquisitionOrder*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_OmpReleaseLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint32_t lockID, - uint32_t acquisitionOrder ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint32_t /*lockID*/, + uint32_t /*acquisitionOrder*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_OmpTaskCreate( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t taskID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*taskID*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_OmpTaskSwitch( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t taskID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*taskID*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_OmpTaskComplete( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - uint64_t taskID ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + uint64_t /*taskID*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } @@ -695,7 +687,7 @@ OTF2_CallbackCode ParserEventOTF2::callback_OmpTaskComplete( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_Metric( OTF2_LocationRef locationID, OTF2_TimeStamp time, void* userData, - OTF2_AttributeList* attributeList, + OTF2_AttributeList* /*attributeList*/, OTF2_MetricRef metric, uint8_t numberOfMetrics, const OTF2_Type* typeIDs, @@ -749,39 +741,39 @@ OTF2_CallbackCode ParserEventOTF2::callback_Metric( OTF2_LocationRef loca OTF2_CallbackCode ParserEventOTF2::callback_ParameterString( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_ParameterRef parameter, - OTF2_StringRef string ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_ParameterRef /*parameter*/, + OTF2_StringRef /*string*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_ParameterInt( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_ParameterRef parameter, - int64_t value ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_ParameterRef /*parameter*/, + int64_t /*value*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_ParameterUnsignedInt( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_ParameterRef parameter, - uint64_t value ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_ParameterRef /*parameter*/, + uint64_t /*value*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_RmaWinCreate( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -789,9 +781,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaWinCreate( OTF2_LocationRef lo OTF2_CallbackCode ParserEventOTF2::callback_RmaWinDestroy( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -799,33 +791,33 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaWinDestroy( OTF2_LocationRef l OTF2_CallbackCode ParserEventOTF2::callback_RmaCollectiveBegin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_RmaCollectiveEnd( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CollectiveOp collectiveOp, - OTF2_RmaSyncLevel syncLevel, - OTF2_RmaWinRef win, - uint32_t root, - uint64_t bytesSent, - uint64_t bytesReceived ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CollectiveOp /*collectiveOp*/, + OTF2_RmaSyncLevel /*syncLevel*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*root*/, + uint64_t /*bytesSent*/, + uint64_t /*bytesReceived*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_RmaGroupSync( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaSyncLevel syncLevel, - OTF2_RmaWinRef win, - OTF2_GroupRef group ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaSyncLevel /*syncLevel*/, + OTF2_RmaWinRef /*win*/, + OTF2_GroupRef /*group*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -833,12 +825,12 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaGroupSync( OTF2_LocationRef lo OTF2_CallbackCode ParserEventOTF2::callback_RmaRequestLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - uint64_t lockId, - OTF2_LockType lockType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + uint64_t /*lockId*/, + OTF2_LockType /*lockType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -846,12 +838,12 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaRequestLock( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_RmaAcquireLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - uint64_t lockId, - OTF2_LockType lockType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + uint64_t /*lockId*/, + OTF2_LockType /*lockType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -859,12 +851,12 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaAcquireLock( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_RmaTryLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - uint64_t lockId, - OTF2_LockType lockType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + uint64_t /*lockId*/, + OTF2_LockType /*lockType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -872,11 +864,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaTryLock( OTF2_LocationRef loca OTF2_CallbackCode ParserEventOTF2::callback_RmaReleaseLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - uint64_t lockId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + uint64_t /*lockId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -884,11 +876,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaReleaseLock( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_RmaSync( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - OTF2_RmaSyncType syncType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + OTF2_RmaSyncType /*syncType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -896,9 +888,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaSync( OTF2_LocationRef locatio OTF2_CallbackCode ParserEventOTF2::callback_RmaWaitChange( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -906,38 +898,38 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaWaitChange( OTF2_LocationRef l OTF2_CallbackCode ParserEventOTF2::callback_RmaPut( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - uint64_t bytes, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + uint64_t /*bytes*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_RmaGet( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - uint64_t bytes, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + uint64_t /*bytes*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_RmaAtomic( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint32_t remote, - OTF2_RmaAtomicType type, - uint64_t bytesSent, - uint64_t bytesReceived, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint32_t /*remote*/, + OTF2_RmaAtomicType /*type*/, + uint64_t /*bytesSent*/, + uint64_t /*bytesReceived*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -945,10 +937,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaAtomic( OTF2_LocationRef locat OTF2_CallbackCode ParserEventOTF2::callback_RmaOpCompleteBlocking( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -956,10 +948,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaOpCompleteBlocking( OTF2_Location OTF2_CallbackCode ParserEventOTF2::callback_RmaOpCompleteNonBlocking( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -967,10 +959,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaOpCompleteNonBlocking( OTF2_Locat OTF2_CallbackCode ParserEventOTF2::callback_RmaOpTest( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -978,10 +970,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaOpTest( OTF2_LocationRef locat OTF2_CallbackCode ParserEventOTF2::callback_RmaOpCompleteRemote( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_RmaWinRef win, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_RmaWinRef /*win*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -989,28 +981,28 @@ OTF2_CallbackCode ParserEventOTF2::callback_RmaOpCompleteRemote( OTF2_LocationRe OTF2_CallbackCode ParserEventOTF2::callback_ThreadFork( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_Paradigm model, - uint32_t numberOfRequestedThreads ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_Paradigm /*model*/, + uint32_t /*numberOfRequestedThreads*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_ThreadJoin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_Paradigm model ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_Paradigm /*model*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_ThreadTeamBegin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadTeam ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadTeam*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1018,9 +1010,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadTeamBegin( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_ThreadTeamEnd( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadTeam ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadTeam*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1028,11 +1020,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadTeamEnd( OTF2_LocationRef l OTF2_CallbackCode ParserEventOTF2::callback_ThreadAcquireLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_Paradigm model, - uint32_t lockID, - uint32_t acquisitionOrder ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_Paradigm /*model*/, + uint32_t /*lockID*/, + uint32_t /*acquisitionOrder*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1040,11 +1032,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadAcquireLock( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_ThreadReleaseLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_Paradigm model, - uint32_t lockID, - uint32_t acquisitionOrder ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_Paradigm /*model*/, + uint32_t /*lockID*/, + uint32_t /*acquisitionOrder*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1052,11 +1044,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadReleaseLock( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_ThreadTaskCreate( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadTeam, - uint32_t creatingThread, - uint32_t generationNumber ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadTeam*/, + uint32_t /*creatingThread*/, + uint32_t /*generationNumber*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1064,11 +1056,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadTaskCreate( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_ThreadTaskSwitch( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadTeam, - uint32_t creatingThread, - uint32_t generationNumber ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadTeam*/, + uint32_t /*creatingThread*/, + uint32_t /*generationNumber*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1076,11 +1068,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadTaskSwitch( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_ThreadTaskComplete( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadTeam, - uint32_t creatingThread, - uint32_t generationNumber ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadTeam*/, + uint32_t /*creatingThread*/, + uint32_t /*generationNumber*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1088,20 +1080,20 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadTaskComplete( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_ThreadCreate( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadContingent, - uint64_t sequenceCount ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadContingent*/, + uint64_t /*sequenceCount*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_ThreadBegin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadContingent, - uint64_t sequenceCount ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadContingent*/, + uint64_t /*sequenceCount*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here @@ -1110,10 +1102,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadBegin( OTF2_LocationRef loc OTF2_CallbackCode ParserEventOTF2::callback_ThreadWait( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadContingent, - uint64_t sequenceCount ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadContingent*/, + uint64_t /*sequenceCount*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1121,10 +1113,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadWait( OTF2_LocationRef loca OTF2_CallbackCode ParserEventOTF2::callback_ThreadEnd( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CommRef threadContingent, - uint64_t sequenceCount ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CommRef /*threadContingent*/, + uint64_t /*sequenceCount*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1132,10 +1124,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_ThreadEnd( OTF2_LocationRef locat OTF2_CallbackCode ParserEventOTF2::callback_CallingContextEnter( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CallingContextRef callingContext, - uint32_t unwindDistance ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CallingContextRef /*callingContext*/, + uint32_t /*unwindDistance*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1143,9 +1135,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_CallingContextEnter( OTF2_LocationRe OTF2_CallbackCode ParserEventOTF2::callback_CallingContextLeave( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CallingContextRef callingContext ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CallingContextRef /*callingContext*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1153,11 +1145,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_CallingContextLeave( OTF2_LocationRe OTF2_CallbackCode ParserEventOTF2::callback_CallingContextSample( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_CallingContextRef callingContext, - uint32_t unwindDistance, - OTF2_InterruptGeneratorRef interruptGenerator ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_CallingContextRef /*callingContext*/, + uint32_t /*unwindDistance*/, + OTF2_InterruptGeneratorRef /*interruptGenerator*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1165,12 +1157,12 @@ OTF2_CallbackCode ParserEventOTF2::callback_CallingContextSample( OTF2_LocationR OTF2_CallbackCode ParserEventOTF2::callback_IoCreateHandle( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - OTF2_IoAccessMode mode, - OTF2_IoCreationFlag creationFlags, - OTF2_IoStatusFlag statusFlags ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + OTF2_IoAccessMode /*mode*/, + OTF2_IoCreationFlag /*creationFlags*/, + OTF2_IoStatusFlag /*statusFlags*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1178,9 +1170,9 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoCreateHandle( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_IoDestroyHandle( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1188,11 +1180,11 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoDestroyHandle( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_IoDuplicateHandle( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef oldHandle, - OTF2_IoHandleRef newHandle, - OTF2_IoStatusFlag statusFlags ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*oldHandle*/, + OTF2_IoHandleRef /*newHandle*/, + OTF2_IoStatusFlag /*statusFlags*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1200,12 +1192,12 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoDuplicateHandle( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_IoSeek( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - int64_t offsetRequest, - OTF2_IoSeekOption whence, - uint64_t offsetResult ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + int64_t /*offsetRequest*/, + OTF2_IoSeekOption /*whence*/, + uint64_t /*offsetResult*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1213,10 +1205,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoSeek( OTF2_LocationRef location OTF2_CallbackCode ParserEventOTF2::callback_IoChangeStatusFlags( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - OTF2_IoStatusFlag statusFlags ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + OTF2_IoStatusFlag /*statusFlags*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1224,10 +1216,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoChangeStatusFlags( OTF2_LocationRe OTF2_CallbackCode ParserEventOTF2::callback_IoDeleteFile( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoParadigmRef ioParadigm, - OTF2_IoFileRef file ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoParadigmRef /*ioParadigm*/, + OTF2_IoFileRef /*file*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1235,13 +1227,13 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoDeleteFile( OTF2_LocationRef lo OTF2_CallbackCode ParserEventOTF2::callback_IoOperationBegin( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - OTF2_IoOperationMode mode, - OTF2_IoOperationFlag operationFlags, - uint64_t bytesRequest, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + OTF2_IoOperationMode /*mode*/, + OTF2_IoOperationFlag /*operationFlags*/, + uint64_t /*bytesRequest*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1249,10 +1241,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoOperationBegin( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_IoOperationTest( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1260,21 +1252,21 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoOperationTest( OTF2_LocationRef OTF2_CallbackCode ParserEventOTF2::callback_IoOperationIssued( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); NOT_IMPLEMENTED_YET(time); } OTF2_CallbackCode ParserEventOTF2::callback_IoOperationComplete( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - uint64_t bytesResult, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + uint64_t /*bytesResult*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1282,10 +1274,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoOperationComplete( OTF2_LocationRe OTF2_CallbackCode ParserEventOTF2::callback_IoOperationCancelled( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - uint64_t matchingId ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + uint64_t /*matchingId*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1293,10 +1285,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoOperationCancelled( OTF2_LocationR OTF2_CallbackCode ParserEventOTF2::callback_IoAcquireLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - OTF2_LockType lockType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + OTF2_LockType /*lockType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1304,10 +1296,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoAcquireLock( OTF2_LocationRef l OTF2_CallbackCode ParserEventOTF2::callback_IoReleaseLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - OTF2_LockType lockType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + OTF2_LockType /*lockType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; @@ -1315,10 +1307,10 @@ OTF2_CallbackCode ParserEventOTF2::callback_IoReleaseLock( OTF2_LocationRef l OTF2_CallbackCode ParserEventOTF2::callback_IoTryLock( OTF2_LocationRef locationID, OTF2_TimeStamp time, - void* userData, - OTF2_AttributeList* attributeList, - OTF2_IoHandleRef handle, - OTF2_LockType lockType ) { + void* /*userData*/, + OTF2_AttributeList* /*attributeList*/, + OTF2_IoHandleRef /*handle*/, + OTF2_LockType /*lockType*/ ) { ENTER_CALLBACK(time, locationID); // Nothing to do here return OTF2_CALLBACK_SUCCESS; diff --git a/src/parser/OTFParser/mt_ParserOTF.cpp b/src/parser/OTFParser/mt_ParserOTF.cpp index 01a11b0ca9e160950d4edcdbc644345d12075d7a..5a1dd8c3e04d9b3b291dd1b82854ce02bef49230 100644 --- a/src/parser/OTFParser/mt_ParserOTF.cpp +++ b/src/parser/OTFParser/mt_ParserOTF.cpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** use, modify and/or redistribute the software under the terms of the -** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following -** URL: "http://www.cecill.info". -** -** As a counterpart to the access to the source code and rights to copy, -** modify and redistribute granted by the license, users are provided -** only with a limited warranty and the software's author, the holder of -** the economic rights, and the successive licensors have only limited -** liability. -** -** In this respect, the user's attention is drawn to the risks associated -** with loading, using, modifying and/or developing or reproducing the -** software by the user in light of its specific status of free software, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** their requirements in conditions enabling the security of their -** systems and/or data to be ensured and, more generally, to use and -** operate it in the same conditions as regards security. -** -** The fact that you are presently reading this means that you have had -** knowledge of the CeCILL-A license and that you accept its terms. -** -** -** ViTE developers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** use, modify and/or redistribute the software under the terms of the + ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following + ** URL: "http://www.cecill.info". + ** + ** As a counterpart to the access to the source code and rights to copy, + ** modify and redistribute granted by the license, users are provided + ** only with a limited warranty and the software's author, the holder of + ** the economic rights, and the successive licensors have only limited + ** liability. + ** + ** In this respect, the user's attention is drawn to the risks associated + ** with loading, using, modifying and/or developing or reproducing the + ** software by the user in light of its specific status of free software, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** their requirements in conditions enabling the security of their + ** systems and/or data to be ensured and, more generally, to use and + ** operate it in the same conditions as regards security. + ** + ** The fact that you are presently reading this means that you have had + ** knowledge of the CeCILL-A license and that you accept its terms. + ** + ** + ** ViTE developers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ #include <iostream> #include <fstream> @@ -77,7 +77,7 @@ mt_ParserOTF::mt_ParserOTF(const string &filename) : Parser(filename) {} mt_ParserOTF::~mt_ParserOTF() {}; void mt_ParserOTF::parse(Trace &trace, - bool finish_trace_after_parse) { + bool finish_trace_after_parse) { ParserDefinitionOTF *parserdefinition; @@ -91,13 +91,13 @@ void mt_ParserOTF::parse(Trace &trace, const std::string filename = get_next_file_to_parse(); if(filename == "") return ; - /* OTF_MasterControl* mc; - mc = OTF_MasterControl_new( manager ); - OTF_MasterControl_read( mc, filename.c_str()); + /* OTF_MasterControl* mc; + mc = OTF_MasterControl_new( manager ); + OTF_MasterControl_read( mc, filename.c_str()); - uint32_t streamcount = OTF_MasterControl_getCount( mc ); + uint32_t streamcount = OTF_MasterControl_getCount( mc ); - printf("nb of streams %d\n", streamcount);*/ + printf("nb of streams %d\n", streamcount);*/ OTF_Reader *reader; int ret = 0; @@ -111,14 +111,14 @@ void mt_ParserOTF::parse(Trace &trace, int n_events=10000; OTF_Trace_builder_struct* tb_structs= new OTF_Trace_builder_struct[n_events]; parserevent2->connect((const QObject*)this, - SIGNAL(build_trace(int, OTF_Trace_builder_struct*)), - SLOT(build_trace(int, OTF_Trace_builder_struct*))); + SIGNAL(build_trace(int, OTF_Trace_builder_struct*)), + SLOT(build_trace(int, OTF_Trace_builder_struct*))); parserevent2->connect((const QObject*)this, - SIGNAL(build_finished()), - SLOT(build_finished())); - QThread traceThread; + SIGNAL(build_finished()), + SLOT(build_finished())); + QThread traceThread; parserevent2->moveToThread(&traceThread); - traceThread.start(); + traceThread.start(); reader = OTF_Reader_open(filename.c_str(), manager); if(reader == NULL) { @@ -129,6 +129,7 @@ void mt_ParserOTF::parse(Trace &trace, if(finish_trace_after_parse) { // true by default trace.finish(); } + delete[] tb_structs; return; } @@ -153,7 +154,7 @@ void mt_ParserOTF::parse(Trace &trace, freeSlots.acquire(); //do not produce too fast (5 blocks max at a time) emit(build_trace(n_read, tb_structs)); linesProduced.release(); - tb_structs= new OTF_Trace_builder_struct[n_events]; + tb_structs = new OTF_Trace_builder_struct[n_events]; } freeSlots.acquire(); //do not produce too fast (5 blocks max at a time) @@ -166,8 +167,8 @@ void mt_ParserOTF::parse(Trace &trace, while ( ((ret=parserevent->read_markers(reader, tb_structs,&n_read)) != 0) && (!_is_canceled)) { - freeSlots.acquire(); //do not produce too fast (5 blocks max at a time) - emit(build_trace(n_read, tb_structs)); + freeSlots.acquire(); //do not produce too fast (5 blocks max at a time) + emit(build_trace(n_read, tb_structs)); linesProduced.release(); tb_structs= new OTF_Trace_builder_struct[n_events]; } @@ -183,9 +184,9 @@ void mt_ParserOTF::parse(Trace &trace, } QMutexLocker locker(&mutex); - emit build_finished(); - ended.wait(&mutex); - locker.unlock(); + emit build_finished(); + ended.wait(&mutex); + locker.unlock(); traceThread.quit(); traceThread.wait(); delete parserevent; diff --git a/src/parser/PajeParser/ParserDefinitionPaje.cpp b/src/parser/PajeParser/ParserDefinitionPaje.cpp index 500b0d8240d4ac107cc9af79a88d71c0ea8d3d0b..53f6921146f86dd7c0817819abaa8650a78da516 100644 --- a/src/parser/PajeParser/ParserDefinitionPaje.cpp +++ b/src/parser/PajeParser/ParserDefinitionPaje.cpp @@ -209,7 +209,7 @@ void ParserDefinitionPaje::enter_definition(const PajeLine_t *line){ } // Get the trid of the definition in the trace (trid) - if(sscanf(tridstr, "%u", &trid) != 1){ + if(sscanf(tridstr, "%d", &trid) != 1){ Error::set(Error::VITE_ERR_EXPECT_ID_DEF, line->_id, Error::VITE_ERRCODE_ERROR); return; } @@ -232,7 +232,7 @@ void ParserDefinitionPaje::enter_definition(const PajeLine_t *line){ } // Everything is ok, we initialize the currentEvtDef - assert(_defid == _EventDefs.size()); + assert( _defid == (int)_EventDefs.size()); def._name = defname; def._id = _AvailableEvDef[defname]._id; @@ -266,7 +266,7 @@ void ParserDefinitionPaje::leave_definition(const PajeLine_t *line){ // We remove the definition _EvDefTrId2Id.erase(_EventDefs[_defid]._trid); _EventDefs.pop_back(); - assert( _defid == _EventDefs.size() ); + assert( _defid == (int)_EventDefs.size() ); return; } @@ -274,7 +274,7 @@ void ParserDefinitionPaje::leave_definition(const PajeLine_t *line){ PajeDef::print(&_FieldNames,&_EventDefs[_defid]); #endif _defid++; - assert( _defid == _EventDefs.size() ); + assert( _defid == (int)_EventDefs.size() ); } void ParserDefinitionPaje::add_field_to_definition(const PajeLine_t *line){ @@ -320,7 +320,7 @@ void ParserDefinitionPaje::add_field_to_definition(const PajeLine_t *line){ strcpy_s(newfn, size, fieldname); #endif // In case there are more than the default value - if(_FieldNames.size() <= _nbFieldNames) { + if ( (int)_FieldNames.size() <= _nbFieldNames ) { _FieldNames.resize(2*_nbFieldNames); } _FieldNames[_nbFieldNames]._name = newfn; diff --git a/src/parser/PajeParser/ParserEventPaje.cpp b/src/parser/PajeParser/ParserEventPaje.cpp index 284393f436f3f78603c5832b2b6bd09498ebc9cc..66e3cfec09e5903f574484d8d696f29355665c09 100644 --- a/src/parser/PajeParser/ParserEventPaje.cpp +++ b/src/parser/PajeParser/ParserEventPaje.cpp @@ -100,7 +100,7 @@ void ParserEventPaje::store_event(const PajeLine *line, int idname, idtype; // We check if we have an event identifier - if(sscanf(line->_tokens[0], "%u", &trid) != 1){ + if(sscanf(line->_tokens[0], "%d", &trid) != 1){ Error::set(Error::VITE_ERR_EXPECT_ID_DEF, line->_id, Error::VITE_ERRCODE_WARNING); return; } diff --git a/src/parser/PajeParser/mt_ParserEventPaje.cpp b/src/parser/PajeParser/mt_ParserEventPaje.cpp index eabcf8af78a593e33768a389fc0119f1d686a710..3a8b040c5e196a60138c5e404e80867517272270 100644 --- a/src/parser/PajeParser/mt_ParserEventPaje.cpp +++ b/src/parser/PajeParser/mt_ParserEventPaje.cpp @@ -99,7 +99,7 @@ int mt_ParserEventPaje::store_event(const PajeLine *line, int idname, idtype; // We check if we have an event identifier - if(sscanf(line->_tokens[0], "%u", &trid) != 1){ + if(sscanf(line->_tokens[0], "%d", &trid) != 1){ Error::set(Error::VITE_ERR_EXPECT_ID_DEF, line->_id, Error::VITE_ERRCODE_WARNING); return -1; } diff --git a/src/parser/PajeParser/mt_ParserPaje.cpp b/src/parser/PajeParser/mt_ParserPaje.cpp index 4f096bb303d5a1a749c2025c9ef882c9b04f9770..222ce6336e2566e973096a2a1ce599ab17957c3a 100644 --- a/src/parser/PajeParser/mt_ParserPaje.cpp +++ b/src/parser/PajeParser/mt_ParserPaje.cpp @@ -179,7 +179,6 @@ void mt_ParserPaje::parse(Trace &trace, std::string filename = get_next_file_to_parse(); while(filename != "") { - mt_PajeFileManager *file; // Open the trace try { _file = new mt_PajeFileManager(filename.c_str()); @@ -247,8 +246,7 @@ void mt_ParserPaje::parse(Trace &trace, } //send the last batch emit produced(i, line); - line=NULL; - delete file; + line = NULL; //send the finish signal to the BuilderThread, which will do the same to the TraceBuilderThread //both threads will then be finished and ready to destroy diff --git a/src/parser/ParsingThread.cpp b/src/parser/ParsingThread.cpp index 5d786b25c0b0b2a2645425ac85042628a244af00..c029a412af190f7674c3cdcf102284faedca00ce 100644 --- a/src/parser/ParsingThread.cpp +++ b/src/parser/ParsingThread.cpp @@ -113,7 +113,11 @@ void ParsingThread::dump(const std::string &path, _is_finished = true; #if defined(USE_ITC) && defined(BOOST_SERIALIZE) - if(! _is_killed)_trace->dump(path, filename); + if(! _is_killed) + _trace->dump(path, filename); +#else + (void)path; + (void)filename; #endif //locks the mutex and automatically unlocks it when going out of scope diff --git a/src/render/GanttDiagram.hpp b/src/render/GanttDiagram.hpp index 9601b04eedbf4dfe1103403573b0371904526555..1fe91383510b75fdac02f7aca7dc40b2323ba83c 100644 --- a/src/render/GanttDiagram.hpp +++ b/src/render/GanttDiagram.hpp @@ -203,6 +203,9 @@ public: */ inline void draw_container_text(const Element_pos x, const Element_pos y, const std::string &value) { + (void)x; + (void)y; + (void)value; return; } @@ -386,7 +389,7 @@ public: */ inline void draw_text_value(long int id, double text, double y) { - _render->draw_text_value(id,text,y); + _render->draw_text_value( id, text, y ); } /*! diff --git a/src/render/Render_alternate.cpp b/src/render/Render_alternate.cpp index e739922c46c02eb65f7ceb69a4830d0d16a31541..07da34bee06699eaf422a1ebb0aae176ad39af7a 100644 --- a/src/render/Render_alternate.cpp +++ b/src/render/Render_alternate.cpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** use, modify and/or redistribute the software under the terms of the -** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following -** URL: "http://www.cecill.info". -** -** As a counterpart to the access to the source code and rights to copy, -** modify and redistribute granted by the license, users are provided -** only with a limited warranty and the software's author, the holder of -** the economic rights, and the successive licensors have only limited -** liability. -** -** In this respect, the user's attention is drawn to the risks associated -** with loading, using, modifying and/or developing or reproducing the -** software by the user in light of its specific status of free software, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** their requirements in conditions enabling the security of their -** systems and/or data to be ensured and, more generally, to use and -** operate it in the same conditions as regards security. -** -** The fact that you are presently reading this means that you have had -** knowledge of the CeCILL-A license and that you accept its terms. -** -** -** ViTE developers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** use, modify and/or redistribute the software under the terms of the + ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following + ** URL: "http://www.cecill.info". + ** + ** As a counterpart to the access to the source code and rights to copy, + ** modify and redistribute granted by the license, users are provided + ** only with a limited warranty and the software's author, the holder of + ** the economic rights, and the successive licensors have only limited + ** liability. + ** + ** In this respect, the user's attention is drawn to the risks associated + ** with loading, using, modifying and/or developing or reproducing the + ** software by the user in light of its specific status of free software, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** their requirements in conditions enabling the security of their + ** systems and/or data to be ensured and, more generally, to use and + ** operate it in the same conditions as regards security. + ** + ** The fact that you are presently reading this means that you have had + ** knowledge of the CeCILL-A license and that you accept its terms. + ** + ** + ** ViTE developers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ /*! *\file Render_alternate.cpp */ @@ -89,9 +89,15 @@ using namespace std; extern "C" { - void checkGlError(){ - assert(rc == GL_NO_ERROR ); +#if !defined(NDEBUG) + static inline void checkGlError(){ + int rc = glGetError(); + assert( rc == GL_NO_ERROR ); + } +#else + static inline void checkGlError(){ } +#endif } @@ -133,7 +139,7 @@ Render_alternate::Render_alternate(Core* core, QWidget *parent, const QGLFormat& _links.clear(); vertical_line = 0; /*int error = FT_Init_FreeType(&library); - if(error != 0) + if(error != 0) std::cout << "an error occured during freetype initialization" << std::endl;*/ } @@ -174,10 +180,12 @@ void Render_alternate::initializeGL() { // Check for OpenGL version support const GLubyte * version = glGetString(GL_SHADING_LANGUAGE_VERSION); checkGlError(); - if (version==nullptr) + if ( version == nullptr ) { std::cout << "ERROR : could not detect your GLSL version" << std::endl; - else - std::cout << "Version GLSL : " << version << std::endl; + return; + } + + std::cout << "Version GLSL : " << version << std::endl; _glsl = (version[0]-'0')*100 + (version[2]-'0')*10 + version[3]-'0'; _shader = new Shader(_glsl); @@ -187,61 +195,60 @@ void Render_alternate::initializeGL() { _core->waitGUIInit->quit(); _modelview = glm::scale(_modelview, glm::vec3(1,-1,1)); _modelview = glm::translate(_modelview, glm::vec3(0,-Info::Render::height, 0)); - /* code from test on freetype library - see http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02*/ - /*face = FT_New_Face(library, - "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", - 0, - &face); - - if(error) - std::cout << "an error occured when loading font" << std::endl; - - error = FT_Set_Char_Size(face, - 0, - 16*64, - 1920, - 1080); - - if(error) - std::cout << "an error occured when changing character size" << std::endl; - - FT_Glyphslot g = face->glyph; - int w=0, h=0; - for(int i = 32; i < 128; i++) { - if(FT_Load_Char(face, i, FT_LOAD_RENDER)) { - fprintf(stderr, "Loading character %c failed!\n", i); - continue; - } - - w += g->bitmap.width; - h = std::max(h, g->bitmap.rows); - char_info[*p].ax = g->advance.x >> 6; - char_info[*p].ay = g->advance.y >> 6; - char_info[*p].bw = g->bitmap.width; - char_info[*p].bh = g->bitmap.rows; - char_info[*p].bl = g->bitmap_left; - char_info[*p].bt = g->bitmap_top; - char_info[*p].tx = (float)x / w; - - /* you might as well save this value as it is needed later on */ - - /*} - atlas_width = w; - GLuint tex; - glActiveTexture(GL_TEXTURE0); - glGenTextures(1, &tex); - glBindTexture(GL_TEXTURE_2D, tex); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0); -int x = 0; -for(int i = 32; i < 128; i++) { - if(FT_Load_Char(face, i, FT_LOAD_RENDER)) - continue; - glTexSubImage2D(GL_TEXTURE_2D, 0, x, 0, g->bitmap.width, g->bitmap.rows, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap.buffer); - x += g->bitmap.width; - }*/ + // code from test on freetype library + // see http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02 + // face = FT_New_Face(library, + // "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", + // 0, + // &face); + + // if(error) + // std::cout << "an error occured when loading font" << std::endl; + + // error = FT_Set_Char_Size(face, + // 0, + // 16*64, + // 1920, + // 1080); + + // if(error) + // std::cout << "an error occured when changing character size" << std::endl; + + // FT_Glyphslot g = face->glyph; + // int w=0, h=0; + // for(int i = 32; i < 128; i++) { + // if(FT_Load_Char(face, i, FT_LOAD_RENDER)) { + // fprintf(stderr, "Loading character %c failed!\n", i); + // continue; + // } + + // w += g->bitmap.width; + // h = std::max(h, g->bitmap.rows); + // char_info[*p].ax = g->advance.x >> 6; + // char_info[*p].ay = g->advance.y >> 6; + // char_info[*p].bw = g->bitmap.width; + // char_info[*p].bh = g->bitmap.rows; + // char_info[*p].bl = g->bitmap_left; + // char_info[*p].bt = g->bitmap_top; + // char_info[*p].tx = (float)x / w; + + // // you might as well save this value as it is needed later on + // } + // atlas_width = w; + // GLuint tex; + // glActiveTexture(GL_TEXTURE0); + // glGenTextures(1, &tex); + // glBindTexture(GL_TEXTURE_2D, tex); + // glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + // glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0); + // int x = 0; + // for(int i = 32; i < 128; i++) { + // if(FT_Load_Char(face, i, FT_LOAD_RENDER)) + // continue; + // glTexSubImage2D(GL_TEXTURE_2D, 0, x, 0, g->bitmap.width, g->bitmap.rows, GL_ALPHA, GL_UNSIGNED_BYTE, g->bitmap.buffer); + // x += g->bitmap.width; + // } } void Render_alternate::render_text(const QString &text, float x, float y, float w, float h){ @@ -284,26 +291,26 @@ void Render_alternate::render_text(const QString &text, float x, float y, float glUseProgram(0); delete image; /*trying freetype*/ - /* int n=0; - for(char*p = text; *p; p++){ - float x2 = x + c[*p].bl * sx; - float y2 = -y - c[*p].bt * sy; - float w = c[*p].bw * sx; - float h = c[*p].bh * sy; - /* Advance the cursor to the start of the next character */ - /* x += c[*p].ax * sx; - y += c[*p].ay * sy; - - /* Skip glyphs that have no pixels */ - /*if(!w || !h) - continue; - _text.add(x2, y2, c[*p].tx, 0); - _text.add(x2+w, -y2, c[*p].tx + c[*p].bw / atlas_width, 0); - _text.add(x2, -y2 - h, c[*p].tx, c[*p].bh / atlas_height); //remember: each glyph occupies a different amount of vertical space - _text.add(x2 + w, -y2 , c[*p].tx + c[*p].bw / atlas_width, 0); - _text.add(x2, -y2 - h, c[*p].tx, c[*p].bh / atlas_height); - _text.add(x2 + w, -y2 - h, c[*p].tx + c[*p].bw / atlas_width, c[*p].bh / atlas_height); - }*/ + // int n=0; + // for(char*p = text; *p; p++){ + // float x2 = x + c[*p].bl * sx; + // float y2 = -y - c[*p].bt * sy; + // float w = c[*p].bw * sx; + // float h = c[*p].bh * sy; + // /* Advance the cursor to the start of the next character */ + // x += c[*p].ax * sx; + // y += c[*p].ay * sy; + + // /* Skip glyphs that have no pixels */ + // if(!w || !h) + // continue; + // _text.add(x2, y2, c[*p].tx, 0); + // _text.add(x2+w, -y2, c[*p].tx + c[*p].bw / atlas_width, 0); + // _text.add(x2, -y2 - h, c[*p].tx, c[*p].bh / atlas_height); //remember: each glyph occupies a different amount of vertical space + // _text.add(x2 + w, -y2 , c[*p].tx + c[*p].bw / atlas_width, 0); + // _text.add(x2, -y2 - h, c[*p].tx, c[*p].bh / atlas_height); + // _text.add(x2 + w, -y2 - h, c[*p].tx + c[*p].bw / atlas_width, c[*p].bh / atlas_height); + // } } void Render_alternate::resizeGL(int width, int height) { @@ -318,8 +325,8 @@ void Render_alternate::resizeGL(int width, int height) { else if(_state == DRAWING_STATE_DRAWING) _projection = glm::ortho(0.f, Info::Render::width, 0.f, Info::Render::height, 0.f, 100.f); else{ - message << tr("Undefined value for the drawing state attribute - Render area").toStdString() << Message::ende; - } + message << tr("Undefined value for the drawing state attribute - Render area").toStdString() << Message::ende; + } } @@ -464,31 +471,31 @@ void Render_alternate::paintGL(){ it_arrow++; } if(Info::Render::_arrows_shape == 0){ //triangles - std::map<EntityValue*, std::vector<Element_pos> >::iterator it_link = _links.begin(); - _modelview = glm::scale(_modelview, glm::vec3(1/_x_state_scale, 1/_y_state_scale, 1)); - tmp2 = _modelview; - _arrows3.lock(); - while(it_link != _links.end()){ - Shader *s = _arrows[it_link->first].first->get_shader(); - glUseProgram(s->getProgramID()); - std::vector<Element_pos> v = it_link->second; - int n = v.size()/3; - if(it_link->first != nullptr && !it_link->first->get_visible()){ - it_link++; - continue; - } - for(int i=0 ; i<n ; i++){ - _modelview = glm::translate(_modelview, glm::vec3(_x_state_scale * v[3*i], _y_state_scale * v[3*i+1], 0)); - _modelview = glm::rotate(_modelview, v[3*i+2], glm::vec3(0, 0, 1)); - mvp = _projection * _modelview; - glUniformMatrix4fv(glGetUniformLocation(s->getProgramID(), "MVP"), 1, GL_FALSE, glm::value_ptr(mvp)); - - glDrawArrays(GL_TRIANGLES, 0, _arrows3.getNbVertex()); - _modelview = tmp2; - } + std::map<EntityValue*, std::vector<Element_pos> >::iterator it_link = _links.begin(); + _modelview = glm::scale(_modelview, glm::vec3(1/_x_state_scale, 1/_y_state_scale, 1)); + tmp2 = _modelview; + _arrows3.lock(); + while(it_link != _links.end()){ + Shader *s = _arrows[it_link->first].first->get_shader(); + glUseProgram(s->getProgramID()); + std::vector<Element_pos> v = it_link->second; + int n = v.size()/3; + if(it_link->first != nullptr && !it_link->first->get_visible()){ it_link++; + continue; + } + for(int i=0 ; i<n ; i++){ + _modelview = glm::translate(_modelview, glm::vec3(_x_state_scale * v[3*i], _y_state_scale * v[3*i+1], 0)); + _modelview = glm::rotate(_modelview, v[3*i+2], glm::vec3(0, 0, 1)); + mvp = _projection * _modelview; + glUniformMatrix4fv(glGetUniformLocation(s->getProgramID(), "MVP"), 1, GL_FALSE, glm::value_ptr(mvp)); + + glDrawArrays(GL_TRIANGLES, 0, _arrows3.getNbVertex()); + _modelview = tmp2; } - _arrows3.unlock(); + it_link++; + } + _arrows3.unlock(); } _modelview = tmp; } @@ -564,19 +571,19 @@ void Render_alternate::paintGL(){ qglColor(Qt::red); checkGlError(); renderText ( render_to_screen_x(trace_to_render_x(vertical_line))-metric.size(Qt::TextSingleLine,t).width() -5, - metric.height()-1, - t, - arial_font); + metric.height()-1, + t, + arial_font); /*render_text(t, - render_to_screen_x(trace_to_render_x(vertical_line))-metric.size(Qt::TextSingleLine,t).width() -5, - metric.height()-1, - 100, + render_to_screen_x(trace_to_render_x(vertical_line))-metric.size(Qt::TextSingleLine,t).width() -5, + metric.height()-1, + 100, 100);*/ glGetError(); /*render_text("Test", - vertical_line, - 0, - 1, + vertical_line, + 0, + 1, 1);*/ checkGlError(); @@ -589,7 +596,7 @@ void Render_alternate::paintGL(){ render_to_screen_y( trace_to_render_y((*it).second.y) + 0.5), QString().setNum((*it).second.value), arial_font); - } + } checkGlError(); @@ -607,70 +614,70 @@ void Render_alternate::paintGL(){ - if (trace_to_render_y(_texts[i].y) + 0.5 < 9) continue;/* Do not display text if it is on the ruler area */ + if (trace_to_render_y(_texts[i].y) + 0.5 < 9) continue;/* Do not display text if it is on the ruler area */ - //check if ye are not too close to another container to properly display the text - std::map<Element_pos,Element_pos>::const_iterator it = previous_by_column.find(_texts[i].x); - const std::map<Element_pos,Element_pos>::const_iterator it_end = previous_by_column.end(); + //check if ye are not too close to another container to properly display the text + std::map<Element_pos,Element_pos>::const_iterator it = previous_by_column.find(_texts[i].x); + const std::map<Element_pos,Element_pos>::const_iterator it_end = previous_by_column.end(); - if (it==it_end || render_to_screen_y(trace_to_render_y(_texts[i].y)) - render_to_screen_y(trace_to_render_y((*it).second))> height ){ - const QString text_elided = metric.elidedText(_texts[i].value.c_str(), Qt::ElideRight, 0.8 * _x_scale_container_state*Info::Screen::width/(Info::Trace::depth+1.)); - renderText ( render_to_screen_x(_texts[i].x * _x_scale_container_state/0.20), - render_to_screen_y( trace_to_render_y(_texts[i].y) + 0.5), - text_elided, - arial_font); + if (it==it_end || render_to_screen_y(trace_to_render_y(_texts[i].y)) - render_to_screen_y(trace_to_render_y((*it).second))> height ){ + const QString text_elided = metric.elidedText(_texts[i].value.c_str(), Qt::ElideRight, 0.8 * _x_scale_container_state*Info::Screen::width/(Info::Trace::depth+1.)); + renderText ( render_to_screen_x(_texts[i].x * _x_scale_container_state/0.20), + render_to_screen_y( trace_to_render_y(_texts[i].y) + 0.5), + text_elided, + arial_font); - //push only displayed values in the map - previous_by_column[_texts[i].x]=_texts[i].y; - //displayed++; - }//else{skipped++;} - } - /*Draw ruler text*/ - std::ostringstream buf_txt; - Element_pos graduation_diff; - Element_pos coeff_prefix; - graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible); - coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible); + //push only displayed values in the map + previous_by_column[_texts[i].x]=_texts[i].y; + //displayed++; + }//else{skipped++;} + } + /*Draw ruler text*/ + std::ostringstream buf_txt; + Element_pos graduation_diff; + Element_pos coeff_prefix; + graduation_diff = Ruler::get_graduation_diff(Info::Render::_x_min_visible, Info::Render::_x_max_visible); + coeff_prefix = Ruler::get_coeff_for_common_prefix(Info::Render::_x_min_visible, Info::Render::_x_max_visible); - arial_font.setPointSize(14); + arial_font.setPointSize(14); - buf_txt.str("");/* flush the buffer */ - buf_txt << "min: " << (double)Info::Render::_x_min_visible; + buf_txt.str("");/* flush the buffer */ + buf_txt << "min: " << (double)Info::Render::_x_min_visible; - renderText (render_to_screen_x(trace_to_render_x(Info::Render::_x_min_visible)), - render_to_screen_y(3), - buf_txt.str().c_str(), - arial_font); + renderText (render_to_screen_x(trace_to_render_x(Info::Render::_x_min_visible)), + render_to_screen_y(3), + buf_txt.str().c_str(), + arial_font); - buf_txt.str("");/* flush the buffer */ - buf_txt << "max: " << (double)Info::Render::_x_max_visible; + buf_txt.str("");/* flush the buffer */ + buf_txt << "max: " << (double)Info::Render::_x_max_visible; - renderText (render_to_screen_x(trace_to_render_x(Info::Render::_x_max_visible))-130, - render_to_screen_y(3), - buf_txt.str().c_str(), - arial_font); + renderText (render_to_screen_x(trace_to_render_x(Info::Render::_x_max_visible))-130, + render_to_screen_y(3), + buf_txt.str().c_str(), + arial_font); - buf_txt.str(""); - buf_txt << Ruler::get_common_part_string(Info::Render::_x_min_visible, coeff_prefix) << "--"; + buf_txt.str(""); + buf_txt << Ruler::get_common_part_string(Info::Render::_x_min_visible, coeff_prefix) << "--"; - renderText (render_to_screen_x(trace_to_render_x((Info::Render::_x_min_visible + - Info::Render::_x_max_visible) / 2)), - render_to_screen_y(3), - buf_txt.str().c_str(), - arial_font); - //glGetError(); + renderText (render_to_screen_x(trace_to_render_x((Info::Render::_x_min_visible + + Info::Render::_x_max_visible) / 2)), + render_to_screen_y(3), + buf_txt.str().c_str(), + arial_font); + //glGetError(); - for (Element_pos i = Info::Render::_x_min_visible ; - i < Info::Render::_x_max_visible ; - i+=graduation_diff){ + for (Element_pos i = Info::Render::_x_min_visible ; + i < Info::Render::_x_max_visible ; + i+=graduation_diff){ - buf_txt.str("");/* flush the buffer */ - buf_txt << Ruler::get_variable_part(i, coeff_prefix, 2); + buf_txt.str("");/* flush the buffer */ + buf_txt << Ruler::get_variable_part(i, coeff_prefix, 2); - renderText (render_to_screen_x(trace_to_render_x(i)+1), - render_to_screen_y(8), - buf_txt.str().c_str(), - arial_font); + renderText (render_to_screen_x(trace_to_render_x(i)+1), + render_to_screen_y(8), + buf_txt.str().c_str(), + arial_font); } @@ -710,16 +717,16 @@ bool Render_alternate::build(){ /* trying to render text with qpainter outside paintGL Not working yet*/ /*void Render_alternate::paintEvent(QPaintEvent *Event){ - paintGL(); - QPainter p(this); - QFont arial_font = QFont("Arial", 10); - const QFontMetrics metric(arial_font); - QString t =QString().setNum(vertical_line); - p.drawText(render_to_screen_x(trace_to_render_x(vertical_line))-metric.size(Qt::TextSingleLine,t).width() -5, - metric.height()-1, - t); - glGetError(); - checkGlError(); + paintGL(); + QPainter p(this); + QFont arial_font = QFont("Arial", 10); + const QFontMetrics metric(arial_font); + QString t =QString().setNum(vertical_line); + p.drawText(render_to_screen_x(trace_to_render_x(vertical_line))-metric.size(Qt::TextSingleLine,t).width() -5, + metric.height()-1, + t); + glGetError(); + checkGlError(); }*/ @@ -805,7 +812,7 @@ GLuint Render_alternate::draw_wait() { _wait->config(_glsl); } - return 1; + return 1; } @@ -850,7 +857,7 @@ void Render_alternate::call_ruler(){ trace_to_render_x(i) + offset_x, 8, _z_ruler); } - return; + return; } @@ -888,32 +895,33 @@ void Render_alternate::draw_quad(Element_pos x, Element_pos y, Element_pos z, El else if(_draw_states){ offset_x = -_default_entity_x_translate; if(_glsl<330) { //float for color gradient - _current->add(x+offset_x , y+offset_y, 2.0f); - _current->add(x+offset_x+w, y+offset_y, 1.0f); - _current->add(x+offset_x+w, y+offset_y+h, 1.0f); - _current->add(x+offset_x+w, y+offset_y+h, 1.0f); - _current->add(x+offset_x , y+offset_y+h, 2.0f); - _current->add(x+offset_x , y+offset_y, 2.0f); + _current->add( x+offset_x, y+offset_y, 2.0f ); + _current->add( x+offset_x+w, y+offset_y, 1.0f ); + _current->add( x+offset_x+w, y+offset_y+h, 1.0f ); + _current->add( x+offset_x+w, y+offset_y+h, 1.0f ); + _current->add( x+offset_x, y+offset_y+h, 2.0f ); + _current->add( x+offset_x, y+offset_y, 2.0f ); } else{ //char for color gradient char c1 = 1; char c2 = 2; - _current->add(x+offset_x , y+offset_y, c2); - _current->add(x+offset_x+w, y+offset_y, c1); + _current->add(x+offset_x, y+offset_y, c2); + _current->add(x+offset_x+w, y+offset_y, c1); _current->add(x+offset_x+w, y+offset_y+h, c1); _current->add(x+offset_x+w, y+offset_y+h, c1); - _current->add(x+offset_x , y+offset_y+h, c2); - _current->add(x+offset_x , y+offset_y, c2); + _current->add(x+offset_x, y+offset_y+h, c2); + _current->add(x+offset_x, y+offset_y, c2); } } else if(_draw_ruler){ } checkGlError(); + (void)z; } void Render_alternate::draw_triangle(Element_pos , Element_pos , - Element_pos , Element_pos ){ + Element_pos , Element_pos ){ } void Render_alternate::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, Element_pos y2, Element_pos z){ @@ -929,6 +937,8 @@ void Render_alternate::draw_line(Element_pos x1, Element_pos y1, Element_pos x2, _ruler.add(x1+offset_x, y1, _r, _g, _b); _ruler.add(x2+offset_x, y2, _r, _g, _b); } + + (void)z; } void Render_alternate::draw_circle(Element_pos /*x*/, Element_pos /*y*/, Element_pos /*z*/, Element_pos /*r*/){ @@ -1006,52 +1016,63 @@ void Render_alternate::end_draw_states(){ void Render_alternate::start_draw_arrows(){ _draw_arrow = true; - } - void Render_alternate::draw_arrow(const Element_pos start_time, const Element_pos end_time, const Element_pos start_height, const Element_pos end_height, const Element_col red, const Element_col green, const Element_col blue, EntityValue* value){ - if(_arrows.count(value) == 0){ //if there is no vbo corresponding to value - /* Create a new vbo and a new shader*/ - Shader *s = new Shader(_glsl, _r, _g, _b, false); - s->charger(); - Vbo* v1 = new Vbo(s); - Vbo* v2 = new Vbo(s); - std::pair<Vbo*, Vbo*> p1(v1, v2); - std::pair<EntityValue*, std::pair<Vbo*, Vbo*> > p2(value, p1); - _arrows.insert(p2); - std::vector<Element_pos> v; - std::pair<EntityValue*, std::vector<Element_pos> > p3(value, v); - _links.insert(p3); +void Render_alternate::draw_arrow( const Element_pos start_time, + const Element_pos end_time, + const Element_pos start_height, + const Element_pos end_height, + const Element_col red, + const Element_col green, + const Element_col blue, + EntityValue* value) +{ + if(_arrows.count(value) == 0){ //if there is no vbo corresponding to value + /* Create a new vbo and a new shader*/ + Shader *s = new Shader(_glsl, _r, _g, _b, false); + s->charger(); + Vbo* v1 = new Vbo(s); + Vbo* v2 = new Vbo(s); + std::pair<Vbo*, Vbo*> p1(v1, v2); + std::pair<EntityValue*, std::pair<Vbo*, Vbo*> > p2(value, p1); + _arrows.insert(p2); + std::vector<Element_pos> v; + std::pair<EntityValue*, std::vector<Element_pos> > p3(value, v); + _links.insert(p3); connect( value, SIGNAL(changedColor( EntityValue * )), this, SLOT(update_ev( EntityValue *)) ); - } - //store data in vbo - const Element_pos offset_x = -_default_entity_x_translate; - const Element_pos offset_y = -_ruler_y - _ruler_height; - Element_pos x0, x1, y0, y1, l, alpha, cosa, sina; - x0 = start_time + offset_x; - x1 = end_time + offset_x; - y0 = start_height + offset_y; - y1 = end_height + offset_y; - //size of the arrow - l = sqrt(pow(x1-x0,2)+pow(y1-y0,2)); - //calculate angle beetween arrow and horizontal axe - cosa = (x1-x0)/l; - sina = (y1-y0)/l; - alpha = acos(cosa); - if(sina<0) alpha*= -1; - _current = _arrows[value].first; - _current->add(x0, y0); - _current->add(x1, y1); - _current = _arrows[value].second; - _current->add(x1, y1); - /* Need this to draw triangles heads. Necessary for matrix operations*/ - std::vector<Element_pos> *v = &_links[value]; - v->push_back(x1); - v->push_back(y1); - v->push_back(alpha); - } + } + //store data in vbo + const Element_pos offset_x = -_default_entity_x_translate; + const Element_pos offset_y = -_ruler_y - _ruler_height; + Element_pos x0, x1, y0, y1, l, alpha, cosa, sina; + x0 = start_time + offset_x; + x1 = end_time + offset_x; + y0 = start_height + offset_y; + y1 = end_height + offset_y; + //size of the arrow + l = sqrt(pow(x1-x0,2)+pow(y1-y0,2)); + //calculate angle beetween arrow and horizontal axe + cosa = (x1-x0)/l; + sina = (y1-y0)/l; + alpha = acos(cosa); + if(sina<0) alpha*= -1; + _current = _arrows[value].first; + _current->add(x0, y0); + _current->add(x1, y1); + _current = _arrows[value].second; + _current->add(x1, y1); + /* Need this to draw triangles heads. Necessary for matrix operations*/ + std::vector<Element_pos> *v = &_links[value]; + v->push_back(x1); + v->push_back(y1); + v->push_back(alpha); + + (void)red; + (void)green; + (void)blue; +} void Render_alternate::end_draw_arrows(){ //coordinates that we use for draw the head all arrows when parameter arrows_shape is triangle, we will change the angle and scale of using the modelview matrix @@ -1160,7 +1181,7 @@ void Render_alternate::draw_text_value(long int id,double text, double y){ Variable_text_ buf; buf.y=y; buf.value=text; - // printf("adding %f at %f for %p\n", text, y, (void*)id); + // printf("adding %f at %f for %p\n", text, y, (void*)id); _variable_texts[id]=buf; }else{ //it's an update @@ -1192,7 +1213,7 @@ void Render_alternate::draw_vertical_line(){ glUniformMatrix4fv(glGetUniformLocation(_shader->getProgramID(), "MVP"), 1, GL_FALSE, glm::value_ptr(mvp)); glDrawArrays(GL_LINES, 0, 2); _time_line.unlock(); - checkGlError(); + checkGlError(); } /*! @@ -1200,7 +1221,7 @@ void Render_alternate::draw_vertical_line(){ */ void Render_alternate::update_vertical_line(){ if (_mouse_pressed_inside_container) - set_vertical_line(0); + set_vertical_line(0); else set_vertical_line(render_to_trace_x( screen_to_render_x(_mouse_x))); updateGL(); @@ -1216,7 +1237,7 @@ void Render_alternate::set_vertical_line(Element_pos new_coord){ } Element_pos Render_alternate::get_vertical_line(){ - return vertical_line; + return vertical_line; } void Render_alternate::clear_text (){ @@ -1286,6 +1307,10 @@ Render_alternate::update_ev( EntityValue *ev ) EntityClass_t ec = ev->get_class(); switch( ec ) { + case _EntityClass_Variable: + // NOT handled for now + break; + case _EntityClass_State: update_ev_single( ev, &_states, true ); break; @@ -1412,9 +1437,9 @@ void Render_alternate::reload_states(){ it->first->set_visible(true); it->second->delete_shader(); Shader* s = new Shader(_glsl, it->first->get_used_color()->get_red(), - it->first->get_used_color()->get_green(), - it->first->get_used_color()->get_blue(), - true); + it->first->get_used_color()->get_green(), + it->first->get_used_color()->get_blue(), + true); s->charger(); it->second->set_shader(s); } @@ -1429,9 +1454,9 @@ void Render_alternate::reload_links(){ it->first->set_visible(true); it->second.first->delete_shader(); Shader* s = new Shader(_glsl, it->first->get_used_color()->get_red(), - it->first->get_used_color()->get_green(), - it->first->get_used_color()->get_blue(), - false); + it->first->get_used_color()->get_green(), + it->first->get_used_color()->get_blue(), + false); s->charger(); it->second.first->set_shader(s); it->second.second->set_shader(s); @@ -1448,9 +1473,9 @@ void Render_alternate::reload_events(){ it->first->set_visible(true); it->second.first->delete_shader(); Shader* s = new Shader(_glsl, it->first->get_used_color()->get_red(), - it->first->get_used_color()->get_green(), - it->first->get_used_color()->get_blue(), - false); + it->first->get_used_color()->get_green(), + it->first->get_used_color()->get_blue(), + false); s->charger(); it->second.first->set_shader(s); it->second.second->set_shader(s); diff --git a/src/render/Render_alternate.hpp b/src/render/Render_alternate.hpp index 2fa298b18299e476d9c0ff51fc4460ed6a16fd62..3e522a244a9b8dfd718bb07121558495d7ac1f2a 100644 --- a/src/render/Render_alternate.hpp +++ b/src/render/Render_alternate.hpp @@ -94,17 +94,17 @@ class Render_alternate : public Hook_event, public Render { Q_OBJECT private: - /*struct for using freetype for text rendering - see http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02 - /*struct character_info { - float ax; // advance.x - float ay; // advance.y - float bw; // bitmap.width; - float bh; // bitmap.rows; - float bl; // bitmap_left; - float bt; // bitmap_top; - float tx; // x offset of glyph in texture coordinates - } char_info[128];*/ + // struct for using freetype for text rendering + // see http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Text_Rendering_02 + // struct character_info { + // float ax; // advance.x + // float ay; // advance.y + // float bw; // bitmap.width; + // float bh; // bitmap.rows; + // float bl; // bitmap_left; + // float bt; // bitmap_top; + // float tx; // x offset of glyph in texture coordinates + // } char_info[128]; //FT_Library library; //FT_Face face; //int atlas_width; diff --git a/src/render/Render_svg.cpp b/src/render/Render_svg.cpp index eb5d88c11a7a4d28ddb9ab0c1610902a474ef3c7..fe96c0d5e79bc32cac6b78c868e5d8e3be193b25 100644 --- a/src/render/Render_svg.cpp +++ b/src/render/Render_svg.cpp @@ -251,6 +251,8 @@ void Render_svg::draw_arrow(const Element_pos start_time, draw_triangle(end_time, end_height, triangle_size, angle); draw_line(start_time, start_height, end_time, end_height, _z_arrow); + + (void)r; (void)g; (void)b; } void Render_svg::end_draw_arrows(){ @@ -345,6 +347,7 @@ void Render_svg::update_vertical_line(){ } void Render_svg::set_vertical_line(Element_pos l){ + (void)l; } void Render_svg::call_ruler(){ diff --git a/src/render/Render_svg.hpp b/src/render/Render_svg.hpp index 33bb5f85046e5c625117401f42fdd2466101bb6a..602fbe44604f00cdea08f484b07ec3feef3af097 100644 --- a/src/render/Render_svg.hpp +++ b/src/render/Render_svg.hpp @@ -288,7 +288,11 @@ public: * \param text text to draw. * \param y y position of the point. */ - void draw_text_value(long int id, double text, double y) override{} + void draw_text_value(long int id, double text, double y) override { + (void)id; + (void)text; + (void)y; + } /*! * \brief draws the vertical helper line diff --git a/src/render/Shader.cpp b/src/render/Shader.cpp index 630b4eab499b182e333169d8045a7079450be889..d47ef44a92a4b3e063cb5b64296b2f6986f58c75 100644 --- a/src/render/Shader.cpp +++ b/src/render/Shader.cpp @@ -18,7 +18,8 @@ Shader::Shader() : m_vertex_code("#version 330 core \n" } /*Constructor for shaders using textures. Parameter n is not used, it just allow to create a have another constructor. */ -Shader::Shader(int glsl, int n):m_vertexID(0), m_fragmentID(0), m_programID(0){ +Shader::Shader(int glsl, int n) : m_vertexID(0), m_fragmentID(0), m_programID(0) +{ std::ostringstream os1, os2; os1 << "#version "; os1 << glsl; @@ -30,6 +31,8 @@ Shader::Shader(int glsl, int n):m_vertexID(0), m_fragmentID(0), m_programID(0){ m_fragment_code = os2.str(); //std::cout << m_vertex_code << std::endl; //std::cout << m_fragment_code << std::endl; + + (void)n; } /* Construct a Shader reading colors in the VBO. Still used for containers, selection*/ diff --git a/src/trace/DrawTrace.hpp b/src/trace/DrawTrace.hpp index fd352f92f2cb192e6cb1181c81ece2ee3e77f968..aced4f917d86903117359426d56340a7b5dd3ea1 100644 --- a/src/trace/DrawTrace.hpp +++ b/src/trace/DrawTrace.hpp @@ -454,43 +454,43 @@ public: assert(color); if(link_is_in_set(link,set_container,interval)) draw_link(draw_object, link, color, value); - /*bool display=false; - color=NULL; - if(!Session::get_use_palette("link_types")) display = true; - else{ - if (link->get_type()){ - Palette *lt = Session::get_palette("link_types", Session::get_current_palette("link_types")); - - color = lt->get_color(link->get_type()->get_name().to_string()); - if(color) display=true; - */ - /*for(std::list<std::string>::const_iterator it2= link_types->get_->begin(); - it2!= link_types->end(); - it2++ ){ - if(*it2 == link->get_type()->get_name().to_string()){ - display=true; - break; - - } - } */ - - //} - /*} - if(display && - link_is_in_set(link,set_container,interval)){ - - // Search the color - if (color==NULL && - link->get_type()&& - link->get_type()->get_extra_fields()!=NULL && - !link->get_type()->get_extra_fields()->empty() && - ((field = link->get_type()->get_extra_fields()->find(std::string("Color"))) != link->get_type()->get_extra_fields()->end())) - /* Call the object link drawing function with the link color */ - /* color = (const Color *)(*field).second; - - draw_link(draw_object, link, color ); - } - }/* end for */ + // /*bool display=false; + // color=NULL; + // if(!Session::get_use_palette("link_types")) display = true; + // else{ + // if (link->get_type()){ + // Palette *lt = Session::get_palette("link_types", Session::get_current_palette("link_types")); + + // color = lt->get_color(link->get_type()->get_name().to_string()); + // if(color) display=true; + // */ + // /*for(std::list<std::string>::const_iterator it2= link_types->get_->begin(); + // it2!= link_types->end(); + // it2++ ){ + // if(*it2 == link->get_type()->get_name().to_string()){ + // display=true; + // break; + + // } + // } */ + + // //} + // /*} + // if(display && + // link_is_in_set(link,set_container,interval)){ + + // // Search the color + // if (color==NULL && + // link->get_type()&& + // link->get_type()->get_extra_fields()!=NULL && + // !link->get_type()->get_extra_fields()->empty() && + // ((field = link->get_type()->get_extra_fields()->find(std::string("Color"))) != link->get_type()->get_extra_fields()->end())) + // /* Call the object link drawing function with the link color */ + // /* color = (const Color *)(*field).second; + + // draw_link(draw_object, link, color ); + // } + // }/* end for */ }//end for }/* end while (!_stack_states.empty()) */ } @@ -953,7 +953,7 @@ public: render->draw_text_value((*it).first,(*it).second, -1); it++; } - + (void)date; } }; #endif diff --git a/src/trace/EntityType.cpp b/src/trace/EntityType.cpp index 733c59cf8d0feae14c774075e5ae959780dd9b9a..553490709703620e444dbf9b930e2eed31bb45ea 100644 --- a/src/trace/EntityType.cpp +++ b/src/trace/EntityType.cpp @@ -110,7 +110,7 @@ EntityType::get_alias() const { return _name.get_alias(); } -const EntityClass_t EntityType::get_class() const { +EntityClass_t EntityType::get_class() const { return _class; } diff --git a/src/trace/EntityType.hpp b/src/trace/EntityType.hpp index 54725cd35ebad36d71129ad7e2efb1b99ff9065e..4b6f222420086977855c7d4e848503c7b481421a 100644 --- a/src/trace/EntityType.hpp +++ b/src/trace/EntityType.hpp @@ -93,7 +93,7 @@ public: const std::string get_name() const; const std::string get_alias() const; - const EntityClass_t get_class() const; + EntityClass_t get_class() const; /*! * \fn get_container_type() const diff --git a/src/trace/EntityValue.cpp b/src/trace/EntityValue.cpp index f6b18b422acc7b3349aabfda8d0593d4e6c78843..45e741fd5e093bc1ff448c12347ffb4899e5c190 100644 --- a/src/trace/EntityValue.cpp +++ b/src/trace/EntityValue.cpp @@ -167,7 +167,7 @@ EntityValue::get_visible() const return _visible; } -const EntityClass_t +EntityClass_t EntityValue::get_class() const { return _type->get_class(); diff --git a/src/trace/EntityValue.hpp b/src/trace/EntityValue.hpp index 6ecbea506bd251846404ccae5d88b763d6bb33dd..1fba366df5e136027441f5ea8fb442940389d484 100644 --- a/src/trace/EntityValue.hpp +++ b/src/trace/EntityValue.hpp @@ -104,7 +104,7 @@ public: Color *get_used_color() const; Color *get_file_color() const; bool get_visible() const; - const EntityClass_t get_class() const; + EntityClass_t get_class() const; void set_used_color(Color *c); void set_visible(bool b); diff --git a/src/trace/Variable.cpp b/src/trace/Variable.cpp index 200e77f5b6f03ca43d1e98dc6825d06909e3d0bf..87276c22e23f66797e56b343f02e90d790bff276 100644 --- a/src/trace/Variable.cpp +++ b/src/trace/Variable.cpp @@ -83,7 +83,7 @@ const list<pair<Date, Double> > *Variable::get_values() const { return &_values; } -const double Variable::get_value_at(double d) const { +double Variable::get_value_at(double d) const { list<pair<Date, Double> >::const_iterator it= _values.begin(); const list<pair<Date, Double> >::const_iterator it_end= _values.end(); if(it==it_end)return 0.0; diff --git a/src/trace/Variable.hpp b/src/trace/Variable.hpp index 486626ecf009628b266ffddcaea8012fe12d334b..fa93a9a571e533929d1742a3ac9cb800c1bd0ec7 100644 --- a/src/trace/Variable.hpp +++ b/src/trace/Variable.hpp @@ -92,7 +92,7 @@ public: /*! * \brief Get the value at a given time */ - const double get_value_at(double d) const ; + double get_value_at(double d) const ; /*! * \brief Get the minimum of the values diff --git a/tests/generator/Generator.cpp b/tests/generator/Generator.cpp index e62b79da176ddf0327294c53599ae5279e4115ee..30782e8c49e0c9c9d0e479920a52bda63b0d32b8 100644 --- a/tests/generator/Generator.cpp +++ b/tests/generator/Generator.cpp @@ -3,24 +3,31 @@ #include <math.h> Generator::Generator (QString name, - int depth, int procNbr, int nbrOfState, int nbrOfLine, + int depth, int procNbr, int nbrOfState, int nbrOfLine, int countNbr, int eventNbr, int linkNbr, int eventTypeNbr, int linkTypeNbr, - bool paje, bool otf, bool tau){ - - _name = name ; - _depth = depth ; - _procNbr = procNbr ; - _numberOfState = nbrOfState ; - _numberOfLine = nbrOfLine ; - _counterNbr = countNbr ; - _eventNbr = eventNbr ; - _linkNbr = linkNbr ; + bool paje, bool otf, bool tau) +{ + _paje = paje; + _otf = otf; + _tau = tau; + + _name = name; + _depth = depth; + _procNbr = procNbr; + _numberOfState = nbrOfState; + _numberOfLine = nbrOfLine; + + _counter = false; + _event = false; + _link = false; + + _linkNbr = linkNbr; + _linkTypeNbr = linkTypeNbr; + _eventNbr = eventNbr; _eventTypeNbr = eventTypeNbr; - _linkTypeNbr = linkTypeNbr ; - _paje = paje ; - _otf = otf ; - _tau = tau ; + _counterNbr = countNbr; + _size = 0; _arrayOfValues = new int[TYPEACTION]; @@ -85,7 +92,7 @@ void Generator::endTrace (){ int i; my_link lnk; fpritnf (stderr, "Ending the trace, nettoyage des liens morts\n"); - for (i=0; i<_size ; i++){ + for (i=0; i<_size; i++){ lnk = getLink (1); // Ending the link endLink (lnk.proc, lnk.type, lnk.time); @@ -165,9 +172,9 @@ void Generator::decCpt (int proc, int var, double time){ void Generator::generate (){ int i; int val = 0; - + initTrace (_name, _depth, _procNbr, _numberOfState, _eventTypeNbr, _linkTypeNbr, _counterNbr); - for (i=0; i<_numberOfLine ; i++){ + for (i=0; i<_numberOfLine; i++){ do{ val = getRand (_numberAction); if (_arrayOfValues[val]==STARTLINK) @@ -180,10 +187,10 @@ void Generator::generate (){ } void Generator::launchAction (int val, int time){ - int newVal ; + int newVal; int newVal2; - my_link lnk ; - + my_link lnk; + switch (val){ case CHANGESTATE : // Getting the corresponding proc @@ -193,7 +200,7 @@ void Generator::launchAction (int val, int time){ addState (newVal, newVal2, time); break; case STARTLINK : - // Getting the corresponding proc + // Getting the corresponding proc newVal = getRand (_linkNbr); // Getting the corresponding link type newVal2 = getRand (_linkTypeNbr); @@ -234,9 +241,9 @@ void Generator::launchAction (int val, int time){ default : break; } - + } - + my_link Generator::getLink (int pos){ my_link ret; QList<my_link>::iterator it = _startedLink.begin (); @@ -248,7 +255,6 @@ my_link Generator::getLink (int pos){ int Generator::getRand (int max){ - int ret = 10.0 * rand () / (RAND_MAX + 1.0); + int ret = 10.0 * rand () / (RAND_MAX + 1.0); return ret%max; } - diff --git a/tests/generator/Generator.hpp b/tests/generator/Generator.hpp index 478fb96cc90e48e46595ccc6c6e720cf9fed27d5..aa1153fc4ce9a18b06282bafa2ab031bfec4edc3 100644 --- a/tests/generator/Generator.hpp +++ b/tests/generator/Generator.hpp @@ -26,7 +26,7 @@ private : bool _tau; bool _otf; - // Values + // Values QString _name ; // Name of the file to create int _depth ; // Depth of the container tree int _procNbr ; // Number of procs @@ -45,7 +45,7 @@ private : // List of started links QList<my_link> _startedLink ; int _size ; // Number of link started - int* _arrayOfValues; + int* _arrayOfValues; // Action = changeState, startLink, endLink, event, incCpt, decCpt static const int TYPEACTION = 6; @@ -64,7 +64,7 @@ public : // Constructor Generator (QString name, - int depth, int procNbr, int nbrOfState, int nbrOfLine, + int depth, int procNbr, int nbrOfState, int nbrOfLine, int countNbr, int eventNbr, int linkNbr, int eventTypeNbr, int linkTypeNbr, bool paje, bool otf, bool tau); diff --git a/tests/stubs/Errors.cpp b/tests/stubs/Errors.cpp index 2084a31430ec51bbc313b55e48161c11ea97c6cb..96c4e812350f55410075bc4ef4f7e955bd697ea6 100644 --- a/tests/stubs/Errors.cpp +++ b/tests/stubs/Errors.cpp @@ -1,45 +1,45 @@ /* -** This file is part of the ViTE project. -** -** This software is governed by the CeCILL-A license under French law -** and abiding by the rules of distribution of free software. You can -** use, modify and/or redistribute the software under the terms of the -** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following -** URL: "http://www.cecill.info". -** -** As a counterpart to the access to the source code and rights to copy, -** modify and redistribute granted by the license, users are provided -** only with a limited warranty and the software's author, the holder of -** the economic rights, and the successive licensors have only limited -** liability. -** -** In this respect, the user's attention is drawn to the risks associated -** with loading, using, modifying and/or developing or reproducing the -** software by the user in light of its specific status of free software, -** that may mean that it is complicated to manipulate, and that also -** therefore means that it is reserved for developers and experienced -** professionals having in-depth computer knowledge. Users are therefore -** encouraged to load and test the software's suitability as regards -** their requirements in conditions enabling the security of their -** systems and/or data to be ensured and, more generally, to use and -** operate it in the same conditions as regards security. -** -** The fact that you are presently reading this means that you have had -** knowledge of the CeCILL-A license and that you accept its terms. -** -** -** ViTE developpers are (for version 0.* to 1.0): -** -** - COULOMB Kevin -** - FAVERGE Mathieu -** - JAZEIX Johnny -** - LAGRASSE Olivier -** - MARCOUEILLE Jule -** - NOISETTE Pascal -** - REDONDY Arthur -** - VUCHENER Clément -** -*/ + ** This file is part of the ViTE project. + ** + ** This software is governed by the CeCILL-A license under French law + ** and abiding by the rules of distribution of free software. You can + ** use, modify and/or redistribute the software under the terms of the + ** CeCILL-A license as circulated by CEA, CNRS and INRIA at the following + ** URL: "http://www.cecill.info". + ** + ** As a counterpart to the access to the source code and rights to copy, + ** modify and redistribute granted by the license, users are provided + ** only with a limited warranty and the software's author, the holder of + ** the economic rights, and the successive licensors have only limited + ** liability. + ** + ** In this respect, the user's attention is drawn to the risks associated + ** with loading, using, modifying and/or developing or reproducing the + ** software by the user in light of its specific status of free software, + ** that may mean that it is complicated to manipulate, and that also + ** therefore means that it is reserved for developers and experienced + ** professionals having in-depth computer knowledge. Users are therefore + ** encouraged to load and test the software's suitability as regards + ** their requirements in conditions enabling the security of their + ** systems and/or data to be ensured and, more generally, to use and + ** operate it in the same conditions as regards security. + ** + ** The fact that you are presently reading this means that you have had + ** knowledge of the CeCILL-A license and that you accept its terms. + ** + ** + ** ViTE developpers are (for version 0.* to 1.0): + ** + ** - COULOMB Kevin + ** - FAVERGE Mathieu + ** - JAZEIX Johnny + ** - LAGRASSE Olivier + ** - MARCOUEILLE Jule + ** - NOISETTE Pascal + ** - REDONDY Arthur + ** - VUCHENER Clément + ** + */ #include "Errors.hpp" using namespace std; @@ -98,7 +98,7 @@ 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){ char line[10]; - sprintf(line, "%d", line_number); + sprintf(line, "%u", line_number); set(kind_of_error + " on line " + line, priority); } @@ -109,7 +109,7 @@ void Error::set_and_print(const string kind_of_error, const int priority){ void Error::set_and_print(const string kind_of_error, const unsigned int line_number, const int priority){ char line[10]; - sprintf(line, "%d", line_number); + sprintf(line, "%u", line_number); set(kind_of_error + " on line " + line, priority); print(priority); } @@ -118,7 +118,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){ if(condition){ char line[10]; - sprintf(line, "%d", line_number); + sprintf(line, "%u", line_number); set(kind_of_error + " on line " + line, priority); return true; } @@ -169,20 +169,19 @@ void Error::flush(const string &filename){ return; } else { - + const int number_of_errors = Error::_errors.size(); const int number_of_warnings = Error::_warnings.size(); - + // Print the errors while(!_errors.empty()) { _errors.pop(); } - + while(!_warnings.empty()) { _warnings.pop(); } - + cerr << endl << "Your trace has " << number_of_errors << " errors and " << number_of_warnings << " warnings." << endl; } } -