threads / patch / 44849

patchindex: improve constness for reading blob data

Subject: [PATCH] index: improve constness for reading blob data

## tl;dr

2 messages between Jan 10, 2017 and Jan 11, 2017. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Brandon Williams· Jan 10, 2017, 20:06 UTC · lore

Improve constness of the index_state parameter to the 'read_blob_data_from_index' function.

Signed-off-by: Brandon Williams <bmwill@google.com>
---
 cache.h      | 2 +-
 read-cache.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
Show changes to 2 files +3 −2

cache.h, read-cache.c

diff --git a/cache.h b/cache.h
index a50a61a19..363953c1a 100644
--- a/cache.h
+++ b/cache.h
@@ -599,7 +599,7 @@ extern int chmod_index_entry(struct index_state *, struct cache_entry *ce, char
 extern int ce_same_name(const struct cache_entry *a, const struct cache_entry *b);
 extern void set_object_name_for_intent_to_add_entry(struct cache_entry *ce);
 extern int index_name_is_other(const struct index_state *, const char *, int);
-extern void *read_blob_data_from_index(struct index_state *, const char *, unsigned long *);
+extern void *read_blob_data_from_index(const struct index_state *, const char *, unsigned long *);
 
 /* do stat comparison even if CE_VALID is true */
 #define CE_MATCH_IGNORE_VALID		01
diff --git a/read-cache.c b/read-cache.c
index f92a912dc..6ee044442 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2292,7 +2292,8 @@ int index_name_is_other(const struct index_state *istate, const char *name,
 	return 1;
 }
 
-void *read_blob_data_from_index(struct index_state *istate, const char *path, unsigned long *size)
+void *read_blob_data_from_index(const struct index_state *istate,
+				const char *path, unsigned long *size)
 {
 	int pos, len;
 	unsigned long sz;
-- 
2.11.0.390.gc69c2f50cf-goog
Junio C Hamano· Jan 11, 2017, 21:36 UTC · re: Brandon Williams · lore

Re: [PATCH] index: improve constness for reading blob data

Brandon Williams <bmwill@google.com> writes:
Show 5 quoted lines
> Improve constness of the index_state parameter to the
> 'read_blob_data_from_index' function.
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---
Thanks.

← back to recent threads