@matheusbsbs / matheus-bagliano / commits / 1e0f8c41ac
Fork 0

sparse: Fix an "symbol 'merge_file' not decared" warning

In order to fix the warning, we add a new "merge-file.h" header containing the extern declaration of the merge_file() function, and include the header in the source files that require the declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed Apr 7, 2011 at 19:31 UTC 1e0f8c41ac157c54a33f2ee0afb7d96f5156ed0d
4 files changed +10 -2
Makefile
+1
@@ -525,6 +525,7 @@ LIB_H += list-objects.h
525 LIB_H += ll-merge.h
526 LIB_H += log-tree.h
527 LIB_H += mailmap.h
528 +LIB_H += merge-file.h
529 LIB_H += merge-recursive.h
530 LIB_H += notes.h
531 LIB_H += notes-cache.h
builtin/merge-tree.c
+1 -2
@@ -3,6 +3,7 @@
3 #include "xdiff-interface.h"
4 #include "blob.h"
5 #include "exec_cmd.h"
6 +#include "merge-file.h"
7
8 static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
9 static int resolve_directories = 1;
@@ -54,8 +55,6 @@ static const char *explanation(struct merge_list *entry)
55 return "removed in remote";
56 }
57
57 -extern void *merge_file(const char *, struct blob *, struct blob *, struct blob *, unsigned long *);
58 -
58 static void *result(struct merge_list *entry, unsigned long *size)
59 {
60 enum object_type type;
merge-file.c
+1
@@ -3,6 +3,7 @@
3 #include "xdiff-interface.h"
4 #include "ll-merge.h"
5 #include "blob.h"
6 +#include "merge-file.h"
7
8 static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
9 {
merge-file.h new
+7
@@ -0,0 +1,7 @@
1 +#ifndef MERGE_FILE_H
2 +#define MERGE_FILE_H
3 +
4 +extern void *merge_file(const char *path, struct blob *base, struct blob *our,
5 + struct blob *their, unsigned long *size);
6 +
7 +#endif