Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use correct type for variables, and avoid loosing precision.
[simgrid.git] / src / xbt / automaton / automaton.c
index 3d39319..5fc60df 100644 (file)
@@ -1,6 +1,6 @@
 /* automaton - representation of büchi automaton */
 
-/* Copyright (c) 2011-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2011-2020. 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. */
@@ -327,10 +327,11 @@ int xbt_automaton_exp_label_compare(const_xbt_automaton_exp_label_t l1, const_xb
   return res;
 }
 
-int xbt_automaton_propositional_symbols_compare_value(xbt_dynar_t s1, xbt_dynar_t s2){
-  unsigned int nb_elem = xbt_dynar_length(s1);
+int xbt_automaton_propositional_symbols_compare_value(const_xbt_dynar_t s1, const_xbt_dynar_t s2)
+{
+  unsigned long nb_elem = xbt_dynar_length(s1);
 
-  for (unsigned int cursor = 0; cursor < nb_elem; cursor++) {
+  for (unsigned long cursor = 0; cursor < nb_elem; cursor++) {
     const int* iptr1 = xbt_dynar_get_ptr(s1, cursor);
     const int* iptr2 = xbt_dynar_get_ptr(s2, cursor);
     if(*iptr1 != *iptr2)