aboutsummaryrefslogtreecommitdiffstats
path: root/libpatch_reverse_diff2.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-01-09 22:04:24 +0100
committerMattias Andrée <maandree@kth.se>2024-01-09 22:04:24 +0100
commitae850b1ac755f471beac4dbfef4654fe3fbaaae9 (patch)
tree319e7f7f1b99cd1ee75e100f0a29b0f7c827ccea /libpatch_reverse_diff2.c
downloadlibpatch-ae850b1ac755f471beac4dbfef4654fe3fbaaae9.tar.gz
libpatch-ae850b1ac755f471beac4dbfef4654fe3fbaaae9.tar.bz2
libpatch-ae850b1ac755f471beac4dbfef4654fe3fbaaae9.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libpatch_reverse_diff2.c')
-rw-r--r--libpatch_reverse_diff2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libpatch_reverse_diff2.c b/libpatch_reverse_diff2.c
new file mode 100644
index 0000000..a247efd
--- /dev/null
+++ b/libpatch_reverse_diff2.c
@@ -0,0 +1,15 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+void
+libpatch_reverse_diff2(struct libpatch_diff2 *diff, size_t difflen)
+{
+ size_t i;
+ for (i = 0; i < difflen; i++) {
+ if (diff[i].change == 1)
+ diff[i].change = 2;
+ else if (diff[i].change == 2)
+ diff[i].change = 1;
+ }
+}