From 048cdcaa318f111e12d78c60927a0e2fc30eb1d6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 6 Sep 2020 17:41:25 +0200 Subject: cleanup: remove count_divecomputers() function There is a number_of_computers() function which does the same thing with two exceptions: 1) checks for null-dive 2) returns an unsigned int Replace calls to count_divecomputers() by calls to number_of_computers(). In one case, the return type makes a different - add a cast to int there. Ultimately, we should probably change the dc_number to signed int throughout the code. Signed-off-by: Berthold Stoeger --- commands/command_divelist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands') diff --git a/commands/command_divelist.cpp b/commands/command_divelist.cpp index 8f769514a..6d81482e0 100644 --- a/commands/command_divelist.cpp +++ b/commands/command_divelist.cpp @@ -905,7 +905,7 @@ MoveDiveComputerToFront::MoveDiveComputerToFront(dive *d, int dc_num) } DeleteDiveComputer::DeleteDiveComputer(dive *d, int dc_num) - : DiveComputerBase(d, clone_delete_divecomputer(d, dc_num), std::min(count_divecomputers(d) - 1, dc_num)) + : DiveComputerBase(d, clone_delete_divecomputer(d, dc_num), std::min((int)number_of_computers(d) - 1, dc_num)) { setText(Command::Base::tr("delete dive computer")); } -- cgit v1.2.3-70-g09d2