Skip to content

Commit bf04590

Browse files
committed
Merge branch 'dd/sparse-fixes'
Compilation fix. * dd/sparse-fixes: progress.c: silence cgcc suggestion about internal linkage graph.c: limit linkage of internal variable compat/regex: move stdlib.h up in inclusion chain test-parse-pathspec-file.c: s/0/NULL/ for pointer type
2 parents 3e68f55 + 3cacb9a commit bf04590

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

compat/regex/regex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#undefs RE_DUP_MAX and sets it to the right value. */
6161
#include <limits.h>
6262
#include <stdint.h>
63+
#include <stdlib.h>
6364

6465
#ifdef GAWK
6566
#undef alloca

compat/regex/regex_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <assert.h>
2424
#include <ctype.h>
2525
#include <stdio.h>
26-
#include <stdlib.h>
2726
#include <string.h>
2827

2928
#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC

fmt-merge-msg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
484484
enum object_type type;
485485
unsigned long size, len;
486486
char *buf = read_object_file(oid, &type, &size);
487-
struct signature_check sigc = { 0 };
487+
struct signature_check sigc = { NULL };
488488
struct strbuf sig = STRBUF_INIT;
489489

490490
if (!buf || type != OBJ_TAG)

graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ static void graph_output_commit_line(struct git_graph *graph, struct graph_line
10551055
graph_update_state(graph, GRAPH_COLLAPSING);
10561056
}
10571057

1058-
const char merge_chars[] = {'/', '|', '\\'};
1058+
static const char merge_chars[] = {'/', '|', '\\'};
10591059

10601060
static void graph_output_post_merge_line(struct git_graph *graph, struct graph_line *line)
10611061
{

progress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* published by the Free Software Foundation.
99
*/
1010

11+
#define GIT_TEST_PROGRESS_ONLY
1112
#include "cache.h"
1213
#include "gettext.h"
1314
#include "progress.h"
@@ -52,7 +53,6 @@ static volatile sig_atomic_t progress_update;
5253
*/
5354
int progress_testing;
5455
uint64_t progress_test_ns = 0;
55-
void progress_test_force_update(void); /* To silence -Wmissing-prototypes */
5656
void progress_test_force_update(void)
5757
{
5858
progress_update = 1;

progress.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33

44
struct progress;
55

6+
#ifdef GIT_TEST_PROGRESS_ONLY
7+
8+
extern int progress_testing;
9+
extern uint64_t progress_test_ns;
10+
void progress_test_force_update(void);
11+
12+
#endif
13+
614
void display_throughput(struct progress *progress, uint64_t total);
715
void display_progress(struct progress *progress, uint64_t n);
816
struct progress *start_progress(const char *title, uint64_t total);

t/helper/test-parse-pathspec-file.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
int cmd__parse_pathspec_file(int argc, const char **argv)
77
{
88
struct pathspec pathspec;
9-
const char *pathspec_from_file = 0;
9+
const char *pathspec_from_file = NULL;
1010
int pathspec_file_nul = 0, i;
1111

1212
static const char *const usage[] = {
@@ -20,9 +20,9 @@ int cmd__parse_pathspec_file(int argc, const char **argv)
2020
OPT_END()
2121
};
2222

23-
parse_options(argc, argv, 0, options, usage, 0);
23+
parse_options(argc, argv, NULL, options, usage, 0);
2424

25-
parse_pathspec_file(&pathspec, 0, 0, 0, pathspec_from_file,
25+
parse_pathspec_file(&pathspec, 0, 0, NULL, pathspec_from_file,
2626
pathspec_file_nul);
2727

2828
for (i = 0; i < pathspec.nr; i++)

t/helper/test-progress.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,13 @@
1313
*
1414
* See 't0500-progress-display.sh' for examples.
1515
*/
16+
#define GIT_TEST_PROGRESS_ONLY
1617
#include "test-tool.h"
1718
#include "gettext.h"
1819
#include "parse-options.h"
1920
#include "progress.h"
2021
#include "strbuf.h"
2122

22-
/*
23-
* These are defined in 'progress.c', but are not exposed in 'progress.h',
24-
* because they are exclusively for testing.
25-
*/
26-
extern int progress_testing;
27-
extern uint64_t progress_test_ns;
28-
void progress_test_force_update(void);
29-
3023
int cmd__progress(int argc, const char **argv)
3124
{
3225
int total = 0;

0 commit comments

Comments
 (0)