Index: sources/src/schedulers.cc
===================================================================
--- sources/src/schedulers.cc	(revision 63)
+++ sources/src/schedulers.cc	(revision 65)
@@ -61,11 +61,13 @@
 namespace sc_core {
 
+//
 // sort_functions splits and sorts instances_list into three functions lists : 
-method_process_list_t * transition_func_list;
-method_process_list_t * moore_func_list;
-#ifdef _OPENMP
-#pragma omp threadprivate(transition_func_list, moore_func_list)
+method_process_list_t *transition_func_list;
+method_process_list_t *moore_func_list;
+#ifdef _OPENMP
+#pragma omp threadprivate (transition_func_list, moore_func_list)
 #endif
 method_process_list_t combinational_func_list;
+
 /* ***************************** */
 /* Dumping functions (for debug) */
@@ -84,6 +86,4 @@
 /*  functions   */
 /****************/
-
-
 
 static bool sort_by_module_ptr (const method_process_t * a1, const method_process_t * a2) {
@@ -133,24 +133,26 @@
             if ((*m)->omp_threadnum == omp_get_thread_num())
 #endif
-            {
-                if ((*m)->is_transition()) {
-                    transition_func_list->push_back(*m);
-                }
-                else if ((*m)->is_genmoore()) {
-                    moore_func_list->push_back(*m);
-                }
-            }
-        }
-        // Sort transition functions by method pointer (1) and by module pointer (2)
-        std::sort(transition_func_list->begin(), transition_func_list->end(), sort_by_fct_ptr);
-        // Sort generation functions by method pointer (1) and by module pointer (2)
-        std::sort(moore_func_list->begin(), moore_func_list->end(), sort_by_fct_ptr);
-    }
-
-    for (m = method_process_list.begin(); m != method_process_list.end(); ++m) {
-        if ((*m)->is_combinational()) {
-            combinational_func_list.push_back(*m);
-        }
-    }
+	    {
+	        if ((*m)->is_transition ())
+		    transition_func_list->push_back(*m);
+	        else if ((*m)->is_genmoore ())
+		    moore_func_list->push_back(*m);
+	    }
+	}
+#if 1
+	// Sort transition functions by method pointer (1) and by module pointer (2)
+	std::sort (transition_func_list->begin(), transition_func_list->end(), sort_by_fct_ptr);
+	// Sort generation functions by method pointer (1) and by module pointer (2)
+	std::sort (moore_func_list->begin(), moore_func_list->end(), sort_by_fct_ptr);
+#endif
+#if 0
+	std::sort (transition_func_list->begin(), transition_func_list->end(), only_sort_by_module_ptr);
+	std::sort (moore_func_list->begin(), moore_func_list->end(), only_sort_by_module_ptr);
+#endif
+  }
+
+  for (m = method_process_list.begin(); m != method_process_list.end(); ++m) {
+    if ((*m)->is_combinational()) combinational_func_list.push_back(*m);
+  }
 }
 
@@ -225,13 +227,12 @@
 }
 
