Browse Source

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>
maint
Shawn O. Pearce 18 years ago committed by Junio C Hamano
parent
commit
1a8f27413b
  1. 4
      builtin-revert.c
  2. 2
      cache.h
  3. 2
      environment.c

4
builtin-revert.c

@ -235,8 +235,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
unsigned char head[20]; unsigned char head[20];
struct commit *base, *next; struct commit *base, *next;
int i; int i;
char *oneline, *encoding, *reencoded_message = NULL; char *oneline, *reencoded_message = NULL;
const char *message; const char *message, *encoding;


git_config(git_default_config); git_config(git_default_config);
me = action == REVERT ? "revert" : "cherry-pick"; me = action == REVERT ? "revert" : "cherry-pick";

2
cache.h

@ -449,7 +449,7 @@ extern int check_repository_format_version(const char *var, const char *value);
extern char git_default_email[MAX_GITNAME]; extern char git_default_email[MAX_GITNAME];
extern char git_default_name[MAX_GITNAME]; extern char git_default_name[MAX_GITNAME];


extern char *git_commit_encoding; extern const char *git_commit_encoding;
extern const char *git_log_output_encoding; extern const char *git_log_output_encoding;


extern int copy_fd(int ifd, int ofd); extern int copy_fd(int ifd, int ofd);

2
environment.c

@ -20,7 +20,7 @@ int is_bare_repository_cfg = -1; /* unspecified */
int log_all_ref_updates = -1; /* unspecified */ int log_all_ref_updates = -1; /* unspecified */
int warn_ambiguous_refs = 1; int warn_ambiguous_refs = 1;
int repository_format_version; int repository_format_version;
char *git_commit_encoding; const char *git_commit_encoding;
const char *git_log_output_encoding; const char *git_log_output_encoding;
int shared_repository = PERM_UMASK; int shared_repository = PERM_UMASK;
const char *apply_default_whitespace; const char *apply_default_whitespace;

Loading…
Cancel
Save