1. Shlomi Fish
  2. fc-solve

Commits

Shlomi Fish  committed 95491e9

Added the fcs_move_stack_push_params function and converted to it in one place.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/branches/switch-to-fcs_move_stack_push_params@1631 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits d92c196
  • Branches switch-to-fcs_move_stack_push_params, switch-to-fcs_move_stack_push_params@3680

Comments (0)

Files changed (2)

File fc-solve/source/freecell.c

View file
 
                     fcs_increment_foundation(new_state, deck*4+fcs_card_suit(card));
 
-
-
-                    fcs_move_set_type(temp_move,FCS_MOVE_TYPE_STACK_TO_FOUNDATION);
-                    fcs_move_set_src_stack(temp_move,stack_idx);
-                    fcs_move_set_foundation(temp_move,deck*4+fcs_card_suit(card));
-
-                    fcs_move_stack_push(moves, temp_move);
+                    fcs_move_stack_push_params(moves, 
+                        FCS_MOVE_TYPE_STACK_TO_FOUNDATION,
+                        /* src = */          stack_idx,
+                        /* dest = */         deck*4+fcs_card_suit(card),
+                        /* num_cards = */    0
+                    );
 
                     fcs_flip_top_card(stack_idx);
 

File fc-solve/source/move.h

View file
 #include "state.h"
 #include "fcs_move.h"
 
+#include "inline.h"
+
 extern const fcs_move_t fc_solve_empty_move;
 
 #if 0
             \
 }
 
+static void GCC_INLINE fcs_move_stack_push_params(
+    fcs_move_stack_t * stack,
+    unsigned char type,
+    unsigned char src,
+    unsigned char dest,
+    unsigned char num_cards
+    )
+{
+    register fcs_move_t move = {{type, src, dest, num_cards}};
+    fcs_move_stack_push(stack, move);
+}
+
 extern void fc_solve_derived_states_list_add_state(
         fcs_derived_states_list_t * list,
         fcs_state_extra_info_t * state_val,