lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 26cb882 6/7: Reorder a function's arguments


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 26cb882 6/7: Reorder a function's arguments
Date: Mon, 12 Feb 2018 07:15:10 -0500 (EST)

branch: master
commit 26cb8826142f0da8fe22bbbbc2b17633167ef3d4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Reorder a function's arguments
    
    The goal may be stated tersely thus:
      Spread J rows in groups of K over a number of pages of length L
    and it seems a little easier to understand the arguments in that order,
    keeping J and K together because both refer to data rows, while L refers
    to output lines.
---
 ledger_pdf_generator_wx.cpp | 2 +-
 miscellany.cpp              | 2 +-
 miscellany.hpp              | 2 +-
 miscellany_test.cpp         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 8970c77..19ae62b 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1768,8 +1768,8 @@ class page_with_tabular_report
         // We return the number of extra pages only, hence -1.
         return page_count
             (ledger.GetMaxLength()
-            ,rows_per_page
             ,rows_per_group
+            ,rows_per_page
             ) - 1;
     }
 };
diff --git a/miscellany.cpp b/miscellany.cpp
index 266b624..2ea4baf 100644
--- a/miscellany.cpp
+++ b/miscellany.cpp
@@ -192,8 +192,8 @@ std::string iso_8601_datestamp_terse()
 
 int page_count
     (int total_rows
-    ,int rows_per_page
     ,int rows_per_group
+    ,int rows_per_page
     )
 {
     // The caller must check for this precondition because this function is too
diff --git a/miscellany.hpp b/miscellany.hpp
index 89082fe..bf8b99a 100644
--- a/miscellany.hpp
+++ b/miscellany.hpp
@@ -196,8 +196,8 @@ inline unsigned char lmi_toupper(unsigned char c)
 
 int LMI_SO page_count
     (int total_rows
-    ,int rows_per_page
     ,int rows_per_group
+    ,int rows_per_page
     );
 
 /// DWISOTT
diff --git a/miscellany_test.cpp b/miscellany_test.cpp
index a62648e..4b9b178 100644
--- a/miscellany_test.cpp
+++ b/miscellany_test.cpp
@@ -159,7 +159,7 @@ void test_page_count()
     // numbers of total rows.
     auto const do_test = [](int total_rows) -> int
         {
-        return page_count(total_rows, 28, 5);
+        return page_count(total_rows, 5, 28);
         };
 
     BOOST_TEST_EQUAL(do_test( 1), 1); // Edge case (0 rows is not allowed).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]