Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unused type definitions.
[simgrid.git] / src / instr / instr_interface.cpp
index 5881002..14e3d3b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -137,8 +137,7 @@ void TRACE_declare_mark(const char *mark_type)
   if (not TRACE_is_enabled() || not TRACE_needs_platform())
     return;
 
-  if (not mark_type)
-    THROWF (tracing_error, 1, "mark_type is nullptr");
+  xbt_assert(mark_type, "mark_type is nullptr");
 
   //check if mark_type is already declared
   if (declared_marks.find(mark_type) != declared_marks.end()) {
@@ -171,10 +170,8 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar
   if (not TRACE_is_enabled() || not TRACE_needs_platform())
     return;
 
-  if (not mark_type)
-    THROWF (tracing_error, 1, "mark_type is nullptr");
-  if (not mark_value)
-    THROWF (tracing_error, 1, "mark_value is nullptr");
+  xbt_assert(mark_type, "mark_type is nullptr");
+  xbt_assert(mark_value, "mark_value is nullptr");
 
   simgrid::instr::EventType* type =
       static_cast<simgrid::instr::EventType*>(simgrid::instr::Container::get_root()->type_->by_name(mark_type));
@@ -226,10 +223,8 @@ void TRACE_mark(const char *mark_type, const char *mark_value)
   if (not TRACE_is_enabled() || not TRACE_needs_platform())
     return;
 
-  if (not mark_type)
-    THROWF (tracing_error, 1, "mark_type is nullptr");
-  if (not mark_value)
-    THROWF (tracing_error, 1, "mark_value is nullptr");
+  xbt_assert(mark_type, "mark_type is nullptr");
+  xbt_assert(mark_value, "mark_value is nullptr");
 
   //check if mark_type is already declared
   simgrid::instr::EventType* type =
@@ -288,7 +283,6 @@ static void instr_user_variable(double time, const char* resource, const char* v
           break;
         default:
           THROW_IMPOSSIBLE;
-          break;
       }
     }
   }