@@ -50,16 +50,11 @@ bool test_underline(  // look for underlines
5050    int16_t  baseline, // /< coords of baseline
5151    int16_t  xheight   // /< height of line
5252) {
53-   int16_t  occ;
54-   int16_t  blob_width; //  width of blob
55-   TBOX blob_box;      //  bounding box
56-   int32_t  desc_occ;
57-   int32_t  x_occ;
58-   int32_t  asc_occ;
53+   int32_t  occ;
5954  STATS projection;
6055
61-   blob_box = blob->bounding_box ();
62-   blob_width = blob->bounding_box ().width ();
56+   auto   blob_box = blob->bounding_box ();
57+   auto   blob_width = blob->bounding_box ().width ();
6358  projection.set_range (blob_box.bottom (), blob_box.top () + 1 );
6459  if  (testing_on) {
6560    //               blob->plot(to_win,GOLDENROD,GOLDENROD);
@@ -73,21 +68,21 @@ bool test_underline(  // look for underlines
7368            blob->bounding_box ().right (), blob->bounding_box ().top (), baseline);
7469  }
7570  horizontal_cblob_projection (blob, &projection);
76-   desc_occ = 0 ;
71+   int32_t   desc_occ = 0 ;
7772  for  (occ = blob_box.bottom (); occ < baseline; occ++) {
7873    if  (occ <= blob_box.top () && projection.pile_count (occ) > desc_occ) {
7974      //  max in region
8075      desc_occ = projection.pile_count (occ);
8176    }
8277  }
83-   x_occ = 0 ;
78+   int32_t   x_occ = 0 ;
8479  for  (occ = baseline; occ <= baseline + xheight; occ++) {
8580    if  (occ >= blob_box.bottom () && occ <= blob_box.top () && projection.pile_count (occ) > x_occ) {
8681      //  max in region
8782      x_occ = projection.pile_count (occ);
8883    }
8984  }
90-   asc_occ = 0 ;
85+   int32_t   asc_occ = 0 ;
9186  for  (occ = baseline + xheight + 1 ; occ <= blob_box.top (); occ++) {
9287    if  (occ >= blob_box.bottom () && projection.pile_count (occ) > asc_occ) {
9388      asc_occ = projection.pile_count (occ);
0 commit comments