* [PATCH 2/7] commit.c: mark file-scope functions as static
2012-09-15 21:10 ` [PATCH 1/7] builtin/notes.c: mark file-scope functions as static Junio C Hamano
@ 2012-09-15 21:10 ` Junio C Hamano
2012-09-15 21:10 ` [PATCH 3/7] diff.c: mark private file-scope symbols " Junio C Hamano
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2012-09-15 21:10 UTC (permalink / raw)
To: git; +Cc: Ramsay Jones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
commit.c | 7 +++++--
commit.h | 1 -
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/commit.c b/commit.c
index 0ea441d..0246767 100644
--- a/commit.c
+++ b/commit.c
@@ -9,6 +9,8 @@
#include "gpg-interface.h"
#include "mergesort.h"
+static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
+
int save_commit_buffer = 1;
const char *commit_type = "commit";
@@ -1073,8 +1075,9 @@ static int excluded_header_field(const char *field, size_t len, const char **exc
return 0;
}
-struct commit_extra_header *read_commit_extra_header_lines(const char *buffer, size_t size,
- const char **exclude)
+static struct commit_extra_header *read_commit_extra_header_lines(
+ const char *buffer, size_t size,
+ const char **exclude)
{
struct commit_extra_header *extra = NULL, **tail = &extra, *it = NULL;
const char *line, *next, *eof, *eob;
diff --git a/commit.h b/commit.h
index 6edce87..9f21313 100644
--- a/commit.h
+++ b/commit.h
@@ -204,7 +204,6 @@ extern int commit_tree_extended(const struct strbuf *msg, unsigned char *tree,
struct commit_extra_header *);
extern struct commit_extra_header *read_commit_extra_headers(struct commit *, const char **);
-extern struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
extern void free_commit_extra_headers(struct commit_extra_header *extra);
--
1.7.12.508.g4d78187
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/7] diff.c: mark private file-scope symbols as static
2012-09-15 21:10 ` [PATCH 1/7] builtin/notes.c: mark file-scope functions as static Junio C Hamano
2012-09-15 21:10 ` [PATCH 2/7] commit.c: " Junio C Hamano
@ 2012-09-15 21:10 ` Junio C Hamano
2012-09-15 21:10 ` [PATCH 4/7] graph.c: " Junio C Hamano
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2012-09-15 21:10 UTC (permalink / raw)
To: git; +Cc: Ramsay Jones
---
diff.c | 2 +-
diff.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/diff.c b/diff.c
index 32142db..35d3f07 100644
--- a/diff.c
+++ b/diff.c
@@ -25,7 +25,7 @@
static int diff_detect_rename_default;
static int diff_rename_limit_default = 400;
static int diff_suppress_blank_empty;
-int diff_use_color_default = -1;
+static int diff_use_color_default = -1;
static const char *diff_word_regex_cfg;
static const char *external_diff_cmd_cfg;
int diff_auto_refresh_index = 1;
diff --git a/diff.h b/diff.h
index e25addb..a658f85 100644
--- a/diff.h
+++ b/diff.h
@@ -243,7 +243,6 @@ extern int parse_long_opt(const char *opt, const char **argv,
extern int git_diff_basic_config(const char *var, const char *value, void *cb);
extern int git_diff_ui_config(const char *var, const char *value, void *cb);
-extern int diff_use_color_default;
extern void diff_setup(struct diff_options *);
extern int diff_opt_parse(struct diff_options *, const char **, int);
extern void diff_setup_done(struct diff_options *);
--
1.7.12.508.g4d78187
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/7] graph.c: mark private file-scope symbols as static
2012-09-15 21:10 ` [PATCH 1/7] builtin/notes.c: mark file-scope functions as static Junio C Hamano
2012-09-15 21:10 ` [PATCH 2/7] commit.c: " Junio C Hamano
2012-09-15 21:10 ` [PATCH 3/7] diff.c: mark private file-scope symbols " Junio C Hamano
@ 2012-09-15 21:10 ` Junio C Hamano
2012-09-15 21:10 ` [PATCH 5/7] grep.c: " Junio C Hamano
` (2 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2012-09-15 21:10 UTC (permalink / raw)
To: git; +Cc: Ramsay Jones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
graph.c | 32 ++++++++++++++++++++++++++++++--
graph.h | 27 ---------------------------
2 files changed, 30 insertions(+), 29 deletions(-)
diff --git a/graph.c b/graph.c
index 7e0a099..e864fe2 100644
--- a/graph.c
+++ b/graph.c
@@ -8,6 +8,34 @@
/* Internal API */
/*
+ * Output the next line for a graph.
+ * This formats the next graph line into the specified strbuf. It is not
+ * terminated with a newline.
+ *
+ * Returns 1 if the line includes the current commit, and 0 otherwise.
+ * graph_next_line() will return 1 exactly once for each time
+ * graph_update() is called.
+ */
+static int graph_next_line(struct git_graph *graph, struct strbuf *sb);
+
+/*
+ * Set up a custom scheme for column colors.
+ *
+ * The default column color scheme inserts ANSI color escapes to colorize
+ * the graph. The various color escapes are stored in an array of strings
+ * where each entry corresponds to a color, except for the last entry,
+ * which denotes the escape for resetting the color back to the default.
+ * When generating the graph, strings from this array are inserted before
+ * and after the various column characters.
+ *
+ * This function allows you to enable a custom array of color escapes.
+ * The 'colors_max' argument is the index of the last "reset" entry.
+ *
+ * This functions must be called BEFORE graph_init() is called.
+ */
+static void graph_set_column_colors(const char **colors, unsigned short colors_max);
+
+/*
* Output a padding line in the graph.
* This is similar to graph_next_line(). However, it is guaranteed to
* never print the current commit line. Instead, if the commit line is
@@ -62,7 +90,7 @@ enum graph_state {
static const char **column_colors;
static unsigned short column_colors_max;
-void graph_set_column_colors(const char **colors, unsigned short colors_max)
+static void graph_set_column_colors(const char **colors, unsigned short colors_max)
{
column_colors = colors;
column_colors_max = colors_max;
@@ -1116,7 +1144,7 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf
graph_update_state(graph, GRAPH_PADDING);
}
-int graph_next_line(struct git_graph *graph, struct strbuf *sb)
+static int graph_next_line(struct git_graph *graph, struct strbuf *sb)
{
switch (graph->state) {
case GRAPH_PADDING:
diff --git a/graph.h b/graph.h
index aff960c..19b0f66 100644
--- a/graph.h
+++ b/graph.h
@@ -4,22 +4,6 @@
/* A graph is a pointer to this opaque structure */
struct git_graph;
-/*
- * Set up a custom scheme for column colors.
- *
- * The default column color scheme inserts ANSI color escapes to colorize
- * the graph. The various color escapes are stored in an array of strings
- * where each entry corresponds to a color, except for the last entry,
- * which denotes the escape for resetting the color back to the default.
- * When generating the graph, strings from this array are inserted before
- * and after the various column characters.
- *
- * This function allows you to enable a custom array of color escapes.
- * The 'colors_max' argument is the index of the last "reset" entry.
- *
- * This functions must be called BEFORE graph_init() is called.
- */
-void graph_set_column_colors(const char **colors, unsigned short colors_max);
/*
* Create a new struct git_graph.
@@ -49,17 +33,6 @@ void graph_update(struct git_graph *graph, struct commit *commit);
*/
int graph_is_commit_finished(struct git_graph const *graph);
-/*
- * Output the next line for a graph.
- * This formats the next graph line into the specified strbuf. It is not
- * terminated with a newline.
- *
- * Returns 1 if the line includes the current commit, and 0 otherwise.
- * graph_next_line() will return 1 exactly once for each time
- * graph_update() is called.
- */
-int graph_next_line(struct git_graph *graph, struct strbuf *sb);
-
/*
* graph_show_*: helper functions for printing to stdout
--
1.7.12.508.g4d78187
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 5/7] grep.c: mark private file-scope symbols as static
2012-09-15 21:10 ` [PATCH 1/7] builtin/notes.c: mark file-scope functions as static Junio C Hamano
` (2 preceding siblings ...)
2012-09-15 21:10 ` [PATCH 4/7] graph.c: " Junio C Hamano
@ 2012-09-15 21:10 ` Junio C Hamano
2012-09-19 18:02 ` Ramsay Jones
2012-09-15 21:10 ` [PATCH 6/7] rerere.c: " Junio C Hamano
2012-09-15 21:10 ` [PATCH 7/7] notes.c: " Junio C Hamano
5 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2012-09-15 21:10 UTC (permalink / raw)
To: git; +Cc: Ramsay Jones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
grep.c | 6 +++++-
grep.h | 3 +--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/grep.c b/grep.c
index 925aa92..c7f8a47 100644
--- a/grep.c
+++ b/grep.c
@@ -3,6 +3,10 @@
#include "userdiff.h"
#include "xdiff-interface.h"
+static int grep_source_load(struct grep_source *gs);
+static int grep_source_is_binary(struct grep_source *gs);
+
+
static struct grep_pat *create_grep_pat(const char *pat, size_t patlen,
const char *origin, int no,
enum grep_pat_token t,
@@ -403,7 +407,7 @@ static void dump_grep_expression_1(struct grep_expr *x, int in)
}
}
-void dump_grep_expression(struct grep_opt *opt)
+static void dump_grep_expression(struct grep_opt *opt)
{
struct grep_expr *x = opt->pattern_expression;
diff --git a/grep.h b/grep.h
index 00d71f7..8a28a67 100644
--- a/grep.h
+++ b/grep.h
@@ -159,11 +159,10 @@ struct grep_source {
void grep_source_init(struct grep_source *gs, enum grep_source_type type,
const char *name, const void *identifier);
-int grep_source_load(struct grep_source *gs);
void grep_source_clear_data(struct grep_source *gs);
void grep_source_clear(struct grep_source *gs);
void grep_source_load_driver(struct grep_source *gs);
-int grep_source_is_binary(struct grep_source *gs);
+
int grep_source(struct grep_opt *opt, struct grep_source *gs);
--
1.7.12.508.g4d78187
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 5/7] grep.c: mark private file-scope symbols as static
2012-09-15 21:10 ` [PATCH 5/7] grep.c: " Junio C Hamano
@ 2012-09-19 18:02 ` Ramsay Jones
2012-09-19 20:46 ` Junio C Hamano
0 siblings, 1 reply; 15+ messages in thread
From: Ramsay Jones @ 2012-09-19 18:02 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano wrote:
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> grep.c | 6 +++++-
> grep.h | 3 +--
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/grep.c b/grep.c
> index 925aa92..c7f8a47 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -3,6 +3,10 @@
> #include "userdiff.h"
> #include "xdiff-interface.h"
>
> +static int grep_source_load(struct grep_source *gs);
> +static int grep_source_is_binary(struct grep_source *gs);
> +
> +
> static struct grep_pat *create_grep_pat(const char *pat, size_t patlen,
> const char *origin, int no,
> enum grep_pat_token t,
> @@ -403,7 +407,7 @@ static void dump_grep_expression_1(struct grep_expr *x, int in)
> }
> }
>
> -void dump_grep_expression(struct grep_opt *opt)
> +static void dump_grep_expression(struct grep_opt *opt)
> {
> struct grep_expr *x = opt->pattern_expression;
>
> diff --git a/grep.h b/grep.h
> index 00d71f7..8a28a67 100644
> --- a/grep.h
> +++ b/grep.h
> @@ -159,11 +159,10 @@ struct grep_source {
>
> void grep_source_init(struct grep_source *gs, enum grep_source_type type,
> const char *name, const void *identifier);
> -int grep_source_load(struct grep_source *gs);
> void grep_source_clear_data(struct grep_source *gs);
> void grep_source_clear(struct grep_source *gs);
> void grep_source_load_driver(struct grep_source *gs);
> -int grep_source_is_binary(struct grep_source *gs);
> +
>
> int grep_source(struct grep_opt *opt, struct grep_source *gs);
Heh, so I obviously didn't see this before sending the patch yesterday! :-D
Yes, this solves the problem addressed by yesterday's patch, so please
ignore that. However, this tickles sparse to complain as well ... ;-)
New patch on it's way.
[I have a funny feeling that I'm about to download an email, in response
to yesterday's patch, that says something like: "does commit 07a7d656 not
fix it for you ..." :-P ]
ATB,
Ramsay Jones
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/7] grep.c: mark private file-scope symbols as static
2012-09-19 18:02 ` Ramsay Jones
@ 2012-09-19 20:46 ` Junio C Hamano
2012-09-20 20:43 ` Ramsay Jones
0 siblings, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2012-09-19 20:46 UTC (permalink / raw)
To: Ramsay Jones; +Cc: git
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
> Heh, so I obviously didn't see this before sending the patch yesterday! :-D
>
> Yes, this solves the problem addressed by yesterday's patch, so please
> ignore that. However, this tickles sparse to complain as well ... ;-)
>
> New patch on it's way.
Are you sure the patch you are responding to really "tickles
sparse"?
You have another grep.c patch timestamped two minutes after the
message I am responding to, and as far as I can see, it is a subset
of the patch you are responding to with the message I am responding
to.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 5/7] grep.c: mark private file-scope symbols as static
2012-09-19 20:46 ` Junio C Hamano
@ 2012-09-20 20:43 ` Ramsay Jones
0 siblings, 0 replies; 15+ messages in thread
From: Ramsay Jones @ 2012-09-20 20:43 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano wrote:
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>
>> Heh, so I obviously didn't see this before sending the patch yesterday! :-D
>>
>> Yes, this solves the problem addressed by yesterday's patch, so please
>> ignore that. However, this tickles sparse to complain as well ... ;-)
>>
>> New patch on it's way.
>
> Are you sure the patch you are responding to really "tickles
> sparse"?
Yes.
> You have another grep.c patch timestamped two minutes after the
> message I am responding to, and as far as I can see, it is a subset
> of the patch you are responding to with the message I am responding
> to.
Hmm, that sentence has too many twists for me! :-D
Let me see if I can clear up the misunderstanding:
- the "patch from yesterday" (18-09-2021) fixed a complaint from
sparse regarding symbol 'dump_grep_expression'. This was before
I had seen this patch email, or the resulting commit 07a7d656.
Since my "patch from yesterday" is a strict subset of your patch,
then your patch also fixes the complaint from sparse regarding
the 'dump_grep_expression' symbol.
- this patch (commit 07a7d656) causes sparse to complain about the
symbols 'grep_source_load' and 'grep_source_is_binary'. The new
patch from me ("timestamped two minutes after ...") also titled
"grep.c: Fix some sparse warnings" on 19-09-2012 at 7:04 PM, is
*not* a subset of commit 07a7d656. This patch addresses the new
sparse warnings regarding 'grep_source_load' and
'grep_source_is_binary'.
Hopefully that addresses the confusion! ;-)
HTH
ATB,
Ramsay Jones
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 6/7] rerere.c: mark private file-scope symbols as static
2012-09-15 21:10 ` [PATCH 1/7] builtin/notes.c: mark file-scope functions as static Junio C Hamano
` (3 preceding siblings ...)
2012-09-15 21:10 ` [PATCH 5/7] grep.c: " Junio C Hamano
@ 2012-09-15 21:10 ` Junio C Hamano
2012-09-15 21:10 ` [PATCH 7/7] notes.c: " Junio C Hamano
5 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2012-09-15 21:10 UTC (permalink / raw)
To: git; +Cc: Ramsay Jones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
rerere.c | 2 +-
rerere.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/rerere.c b/rerere.c
index b57a34d..a6a5cd5 100644
--- a/rerere.c
+++ b/rerere.c
@@ -25,7 +25,7 @@ const char *rerere_path(const char *hex, const char *file)
return git_path("rr-cache/%s/%s", hex, file);
}
-int has_rerere_resolution(const char *hex)
+static int has_rerere_resolution(const char *hex)
{
struct stat st;
return !stat(rerere_path(hex, "postimage"), &st);
diff --git a/rerere.h b/rerere.h
index fcd8bc1..156d2aa 100644
--- a/rerere.h
+++ b/rerere.h
@@ -16,7 +16,6 @@ extern void *RERERE_RESOLVED;
extern int setup_rerere(struct string_list *, int);
extern int rerere(int);
extern const char *rerere_path(const char *hex, const char *file);
-extern int has_rerere_resolution(const char *hex);
extern int rerere_forget(const char **);
extern int rerere_remaining(struct string_list *);
extern void rerere_clear(struct string_list *);
--
1.7.12.508.g4d78187
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/7] notes.c: mark private file-scope symbols as static
2012-09-15 21:10 ` [PATCH 1/7] builtin/notes.c: mark file-scope functions as static Junio C Hamano
` (4 preceding siblings ...)
2012-09-15 21:10 ` [PATCH 6/7] rerere.c: " Junio C Hamano
@ 2012-09-15 21:10 ` Junio C Hamano
5 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2012-09-15 21:10 UTC (permalink / raw)
To: git; +Cc: Ramsay Jones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
notes.c | 14 ++++++++++++--
notes.h | 14 --------------
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/notes.c b/notes.c
index 93e9868..bc454e1 100644
--- a/notes.c
+++ b/notes.c
@@ -1196,8 +1196,18 @@ void free_notes(struct notes_tree *t)
memset(t, 0, sizeof(struct notes_tree));
}
-void format_note(struct notes_tree *t, const unsigned char *object_sha1,
- struct strbuf *sb, const char *output_encoding, int flags)
+/*
+ * Fill the given strbuf with the notes associated with the given object.
+ *
+ * If the given notes_tree structure is not initialized, it will be auto-
+ * initialized to the default value (see documentation for init_notes() above).
+ * If the given notes_tree is NULL, the internal/default notes_tree will be
+ * used instead.
+ *
+ * 'flags' is a bitwise combination of the flags for format_display_notes.
+ */
+static void format_note(struct notes_tree *t, const unsigned char *object_sha1,
+ struct strbuf *sb, const char *output_encoding, int flags)
{
static const char utf8[] = "utf-8";
const unsigned char *sha1;
diff --git a/notes.h b/notes.h
index c716694..3592b19 100644
--- a/notes.h
+++ b/notes.h
@@ -241,20 +241,6 @@ void free_notes(struct notes_tree *t);
#define NOTES_SHOW_HEADER 1
#define NOTES_INDENT 2
-/*
- * Fill the given strbuf with the notes associated with the given object.
- *
- * If the given notes_tree structure is not initialized, it will be auto-
- * initialized to the default value (see documentation for init_notes() above).
- * If the given notes_tree is NULL, the internal/default notes_tree will be
- * used instead.
- *
- * 'flags' is a bitwise combination of the above formatting flags.
- */
-void format_note(struct notes_tree *t, const unsigned char *object_sha1,
- struct strbuf *sb, const char *output_encoding, int flags);
-
-
struct string_list;
struct display_notes_opt {
--
1.7.12.508.g4d78187
^ permalink raw reply related [flat|nested] 15+ messages in thread