Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 14 May 2017 07:54:12 +0000 (09:54 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 14 May 2017 08:07:09 +0000 (10:07 +0200)
- kill an unused declaration
- dont test double equality

include/simgrid/simix.h
src/surf/trace_mgr_test.cpp

index c101d43..95d78c3 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2017. 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. */
@@ -102,7 +101,6 @@ typedef struct s_smx_file *smx_file_t;
 
 /********************************** Storage *************************************/
 typedef xbt_dictelm_t smx_storage_t;
-typedef struct s_smx_storage_priv *smx_storage_priv_t;
 
 /* ****************************** Process *********************************** */
 
index 43f2fec..6c6c164 100644 (file)
@@ -29,13 +29,17 @@ public:
   bool isUsed() { return true; }
 };
 
+static inline bool doubleEq(double d1, double d2)
+{
+  return std::abs(d1 - d2) < 0.0001;
+}
 class Evt {
 public:
   double date;
   double value;
   explicit Evt(double d, double v) : date(d), value(v) {}
-  bool operator==(Evt e2) { return (date == e2.date) && (value == e2.value); }
-  bool operator!=(Evt e2) { return (date != e2.date) || (value != e2.value); }
+  bool operator==(Evt e2) { return (doubleEq(date, e2.date)) && (doubleEq(value, e2.value)); }
+  bool operator!=(Evt e2) { return !(*this == e2); }
 };
 static std::ostream& operator<<(std::ostream& out, const Evt& e)
 {