diff --git a/fc-solve/source/CMakeLists.txt b/fc-solve/source/CMakeLists.txt
index 1179c5f3..14852e78 100644
--- a/fc-solve/source/CMakeLists.txt
+++ b/fc-solve/source/CMakeLists.txt
@@ -491,6 +491,8 @@ ENDIF ()
 
 SHLOMIF_FINALIZE_FLAGS()
 
+ADD_DEFINITIONS("-Weverything -Wno-language-extension-token -Wno-format-nonliteral -Wno-padded -Wno-gnu-statement-expression -Wno-unused-parameter")
+
 IF (FCS_TRACE_MEM)
     ADD_DEFINITIONS("-DFCS_TRACE_MEM=1")
 ENDIF ()
diff --git a/fc-solve/source/board_gen/pi_make_microsoft_freecell_board.c b/fc-solve/source/board_gen/pi_make_microsoft_freecell_board.c
index 15dfabd5..b3ae5aea 100644
--- a/fc-solve/source/board_gen/pi_make_microsoft_freecell_board.c
+++ b/fc-solve/source/board_gen/pi_make_microsoft_freecell_board.c
@@ -35,7 +35,7 @@
 
 typedef int CARD;
 
-const int NUM_CARDS = (4 * 13);
+#define NUM_CARDS (4 * 13)
 #define SUIT(card) ((card) % 4)
 #define VALUE(card) ((card) / 4)
 
