All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add missing const to char* declarations
@ 2011-02-22 22:43 Ævar Arnfjörð Bjarmason
  2011-02-22 22:43 ` [PATCH 1/2] checkout: add missing const to describe_detached_head Ævar Arnfjörð Bjarmason
  2011-02-22 22:43 ` [PATCH 2/2] update-index --refresh --porcelain: add missing const Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 22:43 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jonathan Nieder, Ævar Arnfjörð Bjarmason

These two patches by Jonathan Nieder have been extracted from my
soon-to-be-sent updated gettext series, which he's graciously helped
with.

Without these changes this code using the new _() function will warn
because it's expecting char* but it's returning const char*. Since
there's no reason for these not to be const just add a const to the
declaration.

Jonathan Nieder (2):
  checkout: add missing const to describe_detached_head
  update-index --refresh --porcelain: add missing const

 builtin/checkout.c |    2 +-
 cache.h            |    2 +-
 read-cache.c       |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

-- 
1.7.2.3

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

* [PATCH 1/2] checkout: add missing const to describe_detached_head
  2011-02-22 22:43 [PATCH 0/2] Add missing const to char* declarations Ævar Arnfjörð Bjarmason
@ 2011-02-22 22:43 ` Ævar Arnfjörð Bjarmason
  2011-02-22 22:43 ` [PATCH 2/2] update-index --refresh --porcelain: add missing const Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 22:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder

From: Jonathan Nieder <jrnieder@gmail.com>

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 builtin/checkout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index cd7f56e..bef324e 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -297,7 +297,7 @@ static void show_local_changes(struct object *head, struct diff_options *opts)
 	run_diff_index(&rev, 0);
 }
 
-static void describe_detached_head(char *msg, struct commit *commit)
+static void describe_detached_head(const char *msg, struct commit *commit)
 {
 	struct strbuf sb = STRBUF_INIT;
 	struct pretty_print_context ctx = {0};
-- 
1.7.2.3

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

* [PATCH 2/2] update-index --refresh --porcelain: add missing const
  2011-02-22 22:43 [PATCH 0/2] Add missing const to char* declarations Ævar Arnfjörð Bjarmason
  2011-02-22 22:43 ` [PATCH 1/2] checkout: add missing const to describe_detached_head Ævar Arnfjörð Bjarmason
@ 2011-02-22 22:43 ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2011-02-22 22:43 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Jonathan Nieder

From: Jonathan Nieder <jrnieder@gmail.com>

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 cache.h      |    2 +-
 read-cache.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cache.h b/cache.h
index 3abf895..4a758ba 100644
--- a/cache.h
+++ b/cache.h
@@ -511,7 +511,7 @@ extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
 #define REFRESH_IGNORE_MISSING	0x0008	/* ignore non-existent */
 #define REFRESH_IGNORE_SUBMODULES	0x0010	/* ignore submodules */
 #define REFRESH_IN_PORCELAIN	0x0020	/* user friendly output, not "needs update" */
-extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, char *header_msg);
+extern int refresh_index(struct index_state *, unsigned int flags, const char **pathspec, char *seen, const char *header_msg);
 
 struct lock_file {
 	struct lock_file *next;
diff --git a/read-cache.c b/read-cache.c
index 4f2e890..15b0a73 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1104,7 +1104,7 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
 }
 
 static void show_file(const char * fmt, const char * name, int in_porcelain,
-		      int * first, char *header_msg)
+		      int * first, const char *header_msg)
 {
 	if (in_porcelain && *first && header_msg) {
 		printf("%s\n", header_msg);
@@ -1114,7 +1114,7 @@ static void show_file(const char * fmt, const char * name, int in_porcelain,
 }
 
 int refresh_index(struct index_state *istate, unsigned int flags, const char **pathspec,
-		  char *seen, char *header_msg)
+		  char *seen, const char *header_msg)
 {
 	int i;
 	int has_errors = 0;
-- 
1.7.2.3

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

end of thread, other threads:[~2011-02-22 22:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22 22:43 [PATCH 0/2] Add missing const to char* declarations Ævar Arnfjörð Bjarmason
2011-02-22 22:43 ` [PATCH 1/2] checkout: add missing const to describe_detached_head Ævar Arnfjörð Bjarmason
2011-02-22 22:43 ` [PATCH 2/2] update-index --refresh --porcelain: add missing const Ævar Arnfjörð Bjarmason

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.