pingus-cvs
[Top][All Lists]
Advanced

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

[Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.10,1.11 bmp_map.cxx,1.1


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src blitter.cxx,1.10,1.11 bmp_map.cxx,1.1,1.2 col_map.cxx,1.5,1.6 config.cxx,1.3,1.4 demo_player.cxx,1.2,1.3 demo_recorder.cxx,1.4,1.5 entrance_data.cxx,1.3,1.4 pingu_action_factory.cxx,1.4,1.5 pingus_error.cxx,1.2,1.3 pingus_error.hxx,1.4,1.5 plf_parser.cxx,1.2,1.3 plf_plf.cxx,1.4,1.5 plt_parser.cxx,1.3,1.4 plt_xml.cxx,1.2,1.3 psm_parser.cxx,1.3,1.4 res_descriptor.cxx,1.7,1.8 server.cxx,1.8,1.9 specs_reader.cxx,1.1,1.2 spot_map.cxx,1.5,1.6 theme_selector.cxx,1.2,1.3 trap_data.cxx,1.3,1.4 worldobj_data_factory.cxx,1.2,1.3 xml_plf.cxx,1.6,1.7
Date: 16 Aug 2002 15:14:02 -0000

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

Modified Files:
        blitter.cxx bmp_map.cxx col_map.cxx config.cxx demo_player.cxx 
        demo_recorder.cxx entrance_data.cxx pingu_action_factory.cxx 
        pingus_error.cxx pingus_error.hxx plf_parser.cxx plf_plf.cxx 
        plt_parser.cxx plt_xml.cxx psm_parser.cxx res_descriptor.cxx 
        server.cxx specs_reader.cxx spot_map.cxx theme_selector.cxx 
        trap_data.cxx worldobj_data_factory.cxx xml_plf.cxx 
Log Message:
moved exceptions out of line - reduces code size (memory usage) and compilation 
time


Index: blitter.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/blitter.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- blitter.cxx 25 Jun 2002 21:31:40 -0000      1.10
+++ blitter.cxx 16 Aug 2002 15:13:59 -0000      1.11
@@ -64,7 +64,7 @@
       put_surface_32bit(canvas, provider, x, y);
       break;
     default: 
-      throw PingusError("Blitter:put_surface:Unknown color depth: " + 
to_string(provider->get_depth()));
+      PingusError::raise("Blitter:put_surface:Unknown color depth: " + 
to_string(provider->get_depth()));
       break;
     }    
 }
@@ -98,7 +98,7 @@
     {
       char str[1024];
       sprintf(str, _("Couldn't find palette: %d"), sprovider->get_depth());
-      throw PingusError(str);
+      PingusError::raise(str);
     }
 
   twidth = provider->get_width();
@@ -250,7 +250,7 @@
       // FIXME: Memory hole
       //sprovider->unlock ();
       //provider->unlock ();
-      throw PingusError("Image has wrong color depth: " + 
to_string(sprovider->get_depth()));
+      PingusError::raise("Image has wrong color depth: " + 
to_string(sprovider->get_depth()));
     }
   //  assert(provider->get_pixel_format() == RGBA8888);
 

Index: bmp_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/bmp_map.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- bmp_map.cxx 12 Jun 2002 19:04:45 -0000      1.1
+++ bmp_map.cxx 16 Aug 2002 15:13:59 -0000      1.2
@@ -44,7 +44,7 @@
   surface = PingusResource::load_surface(res_desc);
   
   if (!surface) {
-    throw PingusError(res_desc.res_name + _(": Could not open file\n"));;
+    PingusError::raise(res_desc.res_name + _(": Could not open file\n"));;
   }
 }
 
@@ -98,7 +98,7 @@
     vbuffer = provider->get_data();
     assert(vbuffer);
     if (provider->get_depth() != 8)
