@@ -796,12 +796,6 @@ static int group_slide_up(xdfile_t *xdf, struct xdlgroup *g, long flags)
796
796
}
797
797
}
798
798
799
- static void xdl_bug (const char * msg )
800
- {
801
- fprintf (stderr , "BUG: %s\n" , msg );
802
- exit (1 );
803
- }
804
-
805
799
/*
806
800
* Move back and forward change groups for a consistent and pretty diff output.
807
801
* This also helps in finding joinable change groups and reducing the diff
@@ -841,7 +835,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
841
835
/* Shift the group backward as much as possible: */
842
836
while (!group_slide_up (xdf , & g , flags ))
843
837
if (group_previous (xdfo , & go ))
844
- xdl_bug ("group sync broken sliding up" );
838
+ BUG ("group sync broken sliding up" );
845
839
846
840
/*
847
841
* This is this highest that this group can be shifted.
@@ -857,7 +851,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
857
851
if (group_slide_down (xdf , & g , flags ))
858
852
break ;
859
853
if (group_next (xdfo , & go ))
860
- xdl_bug ("group sync broken sliding down" );
854
+ BUG ("group sync broken sliding down" );
861
855
862
856
if (go .end > go .start )
863
857
end_matching_other = g .end ;
@@ -882,9 +876,9 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
882
876
*/
883
877
while (go .end == go .start ) {
884
878
if (group_slide_up (xdf , & g , flags ))
885
- xdl_bug ("match disappeared" );
879
+ BUG ("match disappeared" );
886
880
if (group_previous (xdfo , & go ))
887
- xdl_bug ("group sync broken sliding to match" );
881
+ BUG ("group sync broken sliding to match" );
888
882
}
889
883
} else if (flags & XDF_INDENT_HEURISTIC ) {
890
884
/*
@@ -925,9 +919,9 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
925
919
926
920
while (g .end > best_shift ) {
927
921
if (group_slide_up (xdf , & g , flags ))
928
- xdl_bug ("best shift unreached" );
922
+ BUG ("best shift unreached" );
929
923
if (group_previous (xdfo , & go ))
930
- xdl_bug ("group sync broken sliding to blank line" );
924
+ BUG ("group sync broken sliding to blank line" );
931
925
}
932
926
}
933
927
@@ -936,11 +930,11 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
936
930
if (group_next (xdf , & g ))
937
931
break ;
938
932
if (group_next (xdfo , & go ))
939
- xdl_bug ("group sync broken moving to next group" );
933
+ BUG ("group sync broken moving to next group" );
940
934
}
941
935
942
936
if (!group_next (xdfo , & go ))
943
- xdl_bug ("group sync broken at end of file" );
937
+ BUG ("group sync broken at end of file" );
944
938
945
939
return 0 ;
946
940
}
0 commit comments