Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
read-cache: rename 'new' variables
author
Brandon Williams
<bmwill@google.com>
Wed, 14 Feb 2018 18:59:45 +0000
(10:59 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 22 Feb 2018 18:08:05 +0000
(10:08 -0800)
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
3ce9149
)
diff --git
a/read-cache.c
b/read-cache.c
index 2eb81a66b941325dc339d61a0ab804a60cbb8be2..b22668bfa945c357c71682ac9b59e936a044bc3b 100644
(file)
--- a/
read-cache.c
+++ b/
read-cache.c
@@
-70,20
+70,20
@@
static void replace_index_entry(struct index_state *istate, int nr, struct cache
void rename_index_entry_at(struct index_state *istate, int nr, const char *new_name)
{
void rename_index_entry_at(struct index_state *istate, int nr, const char *new_name)
{
- struct cache_entry *old
= istate->cache[nr], *new
;
+ struct cache_entry *old
_entry = istate->cache[nr], *new_entry
;
int namelen = strlen(new_name);
int namelen = strlen(new_name);
- new = xmalloc(cache_entry_size(namelen));
- copy_cache_entry(new
, old
);
- new->ce_flags &= ~CE_HASHED;
- new->ce_namelen = namelen;
- new->index = 0;
- memcpy(new->name, new_name, namelen + 1);
+ new
_entry
= xmalloc(cache_entry_size(namelen));
+ copy_cache_entry(new
_entry, old_entry
);
+ new
_entry
->ce_flags &= ~CE_HASHED;
+ new
_entry
->ce_namelen = namelen;
+ new
_entry
->index = 0;
+ memcpy(new
_entry
->name, new_name, namelen + 1);
- cache_tree_invalidate_path(istate, old->name);
- untracked_cache_remove_from_index(istate, old->name);
+ cache_tree_invalidate_path(istate, old
_entry
->name);
+ untracked_cache_remove_from_index(istate, old
_entry
->name);
remove_index_entry_at(istate, nr);
remove_index_entry_at(istate, nr);
- add_index_entry(istate, new, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
+ add_index_entry(istate, new
_entry
, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
}
void fill_stat_data(struct stat_data *sd, struct stat *st)
}
void fill_stat_data(struct stat_data *sd, struct stat *st)
@@
-615,18
+615,18
@@
static struct cache_entry *create_alias_ce(struct index_state *istate,
struct cache_entry *alias)
{
int len;
struct cache_entry *alias)
{
int len;
- struct cache_entry *new;
+ struct cache_entry *new
_entry
;
if (alias->ce_flags & CE_ADDED)
die("Will not add file alias '%s' ('%s' already exists in index)", ce->name, alias->name);
/* Ok, create the new entry using the name of the existing alias */
len = ce_namelen(alias);
if (alias->ce_flags & CE_ADDED)
die("Will not add file alias '%s' ('%s' already exists in index)", ce->name, alias->name);
/* Ok, create the new entry using the name of the existing alias */
len = ce_namelen(alias);
- new = xcalloc(1, cache_entry_size(len));
- memcpy(new->name, alias->name, len);
- copy_cache_entry(new, ce);
+ new
_entry
= xcalloc(1, cache_entry_size(len));
+ memcpy(new
_entry
->name, alias->name, len);
+ copy_cache_entry(new
_entry
, ce);
save_or_free_index_entry(istate, ce);
save_or_free_index_entry(istate, ce);
- return new;
+ return new
_entry
;
}
void set_object_name_for_intent_to_add_entry(struct cache_entry *ce)
}
void set_object_name_for_intent_to_add_entry(struct cache_entry *ce)
@@
-1379,7
+1379,7
@@
int refresh_index(struct index_state *istate, unsigned int flags,
added_fmt = (in_porcelain ? "A\t%s\n" : "%s needs update\n");
unmerged_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
for (i = 0; i < istate->cache_nr; i++) {
added_fmt = (in_porcelain ? "A\t%s\n" : "%s needs update\n");
unmerged_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
for (i = 0; i < istate->cache_nr; i++) {
- struct cache_entry *ce, *new;
+ struct cache_entry *ce, *new
_entry
;
int cache_errno = 0;
int changed = 0;
int filtered = 0;
int cache_errno = 0;
int changed = 0;
int filtered = 0;
@@
-1408,10
+1408,10
@@
int refresh_index(struct index_state *istate, unsigned int flags,
if (filtered)
continue;
if (filtered)
continue;
- new = refresh_cache_ent(istate, ce, options, &cache_errno, &changed);
- if (new == ce)
+ new
_entry
= refresh_cache_ent(istate, ce, options, &cache_errno, &changed);
+ if (new
_entry
== ce)
continue;
continue;
- if (!new) {
+ if (!new
_entry
) {
const char *fmt;
if (really && cache_errno == EINVAL) {
const char *fmt;
if (really && cache_errno == EINVAL) {
@@
-1440,7
+1440,7
@@
int refresh_index(struct index_state *istate, unsigned int flags,
continue;
}
continue;
}
- replace_index_entry(istate, i, new);
+ replace_index_entry(istate, i, new
_entry
);
}
return has_errors;
}
}
return has_errors;
}