Commit Diff


commit - 249b637c505366856603a932c859a0baf1973d10
commit + c251eeea7a670a2a176084dd3b4ac4dde6c55c10
blob - 7c2bfddb8f77a9026ec782026f3775a07e004f5e
blob + 6855889d9612f734106a574e7b7ff947b56823d5
--- lib/diff_internal.h
+++ lib/diff_internal.h
@@ -96,30 +96,6 @@ struct diff_chunk {
 
 #define DIFF_RESULT_ALLOC_BLOCKSIZE 128
 
-enum diff_chunk_type {
-	CHUNK_EMPTY,
-	CHUNK_PLUS,
-	CHUNK_MINUS,
-	CHUNK_SAME,
-	CHUNK_ERROR,
-};
-
-static inline enum diff_chunk_type
-diff_chunk_type(const struct diff_chunk *chunk)
-{
-	if (!chunk->left_count && !chunk->right_count)
-		return CHUNK_EMPTY;
-	if (!chunk->solved)
-		return CHUNK_ERROR;
-	if (!chunk->right_count)
-		return CHUNK_MINUS;
-	if (!chunk->left_count)
-		return CHUNK_PLUS;
-	if (chunk->left_count != chunk->right_count)
-		return CHUNK_ERROR;
-	return CHUNK_SAME;
-}
-
 struct diff_chunk_context;
 
 bool
blob - 25d476df152bc9f65ca65f47590adcfc8ef6ae48
blob + e64b1320e5537bedf69b7a4e8a2d62c642f790f4
--- lib/diff_main.c
+++ lib/diff_main.c
@@ -34,6 +34,22 @@
 
 #include "diff_internal.h"
 #include "diff_debug.h"
+
+inline enum diff_chunk_type
+diff_chunk_type(const struct diff_chunk *chunk)
+{
+	if (!chunk->left_count && !chunk->right_count)
+		return CHUNK_EMPTY;
+	if (!chunk->solved)
+		return CHUNK_ERROR;
+	if (!chunk->right_count)
+		return CHUNK_MINUS;
+	if (!chunk->left_count)
+		return CHUNK_PLUS;
+	if (chunk->left_count != chunk->right_count)
+		return CHUNK_ERROR;
+	return CHUNK_SAME;
+}
 
 static int
 read_at(FILE *f, off_t at_pos, unsigned char *buf, size_t len)
blob - fa9dc982956eab298f65b4b9ffca114a46b50b76
blob + 04a6c6e748c995f16f8d1d2d4dc36c1b9f65abdc
--- lib/diff_main.h
+++ lib/diff_main.h
@@ -28,8 +28,8 @@ struct diff_range {
 struct diff_atom {
 	struct diff_data *root; /* back pointer to root diff data */
 
-	off_t pos;		/* if not memory-mapped */
-	const uint8_t *at;	/* if memory-mapped */
+	off_t pos;		/* set whether memory-mapped or not */
+	const uint8_t *at;	/* only set if memory-mapped */
 	off_t len;
 
 	/* This hash is just a very cheap speed up for finding *mismatching*
@@ -140,8 +140,18 @@ struct diff_result {
 	struct diff_data *right;
 
 	diff_chunk_arraylist_t chunks;
+};
+
+enum diff_chunk_type {
+	CHUNK_EMPTY,
+	CHUNK_PLUS,
+	CHUNK_MINUS,
+	CHUNK_SAME,
+	CHUNK_ERROR,
 };
 
+enum diff_chunk_type diff_chunk_type(const struct diff_chunk *c);
+
 struct diff_state;
 
 /* Signature of a utility function to divide a file into diff atoms.