Skip to content

Commit

Permalink
fix GCC errors [fedora40 FTFBS] + tests/build
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Jan 30, 2024
1 parent 5dffd26 commit d723378
Show file tree
Hide file tree
Showing 19 changed files with 64 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ sub _calc_freecell_max_seq_move
my $to_empty = ( defined( $args->{to_empty} ) ? $args->{to_empty} : 0 );

return ( ( $self->num_empty_freecells() + 1 )
<< ( $self->num_empty_columns() - $to_empty ) );
<< ( $self->num_empty_columns() - $to_empty ) );
}

sub _calc_empty_stacks_filled_by_any_card_max_seq_move
Expand Down Expand Up @@ -636,8 +636,9 @@ sub _mv_stack_to_foundation
}
else
{
return Games::Solitaire::Verify::Exception::Move::Dest::Foundation
->new( move => $move );
return
Games::Solitaire::Verify::Exception::Move::Dest::Foundation->new(
move => $move );
}
}

Expand All @@ -651,7 +652,8 @@ sub _mv_stack_seq_to_foundation

if ( $rules ne "simple_simon" )
{
return Games::Solitaire::Verify::Exception::Move::Variant::Unsupported
return
Games::Solitaire::Verify::Exception::Move::Variant::Unsupported
->new( move => $move );
}

Expand All @@ -668,7 +670,8 @@ sub _mv_stack_seq_to_foundation

if ( $num_seq_components != 1 )
{
return Games::Solitaire::Verify::Exception::Move::Src::Col::NotTrueSeq
return
Games::Solitaire::Verify::Exception::Move::Src::Col::NotTrueSeq
->new( move => $move );
}

Expand All @@ -690,8 +693,9 @@ sub _mv_stack_seq_to_foundation
}
else
{
return Games::Solitaire::Verify::Exception::Move::Dest::Foundation
->new( move => $move );
return
Games::Solitaire::Verify::Exception::Move::Dest::Foundation->new(
move => $move );
}
}

Expand All @@ -705,8 +709,9 @@ sub _mv_stack_to_freecell

if ( !$self->get_column($col_idx)->len() )
{
return Games::Solitaire::Verify::Exception::Move::Src::Col::NoCards
->new( move => $move, );
return
Games::Solitaire::Verify::Exception::Move::Src::Col::NoCards->new(
move => $move, );
}

if ( defined( $self->get_freecell($fc_idx) ) )
Expand Down Expand Up @@ -772,8 +777,9 @@ sub _mv_stack_to_stack
)
)
{
return Games::Solitaire::Verify::Exception::Move::NotEnoughEmpties
->new( move => $move, );
return
Games::Solitaire::Verify::Exception::Move::NotEnoughEmpties->new(
move => $move, );
}

# Now let's actually move them.
Expand All @@ -792,7 +798,8 @@ sub _mv_freecell_to_foundation

if ( !defined($card) )
{
return Games::Solitaire::Verify::Exception::Move::Src::Freecell::Empty
return
Games::Solitaire::Verify::Exception::Move::Src::Freecell::Empty
->new( move => $move, );
}

Expand All @@ -810,8 +817,9 @@ sub _mv_freecell_to_foundation
}
else
{
return Games::Solitaire::Verify::Exception::Move::Dest::Foundation
->new( move => $move );
return
Games::Solitaire::Verify::Exception::Move::Dest::Foundation->new(
move => $move );
}
}

Expand All @@ -827,7 +835,8 @@ sub _mv_freecell_to_stack

