diff options
-rw-r--r-- | games/gnome-games/Makefile | 1 | ||||
-rw-r--r-- | games/gnome-games/files/patch-blackjack_src_player.cpp | 75 | ||||
-rw-r--r-- | games/gnomegames2/Makefile | 1 | ||||
-rw-r--r-- | games/gnomegames2/files/patch-blackjack_src_player.cpp | 75 |
4 files changed, 150 insertions, 2 deletions
diff --git a/games/gnome-games/Makefile b/games/gnome-games/Makefile index 19570d993..12df1a5c8 100644 --- a/games/gnome-games/Makefile +++ b/games/gnome-games/Makefile @@ -34,6 +34,5 @@ CONFLICTS= sol-1.0.* post-patch: @${FIND} ${WRKSRC} -name "*.[ch]" | ${XARGS} ${REINPLACE_CMD} -e \ 's|malloc\.h|stdlib.h|g' - @${REINPLACE_CMD} -e '/%[85].2lf%%/s|.2lf%%|.2f%%|g' ${WRKSRC}/blackjack/src/player.cpp .include <bsd.port.mk> diff --git a/games/gnome-games/files/patch-blackjack_src_player.cpp b/games/gnome-games/files/patch-blackjack_src_player.cpp new file mode 100644 index 000000000..7ee5d6f24 --- /dev/null +++ b/games/gnome-games/files/patch-blackjack_src_player.cpp @@ -0,0 +1,75 @@ +--- blackjack/src/player.cpp.orig Mon May 31 16:07:01 2004 ++++ blackjack/src/player.cpp Mon May 31 16:13:37 2004 +@@ -262,8 +262,8 @@ + // Player can always stand. + + bestValue = value = getValueStand (*player, upCard); +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Stand"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Stand"), (long double)(value * 100)); + bestOption = KEY_S; + bestOptionNumber = num_options; + +@@ -271,8 +271,8 @@ + if (bj_hand_can_be_hit ()) { + value = getValueHit (*player, upCard); + +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Hit"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Hit"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_H; +@@ -282,8 +282,8 @@ + // Check if player can double down. + if (bj_hand_can_be_doubled ()) { + value = getValueDoubleDown (*player, upCard); +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Double"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Double"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_D; +@@ -296,8 +296,8 @@ + + if (bj_hand_can_be_split ()) { + value = getValueSplit(player->cards[0].value (), upCard); +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Split"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Split"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_P; +@@ -308,8 +308,8 @@ + // Check if player can surrender. + if (bj_hand_can_be_surrendered ()) { + value = -0.5; +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Surrender"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Surrender"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_R; +@@ -439,12 +439,12 @@ + reset (); + + mark_list[0] = g_strdup_printf ("<b>%s</b>\n", _("Dealer hand probabilities")); +- mark_list[1] = g_strdup_printf (" %s %5.2lf%%\n", _("Bust"), +- getProbabilityBust (upCard) * 100.0 / notBlackjack); ++ mark_list[1] = g_strdup_printf (" %s %5.2Lf%%\n", _("Bust"), ++ (long double)(getProbabilityBust (upCard) * 100.0 / notBlackjack)); + for (int count = 17; count <= 21; count++) { +- mark_list[count-15] = g_strdup_printf (" %2d %5.2lf%%\n", count, +- getProbabilityCount (count, upCard) +- * 100.0 / notBlackjack); ++ mark_list[count-15] = g_strdup_printf (" %2d %5.2Lf%%\n", count, ++ (long double)(getProbabilityCount (count, upCard) ++ * 100.0 / notBlackjack)); + } + + markup = g_strconcat ("<span size=\"small\" font_family=\"monospace\" foreground=\"#eaeac1\">", diff --git a/games/gnomegames2/Makefile b/games/gnomegames2/Makefile index 19570d993..12df1a5c8 100644 --- a/games/gnomegames2/Makefile +++ b/games/gnomegames2/Makefile @@ -34,6 +34,5 @@ CONFLICTS= sol-1.0.* post-patch: @${FIND} ${WRKSRC} -name "*.[ch]" | ${XARGS} ${REINPLACE_CMD} -e \ 's|malloc\.h|stdlib.h|g' - @${REINPLACE_CMD} -e '/%[85].2lf%%/s|.2lf%%|.2f%%|g' ${WRKSRC}/blackjack/src/player.cpp .include <bsd.port.mk> diff --git a/games/gnomegames2/files/patch-blackjack_src_player.cpp b/games/gnomegames2/files/patch-blackjack_src_player.cpp new file mode 100644 index 000000000..7ee5d6f24 --- /dev/null +++ b/games/gnomegames2/files/patch-blackjack_src_player.cpp @@ -0,0 +1,75 @@ +--- blackjack/src/player.cpp.orig Mon May 31 16:07:01 2004 ++++ blackjack/src/player.cpp Mon May 31 16:13:37 2004 +@@ -262,8 +262,8 @@ + // Player can always stand. + + bestValue = value = getValueStand (*player, upCard); +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Stand"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Stand"), (long double)(value * 100)); + bestOption = KEY_S; + bestOptionNumber = num_options; + +@@ -271,8 +271,8 @@ + if (bj_hand_can_be_hit ()) { + value = getValueHit (*player, upCard); + +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Hit"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Hit"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_H; +@@ -282,8 +282,8 @@ + // Check if player can double down. + if (bj_hand_can_be_doubled ()) { + value = getValueDoubleDown (*player, upCard); +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Double"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Double"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_D; +@@ -296,8 +296,8 @@ + + if (bj_hand_can_be_split ()) { + value = getValueSplit(player->cards[0].value (), upCard); +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Split"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Split"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_P; +@@ -308,8 +308,8 @@ + // Check if player can surrender. + if (bj_hand_can_be_surrendered ()) { + value = -0.5; +- mark_list[num_options++] = g_strdup_printf (" %s %8.2lf%%\n", +- _("Surrender"), value * 100); ++ mark_list[num_options++] = g_strdup_printf (" %s %8.2Lf%%\n", ++ _("Surrender"), (long double)(value * 100)); + if (value > bestValue) { + bestValue = value; + bestOption = KEY_R; +@@ -439,12 +439,12 @@ + reset (); + + mark_list[0] = g_strdup_printf ("<b>%s</b>\n", _("Dealer hand probabilities")); +- mark_list[1] = g_strdup_printf (" %s %5.2lf%%\n", _("Bust"), +- getProbabilityBust (upCard) * 100.0 / notBlackjack); ++ mark_list[1] = g_strdup_printf (" %s %5.2Lf%%\n", _("Bust"), ++ (long double)(getProbabilityBust (upCard) * 100.0 / notBlackjack)); + for (int count = 17; count <= 21; count++) { +- mark_list[count-15] = g_strdup_printf (" %2d %5.2lf%%\n", count, +- getProbabilityCount (count, upCard) +- * 100.0 / notBlackjack); ++ mark_list[count-15] = g_strdup_printf (" %2d %5.2Lf%%\n", count, ++ (long double)(getProbabilityCount (count, upCard) ++ * 100.0 / notBlackjack)); + } + + markup = g_strconcat ("<span size=\"small\" font_family=\"monospace\" foreground=\"#eaeac1\">", |