Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rev-parse: tighten constness properly.
author
Junio C Hamano
<junkio@cox.net>
Tue, 6 Jun 2006 05:36:21 +0000
(22:36 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 6 Jun 2006 05:36:21 +0000
(22:36 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-rev-parse.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
1d84a60
)
diff --git
a/builtin-rev-parse.c
b/builtin-rev-parse.c
index c353a481b0c8590689c38b46525dc3217b15efbe..b27a6d382b7540d1d9f6fc98784646458b217af6 100644
(file)
--- a/
builtin-rev-parse.c
+++ b/
builtin-rev-parse.c
@@
-15,7
+15,7
@@
#define DO_NONFLAGS 8
static int filter = ~0;
#define DO_NONFLAGS 8
static int filter = ~0;
-static char *def = NULL;
+static c
onst c
har *def = NULL;
#define NORMAL 0
#define REVERSED 1
#define NORMAL 0
#define REVERSED 1
@@
-111,7
+111,7
@@
static void show_rev(int type, const unsigned char *sha1, const char *name)
}
/* Output a flag, only if filter allows it. */
}
/* Output a flag, only if filter allows it. */
-static int show_flag(char *arg)
+static int show_flag(c
onst c
har *arg)
{
if (!(filter & DO_FLAGS))
return 0;
{
if (!(filter & DO_FLAGS))
return 0;
@@
-124,7
+124,7
@@
static int show_flag(char *arg)
static void show_default(void)
{
static void show_default(void)
{
- char *s = def;
+ c
onst c
har *s = def;
if (s) {
unsigned char sha1[20];
if (s) {
unsigned char sha1[20];
@@
-173,7
+173,7
@@
int cmd_rev_parse(int argc, const char **argv, char **envp)
git_config(git_default_config);
for (i = 1; i < argc; i++) {
git_config(git_default_config);
for (i = 1; i < argc; i++) {
- char *arg = argv[i];
+ c
onst c
har *arg = argv[i];
char *dotdot;
if (as_is) {
char *dotdot;
if (as_is) {
@@
-330,7
+330,7
@@
int cmd_rev_parse(int argc, const char **argv, char **envp)
if (dotdot) {
unsigned char end[20];
char *next = dotdot + 2;
if (dotdot) {
unsigned char end[20];
char *next = dotdot + 2;
- char *this = arg;
+ c
onst c
har *this = arg;
*dotdot = 0;
if (!*next)
next = "HEAD";
*dotdot = 0;
if (!*next)
next = "HEAD";