-      throw PingusError(_("PingusBmpMap::get_colmap: Surface has wrong pixel 
format, need 8bpp!"));
+      PingusError::raise(_("PingusBmpMap::get_colmap: Surface has wrong pixel 
format, need 8bpp!"));
     
     buffer = new unsigned char [provider->get_pitch() * 
provider->get_height()];
     memcpy(buffer, vbuffer, provider->get_pitch() *  provider->get_height());

Index: col_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/col_map.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- col_map.cxx 25 Jun 2002 18:15:18 -0000      1.5
+++ col_map.cxx 16 Aug 2002 15:13:59 -0000      1.6
@@ -53,7 +53,7 @@
 {
   switch(desc.type) {
   case ResDescriptor::RD_FILE:
-    throw PingusError(_("ColMap: File load - Feature is no longer 
implemented")); //    return load(desc.res_name);
+    PingusError::raise(_("ColMap: File load - Feature is no longer 
implemented")); //    return load(desc.res_name);
     break;
   case ResDescriptor::RD_RESOURCE:
     {
@@ -63,7 +63,7 @@
       sur = PingusResource::load_surface(desc);
       provider = sur.get_provider();
       if (provider->get_depth() != 8)
-       throw PingusError(_("PingusBmpMap::get_colmap: Surface has wrong pixel 
format, need 8bpp!")); 
+       PingusError::raise(_("PingusBmpMap::get_colmap: Surface has wrong pixel 
format, need 8bpp!")); 
 
       width  = provider->get_width();
       height = provider->get_height();
@@ -86,6 +86,8 @@
     return 0;
     break;
   }
+  
+  return 0; // never reached
 }
 
 int
@@ -216,7 +218,7 @@
       height = h;
       return 1;
     } else {
-      throw PingusError(_("ColMap::load: Reloaded ColMap!"));
+      PingusError::raise(_("ColMap::load: Reloaded ColMap!"));
       return 0;
     }
 }

Index: config.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/config.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- config.cxx  20 Jun 2002 12:22:51 -0000      1.3
+++ config.cxx  16 Aug 2002 15:13:59 -0000      1.4
@@ -68,7 +68,7 @@
   eof = false;
 
   if (!in) 
-    throw PingusError(_("Couldn't open: ") + filename);
+    PingusError::raise(_("Couldn't open: ") + filename);
     
   if (verbose > 1)
     std::cout << "Successfully opened plf file." << std::endl;
@@ -82,7 +82,7 @@
 
   if (eof) {
     if (verbose > 1) std::cout << "ConfigParser: Result of get_char() will be 
undefined" << std::endl;
-    throw PingusError("");
+    PingusError::raise("");
   }
 
   c = in.get();
@@ -261,7 +261,7 @@
   if (error != "")
     error_str += "PLF:" + error + "\n";
 
-  throw PingusError(error_str);
+  PingusError::raise(error_str);
 }
 
 // Parse the file and fill all structs with the values.
@@ -401,7 +401,7 @@
     }
   else
     {
-      throw PingusError(_("Config: Unknown valueid: ") + valueid);
+      PingusError::raise(_("Config: Unknown valueid: ") + valueid);
     }
 }
 
@@ -418,8 +418,10 @@
     }
   else
     {
-      throw PingusError(_("Config: value: ") + str + _(" is not of type 
bool."));
+      PingusError::raise(_("Config: value: ") + str + _(" is not of type 
bool."));
     }
+    
+  return false; // never reached
 }
 
 int
@@ -429,7 +431,7 @@
 
   if (sscanf(str.c_str(), "%d", &ret_val) != 1) 
     {
-      throw PingusError(_("Config: Couldn't convert std::string to integer: ") 
+ str);
+      PingusError::raise(_("Config: Couldn't convert std::string to integer: 
") + str);
     }
 
   return ret_val;

Index: demo_player.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/demo_player.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- demo_player.cxx     13 Jun 2002 14:25:12 -0000      1.2
+++ demo_player.cxx     16 Aug 2002 15:13:59 -0000      1.3
@@ -51,7 +51,7 @@
   in.open(filename.c_str());
 
   if (!in)
-    throw PingusError(_("DemoPlayer: Couldn't load ") + filename);
+    PingusError::raise(_("DemoPlayer: Couldn't load ") + filename);
 
   in >> levelname; 
   in.get(); // \n ueberlesen

Index: demo_recorder.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/demo_recorder.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- demo_recorder.cxx   21 Jun 2002 07:45:35 -0000      1.4
+++ demo_recorder.cxx   16 Aug 2002 15:13:59 -0000      1.5
@@ -55,7 +55,7 @@
   out << levelname << std::endl;
 
   if (!out)
-    throw PingusError(_("DemoRecorder: Couldn't open: ") + filename);
+    PingusError::raise(_("DemoRecorder: Couldn't open: ") + filename);
 }
 
 void

Index: entrance_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/entrance_data.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- entrance_data.cxx   2 Jul 2002 10:42:38 -0000       1.3
+++ entrance_data.cxx   16 Aug 2002 15:13:59 -0000      1.4
@@ -120,8 +120,10 @@
   } else if (type == "cloud") {
     return new Cloud(*this);
   } else {
-    throw PingusError("Entrance: Entrance type in PLF file is unknown: " + 
type);
+    PingusError::raise("Entrance: Entrance type in PLF file is unknown: " + 
type);
   }
+  
+  return 0; // never reached
 }
 
 EditorObjLst 

Index: pingu_action_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingu_action_factory.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pingu_action_factory.cxx    28 Jun 2002 15:12:22 -0000      1.4
+++ pingu_action_factory.cxx    16 Aug 2002 15:13:59 -0000      1.5
@@ -97,13 +97,15 @@
   std::map<ActionName, PinguActionAbstractFactory*>::iterator it = 
factories.find(id);
   
   if (it == factories.end())
-    throw PingusError("PinguActionFactory: Invalid id: " + id);
+    PingusError::raise("PinguActionFactory: Invalid id: " + id);
   else 
     {
       PinguAction* action = it->second->create ();
       all_actions.push_back (action);
       return action;
     }
+    
+  return 0; // never reached
 }
 
 void

Index: pingus_error.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_error.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- pingus_error.cxx    10 Jul 2002 18:10:06 -0000      1.2
+++ pingus_error.cxx    16 Aug 2002 15:13:59 -0000      1.3
@@ -41,6 +41,12 @@
   std::cout << _("PingusBug: ") << message << std::endl;
 }
 
+void
+PingusBug::raise (std::string msg)
+{
+  throw PingusBug(msg);
+}
+
 std::string
 PingusBug::get_message () const
 {
@@ -51,6 +57,12 @@
 {
   message = mes;
   std::cout << _("PingusError: ") << message << std::endl;
+}
+
+void
+PingusError::raise (std::string msg)
+{
+  throw PingusError(msg);
 }
 
 std::string

Index: pingus_error.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/pingus_error.hxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pingus_error.hxx    16 Aug 2002 13:03:35 -0000      1.4
+++ pingus_error.hxx    16 Aug 2002 15:13:59 -0000      1.5
@@ -38,9 +38,13 @@
     when the thing is properly working. */
 class PingusBug : public PingusException 
 {
-public:
+private:
   PingusBug(std::string mes);
+
+public:
   virtual std::string get_message() const;
+  
+  static void raise (std::string msg);
 };
 
 
@@ -48,11 +52,13 @@
     invalid user input, file not found events or similar stuff. */
 class PingusError : public PingusException
 {
-public:
-  ///
+private:
   PingusError(std::string mes);
-  ///
+
+public:
   virtual std::string get_message () const;
+  
+  static void raise (std::string msg);
 };
 
 #endif

Index: plf_parser.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plf_parser.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- plf_parser.cxx      13 Jun 2002 14:25:12 -0000      1.2
+++ plf_parser.cxx      16 Aug 2002 15:13:59 -0000      1.3
@@ -59,7 +59,7 @@
   eof = false;
 
   if (!in) {
-    throw PingusError("Couldn't open: " + filename);
+    PingusError::raise("Couldn't open: " + filename);
   }
   
   if (verbose > 1)
@@ -74,7 +74,7 @@
 
   if (eof) {
     if (verbose > 1) cout << "PLFParser: Result of get_char() will be 
undefined" << endl;
-    // throw PingusError("");
+    // PingusError::raise("");
   }
 
   c = in.get();
@@ -304,7 +304,7 @@
   if (error != "")
     error_str += ":PLF:" + error + "\n";
 
-  throw PingusError(error_str);
+  PingusError::raise(error_str);
 }
 
 // Parse the file and fill all structs with the values.

Index: plf_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plf_plf.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- plf_plf.cxx 28 Jun 2002 15:12:22 -0000      1.4
+++ plf_plf.cxx 16 Aug 2002 15:13:59 -0000      1.5
@@ -290,7 +290,7 @@
     break;
     
   default:
-    throw PingusError("PLF:set_value(): Internal Parser error!");
+    PingusError::raise("PLF:set_value(): Internal Parser error!");
   }
 }
 
@@ -318,7 +318,7 @@
   } else if (groupname == "buttons") {
     current_group = PLFPLF::BUTTONS;
   } else {
-    throw PingusError("Parse error: Unknown groupname: '" + groupname + "'");
+    PingusError::raise("Parse error: Unknown groupname: '" + groupname + "'");
   }  
 }
 
@@ -371,7 +371,7 @@
   int ret_val;
 
   if (sscanf(str.c_str(), "%d", &ret_val) != 1) {
-    throw PingusError("PLF: Couldn't convert string to integer: " + str);
+    PingusError::raise("PLF: Couldn't convert string to integer: " + str);
   }
 
   return ret_val;
@@ -383,7 +383,7 @@
   float ret_val;
 
   if (sscanf(str.c_str(), "%f", &ret_val) != 1) {
-    throw PingusError("PLF: Couldn't convert string to float: " + str);
+    PingusError::raise("PLF: Couldn't convert string to float: " + str);
   }
 
   return ret_val;
@@ -402,8 +402,10 @@
     }
   else
     {
-      throw PingusError("PLF: value: " + str + " is not of type bool.");
+      PingusError::raise("PLF: value: " + str + " is not of type bool.");
     }
+    
+  return false; // never reached
 }
 
 /* EOF */

Index: plt_parser.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plt_parser.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- plt_parser.cxx      20 Jun 2002 12:22:51 -0000      1.3
+++ plt_parser.cxx      16 Aug 2002 15:13:59 -0000      1.4
@@ -45,7 +45,7 @@
   in.open(filename.c_str());
 
   if (!in) 
-    throw PingusError("PLTParser: Cannot open: " + filename);
+    PingusError::raise("PLTParser: Cannot open: " + filename);
   
   try 
     {
@@ -89,7 +89,7 @@
   } else {
     char str[1024];
     sprintf(str, _("Unexpected keyword: '%s' at line: %d"), keyword.c_str(), 
lineno);
-    throw PingusError(str);
+    PingusError::raise(str);
   }
 }
 
