From 3f975943c49f921e23e0e51e7205d32c0eb75213 Mon Sep 17 00:00:00 2001
From: Arthur Redondy <redondy@enseirb-matmeca.fr>
Date: Sat, 14 Mar 2009 18:45:48 +0000
Subject: [PATCH] rectification de src.pro pour que ca compile merci clement et
 debut d'ajout de messages d'erreurs pour TokenSource

---
 src/parser/Errors.hpp      |  1 -
 src/parser/TokenSource.cpp | 15 ++++++++-------
 src/parser/TokenSource.hpp |  2 ++
 src/src.pro                |  2 --
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/parser/Errors.hpp b/src/parser/Errors.hpp
index 656f49ce..01783371 100644
--- a/src/parser/Errors.hpp
+++ b/src/parser/Errors.hpp
@@ -11,7 +11,6 @@
 #include <iostream>
 #include <fstream>
 #include "../message/message_ns.hpp"
-#include "../interface/interface_graphic.hpp"
 
 /*! \class Error
  *  \brief Define errors and warnings used in the parser.
diff --git a/src/parser/TokenSource.cpp b/src/parser/TokenSource.cpp
index 1349531e..867a126c 100644
--- a/src/parser/TokenSource.cpp
+++ b/src/parser/TokenSource.cpp
@@ -1,6 +1,7 @@
 #include "TokenSource.hpp"
 
 using namespace std;
+using namespace message_ns;
 
 TokenSource::TokenSource(){
     //no file are opened
@@ -18,7 +19,7 @@ TokenSource::~TokenSource(){
     _file.close();
 #else
      if (munmap(_buffer, _filesize) == -1){
-        perror("error : munmap");
+       message << "munmap error" << endw;
      }
      close(_fd);
 #endif
@@ -34,24 +35,24 @@ void TokenSource::open(const char *filename){
     fill_buffer();
 #else
     if ((_fd = ::open(filename, O_RDONLY)) == -1){
-      perror("error : open file"); 
+      message << "open file error" << ende; 
       exit(-1);
     }
 
     struct stat buf;
     if(fstat(_fd, &buf) == -1){
-      perror("error status file"); 
+      message << "status file error" << ende; 
       exit(-1);
     }
 
     _filesize = buf.st_size;
 
     if(_filesize == 0){
-        perror("empty file");
+      message << "empty file" << endw;
     }
 
     if ((_buffer = (char *)mmap(0, _filesize, PROT_READ, MAP_PRIVATE, _fd, 0)) == MAP_FAILED){
-      perror("error mmap");
+      message << "mmap error" << ende;
       exit(-1);
     }
 #endif
@@ -95,14 +96,14 @@ void TokenSource::build_composite_token(){
 #ifdef WIN32
     if (_cursor == _buffer_size){
         if (!fill_buffer()){
-            cout << "found \" at end of file" << endl;
+	  message << "found \" at end of file" << endw;
             return;
         }
         _cursor = 0;
     }
 #else
     if (ensure_capacity()){
-      cout << "error :found \" at end of file" << endl;
+      message << "found \" at end of file" << endw;
       return;
     }
 #endif
diff --git a/src/parser/TokenSource.hpp b/src/parser/TokenSource.hpp
index f10d4a49..31fd7ec4 100644
--- a/src/parser/TokenSource.hpp
+++ b/src/parser/TokenSource.hpp
@@ -4,6 +4,8 @@
 #include <string>
 #include <iostream>
 
+#include "../message/message_ns.hpp"
+
 #ifdef WIN32 // They do not have mmap
     #define BUFFER_SIZE 2048
     #define WORD_SIZE 64
diff --git a/src/src.pro b/src/src.pro
index d49f7aea..ba2be579 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -37,7 +37,6 @@ message/endwarning.hpp \
            trace/ContainerType.hpp \
            trace/DrawTrace.hpp \
            trace/Entity.hpp \
-           trace/EntityList.hpp \
            trace/EntityType.hpp \
            trace/EntityValue.hpp \
            trace/Event.hpp \
@@ -80,7 +79,6 @@ SOURCES +=  message/enderror.cpp \
            trace/Container.cpp \
            trace/ContainerType.cpp \
            trace/Entity.cpp \
-           trace/EntityList.cpp \
            trace/EntityType.cpp \
            trace/EntityValue.cpp \
            trace/Event.cpp \
-- 
GitLab