-
-string get_scheduling(int scheduling_method) {
-    string base_name;
-    /* marque les fonctions comme fonction de mealy ou non */
-    if (dump_funclist_info) {
-        cerr << "method process list : " << method_process_list << "\n";
-    }
-
-    sort_functions();
+string
+get_scheduling (int scheduling_method) 
+{
+  string base_name;
+  /* marque les fonctions comme fonction de mealy ou non */
+  if (dump_funclist_info)
+    cerr << "method process list : " << method_process_list << "\n";
+  sort_functions ();
 #ifdef _OPENMP
 #pragma omp parallel
@@ -243,91 +244,76 @@
             cerr << "Thread " << omp_get_thread_num() << "\n";
 #endif
-            cerr << "  Transition functions : " << *transition_func_list << "\n";
-            cerr << "  Moore generation functions : " << *moore_func_list << "\n";
+    cerr << "  Transition functions : " << *transition_func_list << "\n";
+    cerr << "  Moore generation functions : " << *moore_func_list << "\n";
 #ifdef _OPENMP
 #pragma omp master
 #endif
-            {
-                if (!combinational_func_list.empty()) {
-                    cerr << "Mealy generation functions : " << combinational_func_list << "\n";
-                }
-            }
-        }
-
-    /* Schedule */
-        switch (scheduling_method) {
-            case BUCHMANN_SCHEDULING :
-            {
-                // Generate the scheduled code, compile and link.
-                // Buchmann's thesis explains this scheduling method.
-                // Uses port dependancies like Dr. Mouchard.
-                ProcessDependencyList * process_list = BuchmannScheduling();
-                if (dynamic_link_of_scheduling_code) {
-                    base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list);
-                }
-                else {
-                    gen_scheduling_code_for_static_func(*transition_func_list, *moore_func_list, *process_list);
-                }
-                break;
-            }
-
-            case MOUCHARD_SCHEDULING :
-            {
-                // Generate the scheduled code, compile and link.
-                // Mouchard's thesis explains this scheduling method.
-                // Uses port dependancies like Dr. Mouchard.
-                // CAUTION : unlike FastSysC, this scheduling is totally static 
-                // and does not use an event-driven scheduler.
-                ProcessDependencyList * process_list = MouchardScheduling();
-                if (dynamic_link_of_scheduling_code) {
-                    base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, *process_list);
-                }
-                else {
-                    gen_scheduling_code_for_static_func (*transition_func_list, *moore_func_list, *process_list);
-                }
-                break;
-            }
-
-            case CASS_SCHEDULING :
-            {
-                // Generate the scheduled code, compile and link
-                // Hommais's thesis explains this scheduling method (like CASS strategy)
-                // Doesn't use port dependancies
-                strong_component_list_t * strong_list = NULL;
+    {
+      if (!combinational_func_list.empty()) {
+	    cerr << "Mealy generation functions : " <<
+		combinational_func_list << "\n";
+      }
+    }
+  }
+
+  /* Schedule */ 
+  switch (scheduling_method) {
+  case BUCHMANN_SCHEDULING : {
+    // Generate the scheduled code, compile and link.
+    // Buchmann's thesis explains this scheduling method.
+    // Uses port dependancies like Dr. Mouchard.
+    ProcessDependencyList* process_list = BuchmannScheduling ();
+  if (dynamic_link_of_scheduling_code)
+    base_name = gen_scheduling_code_for_dynamic_link (*transition_func_list, *moore_func_list,*process_list);
+  else
+    gen_scheduling_code_for_static_func (*transition_func_list, *moore_func_list, *process_list);
+    break;
+  }
+  case MOUCHARD_SCHEDULING : {
+    // Generate the scheduled code, compile and link.
+    // Mouchard's thesis explains this scheduling method.
+    // Uses port dependancies like Dr. Mouchard.
+    // CAUTION : unlike FastSysC, this scheduling is totally static 
+    // and does not use an event-driven scheduler.
+    ProcessDependencyList* process_list = MouchardScheduling ();
+  if (dynamic_link_of_scheduling_code)
+    base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list,*process_list);
+  else
+    gen_scheduling_code_for_static_func (*transition_func_list, *moore_func_list, *process_list);
+    break;
+  }
+  case CASS_SCHEDULING : {
+    // Generate the scheduled code, compile and link
+    // Hommais's thesis explains this scheduling method (like CASS strategy)
+    // Doesn't use port dependancies
+    strong_component_list_t *strong_list = NULL;
 #ifdef _OPENMP
 #pragma omp master
 #endif
-                {
-                    Graph * g = makegraph (&combinational_func_list);
-                    if (dump_all_graph && g) {
-                        graph2dot("module_graph", *g);
-                    }
-                    strong_list = strong_component(g);
-                }
-                if (dynamic_link_of_scheduling_code) {
-                    base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list, strong_list);
-                }
-                else {
-                    gen_scheduling_code_for_quasistatic_func (*transition_func_list, *moore_func_list, strong_list);
-                }
-                // free the void_lists in strong_list
-                //for ( strong_component_list_t::iterator i = strong_list->begin(); i < strong_list->end(); i++) {
-                //    delete *i;
-                //}
+    {
+    Graph *g = makegraph (&combinational_func_list);
+    if (dump_all_graph && g)
+      graph2dot("module_graph", *g);
+    strong_list = strong_component (g);
+    }
+  if (dynamic_link_of_scheduling_code)
+    base_name = gen_scheduling_code_for_dynamic_link(*transition_func_list, *moore_func_list,strong_list);
+  else
+    gen_scheduling_code_for_quasistatic_func (*transition_func_list, *moore_func_list, strong_list);
 #ifdef _OPENMP
 #pragma omp master
 #endif
-                {
-                    delete strong_list;
-                }
-                break;
-            }
-            default :
-                cerr << "Error : Unable to schedule SystemC process."
-                    "Please select a scheduling method.\n";
-                exit (35);
-        }
-    }
-    return base_name;
+  {
+    delete strong_list;
+  }
+  break;
+  }
+  default :
+    cerr << "Error : Unable to schedule SystemC process."
+            "Please select a scheduling method.\n";
+    exit (35);
+  }
+  }
+  return base_name;
 }
 
