Skip to content

Instantly share code, notes, and snippets.

@andr1972
Created June 10, 2024 16:37
Show Gist options
  • Save andr1972/ada859954b6dd49ee5a5b575bf385337 to your computer and use it in GitHub Desktop.
Save andr1972/ada859954b6dd49ee5a5b575bf385337 to your computer and use it in GitHub Desktop.
Diff_example
int my_other_func(diffdata_t *dd1, long off1, long lim1)
{
if (my_test_cmp(dd1,off1,lim1)>0) return 1;
if (my_test_cmp(dd1,off1,lim1)<0.5) return -1;
return 0;
}
int my_test_cmp(diffdata_t *dd1, long lim1, diffdata_t *dd2)
{
if (off1 > lim1) return -1;
return test_cmp(dd1,dd2);
}
int my_test_cmp(diffdata_t *dd1, long lim1, diffdata_t *dd2)
{
if (off1 > lim1) return -1;
return test_cmp(dd1,dd2);
}
int my_other_func(diffdata_t *dd1, long off1, long lim1)
{
if (my_test_cmp(dd1,off1,lim1)>0) return 1;
if (my_test_cmp(dd1,off1,lim1)<0.5) return -1;
return 0;
}
1c1
< int my_other_func(diffdata_t *dd1, long off1, long lim1)
---
> int my_test_cmp(diffdata_t *dd1, long lim1, diffdata_t *dd2)
3,5c3,4
< if (my_test_cmp(dd1,off1,lim1)>0) return 1;
< if (my_test_cmp(dd1,off1,lim1)<0.5) return -1;
< return 0;
---
> if (off1 > lim1) return -1;
> return test_cmp(dd1,dd2);
9c8
< int my_test_cmp(diffdata_t *dd1, long lim1, diffdata_t *dd2)
---
> int my_other_func(diffdata_t *dd1, long off1, long lim1)
11,12c10,12
< if (off1 > lim1) return -1;
< return test_cmp(dd1,dd2);
---
> if (my_test_cmp(dd1,off1,lim1)>0) return 1;
> if (my_test_cmp(dd1,off1,lim1)<0.5) return -1;
> return 0;
diff a.txt b.txt > result_diff.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment