{"thread":{"id":"27023","subject":"[PATCH 5/9] sparse: Fix an \"symbol 'merge_file' not decared\" warning","startedAt":"2011-04-07T18:31:24Z","lastAt":"2011-04-07T18:31:24Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"165371","messageId":"4D9E02FC.90800@ramsay1.demon.co.uk","threadId":"27023","inReplyTo":null,"subject":"[PATCH 5/9] sparse: Fix an \"symbol 'merge_file' not decared\" warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-04-07T18:31:24Z","receivedAt":"2011-04-07T18:31:24Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn order to fix the warning, we add a new \"merge-file.h\" header\ncontaining the extern declaration of the merge_file() function,\nand include the header in the source files that require the\ndeclaration.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nNote that I considered re-naming this function to merge_blobs()\nor something, since there is already two other static merge_file()\nfunctions in builtin/merge-index.c and merge-recursive.c.\n\n Makefile             |    1 +\n builtin/merge-tree.c |    3 +--\n merge-file.c         |    1 +\n merge-file.h         |    7 +++++++\n 4 files changed, 10 insertions(+), 2 deletions(-)\n create mode 100644 merge-file.h\n\ndiff --git a/Makefile b/Makefile\nindex 79bef43..2a100b7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -525,6 +525,7 @@ LIB_H += list-objects.h\n LIB_H += ll-merge.h\n LIB_H += log-tree.h\n LIB_H += mailmap.h\n+LIB_H += merge-file.h\n LIB_H += merge-recursive.h\n LIB_H += notes.h\n LIB_H += notes-cache.h\ndiff --git a/builtin/merge-tree.c b/builtin/merge-tree.c\nindex 1991742..897a563 100644\n--- a/builtin/merge-tree.c\n+++ b/builtin/merge-tree.c\n@@ -3,6 +3,7 @@\n #include \"xdiff-interface.h\"\n #include \"blob.h\"\n #include \"exec_cmd.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@@ -54,8 +55,6 @@ static const char *explanation(struct merge_list *entry)\n \treturn \"removed in remote\";\n }\n \n-extern void *merge_file(const char *, 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;\ndiff --git a/merge-file.c b/merge-file.c\nindex f7f4533..7845528 100644\n--- a/merge-file.c\n+++ b/merge-file.c\n@@ -3,6 +3,7 @@\n #include \"xdiff-interface.h\"\n #include \"ll-merge.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..9b3b83a\n--- /dev/null\n+++ b/merge-file.h\n@@ -0,0 +1,7 @@\n+#ifndef MERGE_FILE_H\n+#define MERGE_FILE_H\n+\n+extern void *merge_file(const char *path, struct blob *base, struct blob *our,\n+\t\t\tstruct blob *their, unsigned long *size);\n+\n+#endif\n-- \n1.7.4\n"}]}