@@ -130,7 +130,7 @@
   if (c != ch) {
     char str[1024];
     sprintf(str, "Unexpected '%c' at line: %d", c, lineno);
-    throw PingusError(str);
+    PingusError::raise(str);
   }
   jump_spaces();
 }

Index: plt_xml.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/plt_xml.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- plt_xml.cxx 13 Jun 2002 14:25:12 -0000      1.2
+++ plt_xml.cxx 16 Aug 2002 15:13:59 -0000      1.3
@@ -43,7 +43,7 @@
     }
   else
     {
-      throw PingusError("PLTXML: Couldn't load : " + filename);
+      PingusError::raise("PLTXML: Couldn't load : " + filename);
     }
 }
 

Index: psm_parser.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/psm_parser.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- psm_parser.cxx      20 Jun 2002 11:23:53 -0000      1.3
+++ psm_parser.cxx      16 Aug 2002 15:13:59 -0000      1.4
@@ -44,7 +44,7 @@
     in.open(filename.c_str());
 
     if (!in) 
-      throw PingusError("Cannot open: " + filename);
+      PingusError::raise("Cannot open: " + filename);
     
     GroundpieceData temp;
     
@@ -74,7 +74,7 @@
   }
   catch (PSMParseError err) {
     cout << "PSMParseError occured: " << err.message << " at line: " << lines 
<< endl;
-    throw PingusError(err.message);
+    PingusError::raise(err.message);
   }
   catch (PSMEOF) {}
   file_parsed = true;

