Commit 67889224 authored by Arthur Redondy's avatar Arthur Redondy
Browse files

changement des int en unsigned int

parent c902c5b1
......@@ -38,7 +38,7 @@ string Definition::get_event_name() const{
}
bool Definition::check_definition() const{
const int number_of_fields = _fields.size();
const unsigned int number_of_fields = _fields.size();
// Name - string or integer
// ContainerType - string or integer
......@@ -46,7 +46,7 @@ bool Definition::check_definition() const{
if(_event_name == "PajeDefineContainerType" || _event_name == "PajeDefineEventType" || _event_name == "PajeDefineStateType" || _event_name == "PajeDefineVariableType"){
bool has_name_or_alias = false;
bool has_container_type = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if((_fields[i]._name == "Name" || _fields[i]._name == "Alias") && (_fields[i]._type == "string"|| _fields[i]._type == "int")){
has_name_or_alias = true;
......@@ -68,7 +68,7 @@ bool Definition::check_definition() const{
bool has_time = false;
bool has_type = false;
bool has_container = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if((_fields[i]._name == "Name" || _fields[i]._name == "Alias") && (_fields[i]._type == "string"|| _fields[i]._type == "int")){
has_name_or_alias = true;
......@@ -97,7 +97,7 @@ bool Definition::check_definition() const{
bool has_name_or_alias = false;
bool has_time = false;
bool has_type = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if((_fields[i]._name == "Name" || _fields[i]._name == "Alias") && (_fields[i]._type == "string"|| _fields[i]._type == "int")){
has_name_or_alias = true;
......@@ -124,7 +124,7 @@ bool Definition::check_definition() const{
bool has_ContainerType = false;
bool has_SourceContainerType = false;
bool has_DestContainerType = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if((_fields[i]._name == "Name" || _fields[i]._name == "Alias") && (_fields[i]._type == "string"|| _fields[i]._type == "int")){
has_name_or_alias = true;
......@@ -151,7 +151,7 @@ bool Definition::check_definition() const{
else if(_event_name == "PajeDefineEntityValue"){
bool has_name_or_alias = false;
bool has_EntityType = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if((_fields[i]._name == "Name" || _fields[i]._name == "Alias") && (_fields[i]._type == "string"|| _fields[i]._type == "int")){
has_name_or_alias = true;
......@@ -173,7 +173,7 @@ bool Definition::check_definition() const{
bool has_time = false;
bool has_Value = false;
bool has_type = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if(_fields[i]._name == "Container" &&
(_fields[i]._type == "string"|| _fields[i]._type == "int")){
......@@ -201,7 +201,7 @@ bool Definition::check_definition() const{
bool has_Container = false;
bool has_time = false;
bool has_type = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the time
if(_fields[i]._name == "Time" && _fields[i]._type == "date"){
has_time = true;
......@@ -228,7 +228,7 @@ bool Definition::check_definition() const{
bool has_time = false;
bool has_Value = false;
bool has_type = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if(_fields[i]._name == "Container" &&
(_fields[i]._type == "string"|| _fields[i]._type == "int")){
......@@ -262,7 +262,7 @@ bool Definition::check_definition() const{
bool has_key = false;
bool has_SourceContainer = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if(_fields[i]._name == "Container" &&
(_fields[i]._type == "string"|| _fields[i]._type == "int")){
......@@ -307,7 +307,7 @@ bool Definition::check_definition() const{
bool has_key = false;
bool has_DestContainer = false;
for(int i = 0 ; i < number_of_fields ; i ++){
for(unsigned int i = 0 ; i < number_of_fields ; i ++){
// We check if we have the name or the alias
if(_fields[i]._name == "Container" &&
(_fields[i]._type == "string"|| _fields[i]._type == "int")){
......
......@@ -27,13 +27,13 @@ void ParserDefinitionDecoder::enter_definition(Line &line){
string definition_name;
DIE_IF(!line.item(2, definition_name), "Error : a definition need a name");
int definition_identity;
unsigned int definition_identity;
string definition_identity_string;
DIE_IF(!line.item(3, definition_identity_string), "Error : definition has no identifier");
DIE_IF(sscanf(definition_identity_string.c_str(), "%d", &definition_identity) != 1, "Error : expected identifier for a definition");
Definition current_definition = Definition(definition_name);
_definitions.insert(pair<int,Definition>(definition_identity, current_definition));
_definitions.insert(pair<unsigned int,Definition>(definition_identity, current_definition));
_current_definition = definition_identity;
WARN_IF((line.length() > 4), "Warning : extra token in %EventDef");
......@@ -82,16 +82,16 @@ void ParserDefinitionDecoder::store_definition(Line &line){
}
Definition& ParserDefinitionDecoder::get_definition(int i){
Definition& ParserDefinitionDecoder::get_definition(unsigned int i){
return _definitions[i];
}
map<int,Definition>* ParserDefinitionDecoder::get_hash_table_of_definitions(){
map<unsigned int,Definition>* ParserDefinitionDecoder::get_hash_table_of_definitions(){
return &_definitions;
}
void ParserDefinitionDecoder::print_definitions(){
map<int,Definition>::iterator it;
map<unsigned int,Definition>::iterator it;
for (it = _definitions.begin(); it != _definitions.end() ; ++ it){
......
......@@ -22,9 +22,9 @@ class ParserDefinitionDecoder{
private:
/*! \brief Hash table to retrive easily event in Parser Event. */
std::map<int,Definition> _definitions;
std::map<unsigned int,Definition> _definitions;
int _state;
int _current_definition;
unsigned int _current_definition;
public:
/*!
......@@ -46,17 +46,17 @@ public:
void store_definition(Line &);
/*!
* \fn get_definition(int i)
* \param i : the integer matching the definition we want
* \fn get_definition(unsigned int i)
* \param i : the unsigned integer matching the definition we want
* \return : the i-th definition
*/
Definition &get_definition(int i);
Definition &get_definition(unsigned int i);
/*!
* \fn get_hash_table_of_definitions
* \return : the hash table of definitions
*/
std::map<int,Definition> *get_hash_table_of_definitions();
std::map<unsigned int,Definition> *get_hash_table_of_definitions();
/*!
* \fn enter_definition(Line &line)
......@@ -77,7 +77,6 @@ public:
*/
void add_field_to_definition(std::string& first_token, Line& line);
/*! \fn print_definitions
* \brief Print all the definitions. Useful for debug.
*/
......
......@@ -26,9 +26,9 @@ void ParserEventDecoder::store_event(const Definition &definition, Line &line, T
vector<Value *> extra_fields;
int i = 1;
unsigned int i = 1;
vector<field> fields = definition.get_fields();
int number_of_values = fields.size();
unsigned int number_of_values = fields.size();
while(i < number_of_values+1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment