Commit fe41be07 for tesseract

commit fe41be079f3abe29f02b3710ccc66c3593dc504e
Author: Stefan Weil <sw@weilnetz.de>
Date:   Sun Jun 21 10:13:37 2026 +0200

    Remove more unused function parameters

    Signed-off-by: Stefan Weil <sw@weilnetz.de>

diff --git a/src/textord/cjkpitch.cpp b/src/textord/cjkpitch.cpp
index 42bd488a..0df9749e 100644
--- a/src/textord/cjkpitch.cpp
+++ b/src/textord/cjkpitch.cpp
@@ -1040,7 +1040,7 @@ FPAnalyzer::FPAnalyzer(ICOORD page_tr, TO_BLOCK_LIST *port_blocks)
     TO_BLOCK *block = block_it.data();
     if (!block->get_rows()->empty()) {
       ASSERT_HOST(block->xheight > 0);
-      find_repeated_chars(block, false);
+      find_repeated_chars(block);
     }
   }

diff --git a/src/textord/colfind.cpp b/src/textord/colfind.cpp
index 11e63896..642ae2be 100644
--- a/src/textord/colfind.cpp
+++ b/src/textord/colfind.cpp
@@ -240,7 +240,7 @@ void ColumnFinder::CorrectOrientation(TO_BLOCK *block, bool vertical_text_lines,
     RotateBlobList(rotation_, &block->blobs);
     RotateBlobList(rotation_, &block->small_blobs);
     RotateBlobList(rotation_, &block->noise_blobs);
-    TabFind::ResetForVerticalText(rotation_, rerotate_, &horizontal_lines_, &min_gutter_width_);
+    TabFind::ResetForVerticalText(rotation_, &horizontal_lines_, &min_gutter_width_);
     part_grid_.Init(gridsize(), bleft(), tright());
     // Reset all blobs to initial state and filter by size.
     // Since they have rotated, the list they belong on could have changed.
@@ -294,10 +294,10 @@ int ColumnFinder::FindBlocks(PageSegMode pageseg_mode,
                                           denorm_, cjk_script_, &projection_, diacritic_blobs,
                                           &part_grid_, &big_parts_);
   if (!PSM_SPARSE(pageseg_mode)) {
-    ImageFind::FindImagePartitions(photo_mask_pix, rotation_, rerotate_, input_block, this,
+    ImageFind::FindImagePartitions(photo_mask_pix, rotation_, rerotate_,
                                    pixa_debug, &part_grid_, &big_parts_);
     ImageFind::TransferImagePartsToImageMask(rerotate_, &part_grid_, photo_mask_pix);
-    ImageFind::FindImagePartitions(photo_mask_pix, rotation_, rerotate_, input_block, this,
+    ImageFind::FindImagePartitions(photo_mask_pix, rotation_, rerotate_,
                                    pixa_debug, &part_grid_, &big_parts_);
   }
   part_grid_.ReTypeBlobs(&image_bblobs_);
@@ -415,9 +415,9 @@ int ColumnFinder::FindBlocks(PageSegMode pageseg_mode,
       table_finder.set_left_to_right_language(!input_block->block->right_to_left());
       // Copy cleaned partitions from part_grid_ to clean_part_grid_ and
       // insert dot-like noise into period_grid_
-      table_finder.InsertCleanPartitions(&part_grid_, input_block);
+      table_finder.InsertCleanPartitions(&part_grid_);
       // Get Table Regions
-      table_finder.LocateTables(&part_grid_, best_columns_, WidthCB(), reskew_);
+      table_finder.LocateTables(&part_grid_, best_columns_, WidthCB());
     }
     GridRemoveUnderlinePartitions();
     part_grid_.DeleteUnknownParts(input_block);
@@ -529,7 +529,7 @@ void ColumnFinder::DisplayBlocks(BLOCK_LIST *blocks) {

 // Displays the column edges at each grid y coordinate defined by
 // best_columns_.
-void ColumnFinder::DisplayColumnBounds(PartSetVector *sets) {
+void ColumnFinder::DisplayColumnBounds() {
   ScrollView *col_win = MakeWindow(50, 300, "Columns");
   DisplayBoxes(col_win);
   col_win->Pen(textord_debug_printable ? ScrollView::BLUE : ScrollView::GREEN);
@@ -595,7 +595,7 @@ bool ColumnFinder::MakeColumns(bool single_column) {
     bool any_multi_column = AssignColumns(part_sets);
 #ifndef GRAPHICS_DISABLED
     if (textord_tabfind_show_columns) {
-      DisplayColumnBounds(&part_sets);
+      DisplayColumnBounds();
     }
 #endif
     ComputeMeanColumnGap(any_multi_column);
diff --git a/src/textord/colfind.h b/src/textord/colfind.h
index 075c2e39..4c82b783 100644
--- a/src/textord/colfind.h
+++ b/src/textord/colfind.h
@@ -169,7 +169,7 @@ private:
   void DisplayBlocks(BLOCK_LIST *blocks);
   // Displays the column edges at each grid y coordinate defined by
   // best_columns_.
-  void DisplayColumnBounds(PartSetVector *sets);
+  void DisplayColumnBounds();

   ////// Functions involved in determining the columns used on the page. /////

diff --git a/src/textord/colpartition.cpp b/src/textord/colpartition.cpp
index 1b7029c8..87181d0f 100644
--- a/src/textord/colpartition.cpp
+++ b/src/textord/colpartition.cpp
@@ -1708,7 +1708,7 @@ TO_BLOCK *ColPartition::MakeBlock(const ICOORD &bleft, const ICOORD &tright,
   ColPartition *part = it.data();
   PolyBlockType type = part->type();
   if (type == PT_VERTICAL_TEXT) {
-    return MakeVerticalTextBlock(bleft, tright, block_parts, used_parts);
+    return MakeVerticalTextBlock(block_parts, used_parts);
   }
   // LineSpacingBlocks has handed us a collection of evenly spaced lines and
   // put the average spacing in each partition, so we can just take the
@@ -1754,9 +1754,7 @@ TO_BLOCK *ColPartition::MakeBlock(const ICOORD &bleft, const ICOORD &tright,

 // Constructs a block from the given list of vertical text partitions.
 // Currently only creates rectangular blocks.
-TO_BLOCK *ColPartition::MakeVerticalTextBlock(const ICOORD &bleft,
-                                              const ICOORD &tright,
-                                              ColPartition_LIST *block_parts,
+TO_BLOCK *ColPartition::MakeVerticalTextBlock(ColPartition_LIST *block_parts,
                                               ColPartition_LIST *used_parts) {
   if (block_parts->empty()) {
     return nullptr; // Nothing to do.
diff --git a/src/textord/colpartition.h b/src/textord/colpartition.h
index 43827754..4f78fa0b 100644
--- a/src/textord/colpartition.h
+++ b/src/textord/colpartition.h
@@ -665,9 +665,7 @@ public:

   // Constructs a block from the given list of vertical text partitions.
   // Currently only creates rectangular blocks.
-  static TO_BLOCK *MakeVerticalTextBlock(const ICOORD &bleft,
-                                         const ICOORD &tright,
-                                         ColPartition_LIST *block_parts,
+  static TO_BLOCK *MakeVerticalTextBlock(ColPartition_LIST *block_parts,
                                          ColPartition_LIST *used_parts);

   // Makes a TO_ROW matching this and moves all the blobs to it, transferring
diff --git a/src/textord/edgblob.cpp b/src/textord/edgblob.cpp
index f9a52e7e..4e82b3ff 100644
--- a/src/textord/edgblob.cpp
+++ b/src/textord/edgblob.cpp
@@ -383,7 +383,6 @@ static void fill_buckets(C_OUTLINE_LIST *outlines, // outlines in block
  */

 static bool capture_children(OL_BUCKETS *buckets,  // bucket sort class
-                             C_BLOB_IT *reject_it, // dead grandchildren
                              C_OUTLINE_IT *blob_it // output outlines
 ) {
   // master outline
@@ -440,7 +439,7 @@ static void empty_buckets(BLOCK *block,       // block to scan
     // move to new list
     out_it.add_after_then_move(parent_it.extract());
     // healthy blob
-    bool good_blob = capture_children(buckets, &junk_blobs, &out_it);
+    bool good_blob = capture_children(buckets, &out_it);
     C_BLOB::ConstructBlobsFromOutlines(good_blob, &outlines, &good_blobs,
                                        &junk_blobs);

diff --git a/src/textord/fpchop.cpp b/src/textord/fpchop.cpp
index c5db68c0..f6bfb10d 100644
--- a/src/textord/fpchop.cpp
+++ b/src/textord/fpchop.cpp
@@ -63,8 +63,7 @@ static void join_segments(C_OUTLINE_FRAG *bottom, C_OUTLINE_FRAG *top);
  * Make a ROW from a fixed pitch TO_ROW.
  **********************************************************************/
 ROW *fixed_pitch_words( // find lines
-    TO_ROW *row,        // row to do
-    FCOORD rotation     // for drawing
+    TO_ROW *row         // row to do
 ) {
   bool bol;                // start of line
   uint8_t blanks;          // in front of word
diff --git a/src/textord/fpchop.h b/src/textord/fpchop.h
index 2e8ec39f..659be11b 100644
--- a/src/textord/fpchop.h
+++ b/src/textord/fpchop.h
@@ -61,8 +61,7 @@ ELISTIZEH(C_OUTLINE_FRAG)
 extern INT_VAR_H(textord_fp_chop_error);

 ROW *fixed_pitch_words( // find lines
-    TO_ROW *row,        // row to do
-    FCOORD rotation     // for drawing
+    TO_ROW *row         // row to do
 );

 void split_to_blob(                 // split the blob
diff --git a/src/textord/imagefind.cpp b/src/textord/imagefind.cpp
index e1c4b067..07684d16 100644
--- a/src/textord/imagefind.cpp
+++ b/src/textord/imagefind.cpp
@@ -1134,7 +1134,7 @@ static void DeleteSmallImages(ColPartitionGrid *part_grid) {
 // ColPartitionGrid::ReTypeBlobs must be called afterwards to fix this
 // situation and collect the image blobs.
 void ImageFind::FindImagePartitions(Image image_pix, const FCOORD &rotation,
-                                    const FCOORD &rerotation, TO_BLOCK *block, TabFind *tab_grid,
+                                    const FCOORD &rerotation,
                                     DebugPixa *pixa_debug, ColPartitionGrid *part_grid,
                                     ColPartition_LIST *big_parts) {
   int imageheight = pixGetHeight(image_pix);
diff --git a/src/textord/imagefind.h b/src/textord/imagefind.h
index bd413de0..f1846be7 100644
--- a/src/textord/imagefind.h
+++ b/src/textord/imagefind.h
@@ -98,7 +98,7 @@ public:
   // ColPartitionGrid::ReTypeBlobs must be called afterwards to fix this
   // situation and collect the image blobs.
   static void FindImagePartitions(Image image_pix, const FCOORD &rotation, const FCOORD &rerotation,
-                                  TO_BLOCK *block, TabFind *tab_grid, DebugPixa *pixa_debug,
+                                  DebugPixa *pixa_debug,
                                   ColPartitionGrid *part_grid, ColPartition_LIST *big_parts);
 };

diff --git a/src/textord/makerow.cpp b/src/textord/makerow.cpp
index f067ecaf..f156d059 100644
--- a/src/textord/makerow.cpp
+++ b/src/textord/makerow.cpp
@@ -182,7 +182,7 @@ static float MakeRowFromSubBlobs(TO_BLOCK *block, C_BLOB *blob, TO_ROW_IT *row_i
  * only a single blob, it makes 2 rows, in case the top-level blob
  * is a container of the real blobs to recognize.
  */
-float make_single_row(ICOORD page_tr, bool allow_sub_blobs, TO_BLOCK *block,
+float make_single_row(bool allow_sub_blobs, TO_BLOCK *block,
                       TO_BLOCK_LIST *blocks) {
   BLOBNBOX_IT blob_it = &block->blobs;
   TO_ROW_IT row_it = block->get_rows();
@@ -2022,7 +2022,7 @@ void Textord::make_spline_rows(TO_BLOCK *block, // block to do
       }
     }
 #endif
-    make_old_baselines(block, testing_on, gradient);
+    make_old_baselines(block, gradient);
   }
 #ifndef GRAPHICS_DISABLED
   if (testing_on) {
@@ -2054,7 +2054,7 @@ void make_baseline_spline(TO_ROW *row, // row to fit
   auto *xstarts = new int32_t[row->blob_list()->length() + 1];
   if (segment_baseline(row, block, segments, xstarts) && !textord_straight_baselines &&
       !textord_parallel_baselines) {
-    coeffs = linear_spline_baseline(row, block, segments, xstarts);
+    coeffs = linear_spline_baseline(row, segments, xstarts);
   } else {
     xstarts[1] = xstarts[segments];
     segments = 1;
@@ -2174,7 +2174,6 @@ bool segment_baseline( // split baseline
  */
 double *linear_spline_baseline( // split baseline
     TO_ROW *row,                // row to fit
-    TO_BLOCK *block,            // block it came from
     int32_t &segments,          // no of segments
     int32_t xstarts[]           // coords of segments
 ) {
diff --git a/src/textord/makerow.h b/src/textord/makerow.h
index 3987d3f8..0d55eb4e 100644
--- a/src/textord/makerow.h
+++ b/src/textord/makerow.h
@@ -106,7 +106,7 @@ inline bool within_error_margin(float test, float num, float margin) {
 void fill_heights(TO_ROW *row, float gradient, int min_height, int max_height, STATS *heights,
                   STATS *floating_heights);

-float make_single_row(ICOORD page_tr, bool allow_sub_blobs, TO_BLOCK *block, TO_BLOCK_LIST *blocks);
+float make_single_row(bool allow_sub_blobs, TO_BLOCK *block, TO_BLOCK_LIST *blocks);
 float make_rows(ICOORD page_tr, // top right
                 TO_BLOCK_LIST *port_blocks);
 void make_initial_textrows(ICOORD page_tr,
@@ -222,7 +222,6 @@ bool segment_baseline(                      // split baseline
 );
 double *linear_spline_baseline( // split baseline
     TO_ROW *row,                // row to fit
-    TO_BLOCK *block,            // block it came from
     int32_t &segments,          // no of segments
     int32_t xstarts[]           // coords of segments
 );
diff --git a/src/textord/oldbasel.cpp b/src/textord/oldbasel.cpp
index 0b21c77c..f9612a60 100644
--- a/src/textord/oldbasel.cpp
+++ b/src/textord/oldbasel.cpp
@@ -77,7 +77,6 @@ static double_VAR(textord_oldbl_jumplimit, 0.15, "X fraction for new partition")
  **********************************************************************/

 void Textord::make_old_baselines(TO_BLOCK *block, // block to do
-                                 bool testing_on, // correct orientation
                                  float gradient) {
   QSPLINE *prev_baseline; // baseline of previous row
   TO_ROW *row;            // current row
@@ -378,7 +377,7 @@ void Textord::find_textlines(TO_BLOCK *block,   // block row is in
                               &row->baseline, jumplimit, &ydiffs[0]);
     pointcount = partition_coords(&blobcoords[0], blobcount, &partids[0], bestpart, &xcoords[0],
                                   &ycoords[0]);
-    segments = segment_spline(&blobcoords[0], blobcount, &xcoords[0], &ycoords[0], degree,
+    segments = segment_spline(&xcoords[0], &ycoords[0], degree,
                               pointcount, xstarts);
     if (!holed_line) {
       do {
@@ -400,7 +399,7 @@ void Textord::find_textlines(TO_BLOCK *block,   // block row is in
     old_first_xheight(row, &blobcoords[0], lineheight, blobcount, &row->baseline, jumplimit);
   } else if (textord_old_xheight) {
     make_first_xheight(row, &blobcoords[0], lineheight, static_cast<int>(block->line_size),
-                       blobcount, &row->baseline, jumplimit);
+                       blobcount, &row->baseline);
   } else {
     compute_row_xheight(row, block->block->classify_rotation(), row->line_m(), block->line_size);
   }
@@ -1004,8 +1003,6 @@ int partition_coords(  // find relevant coords
  **********************************************************************/

 int segment_spline(             // make xstarts
-    TBOX blobcoords[],          // boundign boxes
-    int blobcount,              /*no of blobs in row */
     int xcoords[],              /*points to work on */
     int ycoords[],              /*points to work on */
     int degree, int pointcount, /*no of points */
@@ -1424,8 +1421,7 @@ void make_first_xheight( // find xheight
     int lineheight,      // initial guess
     int init_lineheight, // block level guess
     int blobcount,       /*blobs in blobcoords */
-    QSPLINE *baseline,   /*established */
-    float jumplimit      /*min ascender height */
+    QSPLINE *baseline    // established
 ) {
   STATS heightstat(0, HEIGHTBUCKETS - 1);
   int lefts[HEIGHTBUCKETS];
diff --git a/src/textord/oldbasel.h b/src/textord/oldbasel.h
index 7b1d8d09..2898ef1f 100644
--- a/src/textord/oldbasel.h
+++ b/src/textord/oldbasel.h
@@ -89,8 +89,6 @@ int partition_coords(  // find relevant coords
     int ycoords[]      /*points to work on */
 );
 int segment_spline(             // make xstarts
-    TBOX blobcoords[],          // boundign boxes
-    int blobcount,              /*no of blobs in row */
     int xcoords[],              /*points to work on */
     int ycoords[],              /*points to work on */
     int degree, int pointcount, /*no of points */
@@ -134,8 +132,7 @@ void make_first_xheight( // find xheight
     int lineheight,      // initial guess
     int init_lineheight, // block level guess
     int blobcount,       /*blobs in blobcoords */
-    QSPLINE *baseline,   /*established */
-    float jumplimit      /*min ascender height */
+    QSPLINE *baseline    // established
 );

 int *make_height_array( // get array of heights
diff --git a/src/textord/pithsync.cpp b/src/textord/pithsync.cpp
index 868109c4..cb92de8c 100644
--- a/src/textord/pithsync.cpp
+++ b/src/textord/pithsync.cpp
@@ -206,8 +206,7 @@ void FPCUTPT::assign_cheap( // constructor
     STATS *projection,      // vertical occupation
     float projection_scale, // scaling
     int16_t zero_count,     // official zero
-    int16_t pitch,          // proposed pitch
-    int16_t pitch_error     // allowed tolerance
+    int16_t pitch           // proposed pitch
 ) {
   int index;             // test index
   int16_t balance_count; // ding factor
@@ -610,8 +609,7 @@ double check_pitch_sync3(    // find segmentation
                                       projection, projection_scale, zero_count, pitch, pitch_error);
     } else {
       cutpts[x - array_origin].assign_cheap(&cutpts[0], array_origin, x, faking, mid_cut, offset,
-                                            projection, projection_scale, zero_count, pitch,
-                                            pitch_error);
+                                            projection, projection_scale, zero_count, pitch);
     }
     x++;
     if (next_zero < x || next_zero == x + zero_offset) {
diff --git a/src/textord/pithsync.h b/src/textord/pithsync.h
index db7b9ba8..16db4723 100644
--- a/src/textord/pithsync.h
+++ b/src/textord/pithsync.h
@@ -62,8 +62,7 @@ public:
       STATS *projection,      // occupation
       float projection_scale, // scaling
       int16_t zero_count,     // official zero
-      int16_t pitch,          // proposed pitch
-      int16_t pitch_error);   // allowed tolerance
+      int16_t pitch);         // proposed pitch

   int32_t position() { // access func
     return xpos;
diff --git a/src/textord/strokewidth.cpp b/src/textord/strokewidth.cpp
index e579eb21..bbaf6345 100644
--- a/src/textord/strokewidth.cpp
+++ b/src/textord/strokewidth.cpp
@@ -1294,7 +1294,7 @@ PartitionFindResult StrokeWidth::FindInitialPartitions(
   }
   part_grid->SplitOverlappingPartitions(big_parts);
   EasyMerges(part_grid);
-  RemoveLargeUnusedBlobs(block, part_grid, big_parts);
+  RemoveLargeUnusedBlobs(block, big_parts);
   TBOX grid_box(bleft(), tright());
   while (part_grid->GridSmoothNeighbours(BTFT_CHAIN, nontext_map_, grid_box, rerotation)) {
     ;
@@ -1794,7 +1794,7 @@ void StrokeWidth::MergeDiacritics(TO_BLOCK *block, ColPartitionGrid *part_grid)
 // Any blobs on the large_blobs list of block that are still unowned by a
 // ColPartition, are probably drop-cap or vertically touching so the blobs
 // are removed to the big_parts list and treated separately.
-void StrokeWidth::RemoveLargeUnusedBlobs(TO_BLOCK *block, ColPartitionGrid *part_grid,
+void StrokeWidth::RemoveLargeUnusedBlobs(TO_BLOCK *block,
                                          ColPartition_LIST *big_parts) {
   BLOBNBOX_IT large_it(&block->large_blobs);
   for (large_it.mark_cycle_pt(); !large_it.cycled_list(); large_it.forward()) {
diff --git a/src/textord/strokewidth.h b/src/textord/strokewidth.h
index cdab5345..2e2ca189 100644
--- a/src/textord/strokewidth.h
+++ b/src/textord/strokewidth.h
@@ -250,7 +250,7 @@ private:
   // Any blobs on the large_blobs list of block that are still unowned by a
   // ColPartition, are probably drop-cap or vertically touching so the blobs
   // are removed to the big_parts list and treated separately.
-  void RemoveLargeUnusedBlobs(TO_BLOCK *block, ColPartitionGrid *part_grid,
+  void RemoveLargeUnusedBlobs(TO_BLOCK *block,
                               ColPartition_LIST *big_parts);

   // All remaining unused blobs are put in individual ColPartitions.
diff --git a/src/textord/tabfind.cpp b/src/textord/tabfind.cpp
index 45d47e72..03c063b8 100644
--- a/src/textord/tabfind.cpp
+++ b/src/textord/tabfind.cpp
@@ -203,7 +203,7 @@ int TabFind::GutterWidth(int bottom_y, int top_y, const TabVector &v, bool ignor
 }

 // Find the gutter width and distance to inner neighbour for the given blob.
-void TabFind::GutterWidthAndNeighbourGap(int tab_x, int mean_height, int max_gutter, bool left,
+void TabFind::GutterWidthAndNeighbourGap(int tab_x, int max_gutter, bool left,
                                          BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap) {
   const TBOX &box = bbox->bounding_box();
   // The gutter and internal sides of the box.
@@ -1320,7 +1320,7 @@ bool TabFind::Deskew(TabVector_LIST *hlines, BLOBNBOX_LIST *image_blobs, TO_BLOC
 // Flip the vertical and horizontal lines and rotate the grid ready
 // for working on the rotated image.
 // This also makes parameter adjustments for FindInitialTabVectors().
-void TabFind::ResetForVerticalText(const FCOORD &rotate, const FCOORD &rerotate,
+void TabFind::ResetForVerticalText(const FCOORD &rotate,
                                    TabVector_LIST *horizontal_lines, int *min_gutter_width) {
   // Rotate the horizontal and vertical vectors and swap them over.
   // Only the separators are kept and rotated; other tabs are used
diff --git a/src/textord/tabfind.h b/src/textord/tabfind.h
index 2a3ae592..51e6ab68 100644
--- a/src/textord/tabfind.h
+++ b/src/textord/tabfind.h
@@ -93,7 +93,7 @@ public:
   /**
    * Find the gutter width and distance to inner neighbour for the given blob.
    */
-  void GutterWidthAndNeighbourGap(int tab_x, int mean_height, int max_gutter, bool left,
+  void GutterWidthAndNeighbourGap(int tab_x, int max_gutter, bool left,
                                   BLOBNBOX *bbox, int *gutter_width, int *neighbour_gap);

   /**
@@ -217,7 +217,7 @@ protected:
   // for working on the rotated image.
   // The min_gutter_width will be adjusted to the median gutter width between
   // vertical tabs to set a better threshold for tabboxes in the 2nd pass.
-  void ResetForVerticalText(const FCOORD &rotate, const FCOORD &rerotate,
+  void ResetForVerticalText(const FCOORD &rotate,
                             TabVector_LIST *horizontal_lines, int *min_gutter_width);

   // Clear the grid and get rid of the tab vectors, but not separators,
diff --git a/src/textord/tablefind.cpp b/src/textord/tablefind.cpp
index 09bd222a..8490b680 100644
--- a/src/textord/tablefind.cpp
+++ b/src/textord/tablefind.cpp
@@ -188,8 +188,7 @@ void TableFinder::Init(int grid_size, const ICOORD &bottom_left,

 // Copy cleaned partitions from part_grid_ to clean_part_grid_ and
 // insert leaders and rulers into the leader_and_ruling_grid_
-void TableFinder::InsertCleanPartitions(ColPartitionGrid *grid,
-                                        TO_BLOCK *block) {
+void TableFinder::InsertCleanPartitions(ColPartitionGrid *grid) {
   // Calculate stats. This lets us filter partitions in AllowTextPartition()
   // and filter blobs in AllowBlob().
   SetGlobalSpacings(grid);
@@ -258,7 +257,7 @@ void TableFinder::InsertCleanPartitions(ColPartitionGrid *grid,
 // High level function to perform table detection
 void TableFinder::LocateTables(ColPartitionGrid *grid,
                                ColPartitionSet **all_columns,
-                               WidthCallback width_cb, const FCOORD &reskew) {
+                               WidthCallback width_cb) {
   // initialize spacing, neighbors, and columns
   InitializePartitions(all_columns);

diff --git a/src/textord/tablefind.h b/src/textord/tablefind.h
index 378b71a2..71f84b2a 100644
--- a/src/textord/tablefind.h
+++ b/src/textord/tablefind.h
@@ -137,7 +137,7 @@ public:
   // Copy cleaned partitions from ColumnFinder's part_grid_ to this
   // clean_part_grid_ and insert dot-like noise into period_grid_.
   // It resizes the grids in this object to the dimensions of grid.
-  void InsertCleanPartitions(ColPartitionGrid *grid, TO_BLOCK *block);
+  void InsertCleanPartitions(ColPartitionGrid *grid);

   // High level function to perform table detection
   // Finds tables and updates the grid object with new partitions for the
@@ -145,7 +145,7 @@ public:
   // The reskew argument is only used to write the tables to the out.png
   // if that feature is enabled.
   void LocateTables(ColPartitionGrid *grid, ColPartitionSet **columns,
-                    WidthCallback width_cb, const FCOORD &reskew);
+                    WidthCallback width_cb);

 protected:
   // Access for the grid dimensions.
diff --git a/src/textord/tabvector.cpp b/src/textord/tabvector.cpp
index 8ef12b27..604afa6a 100644
--- a/src/textord/tabvector.cpp
+++ b/src/textord/tabvector.cpp
@@ -634,7 +634,7 @@ void TabVector::Evaluate(const ICOORD &vertical, TabFind *finder) {
     int tab_x = XAtY(mid_y);
     int gutter_width;
     int neighbour_gap;
-    finder->GutterWidthAndNeighbourGap(tab_x, mean_height, max_gutter, left, bbox, &gutter_width,
+    finder->GutterWidthAndNeighbourGap(tab_x, max_gutter, left, bbox, &gutter_width,
                                        &neighbour_gap);
     if (debug) {
       tprintf("Box (%d,%d)->(%d,%d) has gutter %d, ndist %d\n", box.left(), box.bottom(),
@@ -704,7 +704,7 @@ void TabVector::Evaluate(const ICOORD &vertical, TabFind *finder) {
       }
       int gutter_width;
       int neighbour_gap;
-      finder->GutterWidthAndNeighbourGap(tab_x, mean_height, max_gutter, left, bbox, &gutter_width,
+      finder->GutterWidthAndNeighbourGap(tab_x, max_gutter, left, bbox, &gutter_width,
                                          &neighbour_gap);
       // Now we can make the test.
       if (gutter_width >= median_gutter * kMinGutterFraction) {
diff --git a/src/textord/textord.cpp b/src/textord/textord.cpp
index 9526fe19..c78d3267 100644
--- a/src/textord/textord.cpp
+++ b/src/textord/textord.cpp
@@ -224,7 +224,7 @@ void Textord::TextordPage(PageSegMode pageseg_mode, const FCOORD &reskew, int wi
     *gradient = make_rows(page_tr_, to_blocks);
   } else if (!PSM_SPARSE(pageseg_mode)) {
     // RAW_LINE, SINGLE_LINE, SINGLE_WORD and SINGLE_CHAR all need a single row.
-    *gradient = make_single_row(page_tr_, pageseg_mode != PSM_RAW_LINE, to_block, to_blocks);
+    *gradient = make_single_row(pageseg_mode != PSM_RAW_LINE, to_block, to_blocks);
   } else {
     *gradient = 0.0f;
   }
@@ -235,7 +235,7 @@ void Textord::TextordPage(PageSegMode pageseg_mode, const FCOORD &reskew, int wi
   // Now make the words in the lines.
   if (PSM_WORD_FIND_ENABLED(pageseg_mode)) {
     // SINGLE_LINE uses the old word maker on the single line.
-    make_words(this, page_tr_, *gradient, blocks, to_blocks);
+    make_words(this, page_tr_, *gradient, to_blocks);
   } else {
     // SINGLE_WORD and SINGLE_CHAR cram all the blobs into a
     // single word, and in SINGLE_CHAR mode, all the outlines
diff --git a/src/textord/textord.h b/src/textord/textord.h
index 308096b4..894104c4 100644
--- a/src/textord/textord.h
+++ b/src/textord/textord.h
@@ -104,15 +104,9 @@ public:
   }

   // tospace.cpp ///////////////////////////////////////////
-  void to_spacing(ICOORD page_tr,       // topright of page
-                  TO_BLOCK_LIST *blocks // blocks on page
-  );
-  ROW *make_prop_words(TO_ROW *row,    // row to make
-                       FCOORD rotation // for drawing
-  );
-  ROW *make_blob_words(TO_ROW *row,    // row to make
-                       FCOORD rotation // for drawing
-  );
+  void to_spacing(TO_BLOCK_LIST *blocks);
+  ROW *make_prop_words(TO_ROW *row);
+  ROW *make_blob_words(TO_ROW *row);
   // tordmain.cpp ///////////////////////////////////////////
   void find_components(Image pix, BLOCK_LIST *blocks, TO_BLOCK_LIST *to_blocks);
   void filter_blobs(ICOORD page_tr, TO_BLOCK_LIST *blocks, bool testing_on);
@@ -147,7 +141,6 @@ public:
 private:
   //// oldbasel.cpp ////////////////////////////////////////
   void make_old_baselines(TO_BLOCK *block, // block to do
-                          bool testing_on, // correct orientation
                           float gradient);
   void correlate_lines(TO_BLOCK *block, float gradient);
   void correlate_neighbours(TO_BLOCK *block, // block rows are in.
diff --git a/src/textord/topitch.cpp b/src/textord/topitch.cpp
index a829c286..cf906594 100644
--- a/src/textord/topitch.cpp
+++ b/src/textord/topitch.cpp
@@ -95,15 +95,15 @@ void compute_fixed_pitch(ICOORD page_tr,             // top right
   block_index = 1;
   for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
     block = block_it.data();
-    compute_block_pitch(block, rotation, block_index, testing_on);
+    compute_block_pitch(block, block_index, testing_on);
     block_index++;
   }

-  if (!try_doc_fixed(page_tr, port_blocks, gradient)) {
+  if (!try_doc_fixed(port_blocks, gradient)) {
     block_index = 1;
     for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
       block = block_it.data();
-      if (!try_block_fixed(block, block_index)) {
+      if (!try_block_fixed(block)) {
         try_rows_fixed(block, block_index, testing_on);
       }
       block_index++;
@@ -122,7 +122,7 @@ void compute_fixed_pitch(ICOORD page_tr,             // top right
     row_index = 1;
     for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
       row = row_it.data();
-      fix_row_pitch(row, block, port_blocks, row_index, block_index);
+      fix_row_pitch(row, port_blocks, row_index, block_index);
       row_index++;
     }
     block_index++;
@@ -142,7 +142,6 @@ void compute_fixed_pitch(ICOORD page_tr,             // top right
  **********************************************************************/

 void fix_row_pitch(TO_ROW *bad_row,        // row to fix
-                   TO_BLOCK *bad_block,    // block of bad_row
                    TO_BLOCK_LIST *blocks,  // blocks to scan
                    int32_t row_target,     // number of row
                    int32_t block_target) { // number of block
@@ -288,7 +287,6 @@ void fix_row_pitch(TO_ROW *bad_row,        // row to fix
  **********************************************************************/

 void compute_block_pitch(TO_BLOCK *block,     // input list
-                         FCOORD rotation,     // for drawing
                          int32_t block_index, // block number
                          bool testing_on) {   // correct orientation
   TBOX block_box;                             // bounding box
@@ -307,7 +305,7 @@ void compute_block_pitch(TO_BLOCK *block,     // input list
   block->pr_space = block->pr_nonsp * textord_spacesize_ratioprop;
   if (!block->get_rows()->empty()) {
     ASSERT_HOST(block->xheight > 0);
-    find_repeated_chars(block, textord_show_initial_words && testing_on);
+    find_repeated_chars(block);
 #ifndef GRAPHICS_DISABLED
     if (textord_show_initial_words && testing_on) {
       // overlap_picture_ops(true);
@@ -366,7 +364,6 @@ bool compute_rows_pitch( // find line stats
  **********************************************************************/

 bool try_doc_fixed(             // determine pitch
-    ICOORD page_tr,             // top right
     TO_BLOCK_LIST *port_blocks, // input list
     float gradient              // page skew
 ) {
@@ -496,10 +493,7 @@ bool try_doc_fixed(             // determine pitch
  * Try to call the entire block fixed.
  **********************************************************************/

-bool try_block_fixed(   // find line stats
-    TO_BLOCK *block,    // block to do
-    int32_t block_index // block number
-) {
+bool try_block_fixed(TO_BLOCK *block) {
   return false;
 }

@@ -1651,8 +1645,7 @@ void print_pitch_sd(         // find fp cells
  * Extract marked leader blobs and put them
  * into words in advance of fixed pitch checking and word generation.
  **********************************************************************/
-void find_repeated_chars(TO_BLOCK *block,   // Block to search.
-                         bool testing_on) { // Debug mode.
+void find_repeated_chars(TO_BLOCK *block) { // Block to search.
   POLY_BLOCK *pb = block->block->pdblk.poly_block();
   if (pb != nullptr && !pb->IsText()) {
     return; // Don't find repeated chars in non-text blocks.
diff --git a/src/textord/topitch.h b/src/textord/topitch.h
index f8db6261..4ef0e558 100644
--- a/src/textord/topitch.h
+++ b/src/textord/topitch.h
@@ -39,15 +39,11 @@ void compute_fixed_pitch(ICOORD page_tr,             // top right
                          float gradient,             // page skew
                          FCOORD rotation,            // for drawing
                          bool testing_on);           // correct orientation
-void fix_row_pitch(                                  // get some value
-    TO_ROW *bad_row,                                 // row to fix
-    TO_BLOCK *bad_block,                             // block of bad_row
-    TO_BLOCK_LIST *blocks,                           // blocks to scan
-    int32_t row_target,                              // number of row
-    int32_t block_target                             // number of block
-);
+void fix_row_pitch(TO_ROW *bad_row,        // row to fix
+                   TO_BLOCK_LIST *blocks,  // blocks to scan
+                   int32_t row_target,     // number of row
+                   int32_t block_target);  // number of block
 void compute_block_pitch(TO_BLOCK *block,     // input list
-                         FCOORD rotation,     // for drawing
                          int32_t block_index, // block number
                          bool testing_on);    // correct orientation
 bool compute_rows_pitch(                      // find line stats
@@ -55,15 +51,10 @@ bool compute_rows_pitch(                      // find line stats
     int32_t block_index,                      // block number
     bool testing_on                           // correct orientation
 );
-bool try_doc_fixed(             // determine pitch
-    ICOORD page_tr,             // top right
-    TO_BLOCK_LIST *port_blocks, // input list
-    float gradient              // page skew
-);
-bool try_block_fixed(   // find line stats
-    TO_BLOCK *block,    // block to do
-    int32_t block_index // block number
-);
+// determine pitch
+bool try_doc_fixed(TO_BLOCK_LIST *port_blocks, float gradient);
+// find line stats
+bool try_block_fixed(TO_BLOCK *block);
 bool try_rows_fixed(     // find line stats
     TO_BLOCK *block,     // block to do
     int32_t block_index, // block number
@@ -165,8 +156,7 @@ void print_pitch_sd(         // find fp cells
     int16_t projection_right, float space_size,
     float initial_pitch // guess at pitch
 );
-void find_repeated_chars(TO_BLOCK *block,  // Block to search.
-                         bool testing_on); // Debug mode.
+void find_repeated_chars(TO_BLOCK *block); // Block to search.
 void plot_fp_word(                         // draw block of words
     TO_BLOCK *block,                       // block to draw
     float pitch,                           // pitch to draw with
diff --git a/src/textord/tospace.cpp b/src/textord/tospace.cpp
index 62d25e0b..1684bb31 100644
--- a/src/textord/tospace.cpp
+++ b/src/textord/tospace.cpp
@@ -42,9 +42,7 @@
 #define MAXSPACING 128 /*max expected spacing in pix */

 namespace tesseract {
-void Textord::to_spacing(ICOORD page_tr,       // topright of page
-                         TO_BLOCK_LIST *blocks // blocks on page
-) {
+void Textord::to_spacing(TO_BLOCK_LIST *blocks) {
   TO_BLOCK_IT block_it; // iterator
   TO_BLOCK *block;      // current block;
   TO_ROW *row;          // current row
@@ -840,9 +838,7 @@ threshold is not within it, move the threshold so that is just inside it.
  *
  * Convert a TO_ROW to a ROW.
  **********************************************************************/
-ROW *Textord::make_prop_words(TO_ROW *row,    // row to make
-                              FCOORD rotation // for drawing
-) {
+ROW *Textord::make_prop_words(TO_ROW *row) {
   bool bol; // start of line
   /* prev_ values are for start of word being built. non prev_ values are for
 the gap between the word being built and the next one. */
@@ -1114,9 +1110,7 @@ the gap between the word being built and the next one. */
  * Converts words into blobs so that each blob is a single character.
  *  Used for chopper test.
  **********************************************************************/
-ROW *Textord::make_blob_words(TO_ROW *row,    // row to make
-                              FCOORD rotation // for drawing
-) {
+ROW *Textord::make_blob_words(TO_ROW *row) {
   bool bol;      // start of line
   ROW *real_row; // output row
   C_OUTLINE_IT cout_it;
diff --git a/src/textord/wordseg.cpp b/src/textord/wordseg.cpp
index b3db3445..897359fa 100644
--- a/src/textord/wordseg.cpp
+++ b/src/textord/wordseg.cpp
@@ -100,7 +100,6 @@ void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST *real_rows) {
 void make_words(tesseract::Textord *textord,
                 ICOORD page_tr,               // top right
                 float gradient,               // page skew
-                BLOCK_LIST *blocks,           // block list
                 TO_BLOCK_LIST *port_blocks) { // output list
   TO_BLOCK_IT block_it;                       // iterator
   TO_BLOCK *block;                            // current block
@@ -111,7 +110,7 @@ void make_words(tesseract::Textord *textord,
     compute_fixed_pitch(page_tr, port_blocks, gradient, FCOORD(0.0f, -1.0f),
                         !bool(textord_test_landscape));
   }
-  textord->to_spacing(page_tr, port_blocks);
+  textord->to_spacing(port_blocks);
   block_it.set_to_list(port_blocks);
   for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {
     block = block_it.data();
@@ -128,7 +127,6 @@ void make_words(tesseract::Textord *textord,

 void set_row_spaces( // find space sizes
     TO_BLOCK *block, // block to do
-    FCOORD rotation, // for drawing
     bool testing_on  // correct orientation
 ) {
   TO_ROW *row; // current row
@@ -170,7 +168,6 @@ int32_t row_words(    // compute space size
     TO_BLOCK *block,  // block it came from
     TO_ROW *row,      // row to operate on
     int32_t maxwidth, // max expected space size
-    FCOORD rotation,  // for drawing
     bool testing_on   // for debug
 ) {
   bool testing_row;      // contains testpt
@@ -323,7 +320,6 @@ int32_t row_words2(   // compute space size
     TO_BLOCK *block,  // block it came from
     TO_ROW *row,      // row to operate on
     int32_t maxwidth, // max expected space size
-    FCOORD rotation,  // for drawing
     bool testing_on   // for debug
 ) {
   bool prev_valid;       // if decent size
@@ -495,13 +491,13 @@ void make_real_words(tesseract::Textord *textord,
       // with force_make_prop_words flag.
       POLY_BLOCK *pb = block->block->pdblk.poly_block();
       if (textord_chopper_test) {
-        real_row = textord->make_blob_words(row, rotation);
+        real_row = textord->make_blob_words(row);
       } else if (textord_force_make_prop_words || (pb != nullptr && !pb->IsText()) ||
                  row->pitch_decision == PITCH_DEF_PROP || row->pitch_decision == PITCH_CORR_PROP) {
-        real_row = textord->make_prop_words(row, rotation);
+        real_row = textord->make_prop_words(row);
       } else if (row->pitch_decision == PITCH_DEF_FIXED ||
                  row->pitch_decision == PITCH_CORR_FIXED) {
-        real_row = fixed_pitch_words(row, rotation);
+        real_row = fixed_pitch_words(row);
       } else {
         ASSERT_HOST(false);
       }
diff --git a/src/textord/wordseg.h b/src/textord/wordseg.h
index be437b74..27b401dc 100644
--- a/src/textord/wordseg.h
+++ b/src/textord/wordseg.h
@@ -33,25 +33,21 @@ void make_single_word(bool one_blob, TO_ROW_LIST *rows, ROW_LIST *real_rows);
 void make_words(tesseract::Textord *textord,
                 ICOORD page_tr,              // top right
                 float gradient,              // page skew
-                BLOCK_LIST *blocks,          // block list
                 TO_BLOCK_LIST *port_blocks); // output list
 void set_row_spaces(                         // find space sizes
     TO_BLOCK *block,                         // block to do
-    FCOORD rotation,                         // for drawing
     bool testing_on                          // correct orientation
 );
 int32_t row_words(    // compute space size
     TO_BLOCK *block,  // block it came from
     TO_ROW *row,      // row to operate on
     int32_t maxwidth, // max expected space size
-    FCOORD rotation,  // for drawing
     bool testing_on   // for debug
 );
 int32_t row_words2(   // compute space size
     TO_BLOCK *block,  // block it came from
     TO_ROW *row,      // row to operate on
     int32_t maxwidth, // max expected space size
-    FCOORD rotation,  // for drawing
     bool testing_on   // for debug
 );
 void make_real_words(tesseract::Textord *textord,