Skip to content

Commit 96a5f38

Browse files
authored
Merge pull request libgit2#5551 from pks-t/pks/missing-declarations
Missing declarations
2 parents b221755 + 03c4f86 commit 96a5f38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+148
-124
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ SET(LIBGIT2_INCLUDES
2121
SET(LIBGIT2_SYSTEM_INCLUDES "")
2222
SET(LIBGIT2_LIBS "")
2323

24+
enable_warnings(missing-declarations)
25+
2426
# Enable tracing
2527
IF(ENABLE_TRACE)
2628
SET(GIT_TRACE 1)

src/blame.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,9 @@ int git_blame_options_init(git_blame_options *opts, unsigned int version)
538538
return 0;
539539
}
540540

541+
#ifndef GIT_DEPRECATE_HARD
541542
int git_blame_init_options(git_blame_options *opts, unsigned int version)
542543
{
543544
return git_blame_options_init(opts, version);
544545
}
546+
#endif

src/blob.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ int git_blob_filter(
445445

446446
/* Deprecated functions */
447447

448+
#ifndef GIT_DEPRECATE_HARD
448449
int git_blob_create_frombuffer(
449450
git_oid *id, git_repository *repo, const void *buffer, size_t len)
450451
{
@@ -491,3 +492,4 @@ int git_blob_filtered_content(
491492

492493
return git_blob_filter(out, blob, path, &opts);
493494
}
495+
#endif

src/buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ void git_buf_dispose(git_buf *buf)
133133
git_buf_init(buf, 0);
134134
}
135135

136+
#ifndef GIT_DEPRECATE_HARD
136137
void git_buf_free(git_buf *buf)
137138
{
138139
git_buf_dispose(buf);
139140
}
141+
#endif
140142

141143
void git_buf_sanitize(git_buf *buf)
142144
{

src/cache.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,6 @@ int git_cache_set_max_object_size(git_object_t type, size_t size)
4141
return 0;
4242
}
4343

44-
void git_cache_dump_stats(git_cache *cache)
45-
{
46-
git_cached_obj *object;
47-
48-
if (git_cache_size(cache) == 0)
49-
return;
50-
51-
printf("Cache %p: %"PRIuZ" items cached, %"PRIdZ" bytes\n",
52-
cache, git_cache_size(cache), cache->used_memory);
53-
54-
git_oidmap_foreach_value(cache->map, object, {
55-
char oid_str[9];
56-
printf(" %s%c %s (%"PRIuZ")\n",
57-
git_object_type2string(object->type),
58-
object->flags == GIT_CACHE_STORE_PARSED ? '*' : ' ',
59-
git_oid_tostr(oid_str, sizeof(oid_str), &object->oid),
60-
object->size
61-
);
62-
});
63-
}
64-
6544
int git_cache_init(git_cache *cache)
6645
{
6746
memset(cache, 0, sizeof(*cache));

src/checkout.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ static int checkout_conflictdata_cmp(const void *a, const void *b)
806806
return diff;
807807
}
808808

809-
int checkout_conflictdata_empty(
809+
static int checkout_conflictdata_empty(
810810
const git_vector *conflicts, size_t idx, void *payload)
811811
{
812812
checkout_conflictdata *conflict;
@@ -2820,7 +2820,9 @@ int git_checkout_options_init(git_checkout_options *opts, unsigned int version)
28202820
return 0;
28212821
}
28222822

2823+
#ifndef GIT_DEPRECATE_HARD
28232824
int git_checkout_init_options(git_checkout_options *opts, unsigned int version)
28242825
{
28252826
return git_checkout_options_init(opts, version);
28262827
}
2828+
#endif

src/cherrypick.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,10 @@ int git_cherrypick_options_init(
229229
return 0;
230230
}
231231

232+
#ifndef GIT_DEPRECATE_HARD
232233
int git_cherrypick_init_options(
233234
git_cherrypick_options *opts, unsigned int version)
234235
{
235236
return git_cherrypick_options_init(opts, version);
236237
}
238+
#endif

src/clone.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,12 @@ int git_clone_options_init(git_clone_options *opts, unsigned int version)
479479
return 0;
480480
}
481481

482+
#ifndef GIT_DEPRECATE_HARD
482483
int git_clone_init_options(git_clone_options *opts, unsigned int version)
483484
{
484485
return git_clone_options_init(opts, version);
485486
}
487+
#endif
486488

487489
static bool can_link(const char *src, const char *dst, int link)
488490
{

src/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ static int multivar_iter_next(git_config_entry **entry, git_config_iterator *_it
10001000
return error;
10011001
}
10021002

1003-
void multivar_iter_free(git_config_iterator *_iter)
1003+
static void multivar_iter_free(git_config_iterator *_iter)
10041004
{
10051005
multivar_iter *iter = (multivar_iter *) _iter;
10061006

src/config_snapshot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
* a Linking Exception. For full terms see the included COPYING file.
66
*/
77

8-
#include "config.h"
8+
#include "config_backend.h"
99

10+
#include "config.h"
1011
#include "config_entries.h"
1112

1213
typedef struct {

0 commit comments

Comments
 (0)