Tried fixing portability issue
[supertux.git] / src / lisp / parser.cpp
index 54af44f..d108ba0 100644 (file)
@@ -1,8 +1,7 @@
 //  $Id$
 //
-//  TuxKart - a fun racing game with go-kart
-//  Copyright (C) 2004 Matthias Braun <matze@braunis.de>
-//  code in this file based on lispreader from Mark Probst
+//  SuperTux
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
@@ -17,6 +16,7 @@
 //  You should have received a copy of the GNU General Public License
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
 #include <config.h>
 
 #include <sstream>
@@ -71,7 +71,7 @@ Parser::parse(const std::string& filename)
     dictionary_manager->add_directory(dirname(filename));
     dictionary = & (dictionary_manager->get_dictionary());
   }
-  
+
   return parse(in);
 }
 
@@ -85,11 +85,11 @@ Parser::parse(std::istream& stream)
   Lisp* result = new Lisp(Lisp::TYPE_CONS);
   result->v.cons.car = read();
   result->v.cons.cdr = 0;
-  
+
   delete lexer;
   lexer = 0;
 
-  return result;    
+  return result;
 }
 
 Lisp*
@@ -111,7 +111,7 @@ Parser::read()
     }
     case Lexer::TOKEN_OPEN_PAREN: {
       result = new Lisp(Lisp::TYPE_CONS);
-      
+
       token = lexer->getNextToken();
       if(token == Lexer::TOKEN_CLOSE_PAREN) {
         result->v.cons.car = 0;
@@ -125,14 +125,14 @@ Parser::read()
         token = lexer->getNextToken();
         if(token != Lexer::TOKEN_STRING)
           throw std::runtime_error("Expected string after '(_'");
-        
+
         result = new Lisp(Lisp::TYPE_STRING);
         if(dictionary) {
           std::string translation = dictionary->translate(lexer->getString());
           result->v.string = new char[translation.size()+1];
           memcpy(result->v.string, translation.c_str(), translation.size()+1);
         } else {
-          size_t len = strlen(lexer->getString()) + 1;                                
+          size_t len = strlen(lexer->getString()) + 1;
           result->v.string = new char[len];
           memcpy(result->v.string, lexer->getString(), len);
         }