All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] config.c: change the function signature of `git_config_string()`
@ 2014-07-22 10:49 Tanay Abhra
  2014-07-22 11:07 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Tanay Abhra @ 2014-07-22 10:49 UTC (permalink / raw)
  To: git; +Cc: Tanay Abhra, Ramkumar Ramachandra, Matthieu Moy, Junio C Hamano

`git_config_string()` output parameter `dest` is declared as a const
which is unnecessary as the caller of the function is given a strduped
string which can be modified without causing any harm.

Thus, remove the const from the function signature.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
---
 cache.h  | 2 +-
 config.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cache.h b/cache.h
index 92fc9f1..93d357a 100644
--- a/cache.h
+++ b/cache.h
@@ -1303,7 +1303,7 @@ extern unsigned long git_config_ulong(const char *, const char *);
 extern int git_config_bool_or_int(const char *, const char *, int *);
 extern int git_config_bool(const char *, const char *);
 extern int git_config_maybe_bool(const char *, const char *);
-extern int git_config_string(const char **, const char *, const char *);
+extern int git_config_string(char **, const char *, const char *);
 extern int git_config_pathname(const char **, const char *, const char *);
 extern int git_config_set_in_file(const char *, const char *, const char *);
 extern int git_config_set(const char *, const char *);
diff --git a/config.c b/config.c
index ba882a1..25e28a7 100644
--- a/config.c
+++ b/config.c
@@ -633,7 +633,7 @@ int git_config_bool(const char *name, const char *value)
 	return !!git_config_bool_or_int(name, value, &discard);
 }
 
-int git_config_string(const char **dest, const char *var, const char *value)
+int git_config_string(char **dest, const char *var, const char *value)
 {
 	if (!value)
 		return config_error_nonbool(var);
-- 
1.9.0.GIT

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-23 17:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22 10:49 [PATCH] config.c: change the function signature of `git_config_string()` Tanay Abhra
2014-07-22 11:07 ` Jeff King
2014-07-22 11:41   ` Tanay Abhra
2014-07-22 11:44   ` Matthieu Moy
2014-07-22 11:48     ` Tanay Abhra
2014-07-22 15:53     ` Junio C Hamano
2014-07-22 16:03       ` Matthieu Moy
2014-07-22 16:47   ` Junio C Hamano
2014-07-23  8:42     ` Matthieu Moy
2014-07-23 17:25       ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.