Skip to content

Commit 5a6de39

Browse files
committed
Merge branch 'az/tighten-string-array-constness'
Code clean-up. * az/tighten-string-array-constness: global: mark usage strings and string tables const
2 parents dd45c2e + 86eef35 commit 5a6de39

15 files changed

+24
-24
lines changed

builtin/blame.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
#include "tag.h"
3737
#include "write-or-die.h"
3838

39-
static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
40-
static char annotate_usage[] = N_("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>");
39+
static const char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
40+
static const char annotate_usage[] = N_("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>");
4141

42-
static const char *blame_opt_usage[] = {
42+
static const char *const blame_opt_usage[] = {
4343
blame_usage,
4444
"",
4545
N_("<rev-opts> are documented in git-rev-list(1)"),
4646
NULL
4747
};
4848

49-
static const char *annotate_opt_usage[] = {
49+
static const char *const annotate_opt_usage[] = {
5050
annotate_usage,
5151
"",
5252
N_("<rev-opts> are documented in git-rev-list(1)"),
@@ -944,7 +944,7 @@ int cmd_blame(int argc,
944944
long anchor;
945945
long num_lines = 0;
946946
const char *str_usage = cmd_is_annotate ? annotate_usage : blame_usage;
947-
const char **opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
947+
const char *const *opt_usage = cmd_is_annotate ? annotate_opt_usage : blame_opt_usage;
948948

949949
setup_default_color_by_age();
950950
git_config(git_blame_config, &output_option);

builtin/commit-graph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
" [--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]\n" \
2323
" <split-options>")
2424

25-
static const char * builtin_commit_graph_verify_usage[] = {
25+
static const char * const builtin_commit_graph_verify_usage[] = {
2626
BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
2727
NULL
2828
};
2929

30-
static const char * builtin_commit_graph_write_usage[] = {
30+
static const char * const builtin_commit_graph_write_usage[] = {
3131
BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
3232
NULL
3333
};

builtin/fast-export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "remote.h"
3131
#include "blob.h"
3232

33-
static const char *fast_export_usage[] = {
33+
static const char *const fast_export_usage[] = {
3434
N_("git fast-export [<rev-list-opts>]"),
3535
NULL
3636
};

builtin/mktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void write_tree(struct object_id *oid)
6767
strbuf_release(&buf);
6868
}
6969

70-
static const char *mktree_usage[] = {
70+
static const char *const mktree_usage[] = {
7171
"git mktree [-z] [--missing] [--batch]",
7272
NULL
7373
};

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static inline void oe_set_delta_size(struct packing_data *pack,
183183
#define SET_DELTA_CHILD(obj, val) oe_set_delta_child(&to_pack, obj, val)
184184
#define SET_DELTA_SIBLING(obj, val) oe_set_delta_sibling(&to_pack, obj, val)
185185

186-
static const char *pack_usage[] = {
186+
static const char *const pack_usage[] = {
187187
N_("git pack-objects --stdout [<options>] [< <ref-list> | < <object-list>]"),
188188
N_("git pack-objects [<options>] <base-name> [< <ref-list> | < <object-list>]"),
189189
NULL

builtin/show-branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "date.h"
2020
#include "wildmatch.h"
2121

22-
static const char* show_branch_usage[] = {
22+
static const char*const show_branch_usage[] = {
2323
N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
2424
" [--current] [--color[=<when>] | --no-color] [--sparse]\n"
2525
" [--more=<n> | --list | --independent | --merge-base]\n"

t/helper/test-bloom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static void get_bloom_filter_for_commit(const struct object_id *commit_oid)
4444
print_bloom_filter(filter);
4545
}
4646

47-
static const char *bloom_usage = "\n"
47+
static const char *const bloom_usage = "\n"
4848
" test-tool bloom get_murmur3 <string>\n"
4949
" test-tool bloom get_murmur3_seven_highbit\n"
5050
" test-tool bloom generate_filter <string> [<string>...]\n"

t/helper/test-date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "date.h"
33
#include "trace.h"
44

5-
static const char *usage_msg = "\n"
5+
static const char *const usage_msg = "\n"
66
" test-tool date relative [time_t]...\n"
77
" test-tool date human [time_t]...\n"
88
" test-tool date show:<format> [time_t]...\n"

t/helper/test-find-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* packfiles containing the object is not <n>.
1616
*/
1717

18-
static const char *find_pack_usage[] = {
18+
static const char *const find_pack_usage[] = {
1919
"test-tool find-pack [--check-count <n>] <object>",
2020
NULL
2121
};

t/helper/test-getcwd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "git-compat-util.h"
33
#include "parse-options.h"
44

5-
static const char *getcwd_usage[] = {
5+
static const char *const getcwd_usage[] = {
66
"test-tool getcwd",
77
NULL
88
};

0 commit comments

Comments
 (0)