Add DiffSub debug check and Diff debug comment.

This commit is contained in:
TomAwezome 2022-10-23 02:09:10 -04:00
parent fc6960b8f7
commit 4a4e7a20fb

View file

@ -181,7 +181,13 @@ Bool DiffSub(CDoc *doc, I64 *_df_flags, I64 j1_lo, I64 j1_hi, I64 j2_lo, I64 j2_
i2++;
else
{
i = StrCompare(doc_sorted1[i1]->tag, doc_sorted2[i2]->tag);
if (!CheckPtr(doc_sorted1[i1]) || !CheckPtr(doc_sorted2[i2]) || !CheckPtr(doc_sorted1[i1]->tag) || !CheckPtr(doc_sorted2[i2]->tag))
{
RawPrint(300, "\nDiffSub PANIC %X %X %X %X\n", doc_sorted1[i1], doc_sorted2[i2], doc_sorted1[i1]->tag, doc_sorted2[i2]->tag);
i = 1; // ???
}
else
i = StrCompare(doc_sorted1[i1]->tag, doc_sorted2[i2]->tag);
if (i > 0)
i2++;
else if (i < 0)
@ -270,7 +276,14 @@ public Bool Diff(U8 *dst_file, U8 *src_file, I64 *_df_flags=NULL)
df_flags = *_df_flags;
else
df_flags = 0;
df_flags &= DF_ABORT_ALL_FILES;
// df_flags &= DF_ABORT_ALL_FILES; // This line removes ALL df_flags values passed to this function,
// while also setting df_flags to DF_ABORT_ALL_FILES
// if it somehow got passed with a value of DF_ABORT_ALL_FILES.
// ... this seems counterproductive, and makes utilizing Diff with df_flags
// very difficult... Changing this to instead !! UN-SET !! DF_ABORT_ALL_FILES,
// which is what I can only guess was the intended behaviour here? ........
df_flags &= ~(DF_ABORT_ALL_FILES);
doc_e = doc1->head.next;
while (doc_e != doc1)