Skip to content

Commit

Permalink
Correct new compiler warnings in builtin-revert
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
spearce authored and Junio C Hamano committed Mar 13, 2007
1 parent b1daf30 commit 1a8f274
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions builtin-revert.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
unsigned char head[20];
struct commit *base, *next;
int i;
char *oneline, *encoding, *reencoded_message = NULL;
const char *message;
char *oneline, *reencoded_message = NULL;
const char *message, *encoding;

git_config(git_default_config);
me = action == REVERT ? "revert" : "cherry-pick";
Expand Down
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_name[MAX_GITNAME];

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

extern int copy_fd(int ifd, int ofd);
Expand Down
2 changes: 1 addition & 1 deletion environment.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int is_bare_repository_cfg = -1; /* unspecified */
int log_all_ref_updates = -1; /* unspecified */
int warn_ambiguous_refs = 1;
int repository_format_version;
char *git_commit_encoding;
const char *git_commit_encoding;
const char *git_log_output_encoding;
int shared_repository = PERM_UMASK;
const char *apply_default_whitespace;
Expand Down

0 comments on commit 1a8f274

Please sign in to comment.