@@ -316,9 +316,7 @@ double check_pitch_sync2( // find segmentation
316316 TBOX this_box; // bounding box
317317 TBOX next_box; // box of next blob
318318 FPSEGPT *segpt; // segment point
319- double best_cost; // best path
320319 double mean_sum; // computes result
321- FPCUTPT *best_end; // end of best path
322320 int16_t best_fake; // best fake level
323321 int16_t best_count; // no of cuts
324322 BLOBNBOX_IT this_it; // copy iterator
@@ -371,8 +369,6 @@ double check_pitch_sync2( // find segmentation
371369 }
372370
373371 this_it = *blob_it;
374- best_cost = FLT_MAX;
375- best_end = nullptr ;
376372 this_box = box_next (&this_it); // first box
377373 next_box = box_next (&this_it); // second box
378374 blob_index = 1 ;
@@ -411,7 +407,8 @@ double check_pitch_sync2( // find segmentation
411407 }
412408
413409 best_fake = INT16_MAX;
414- best_cost = INT32_MAX;
410+ // best path
411+ double best_cost = INT32_MAX;
415412 best_count = INT16_MAX;
416413 while (x < right_edge + pitch) {
417414 offset = x < right_edge ? right_edge - x : 0 ;
@@ -438,7 +435,8 @@ double check_pitch_sync2( // find segmentation
438435 }
439436 ASSERT_HOST (best_fake < INT16_MAX);
440437
441- best_end = &cutpts[(best_left_x + best_right_x) / 2 - array_origin];
438+ // end of best path
439+ FPCUTPT *best_end = &cutpts[(best_left_x + best_right_x) / 2 - array_origin];
442440 if (this_box.right () == textord_test_x && this_box.top () == textord_test_y) {
443441 for (x = left_edge - pitch; x < right_edge + pitch; x++) {
444442 tprintf (" x=%d, C=%g, s=%g, sq=%g, prev=%d\n " , x, cutpts[x - array_origin].cost_function (),
@@ -509,9 +507,7 @@ double check_pitch_sync3( // find segmentation
509507 FPSEGPT *segpt; // segment point
510508 int minindex; // next input position
511509 int test_index; // index to mins
512- double best_cost; // best path
513510 double mean_sum; // computes result
514- FPCUTPT *best_end; // end of best path
515511 int16_t best_fake; // best fake level
516512 int16_t best_count; // no of cuts
517513 FPSEGPT_IT seg_it = seg_list; // output iterator
@@ -549,8 +545,6 @@ double check_pitch_sync3( // find segmentation
549545 offset);
550546 }
551547
552- best_cost = FLT_MAX;
553- best_end = nullptr ;
554548 for (offset = -pitch_error, minindex = 0 ; offset < pitch_error; offset++, minindex++) {
555549 mins[minindex] = projection->local_min (x + offset);
556550 }
@@ -629,7 +623,8 @@ double check_pitch_sync3( // find segmentation
629623 }
630624
631625 best_fake = INT16_MAX;
632- best_cost = INT32_MAX;
626+ // best path
627+ double best_cost = INT32_MAX;
633628 best_count = INT16_MAX;
634629 while (x < right_edge + pitch) {
635630 offset = x < right_edge ? right_edge - x : 0 ;
@@ -656,7 +651,8 @@ double check_pitch_sync3( // find segmentation
656651 }
657652 ASSERT_HOST (best_fake < INT16_MAX);
658653
659- best_end = &cutpts[(best_left_x + best_right_x) / 2 - array_origin];
654+ // end of best path
655+ FPCUTPT *best_end = &cutpts[(best_left_x + best_right_x) / 2 - array_origin];
660656 // for (x=left_edge-pitch;x<right_edge+pitch;x++)
661657 // {
662658 // tprintf("x=%d, C=%g, s=%g, sq=%g, prev=%d\n",
0 commit comments