Author: mordante
Date: Sun Dec  7 10:54:31 2008
New Revision: 31330

URL: http://svn.gna.org/viewcvs/wesnoth?rev=31330&view=rev
Log:
Use the new assert macros and fixed a bug in them.

Modified:
    trunk/src/asserts.hpp
    trunk/src/gui/widgets/settings.cpp

Modified: trunk/src/asserts.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/asserts.hpp?rev=31330&r1=31329&r2=31330&view=diff
==============================================================================
--- trunk/src/asserts.hpp (original)
+++ trunk/src/asserts.hpp Sun Dec  7 10:54:31 2008
@@ -35,7 +35,7 @@
 
 //for custom logging.  Example usage:
 //assert_log(x != y, "x not equal to y. Value of x: " << x << ", y: " << y);
-#define ASSERT_LOG(a,b) if( !(a) ) { std::cerr << __FILE__ << ":" << __LINE__ 
<< " ASSSERTION FAILED: " << (b) << "\n"; abort(); }
+#define ASSERT_LOG(a,b) if( !(a) ) { std::cerr << __FILE__ << ":" << __LINE__ 
<< " ASSSERTION FAILED: " << b << "\n"; abort(); }
 
 
 #endif

Modified: trunk/src/gui/widgets/settings.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/settings.cpp?rev=31330&r1=31329&r2=31330&view=diff
==============================================================================
--- trunk/src/gui/widgets/settings.cpp (original)
+++ trunk/src/gui/widgets/settings.cpp Sun Dec  7 10:54:31 2008
@@ -18,6 +18,7 @@
  */
 
 
+#include "asserts.hpp"
 #include "filesystem.hpp"
 #include "gettext.hpp"
 #include "gui/widgets/window.hpp"
@@ -1208,10 +1209,8 @@
        const tgui_definition::tcontrol_definition_map::const_iterator  
                control_definition = 
current_gui->second.control_definition.find(control_type);
 
-       if(control_definition == current_gui->second.control_definition.end()) {
-               ERR_GUI << "Type '" << control_type << "' is unknown.\n";
-               assert(false);
-       }
+       ASSERT_LOG(control_definition != 
current_gui->second.control_definition.end(),
+                       "Type '" << control_type << "' is unknown.");
 
        std::map<std::string, tcontrol_definition_ptr>::const_iterator 
                control = control_definition->second.find(definition);


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to