[RFC][PATCH 07/10] Sparse: fix "'merge_file' not declared" warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a declaration for merge_file() to a new "merge-file.h" header
file, and add the appropriate include directives.

Signed-off-by: Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx>
---

There are two other (static) definitions of a merge_file() function,
one in merge-recursive.c, which could probably be renamed merge_filespec()
and one in merge-index.c, which could be renamed merge_path().
Maybe the the function in merge-file.c should be called merge_blob() ...
(and then change the file names too!)

 Makefile     |    3 ++-
 merge-file.c |    1 +
 merge-file.h |    8 ++++++++
 merge-tree.c |    3 +--
 4 files changed, 12 insertions(+), 3 deletions(-)
 create mode 100644 merge-file.h

diff --git a/Makefile b/Makefile
index 29243c6..19b6da1 100644
--- a/Makefile
+++ b/Makefile
@@ -296,7 +296,8 @@ LIB_H = \
 	diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \
 	run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
 	tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \
-	utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h mailmap.h
+	utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \
+	mailmap.h merge-file.h
 
 DIFF_OBJS = \
 	diff.o diff-lib.o diffcore-break.o diffcore-order.o \
diff --git a/merge-file.c b/merge-file.c
index 748d15c..7bfefe7 100644
--- a/merge-file.c
+++ b/merge-file.c
@@ -2,6 +2,7 @@
 #include "run-command.h"
 #include "xdiff-interface.h"
 #include "blob.h"
+#include "merge-file.h"
 
 static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
 {
diff --git a/merge-file.h b/merge-file.h
new file mode 100644
index 0000000..a503c90
--- /dev/null
+++ b/merge-file.h
@@ -0,0 +1,8 @@
+#ifndef MERGE_FILE_H
+#define MERGE_FILE_H
+
+#include "blob.h"
+
+extern void *merge_file(struct blob *, struct blob *, struct blob *, unsigned long *);
+
+#endif
diff --git a/merge-tree.c b/merge-tree.c
index 3b8d9e6..93c8f54 100644
--- a/merge-tree.c
+++ b/merge-tree.c
@@ -2,6 +2,7 @@
 #include "tree-walk.h"
 #include "xdiff-interface.h"
 #include "blob.h"
+#include "merge-file.h"
 
 static const char merge_tree_usage[] = "git-merge-tree <base-tree> <branch1> <branch2>";
 static int resolve_directories = 1;
@@ -53,8 +54,6 @@ static const char *explanation(struct merge_list *entry)
 	return "removed in remote";
 }
 
-extern void *merge_file(struct blob *, struct blob *, struct blob *, unsigned long *);
-
 static void *result(struct merge_list *entry, unsigned long *size)
 {
 	enum object_type type;
-- 
1.5.2


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux