Commits

Shlomi Fish committed 4c5169e

Extract two macros.

This gets rid of two #ifdef FCS_RCS_STATES ifdefs.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/fc-solve/trunk@4525 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits e4054c1

Comments (0)

Files changed (1)

File fc-solve/source/instance.c

 
 #endif
 
+#define STATE_STORAGE_TREE_COMPARE() fc_solve_rcs_states_compare
+#define STATE_STORAGE_TREE_CONTEXT() instance
+
+#else
+
+#define STATE_STORAGE_TREE_COMPARE() fc_solve_state_compare_with_context
+#define STATE_STORAGE_TREE_CONTEXT() NULL
+
 #endif
 
 /*
             );
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_LIBAVL2_TREE)
 
-#ifdef FCS_RCS_STATES
     instance->tree = fcs_libavl2_states_tree_create(
-            fc_solve_rcs_states_compare,
-            instance,
+            STATE_STORAGE_TREE_COMPARE(),
+            STATE_STORAGE_TREE_CONTEXT(),
             NULL
             );
-#else
-    instance->tree = fcs_libavl2_states_tree_create(fc_solve_state_compare_with_context, NULL, NULL);
-#endif
-
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_KAZ_TREE)
 
-#ifdef FCS_RCS_STATES
     instance->tree = fc_solve_kaz_tree_create(
-            fc_solve_rcs_states_compare, instance
+            STATE_STORAGE_TREE_COMPARE(), STATE_STORAGE_TREE_CONTEXT()
             );
-#else
-    instance->tree = fc_solve_kaz_tree_create(fc_solve_state_compare_with_context, NULL);
-#endif
 
 #elif (FCS_STATE_STORAGE == FCS_STATE_STORAGE_GLIB_TREE)
     instance->tree = g_tree_new(fc_solve_state_compare);