aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-21 00:12:12 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-10-21 01:43:27 -0400
commit538dfe7397db62e5c7e8861c272380140969a8b8 (patch)
tree70040b3240ed347f8252b8e59aff44ac82e66642
parent6e863d6d129a1b6a13c66d0bb03f3d43db6c51fe (diff)
downloadgit-538dfe7397db62e5c7e8861c272380140969a8b8.tar.gz
git-538dfe7397db62e5c7e8861c272380140969a8b8.tar.xz
Improved const correctness for strings
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--builtin-fetch--tool.c4
-rw-r--r--builtin-mailinfo.c2
-rw-r--r--builtin-reset.c2
-rw-r--r--match-trees.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index e26817de2..6a7851795 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -25,7 +25,7 @@ static int update_ref_env(const char *action,
unsigned char *oldval)
{
char msg[1024];
- char *rla = getenv("GIT_REFLOG_ACTION");
+ const char *rla = getenv("GIT_REFLOG_ACTION");
if (!rla)
rla = "(reflog update)";
@@ -61,7 +61,7 @@ static int update_local_ref(const char *name,
}
if (get_sha1(name, sha1_old)) {
- char *msg;
+ const char *msg;
just_store:
/* new ref */
if (!strncmp(name, "refs/tags/", 10))
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index d7cb11dc0..fb12248f8 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -288,7 +288,7 @@ static void cleanup_space(char *buf)
}
static void decode_header(char *it, unsigned itsize);
-static char *header[MAX_HDR_PARSED] = {
+static const char *header[MAX_HDR_PARSED] = {
"From","Subject","Date",
};
diff --git a/builtin-reset.c b/builtin-reset.c
index 99d5c082a..e1dc31e0e 100644
--- a/builtin-reset.c
+++ b/builtin-reset.c
@@ -169,7 +169,7 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
}
enum reset_type { MIXED, SOFT, HARD, NONE };
-static char *reset_type_names[] = { "mixed", "soft", "hard", NULL };
+static const char *reset_type_names[] = { "mixed", "soft", "hard", NULL };
int cmd_reset(int argc, const char **argv, const char *prefix)
{
diff --git a/match-trees.c b/match-trees.c
index d7e29c4d1..0fd6df7d6 100644
--- a/match-trees.c
+++ b/match-trees.c
@@ -132,7 +132,7 @@ static void match_trees(const unsigned char *hash1,
const unsigned char *hash2,
int *best_score,
char **best_match,
- char *base,
+ const char *base,
int recurse_limit)
{
struct tree_desc one;