Index: res_descriptor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/res_descriptor.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- res_descriptor.cxx  28 Jun 2002 17:48:42 -0000      1.7
+++ res_descriptor.cxx  16 Aug 2002 15:13:59 -0000      1.8
@@ -98,7 +98,7 @@
   } else if (cast == "auto") {
     type = RD_AUTO;
   } else {
-    throw PingusError("ResDescriptor: Wrong cast '"+cast+"' for value 
'"+value+"'\n");
+    PingusError::raise("ResDescriptor: Wrong cast '"+cast+"' for value 
'"+value+"'\n");
   }
   res_name = value;
 }

Index: server.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/server.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- server.cxx  28 Jun 2002 15:12:22 -0000      1.8
+++ server.cxx  16 Aug 2002 15:13:59 -0000      1.9
@@ -45,7 +45,7 @@
   str = event_str.substr(split_pos + 1);
 
   if (sscanf(game_time_str.c_str(), "%d", &game_time) != 1) {
-    throw PingusError("PingusEvent: Unable to parse: " + event_str);
+    PingusError::raise("PingusEvent: Unable to parse: " + event_str);
   }
 }
 

Index: specs_reader.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/specs_reader.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- specs_reader.cxx    12 Jun 2002 19:09:38 -0000      1.1
+++ specs_reader.cxx    16 Aug 2002 15:13:59 -0000      1.2
@@ -90,7 +90,7 @@
     mes += filename;
     mes += "'";
 
