{"thread":{"id":"8521","subject":"[RFC][PATCH 07/10] Sparse: fix \"'merge_file' not declared\" warning","startedAt":"2007-06-08T22:22:51Z","lastAt":"2007-06-08T22:22:51Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"44400","messageId":"4669D6BB.9060900@ramsay1.demon.co.uk","threadId":"8521","inReplyTo":null,"subject":"[RFC][PATCH 07/10] Sparse: fix \"'merge_file' not declared\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2007-06-08T22:22:51Z","receivedAt":"2007-06-08T22:22:51Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nAdd a declaration for merge_file() to a new \"merge-file.h\" header\nfile, and add the appropriate include directives.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nThere are two other (static) definitions of a merge_file() function,\none in merge-recursive.c, which could probably be renamed merge_filespec()\nand one in merge-index.c, which could be renamed merge_path().\nMaybe the the function in merge-file.c should be called merge_blob() ...\n(and then change the file names too!)\n\n Makefile     |    3 ++-\n merge-file.c |    1 +\n merge-file.h |    8 ++++++++\n merge-tree.c |    3 +--\n 4 files changed, 12 insertions(+), 3 deletions(-)\n create mode 100644 merge-file.h\n\ndiff --git a/Makefile b/Makefile\nindex 29243c6..19b6da1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -296,7 +296,8 @@ LIB_H = \\\n \tdiff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \\\n \trun-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \\\n \ttree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \\\n-\tutf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h mailmap.h\n+\tutf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \\\n+\tmailmap.h merge-file.h\n \n DIFF_OBJS = \\\n \tdiff.o diff-lib.o diffcore-break.o diffcore-order.o \\\ndiff --git a/merge-file.c b/merge-file.c\nindex 748d15c..7bfefe7 100644\n--- a/merge-file.c\n+++ b/merge-file.c\n@@ -2,6 +2,7 @@\n #include \"run-command.h\"\n #include \"xdiff-interface.h\"\n #include \"blob.h\"\n+#include \"merge-file.h\"\n \n static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)\n {\ndiff --git a/merge-file.h b/merge-file.h\nnew file mode 100644\nindex 0000000..a503c90\n--- /dev/null\n+++ b/merge-file.h\n@@ -0,0 +1,8 @@\n+#ifndef MERGE_FILE_H\n+#define MERGE_FILE_H\n+\n+#include \"blob.h\"\n+\n+extern void *merge_file(struct blob *, struct blob *, struct blob *, unsigned long *);\n+\n+#endif\ndiff --git a/merge-tree.c b/merge-tree.c\nindex 3b8d9e6..93c8f54 100644\n--- a/merge-tree.c\n+++ b/merge-tree.c\n@@ -2,6 +2,7 @@\n #include \"tree-walk.h\"\n #include \"xdiff-interface.h\"\n #include \"blob.h\"\n+#include \"merge-file.h\"\n \n static const char merge_tree_usage[] = \"git-merge-tree <base-tree> <branch1> <branch2>\";\n static int resolve_directories = 1;\n@@ -53,8 +54,6 @@ static const char *explanation(struct merge_list *entry)\n \treturn \"removed in remote\";\n }\n \n-extern void *merge_file(struct blob *, struct blob *, struct blob *, unsigned long *);\n-\n static void *result(struct merge_list *entry, unsigned long *size)\n {\n \tenum object_type type;\n-- \n1.5.2\n"}]}