From 599ba17959db00261101edcb0f4490edd5264195 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 9 Apr 2021 13:41:40 -0400 Subject: [PATCH] LP1923076: Add cast to int in more places Add cast to int of scalar used on arrays in more places where it seems necessary. Signed-off-by: Jason Stephenson Signed-off-by: Michele Morgan Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Container.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm | 4 ++-- Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm | 2 +- .../src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/storage.pm | 4 ++-- .../src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm | 2 +- .../perlmods/lib/OpenILS/Application/Storage/Publisher/container.pm | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Container.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Container.pm index 46b988829f..28c269d993 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Container.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor/Container.pm @@ -1191,7 +1191,7 @@ sub batch_edit { $fieldset = $e->create_action_fieldset($fieldset); my @keys = keys %$edits; - $max = scalar(@keys); + $max = int(scalar(@keys)); $count = 0; $client->respond({ ord => $stage, count=> $count, max => $max, stage => 'FIELDSET_EDITS_CREATE' }); for my $key (@keys) { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index d0b5136640..1a8667a608 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -3994,7 +3994,7 @@ sub clear_shelf_process { } push(@holds, $hold); - $client->respond({maximum => scalar(@holds), progress => $counter}) if ( (++$counter % $chunk_size) == 0); + $client->respond({maximum => int(scalar(@holds)), progress => $counter}) if ( (++$counter % $chunk_size) == 0); } if ($e->commit) { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm index 9fe2500419..ab372c872e 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Biblio.pm @@ -1147,7 +1147,7 @@ sub staged_search { return {count => 0} unless ( $search_hash and $search_hash->{searches} and - scalar( keys %{$search_hash->{searches}} )); + int(scalar( keys %{$search_hash->{searches}} ))); } my $search_duration; @@ -2410,7 +2410,7 @@ sub biblio_search_isbn_batch { } } } - return { ids => \@recs, count => scalar(@recs) }; + return { ids => \@recs, count => int(scalar(@recs)) }; } foreach my $issn_method (qw/ diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm index cff8c6ffe3..743abcd14b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm @@ -743,7 +743,7 @@ sub send_and_queue_bucket_searches { # parallel, so we need to cacluate summary values up front. my %bre_uniq; $bre_uniq{$_->{bre_id}} = 1 for @$z_searches; - $response->{bre_count} = scalar(keys %bre_uniq); + $response->{bre_count} = int(scalar(keys %bre_uniq)); $response->{search_count} += scalar(@$z_searches); # let the caller know searches are on their way out diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/storage.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/storage.pm index 157aa7cee6..01f17e208c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/storage.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/storage.pm @@ -366,7 +366,7 @@ $dbh->pg_putline($line."\n"); } - return scalar(@fm_nodes); + return int(scalar(@fm_nodes)); } sub copy_create_finish { @@ -398,7 +398,7 @@ copy_create_push( $self => $client => @fm_nodes ); copy_create_finish( $self => $client ); - return scalar(@fm_nodes); + return int(scalar(@fm_nodes)); } sub autoprimary { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index b921e6c8da..e8b8efb1c7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -2473,7 +2473,7 @@ SELECT h.id, h.request_time, h.capture_time, h.fulfillment_time, h.checkin_time $sth->execute(); my @list = $sth->fetchall_hash; - $client->respond(scalar(@list)); # send the row count first, for progress tracking + $client->respond(int(scalar(@list))); # send the row count first, for progress tracking $client->respond( $_ ) for (@list); $client->respond_complete; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/container.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/container.pm index 93ce1f7cba..0907d49c62 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/container.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/container.pm @@ -169,7 +169,7 @@ sub refresh_container_from_carousel_definition { foreach my $bib (@bibs) { container::biblio_record_entry_bucket_item->create({ bucket => $bucket, target_biblio_record_entry => $bib, pos => $i++ }); } - return scalar(@bibs); + return int(scalar(@bibs)); } __PACKAGE__->register_method( -- 2.11.0