if ( !defined($card) )
{
return Games::Solitaire::Verify::Exception::Move::Src::Freecell::Empty
return
Games::Solitaire::Verify::Exception::Move::Src::Freecell::Empty
->new( move => $move, );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ else
my $exit_code;
trap(
sub {
$exit_code = system( $^X, "-I", "lib",
$exit_code = system(
$^X, "-I", "lib",
"bin/verify-solitaire-solution",
"t/data/sample-solutions/1.fc-wrong.sol.txt"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

my @y_params = ( -0.0024, 0.22, 0.0 );

exec( $^X,
exec(
$^X,
"time-scan.pl",
"--method",
"patsolve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

my @y_params = ( 0.0032, 0.32, -3.0 );

exec( $^X,
exec(
$^X,
"time-scan.pl",
"--method",
"patsolve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@

my $recs = $max_scan->{r};
my $iters_count = max(
map { $_->[$ITERS_IDX] }
grep { $_->[$STATUS_IDX] && ( $_->[$TIME_DELTA_IDX] < $quota ) }
map { $_->[$ITERS_IDX] }
grep { $_->[$STATUS_IDX] && ( $_->[$TIME_DELTA_IDX] < $quota ) }
@{$recs}
);
my $time_delta = max(
map { $_->[$TIME_DELTA_IDX] }
grep { $_->[$STATUS_IDX] && ( $_->[$TIME_DELTA_IDX] < $quota ) }
map { $_->[$TIME_DELTA_IDX] }
grep { $_->[$STATUS_IDX] && ( $_->[$TIME_DELTA_IDX] < $quota ) }
@{$recs}
);

Expand Down
4 changes: 2 additions & 2 deletions fc-solve/scripts/FindSeed.pm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ sub from_lines
%$args,
results => [
sort { $a->iters <=> $b->iters }
map {
map {
my $s = $_;
$s =~ s#\A([0-9]+) = ##;
my $deal = $1;
Expand All @@ -100,7 +100,7 @@ sub from_lines
seed => $seed,
}
);
} @{ $args->{lines} },
} @{ $args->{lines} },
],
}
);
Expand Down
2 changes: 1 addition & 1 deletion fc-solve/scripts/extract-states-as-lines.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
print "]"
. (
join "",
map { "$_\\n" }
map { "$_\\n" }
sort { $a cmp $b } ( @cols, $normalized_fc_l, $founds_l )
) . "\n";
}
Expand Down
3 changes: 2 additions & 1 deletion fc-solve/scripts/fcc-delta-stater--test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ sub mytest
$was_printed = 1;
if ( ( ++$count ) % 100 == 0 )
{
print( $DEAL_IDX ,
print(
$DEAL_IDX,
":",
($count),
": max_len = $maxlen ",
Expand Down
4 changes: 2 additions & 2 deletions fc-solve/scripts/process-and-sort-make-output.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sub foo
return (
( $s =~ /\s-c\s+(\S*?\.c)\s*\n?\z/ )
? do
{
{
my $ret = $1;

# print "Ret=$ret \n";
Expand All @@ -22,7 +22,7 @@ sub foo
}

print map { s/[ \t]+/ /gr }
sort { ( foo($a) cmp foo($b) ) or ( $a cmp $b ) }
sort { ( foo($a) cmp foo($b) ) or ( $a cmp $b ) }
grep {
not /-Dfreecell_solver_EXPOR/
|| /-Dfcs_gen_ms_freecell_boards_EXPORTS/
Expand Down
3 changes: 2 additions & 1 deletion fc-solve/scripts/t/range-verifier.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ sub _test_range_verifier
local $Test::Builder::Level = $Test::Builder::Level + 1;

return ok(
!system( $^X, $ranger_verifier,
!system(
$^X, $ranger_verifier,
'--summary-lock', "$verifier_data_dir/summary.lock",
'--summary-stats-file', $stats_file,
'--summary-file', $summary_file,
Expand Down
2 changes: 1 addition & 1 deletion fc-solve/site/wml/eslint-ts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint", "plugin:prettier/recommended"],
"plugin:prettier/recommended"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
Expand Down
6 changes: 3 additions & 3 deletions fc-solve/site/wml/lib/FreecellSolver/GenDealsCharts1.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ sub format_num
sub _calc_deal_nums
{
return [
sort { $a <=> $b }
grep { /\A[0-9]+\z/ }
map { s#.*/##mrs =~ s#\.dump\.txt\z##mrs } glob(
sort { $a <=> $b }
grep { /\A[0-9]+\z/ }
map { s#.*/##mrs =~ s#\.dump\.txt\z##mrs } glob(
"src/charts/fc-pro--4fc-intractable-deals--report/data/*.dump.txt")
];
}
Expand Down
4 changes: 3 additions & 1 deletion fc-solve/source/board_gen/fc_solve_find_index_s2ints.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import re


from pysol_cards.cards import CardRenderer, createCards, ms_rearrange
from pysol_cards.cards import CardRenderer
from pysol_cards.cards import createCards
from pysol_cards.cards import ms_rearrange


def find_index__board_string_to_ints(content):
Expand Down
3 changes: 2 additions & 1 deletion fc-solve/source/board_gen/find-freecell-deal-index-cish.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

import sys

from find_index_lib_py import ffi, lib
from find_index_lib_py import ffi
from find_index_lib_py import lib

from make_pysol_freecell_board import find_index_main

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _tt3_update_file_using_template(fn, template, extra_fields={
return _update_file(fn=fn, newtext=_tt3_myformat(
template=template, extra_fields=extra_fields,))
_tt3_update_file_using_template(fn="vecinit_prog.ocl", template=(
'''kernel void vecinit(global unsigned * restrict r, unsigned mystart)
'''kernel void vecinit(global unsigned * restrict r, unsigned mystart)
{
const unsigned gid = get_global_id(0);
r[gid] = gid + mystart;
Expand Down
2 changes: 1 addition & 1 deletion fc-solve/source/scripts/gen-cmd-line-radix-tree.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sub gen_radix_tree
};
%%
EOF
map { "$_, $strings_to_opts_map{$_}\n" }
map { "$_, $strings_to_opts_map{$_}\n" }
sort { $a cmp $b } keys %strings_to_opts_map,
);
return;
Expand Down
2 changes: 1 addition & 1 deletion fc-solve/source/t/lib/FC_Solve/InlineWrap.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sub import
NAME => $pkg,
INC => join(
" ",
map { "-I$_" }
map { "-I$_" }
map { bin_file($_), src_file($_) } (
["include"], ["rinutils/rinutils/include"],
["patsolve/patsolve"], ["patsolve/patsolve/include"],
Expand Down
14 changes: 8 additions & 6 deletions fc-solve/source/t/t/fc-solve-output-Test-Trap.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ my $MID24_BOARD = samp_board('24-mid.board');
{
trap
{
system( $FC_SOLVE__RAW,
system(
$FC_SOLVE__RAW,
qw/-s -i -p -t -sam -sel -to j/,
samp_board('24-mod-to-test-fc-to-empty-s.board')
);
Expand Down Expand Up @@ -100,8 +101,8 @@ qq#Unknown option "-invalidopt". Type "$FC_SOLVE__RAW --help" for usage informat
/\A\[\[Num FCS Moves\]\]=([0-9]+)\r?\z/
? ( not( $1 > 0 ) )
: 1;
}
grep { /\A\[\[Num FCS Moves\]\]/ } @lines
}
grep { /\A\[\[Num FCS Moves\]\]/ } @lines
],
[],
"All FCS Move counts are valid",
Expand All @@ -114,8 +115,8 @@ qq#Unknown option "-invalidopt". Type "$FC_SOLVE__RAW --help" for usage informat
/\A\[\[Num FCPro Moves\]\]=([0-9]+)\r?\z/
? ( not( $1 > 0 ) )
: 1;
}
grep { /\A\[\[Num FCPro Moves\]\]/ } @lines
}
grep { /\A\[\[Num FCPro Moves\]\]/ } @lines
],
[],
"All FCPro Move counts are valid.",
Expand Down Expand Up @@ -152,7 +153,8 @@ qr/^1591 = Verdict: Intractable.*?^1592 = Verdict: Solved.*?^1593 = Verdict: Sol

trap
{
$status = system( $FC_SOLVE__RAW,
$status = system(
$FC_SOLVE__RAW,
qw#
--flare-name prefix_of_a_long_name --method soft-dfs -to 0123456789 -sp r:tf -opt -opt-to 0123456789ABCDE
-nf --flare-name another_long_name --method soft-dfs -to 0123467 -sp r:tf -opt -opt-to 0123456789ABCDE
Expand Down
2 changes: 1 addition & 1 deletion fc-solve/source/t/t/unit-state-and-col.t
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SV * as_string(SV * obj) {
fc_solve_state_as_string(
ret,
&(o->state),
&(o->state.s),
&o->locs
PASS_FREECELLS(4)
PASS_STACKS(8)
Expand Down

0 comments on commit d723378

Please sign in to comment.