diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2013-06-02 17:46:51 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:31:12 -0700 |
commit | 20d142b48c8f2f50662db095e193836d0a8f5ad1 (patch) | |
tree | 8a176d8db7e8fa7361c825b63ba324bbeb1b08d8 /cache.h | |
parent | edca4152560522a431a51fc0a06147fc680b5b18 (diff) | |
download | git-20d142b48c8f2f50662db095e193836d0a8f5ad1.tar.gz |
cache: mark cache_entry pointers const
Add const for pointers that are only dereferenced for reading by the
inline functions copy_cache_entry and ce_mode_from_stat. This allows
callers to pass in const pointers.
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -190,7 +190,8 @@ struct cache_entry { * another. But we never change the name, or the hash state! */ #define CE_STATE_MASK (CE_HASHED | CE_UNHASHED) -static inline void copy_cache_entry(struct cache_entry *dst, struct cache_entry *src) +static inline void copy_cache_entry(struct cache_entry *dst, + const struct cache_entry *src) { unsigned int state = dst->ce_flags & CE_STATE_MASK; @@ -222,7 +223,8 @@ static inline unsigned int create_ce_mode(unsigned int mode) return S_IFGITLINK; return S_IFREG | ce_permissions(mode); } -static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned int mode) +static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce, + unsigned int mode) { extern int trust_executable_bit, has_symlinks; if (!has_symlinks && S_ISREG(mode) && |