diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-22 11:24:00 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-22 11:24:01 -0700 |
commit | d3aeb31dc410a71ee41b87328f0d71996417294f (patch) | |
tree | c9792a61c95180c0eeb4c85f5c97fbde63aa53d0 /builtin/ls-files.c | |
parent | Merge branch 'jk/gcc-function-attributes' (diff) | |
parent | Convert "struct cache_entry *" to "const ..." wherever possible (diff) | |
download | tgif-d3aeb31dc410a71ee41b87328f0d71996417294f.tar.xz |
Merge branch 'nd/const-struct-cache-entry'
* nd/const-struct-cache-entry:
Convert "struct cache_entry *" to "const ..." wherever possible
Diffstat (limited to 'builtin/ls-files.c')
-rw-r--r-- | builtin/ls-files.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 3a410c35d9..80fff23ad9 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -127,7 +127,7 @@ static void show_killed_files(struct dir_struct *dir) } } -static void show_ce_entry(const char *tag, struct cache_entry *ce) +static void show_ce_entry(const char *tag, const struct cache_entry *ce) { int len = max_prefix_len; @@ -165,7 +165,7 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce) } write_name(ce->name, ce_namelen(ce)); if (debug_mode) { - struct stat_data *sd = &ce->ce_stat_data; + const struct stat_data *sd = &ce->ce_stat_data; printf(" ctime: %d:%d\n", sd->sd_ctime.sec, sd->sd_ctime.nsec); printf(" mtime: %d:%d\n", sd->sd_mtime.sec, sd->sd_mtime.nsec); @@ -203,7 +203,7 @@ static void show_ru_info(void) } } -static int ce_excluded(struct dir_struct *dir, struct cache_entry *ce) +static int ce_excluded(struct dir_struct *dir, const struct cache_entry *ce) { int dtype = ce_to_dtype(ce); return is_excluded(dir, ce->name, &dtype); @@ -223,7 +223,7 @@ static void show_files(struct dir_struct *dir) } if (show_cached || show_stage) { for (i = 0; i < active_nr; i++) { - struct cache_entry *ce = active_cache[i]; + const struct cache_entry *ce = active_cache[i]; if ((dir->flags & DIR_SHOW_IGNORED) && !ce_excluded(dir, ce)) continue; @@ -237,7 +237,7 @@ static void show_files(struct dir_struct *dir) } if (show_deleted || show_modified) { for (i = 0; i < active_nr; i++) { - struct cache_entry *ce = active_cache[i]; + const struct cache_entry *ce = active_cache[i]; struct stat st; int err; if ((dir->flags & DIR_SHOW_IGNORED) && @@ -273,7 +273,7 @@ static void prune_cache(const char *prefix) last = active_nr; while (last > first) { int next = (last + first) >> 1; - struct cache_entry *ce = active_cache[next]; + const struct cache_entry *ce = active_cache[next]; if (!strncmp(ce->name, prefix, max_prefix_len)) { first = next+1; continue; |