-    throw PingusError(mes);
+    PingusError::raise(mes);
   }
 
   while(!in.eof()) {

Index: spot_map.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/spot_map.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- spot_map.cxx        25 Jun 2002 18:15:18 -0000      1.5
+++ spot_map.cxx        16 Aug 2002 15:13:59 -0000      1.6
@@ -91,7 +91,7 @@
   switch(plf->get_foreground().type) 
     {
     case ResDescriptor::RD_RESOURCE:
-      throw PingusError("PingusSpotMap: ResType RESOURCE is not implemented, 
sorry");
+      PingusError::raise("PingusSpotMap: ResType RESOURCE is not implemented, 
sorry");
       break;
 
     case ResDescriptor::RD_FILE:
@@ -100,7 +100,7 @@
       break;
 
     default:
-      throw PingusError("PingusSpotMap: Unknown resource type, bailing out");
+      PingusError::raise("PingusSpotMap: Unknown resource type, bailing out");
       break;
     }
 }
@@ -357,7 +357,7 @@
     {
       char str[1024];
       sprintf(str, _("Image has wrong color depth: %d"), 
sprovider->get_depth());
-      throw PingusError(str);
+      PingusError::raise(str);
     }
   //  assert(provider->get_pixel_format() == RGBA8888);
 

Index: theme_selector.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/theme_selector.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- theme_selector.cxx  13 Jun 2002 14:25:12 -0000      1.2
+++ theme_selector.cxx  16 Aug 2002 15:13:59 -0000      1.3
@@ -339,7 +339,7 @@
 
   if (themes.size() == 0)
     {
-      throw PingusError ("ThemeSelector: Couldn't find any themes");
+      PingusError::raise ("ThemeSelector: Couldn't find any themes");
     }
   else
     {

Index: trap_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/trap_data.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- trap_data.cxx       2 Jul 2002 10:42:38 -0000       1.3
+++ trap_data.cxx       16 Aug 2002 15:13:59 -0000      1.4
@@ -89,7 +89,9 @@
   } else if (type == "bumper") {
     return new Bumper(*this);
   }
-  throw PingusError("Trap: `" + type + "' is unknown");
+  PingusError::raise("Trap: `" + type + "' is unknown");
+  
+  return 0; // never reached;
 }
 
 EditorObjLst

Index: worldobj_data_factory.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobj_data_factory.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- worldobj_data_factory.cxx   18 Jun 2002 10:04:11 -0000      1.2
+++ worldobj_data_factory.cxx   16 Aug 2002 15:13:59 -0000      1.3
@@ -87,8 +87,10 @@
     }
   else
     {
-      throw PingusError ("WorldObjDataFactory::create: Error, no type given.");
+      PingusError::raise ("WorldObjDataFactory::create: Error, no type 
given.");
     }
+    
+  return 0; //never reached
 }
 
 WorldObjData*
@@ -100,9 +102,11 @@
   std::map<std::string, WorldObjDataAbstractFactory*>::iterator it = 
factories.find(id);
   
   if (it == factories.end())
-    throw PingusError("WorldObjDataFactory: Invalid id: " + id);
+    PingusError::raise("WorldObjDataFactory: Invalid id: " + id);
   else 
     return it->second->create (doc, cur);
+    
+  return 0; // never reached
 }
 
 void

Index: xml_plf.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/xml_plf.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- xml_plf.cxx 30 Jun 2002 09:01:02 -0000      1.6
+++ xml_plf.cxx 16 Aug 2002 15:13:59 -0000      1.7
@@ -44,7 +44,7 @@
   doc = xmlParseFile(filename.c_str());
 
   if (doc == NULL)
-    throw PingusError("XMLPLF: Couldn't open \"" + filename + "\"");
+    PingusError::raise("XMLPLF: Couldn't open \"" + filename + "\"");
 
   parse_file();
 }
@@ -155,7 +155,7 @@
        }
       //puts("global done");
     } else {
-      throw PingusError("XMLPLF: This is no valid Pingus level");
+      PingusError::raise("XMLPLF: This is no valid Pingus level");
     }
 }
 





reply via email to

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