@@ -68,8 +68,9 @@ static void card_to_string(char *const s, const CARD card,
 int main(int argc, char *argv[])
 {
     CARD card[MAXCOL][7]; /* current layout of cards, CARDs are ints */
-    int num_cards_left = NUM_CARDS; /*  cards left to be chosen in shuffle */
-    CARD deck[NUM_CARDS];           /* deck of 52 unique cards */
+    /*  cards left to be chosen in shuffle */
+    unsigned num_cards_left = NUM_CARDS;
+    CARD deck[NUM_CARDS]; /* deck of 52 unique cards */
     fcs_bool_t print_ts = FALSE;
 
     int arg = 1;
diff --git a/fc-solve/source/dbm_calc_derived.h b/fc-solve/source/dbm_calc_derived.h
index 44814630..556894c9 100644
--- a/fc-solve/source/dbm_calc_derived.h
+++ b/fc-solve/source/dbm_calc_derived.h
@@ -56,7 +56,9 @@ static inline void fcs_derived_state_list__recycle(
     *p_list = NULL;
 }
 
-#define MAKE_MOVE(src, dest) ((fcs_fcc_move_t)((src) | ((dest) << 4)))
+#define MAKE_MOVE(src, dest)                                                   \
+    ((fcs_fcc_move_t)(                                                         \
+        ((fcs_fcc_move_t)(src)) | (((fcs_fcc_move_t)(dest)) << 4)))
 #define COL2MOVE(idx) (idx)
 #define FREECELL2MOVE(idx) (idx + 8)
 #define FOUND2MOVE(idx) ((idx) + (8 + 4))
@@ -145,18 +147,20 @@ static inline int calc_foundation_to_put_card_on(
 #ifndef FCS_FREECELL_ONLY
     const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
 #endif
-    const int_fast32_t rank = fcs_card_rank(card);
-    const int_fast32_t suit = fcs_card_suit(card);
+    const uint_fast32_t rank = (uint_fast32_t)fcs_card_rank(card);
+    const uint_fast32_t suit = (uint_fast32_t)fcs_card_suit(card);
     for (uint_fast32_t deck = 0; deck < INSTANCE_DECKS_NUM; ++deck)
     {
-        if (fcs_foundation_value(*ptr_state, (deck << 2) + suit) == rank - 1)
+        if ((uint_fast32_t)fcs_foundation_value(
+                *ptr_state, (deck << 2) + suit) == rank - 1)
         {
             uint_fast32_t other_deck_idx;
 
             for (other_deck_idx = 0; other_deck_idx < (INSTANCE_DECKS_NUM << 2);
                  ++other_deck_idx)
             {
-                if (fcs_foundation_value(*ptr_state, other_deck_idx) <
+                if ((uint_fast32_t)fcs_foundation_value(
+                        *ptr_state, other_deck_idx) <
                     rank - 2 -
                         (FCS__SEQS_ARE_BUILT_BY_RANK()
                                 ? 0
@@ -167,7 +171,7 @@ static inline int calc_foundation_to_put_card_on(
             }
             if (other_deck_idx == (INSTANCE_DECKS_NUM << 2))
             {
-                return (deck << 2) + suit;
+                return (int)((deck << 2) + suit);
             }
         }
     }
@@ -339,7 +343,7 @@ static inline int horne_prune__simple(
 }
 
 static inline fcs_bool_t card_cannot_be_placed(const fcs_state_t *const s,
-    const uint16_t ds, const fcs_card_t card, const int sequences_are_built_by)
+    const size_t ds, const fcs_card_t card, const int sequences_are_built_by)
 {
     const_AUTO(col, fcs_state_get_col(*s, ds));
     const_AUTO(col_len, fcs_col_len(col));
@@ -349,7 +353,6 @@ static inline fcs_bool_t card_cannot_be_placed(const fcs_state_t *const s,
 
 #define the_state (init_state_kv_ptr->s)
 static inline fcs_bool_t is_state_solved(
-    const fcs_dbm_variant_type_t local_variant,
     fcs_state_keyval_pair_t *const init_state_kv_ptr)
 {
     for (int suit = 0; suit < DECKS_NUM * 4; suit++)
@@ -372,16 +375,16 @@ static inline fcs_bool_t instance_solver_thread_calc_derived_states(
     const fcs_bool_t perform_horne_prune)
 {
     fcs_derived_state_t *ptr_new_state;
-    int empty_stack_idx = -1;
+    size_t empty_stack_idx = LOCAL_STACKS_NUM;
     const int sequences_are_built_by = CALC_SEQUENCES_ARE_BUILT_BY();
 #define new_state (ptr_new_state->state.s)
-    if (is_state_solved(local_variant, init_state_kv_ptr))
+    if (is_state_solved(init_state_kv_ptr))
     {
         return TRUE;
     }
 
     /* Move top stack cards to foundations. */
-    for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+    for (size_t stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; ++stack_idx)
     {
         const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
         const_AUTO(cards_num, fcs_col_len(col));
@@ -446,7 +449,7 @@ static inline fcs_bool_t instance_solver_thread_calc_derived_states(
         ((local_variant == FCS_DBM_VARIANT_BAKERS_DOZEN) ? 1 : 0);
 
     /* Move stack card on top of a parent */
-    for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+    for (size_t stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; ++stack_idx)
     {
         const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
         const_AUTO(cards_num, fcs_col_len(col));
@@ -456,10 +459,11 @@ static inline fcs_bool_t instance_solver_thread_calc_derived_states(
         }
         const_AUTO(card, fcs_col_get_card(col, cards_num - 1));
 
-        for (int ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
+        for (size_t ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
         {
-            if (ds == stack_idx || card_cannot_be_placed(&the_state, ds, card,
-                                       sequences_are_built_by))
+            if (ds == stack_idx ||
+                card_cannot_be_placed(&the_state, (uint_fast16_t)ds, card,
+                    sequences_are_built_by))
             {
                 continue;
             }
@@ -475,14 +479,14 @@ static inline fcs_bool_t instance_solver_thread_calc_derived_states(
     }
 
     /* Move freecell card on top of a parent */
-    for (int fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
+    for (size_t fc_idx = 0; fc_idx < LOCAL_FREECELLS_NUM; fc_idx++)
     {
         const_AUTO(card, fcs_freecell_card(the_state, fc_idx));
         if (!fcs_card_is_valid(card))
         {
             continue;
         }
-        for (int ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
+        for (size_t ds = 0; ds < LOCAL_STACKS_NUM; ++ds)
         {
             if (card_cannot_be_placed(
                     &the_state, ds, card, sequences_are_built_by))
@@ -500,10 +504,10 @@ static inline fcs_bool_t instance_solver_thread_calc_derived_states(
     }
 
     if ((local_variant != FCS_DBM_VARIANT_BAKERS_DOZEN) &&
-        (empty_stack_idx >= 0))
+        (empty_stack_idx < LOCAL_STACKS_NUM))
     {
         /* Stack Card to Empty Stack */
-        for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+        for (size_t stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; ++stack_idx)
         {
             const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
             const_AUTO(cards_num, fcs_col_len(col));
@@ -548,7 +552,7 @@ static inline fcs_bool_t instance_solver_thread_calc_derived_states(
     if (empty_fc_idx >= 0)
     {
         /* Stack Card to Empty Freecell */
-        for (int stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; stack_idx++)
+        for (size_t stack_idx = 0; stack_idx < LOCAL_STACKS_NUM; ++stack_idx)
         {
             const_AUTO(col, fcs_state_get_col(the_state, stack_idx));
             const_AUTO(cards_num, fcs_col_len(col));
diff --git a/fc-solve/source/dbm_procs.h b/fc-solve/source/dbm_procs.h
index db0052ce..f49a3ed5 100644
--- a/fc-solve/source/dbm_procs.h
+++ b/fc-solve/source/dbm_procs.h
@@ -281,7 +281,7 @@ static void calc_trace(fcs_dbm_record_t *const ptr_initial_record,
 #endif
     }
 #undef GROW_BY
-    *ptr_trace_num = trace_num;
+    *ptr_trace_num = (int)trace_num;
     *ptr_trace = trace;
 }
 
diff --git a/fc-solve/source/delta_states_any.h b/fc-solve/source/delta_states_any.h
index c2412c14..1b2b87a1 100644
--- a/fc-solve/source/delta_states_any.h
+++ b/fc-solve/source/delta_states_any.h
@@ -43,9 +43,8 @@ static inline void fc_solve_delta_stater_init(
     const size_t num_columns, const int num_freecells,
     const int sequences_are_built_by)
 {
-    return fc_solve_debondt_delta_stater_init(delta,
-        FCS_DBM_VARIANT_2FC_FREECELL, init_state, num_columns, num_freecells,
-        sequences_are_built_by);
+    fc_solve_debondt_delta_stater_init(delta, FCS_DBM_VARIANT_2FC_FREECELL,
+        init_state, num_columns, num_freecells, sequences_are_built_by);
 }
 #endif
 #define fc_solve_delta_stater_release(a)                                       \
diff --git a/fc-solve/source/delta_states_debondt_impl.h b/fc-solve/source/delta_states_debondt_impl.h
index 42ee8273..246cb883 100644
--- a/fc-solve/source/delta_states_debondt_impl.h
+++ b/fc-solve/source/delta_states_debondt_impl.h
@@ -101,12 +101,16 @@ static inline void fc_solve_debondt_delta_stater__init_card_states(
     }
 }
 
+#ifdef FCS_USE_INT128_FOR_VAR_BASE
+#define fc_solve_debondt_delta_stater_release(self)
+#else
 static inline void fc_solve_debondt_delta_stater_release(
     fc_solve_debondt_delta_stater_t *const self)
 {
     fc_solve_var_base_reader_release(&(self->r));
     fc_solve_var_base_writer_release(&(self->w));
 }
+#endif
 
 static inline void fc_solve_debondt_delta_stater_set_derived(
     fc_solve_debondt_delta_stater_t *const self, fcs_state_t *const state)
@@ -177,7 +181,8 @@ static void fc_solve_debondt_delta_stater_encode_composite(
 
     for (int suit_idx = 0; suit_idx < FCS_NUM_SUITS; suit_idx++)
     {
-        const unsigned long rank = fcs_foundation_value(*derived, suit_idx);
+        const unsigned long rank =
+            (unsigned long)fcs_foundation_value(*derived, suit_idx);
 
         fc_solve_var_base_writer_write(writer, FOUNDATION_BASE, rank);
 
@@ -189,7 +194,7 @@ static void fc_solve_debondt_delta_stater_encode_composite(
 #define CARD_STATE(card) self->card_states[CARD_POS(card)]
 #define SET_CARD_STATE(card, opt) CARD_STATE(card) = (opt)
 #define RS_STATE(rank, suit_idx) CARD_STATE(fcs_make_card(rank, suit_idx))
-            RS_STATE(r, suit_idx) = OPT_DONT_CARE;
+            RS_STATE((int)r, suit_idx) = OPT_DONT_CARE;
         }
     }
 
@@ -290,7 +295,7 @@ static void fc_solve_debondt_delta_stater_encode_composite(
     {
         for (int suit_idx = 0; suit_idx < FCS_NUM_SUITS; suit_idx++)
         {
-            const unsigned long opt = RS_STATE(rank, suit_idx);
+            const unsigned long opt = (unsigned long)RS_STATE(rank, suit_idx);
             unsigned long base;
 
             if (IS_BAKERS_DOZEN())
@@ -370,7 +375,7 @@ static void fc_solve_debondt_delta_stater_decode(
 
         for (unsigned long rank = 1; rank <= foundation_rank; ++rank)
         {
-            RS_STATE(rank, suit_idx) =
+            RS_STATE((int)rank, suit_idx) =
                 (IS_BAKERS_DOZEN() ? OPT__BAKERS_DOZEN__IN_FOUNDATION
                                    : OPT_IN_FOUNDATION);
         }
@@ -456,7 +461,7 @@ static void fc_solve_debondt_delta_stater_decode(
 
                 if (existing_opt < 0)
                 {
-                    RS_STATE(rank, suit_idx) = item_opt;
+                    RS_STATE(rank, suit_idx) = (int)item_opt;
 
                     if (!IS_BAKERS_DOZEN())
                     {
diff --git a/fc-solve/source/depth_multi_queue.h b/fc-solve/source/depth_multi_queue.h
index 547f229a..4ae81806 100644
--- a/fc-solve/source/depth_multi_queue.h
+++ b/fc-solve/source/depth_multi_queue.h
@@ -59,12 +59,12 @@ static inline void fcs_depth_multi_queue__insert(
 {
     while (depth > queue->max_depth)
     {
-        queue->max_depth++;
+        ++queue->max_depth;
         if (queue->max_depth == queue->max_depth_margin)
         {
             queue->max_depth_margin += DEPTH_Q_GROW_BY;
-            queue->queues_by_depth =
-                SREALLOC(queue->queues_by_depth, queue->max_depth_margin);
+            queue->queues_by_depth = SREALLOC(
+                queue->queues_by_depth, (size_t)queue->max_depth_margin);
         }
         fcs_depth_multi_queue__new_queue(queue,
             &(queue->queues_by_depth[queue->max_depth - queue->min_depth]));
@@ -86,8 +86,8 @@ static inline void fcs_depth_multi_queue__init(
     queue->min_depth = first_depth;
     queue->max_depth_margin = first_depth + DEPTH_Q_GROW_BY;
 
-    queue->queues_by_depth = SMALLOC(
-        queue->queues_by_depth, queue->max_depth_margin - queue->min_depth + 1);
+    queue->queues_by_depth = SMALLOC(queue->queues_by_depth,
+        (size_t)(queue->max_depth_margin - queue->min_depth + 1));
     fcs_depth_multi_queue__new_queue(queue, &(queue->queues_by_depth[0]));
     queue->max_depth = first_depth;
 
@@ -97,7 +97,7 @@ static inline void fcs_depth_multi_queue__init(
 static inline void fcs_depth_multi_queue__destroy(
     fcs_depth_multi_queue_t *const queue)
 {
-    const int limit = queue->max_depth - queue->min_depth;
+    const_AUTO(limit, queue->max_depth - queue->min_depth);
     if (queue->queues_by_depth == NULL)
     {
         return;
@@ -124,7 +124,7 @@ static inline fcs_bool_t fcs_depth_multi_queue__extract(
         var_AUTO(save_queue, queue->queues_by_depth[0]);
         memmove(queue->queues_by_depth, queue->queues_by_depth + 1,
             sizeof(queue->queues_by_depth[0]) *
-                (queue->max_depth - queue->min_depth));
+                (size_t)(queue->max_depth - queue->min_depth));
         queue->queues_by_depth[queue->max_depth - queue->min_depth] =
             save_queue;
         queue->max_depth++;
@@ -132,7 +132,7 @@ static inline fcs_bool_t fcs_depth_multi_queue__extract(
         queue->max_depth_margin++;
     }
 
-    *return_depth = queue->min_depth;
+    *return_depth = (int)(queue->min_depth);
     fcs_offloading_queue__extract(&(queue->queues_by_depth[0]), return_item);
     q_stats_extract(&queue->stats);
     return TRUE;
diff --git a/fc-solve/source/fcs_base64.h b/fc-solve/source/fcs_base64.h
index ec7de36c..5d5b0451 100644
--- a/fc-solve/source/fcs_base64.h
+++ b/fc-solve/source/fcs_base64.h
@@ -26,7 +26,7 @@ static const int mod_table[] = {0, 2, 1};
 static inline void build_decoding_table(void)
 {
     for (int i = 0; i < 64; i++)
-        decoding_table[(unsigned char)encoding_table[i]] = i;
+        decoding_table[(unsigned char)encoding_table[i]] = (char)i;
 }
 
 static void base64_encode(const unsigned char *data, const size_t input_length,
@@ -51,7 +51,7 @@ static void base64_encode(const unsigned char *data, const size_t input_length,
     }
 
     for (int i = 0; i < mod_table[input_length % 3]; i++)
-        encoded_data[*output_length - 1 - i] = '=';
+        encoded_data[*output_length - 1 - (size_t)i] = '=';
 
     encoded_data[*output_length] = '\0';
 }
@@ -71,13 +71,14 @@ static int base64_decode(const char *data, const size_t input_length,
     for (size_t i = 0, j = 0; i < input_length;)
     {
 #define DECODE()                                                               \
-    (data[i] == '=' ? 0 & i++                                                  \
-                    : decoding_table[(size_t)(unsigned char)(data[i++])])
-
-        const uint32_t sextet_a = DECODE();
-        const uint32_t sextet_b = DECODE();
-        const uint32_t sextet_c = DECODE();
-        const uint32_t sextet_d = DECODE();
+    (data[i] == '='                                                            \
+            ? (uint32_t)(0 & i++)                                              \
+            : (uint32_t)decoding_table[(size_t)(unsigned char)(data[i++])])
+
+        const uint32_t sextet_a = (uint32_t)DECODE();
+        const uint32_t sextet_b = (uint32_t)DECODE();
+        const uint32_t sextet_c = (uint32_t)DECODE();
+        const uint32_t sextet_d = (uint32_t)DECODE();
 #undef DECODE
 
         const uint32_t triple = (sextet_a << 3 * 6) + (sextet_b << 2 * 6) +
diff --git a/fc-solve/source/offloading_queue.h b/fc-solve/source/offloading_queue.h
index 45478322..7de3f1a7 100644
--- a/fc-solve/source/offloading_queue.h
+++ b/fc-solve/source/offloading_queue.h
@@ -132,7 +132,7 @@ static inline void fcs_offloading_queue__insert(
 
 #else
 
-const size_t NUM_ITEMS_PER_PAGE = (128 * 1024);
+static const size_t NUM_ITEMS_PER_PAGE = (128 * 1024);
 typedef struct
 {
     long page_index, queue_id;
diff --git a/fc-solve/source/split_fcc_solver.c b/fc-solve/source/split_fcc_solver.c
index 4d65ef97..9956451a 100644
--- a/fc-solve/source/split_fcc_solver.c
+++ b/fc-solve/source/split_fcc_solver.c
@@ -59,7 +59,7 @@ static inline int FccEntryPointNode_compare(
 }
 
 RB_HEAD(FccEntryPointList, FccEntryPointNode);
-const FccEntryPointList FccEntryPointList_init =
+static const FccEntryPointList FccEntryPointList_init =
     RB_INITIALIZER(&(instance->fcc_entry_points));
 
 typedef struct
@@ -501,12 +501,12 @@ static inline void instance_check_key(fcs_dbm_solver_thread_t *const thread,
 
             const_SLOT(moves_to_state_len, instance);
             const size_t added_moves_to_output =
-                moves_to_state_len + trace_num - 1;
+                moves_to_state_len + (size_t)trace_num - 1;
             instance_alloc_num_moves(instance, added_moves_to_output);
             unsigned char *const moves_to_state = instance->moves_to_state;
             for (int i = trace_num - 1; i > 0; i--)
             {
-                moves_to_state[moves_to_state_len + trace_num - 1 - i] =
+                moves_to_state[moves_to_state_len + (size_t)trace_num - 1 - i] =
                     get_move_from_parent_to_child(instance,
                         &(thread->delta_stater), trace[i], trace[i - 1]);
             }
@@ -702,8 +702,8 @@ int main(int argc, char *argv[])
     while (getline(&instance.fingerprint_line, &instance.fingerprint_line_size,
                fingerprint_fh) != -1)
 #else
-    while (fgets(instance.fingerprint_line, instance.fingerprint_line_size - 1,
-        fingerprint_fh))
+    while (fgets(instance.fingerprint_line,
+        (int)instance.fingerprint_line_size - 1, fingerprint_fh))
 #endif
     {
         FccEntryPointNode *const entry_point = fcs_compact_alloc_ptr(
diff --git a/fc-solve/source/state.h b/fc-solve/source/state.h
index 6fd4631b..6e24d062 100644
--- a/fc-solve/source/state.h
+++ b/fc-solve/source/state.h
@@ -431,7 +431,7 @@ static inline void FCS_STATE_collectible_to_kv(
 #define FREECELLS_NUM__VAL freecells_num
 #endif
 
-#define FREECELLS_NUM__ARG PASS_FREECELLS(const int freecells_num)
+#define FREECELLS_NUM__ARG PASS_FREECELLS(const size_t freecells_num)
 
 #ifdef HARD_CODED_NUM_STACKS
 #define PASS_STACKS(arg)
@@ -441,7 +441,7 @@ static inline void FCS_STATE_collectible_to_kv(
 #define STACKS_NUM__VAL stacks_num
 #endif
 
-#define STACKS_NUM__ARG PASS_STACKS(const int stacks_num)
+#define STACKS_NUM__ARG PASS_STACKS(const size_t stacks_num)
 
 #ifdef HARD_CODED_NUM_DECKS
 #define PASS_DECKS(arg)
@@ -451,7 +451,7 @@ static inline void FCS_STATE_collectible_to_kv(
 #define DECKS_NUM__VAL decks_num
 #endif
 
-#define DECKS_NUM__ARG PASS_DECKS(const int decks_num)
+#define DECKS_NUM__ARG PASS_DECKS(const size_t decks_num)
 
 #define FREECELLS_AND_STACKS_ARGS() FREECELLS_NUM__ARG STACKS_NUM__ARG
 #define FREECELLS_STACKS_DECKS__ARGS()                                         \
@@ -600,13 +600,13 @@ static inline fcs_card_t fc_solve_card_parse_str(const char *const str)
 #endif
 
 static inline void fc_solve_state_init_proto(
-    fcs_state_keyval_pair_t *const state STACKS_NUM__ARG GCC_UNUSED
-        IND_BUF_T_PARAM(indirect_stacks_buffer))
+    fcs_state_keyval_pair_t *const state STACKS_NUM__ARG IND_BUF_T_PARAM(
+        indirect_stacks_buffer))
 {
     memset(&(state->s), 0, sizeof(state->s));
 #ifdef INDIRECT_STACK_STATES
-    int i;
-    for (i = 0; i < STACKS_NUM__VAL; i++)
+    size_t i = 0;
+    for (; i < STACKS_NUM__VAL; i++)
     {
         memset(state->s.columns[i] = &indirect_stacks_buffer[i << 7], '\0',
             MAX_NUM_DECKS * 52 + 1);
@@ -690,7 +690,7 @@ static inline fcs_bool_t fc_solve_initial_user_state_to_c_proto(
         }                                                                      \
     }
 
-    for (int s = 0; s < STACKS_NUM__VAL; s++)
+    for (size_t s = 0; s < STACKS_NUM__VAL; s++)
     {
         /* Move to the next stack */
         if (!first_line)
@@ -740,7 +740,7 @@ static inline fcs_bool_t fc_solve_initial_user_state_to_c_proto(
 
                 fcs_put_card_in_freecell(out, c,
                     ((*str == '*') || (*str == '-')) ? fc_solve_empty_card : ({
-                        const char rank = fcs_str2rank(str);
+                        const char rank = (char)fcs_str2rank(str);
                         if (!rank)
                         {
                             return FALSE;
@@ -763,19 +763,19 @@ static inline fcs_bool_t fc_solve_initial_user_state_to_c_proto(
         if (new_str2)
         {
             str = new_str2;
-            for (int f_idx = 0; f_idx < (DECKS_NUM__VAL << 2); f_idx++)
+            for (size_t f_idx = 0; f_idx < (DECKS_NUM__VAL << 2); f_idx++)
             {
                 fcs_set_foundation(out, f_idx, 0);
             }
 
-            int decks_index[4] = {0, 0, 0, 0};
+            size_t decks_index[4] = {0, 0, 0, 0};
             while (1)
             {
                 while ((*str == ' ') || (*str == '\t'))
                     ++str;
                 if ((*str == '\n') || (*str == '\r'))
                     break;
-                const int f_idx = fcs_str2suit(str);
+                const size_t f_idx = (size_t)fcs_str2suit(str);
                 ++str;
                 while (*str == '-')
                     ++str;
@@ -870,7 +870,7 @@ static inline fcs_state_validity_ret_t fc_solve_check_state_validity(
         FREECELLS_STACKS_DECKS__ARGS(),
     fcs_card_t *const misplaced_card)
 {
-    int card_counts[FCS_NUM_SUITS][FCS_MAX_RANK + 1];
+    size_t card_counts[FCS_NUM_SUITS][FCS_MAX_RANK + 1];
 
     const fcs_state_t *const state = &(state_pair->s);
 
@@ -884,26 +884,26 @@ static inline fcs_state_validity_ret_t fc_solve_check_state_validity(
     }
 
     /* Mark the card_counts in the decks */
-    for (int suit_idx = 0; suit_idx < (DECKS_NUM__VAL << 2); suit_idx++)
+    for (size_t suit_idx = 0; suit_idx < (DECKS_NUM__VAL << 2); ++suit_idx)
     {
         for (int c = 1; c <= fcs_foundation_value(*state, suit_idx); c++)
         {
-            card_counts[suit_idx % FCS_NUM_SUITS][c]++;
+            ++card_counts[suit_idx % FCS_NUM_SUITS][c];
         }
     }
 
     /* Mark the card_counts in the freecells */
-    for (int f = 0; f < FREECELLS_NUM__VAL; f++)
+    for (size_t f = 0; f < FREECELLS_NUM__VAL; f++)
     {
         const fcs_card_t card = fcs_freecell_card(*state, f);
         if (fcs_card_is_valid(card))
         {
-            card_counts[fcs_card_suit(card)][fcs_card_rank(card)]++;
+            ++card_counts[fcs_card_suit(card)][fcs_card_rank(card)];
         }
     }
 
     /* Mark the card_counts in the columns */
-    for (int s = 0; s < STACKS_NUM__VAL; s++)
+    for (size_t s = 0; s < STACKS_NUM__VAL; s++)
     {
         const_AUTO(col, fcs_state_get_col(*state, s));
         const int col_len = fcs_col_len(col);
@@ -1083,14 +1083,14 @@ static inline fcs_card_t fcs_state_pop_col_card(
 }
 
 static inline void fcs_state_pop_col_top(
-    fcs_state_t *const state, const int col_idx)
+    fcs_state_t *const state, const size_t col_idx)
 {
     var_AUTO(col, fcs_state_get_col(*state, col_idx));
     fcs_col_pop_top(col);
 }
 
 static inline void fcs_state_push(
-    fcs_state_t *const state, const int col_idx, const fcs_card_t card)
+    fcs_state_t *const state, const size_t col_idx, const fcs_card_t card)
 {
     var_AUTO(col, fcs_state_get_col(*state, col_idx));
     fcs_col_push_card(col, card);
diff --git a/fc-solve/source/var_base_reader.h b/fc-solve/source/var_base_reader.h
index f690a1f2..aa28f24c 100644
--- a/fc-solve/source/var_base_reader.h
+++ b/fc-solve/source/var_base_reader.h
@@ -23,12 +23,16 @@ typedef struct
 #endif
 } fcs_var_base_reader_t;
 
+#ifdef FCS_USE_INT128_FOR_VAR_BASE
+#define fc_solve_var_base_reader_init(s)
+#else
 static inline void fc_solve_var_base_reader_init(fcs_var_base_reader_t *const s)
 {
     FCS_var_base_int__init(s->data);
     FCS_var_base_int__init(s->data_byte_offset);
     FCS_var_base_int__init(s->r);
 }
+#endif
 
 static inline void fc_solve_var_base_reader_start(
     fcs_var_base_reader_t *const s, const unsigned char *const data,
@@ -60,12 +64,15 @@ static inline unsigned long fc_solve_var_base_reader_read(
 #endif
     FCS_var_base_int__mod_div(reader->data, rem, base);
 
-    return FCS_var_base_int__get_ui(rem);
+    return ((unsigned long)FCS_var_base_int__get_ui(rem));
 #ifndef FCS_USE_INT128_FOR_VAR_BASE
 #undef rem
 #endif
 }
 
+#ifdef FCS_USE_INT128_FOR_VAR_BASE
+#define fc_solve_var_base_reader_release(s)
+#else
 static inline void fc_solve_var_base_reader_release(
     fcs_var_base_reader_t *const s)
 {
@@ -73,3 +80,4 @@ static inline void fc_solve_var_base_reader_release(
     FCS_var_base_int__clear(s->r);
     FCS_var_base_int__clear(s->data_byte_offset);
 }
+#endif
diff --git a/fc-solve/source/var_base_writer.h b/fc-solve/source/var_base_writer.h
index 8367596c..534b9dbc 100644
--- a/fc-solve/source/var_base_writer.h
+++ b/fc-solve/source/var_base_writer.h
@@ -22,12 +22,16 @@ typedef struct
     fcs_var_base_int_t remainder;
 } fcs_var_base_writer_t;
 
+#ifdef FCS_USE_INT128_FOR_VAR_BASE
+#define fc_solve_var_base_writer_init(s)
+#else
 static inline void fc_solve_var_base_writer_init(fcs_var_base_writer_t *const s)
 {
     FCS_var_base_int__init(s->data);
     FCS_var_base_int__init(s->multiplier);
     FCS_var_base_int__init(s->remainder);
 }
+#endif
 
 static inline void fc_solve_var_base_writer_start(
     fcs_var_base_writer_t *const s)
@@ -69,6 +73,9 @@ static inline size_t fc_solve_var_base_writer_get_data(
     return count;
 }
 
+#ifdef FCS_USE_INT128_FOR_VAR_BASE
+#define fc_solve_var_base_writer_release(w)
+#else
 static inline void fc_solve_var_base_writer_release(
     fcs_var_base_writer_t *const w)
 {
@@ -76,3 +83,4 @@ static inline void fc_solve_var_base_writer_release(
     FCS_var_base_int__clear(w->multiplier);
     FCS_var_base_int__clear(w->remainder);
 }
+#endif
