Correct new compiler warnings in builtin-revert
The new builtin-revert code introduces a few new compiler errors when I'm building with my stricter set of checks enabled in CFLAGS. These all just stem from trying to store a constant string into a non-const char*. Simple fix, make the variables const char*. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Shawn O. Pearce committed
Mar 12, 2007 at 15:33 UTC
1a8f27413bfe438ce8f8aba56aa48f980f6144d1
3 files changed
+4
-4
builtin-revert.c
+2
-2
@@ -235,8 +235,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
235
unsigned char head[20];
236
struct commit *base, *next;
237
int i;
238
- char *oneline, *encoding, *reencoded_message = NULL;
239
- const char *message;
238
+ char *oneline, *reencoded_message = NULL;
239
+ const char *message, *encoding;
240
241
git_config(git_default_config);
242
me = action == REVERT ? "revert" : "cherry-pick";
cache.h
+1
-1
@@ -449,7 +449,7 @@ extern int check_repository_format_version(const char *var, const char *value);
449
extern char git_default_email[MAX_GITNAME];
450
extern char git_default_name[MAX_GITNAME];
451
452
-extern char *git_commit_encoding;
452
+extern const char *git_commit_encoding;
453
extern const char *git_log_output_encoding;
454
455
extern int copy_fd(int ifd, int ofd);
environment.c
+1
-1
@@ -20,7 +20,7 @@ int is_bare_repository_cfg = -1; /* unspecified */
20
int log_all_ref_updates = -1; /* unspecified */
21
int warn_ambiguous_refs = 1;
22
int repository_format_version;
23
-char *git_commit_encoding;
23
+const char *git_commit_encoding;
24
const char *git_log_output_encoding;
25
int shared_repository = PERM_UMASK;
26
const char *apply_default_whitespace;