Improved const correctness for strings
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Oct 21, 2007 at 00:12 UTC
538dfe7397db62e5c7e8861c272380140969a8b8
4 files changed
+5
-5
builtin-fetch--tool.c
+2
-2
@@ -25,7 +25,7 @@ static int update_ref_env(const char *action,
25
unsigned char *oldval)
26
{
27
char msg[1024];
28
- char *rla = getenv("GIT_REFLOG_ACTION");
28
+ const char *rla = getenv("GIT_REFLOG_ACTION");
29
30
if (!rla)
31
rla = "(reflog update)";
@@ -61,7 +61,7 @@ static int update_local_ref(const char *name,
61
}
62
63
if (get_sha1(name, sha1_old)) {
64
- char *msg;
64
+ const char *msg;
65
just_store:
66
/* new ref */
67
if (!strncmp(name, "refs/tags/", 10))
builtin-mailinfo.c
+1
-1
@@ -288,7 +288,7 @@ static void cleanup_space(char *buf)
288
}
289
290
static void decode_header(char *it, unsigned itsize);
291
-static char *header[MAX_HDR_PARSED] = {
291
+static const char *header[MAX_HDR_PARSED] = {
292
"From","Subject","Date",
293
};
294
builtin-reset.c
+1
-1
@@ -169,7 +169,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
169
}
170
171
enum reset_type { MIXED, SOFT, HARD, NONE };
172
-static char *reset_type_names[] = { "mixed", "soft", "hard", NULL };
172
+static const char *reset_type_names[] = { "mixed", "soft", "hard", NULL };
173
174
int cmd_reset(int argc, const char **argv, const char *prefix)
175
{
match-trees.c
+1
-1
@@ -132,7 +132,7 @@ static void match_trees(const unsigned char *hash1,
132
const unsigned char *hash2,
133
int *best_score,
134
char **best_match,
135
- char *base,
135
+ const char *base,
136
int recurse_limit)
137
{
138
struct tree_desc one;