pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src pingus_error.cxx,1.1,1.2 pingus_error


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src pingus_error.cxx,1.1,1.2 pingus_error.hxx,1.2,1.3 pingus_main.cxx,1.5,1.6
Date: 10 Jul 2002 18:10:08 -0000

Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv27184

Modified Files:
        pingus_error.cxx pingus_error.hxx pingus_main.cxx 
Log Message:
corrected exception handling


Index: pingus_error.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_error.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pingus_error.cxx    12 Jun 2002 19:06:12 -0000      1.1
+++ pingus_error.cxx    10 Jul 2002 18:10:06 -0000      1.2
@@ -42,7 +42,7 @@
 }
 
 std::string
-PingusBug::get_message ()
+PingusBug::get_message () const
 {
   return _("PingusBug: ") + message;
 }
@@ -54,7 +54,7 @@
 }
 
 std::string
-PingusError::get_message ()
+PingusError::get_message () const
 {
   return _("PingusError: ") + message;
 }

Index: pingus_error.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_error.hxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pingus_error.hxx    24 Jun 2002 22:52:55 -0000      1.2
+++ pingus_error.hxx    10 Jul 2002 18:10:06 -0000      1.3
@@ -29,7 +29,7 @@
 public:
   PingusException ();
   virtual ~PingusException ();
-  virtual std::string get_message () =0;
+  virtual std::string get_message () const =0;
 };
 
 /** PingusBug gets thrown on events which are a bug in Pingus, this
@@ -39,7 +39,7 @@
 {
 public:
   PingusBug(std::string mes);
-  virtual std::string get_message();
+  virtual std::string get_message() const;
 };
 
 
@@ -51,7 +51,7 @@
   ///
   PingusError(std::string mes);
   ///
-  virtual std::string get_message ();
+  virtual std::string get_message () const;
 };
 
 #endif

Index: pingus_main.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_main.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pingus_main.cxx     29 Jun 2002 14:01:32 -0000      1.5
+++ pingus_main.cxx     10 Jul 2002 18:10:06 -0000      1.6
@@ -846,11 +846,11 @@
     menu.display ();
   }
   
-  catch (CL_Error err) {
+  catch (const CL_Error& err) {
     PingusMessageBox box(std::string("CL_Error: " + err.message));
   }
   
-  catch (PingusError& err) {
+  catch (const PingusError& err) {
     PingusMessageBox(" PingusError: " + err.get_message ());
   }
 
@@ -885,19 +885,19 @@
     start_game();
   }
   
-  catch (CL_Error err) {
+  catch (const CL_Error& err) {
     std::cout << _("Error caught from ClanLib: ") << err.message << std::endl;
   }
   
-  catch (PingusError err) {
+  catch (const PingusError& err) {
     std::cout << _("Error caught from Pingus: ") << err.get_message () << 
std::endl;
   }
 
-  catch (std::bad_alloc a) {
+  catch (const std::bad_alloc& a) {
     std::cout << _("Pingus: Out of memory!") << std::endl;
   }
 
-  catch (std::exception a) {
+  catch (const std::exception& a) {
     std::cout << _("Pingus: Standard exception caught!:\n") << a.what() << 
std::endl;
   }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]