Skip to content

Commit 44b51d5

Browse files
committed
PR 148586: Merge users/johasc/gvfs-gcc to gvfs/master
This Pull Request lets `gvfs/master` build in Git for Windows' SDK, using the GCC provided therein. - Avoid declarations after statements - Use C types - Avoid function definition with an ellipsis
2 parents e930675 + 26569eb commit 44b51d5

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

cache-tree.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,8 @@ static int update_one(struct cache_tree *it,
244244
int flags)
245245
{
246246
struct strbuf buffer;
247-
int missing_ok = flags & WRITE_TREE_MISSING_OK;
248-
if (gvfs_config_is_set(GVFS_MISSING_OK))
249-
missing_ok = WRITE_TREE_MISSING_OK;
247+
int missing_ok = gvfs_config_is_set(GVFS_MISSING_OK) ?
248+
WRITE_TREE_MISSING_OK : (flags & WRITE_TREE_MISSING_OK);
250249
int dryrun = flags & WRITE_TREE_DRY_RUN;
251250
int repair = flags & WRITE_TREE_REPAIR;
252251
int to_invalidate = 0;

gvfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static inline int gvfs_config_is_set(int mask) {
2727
return (core_gvfs & mask) == mask;
2828
}
2929

30-
static inline int gvfs_config_is_set_any() {
30+
static inline int gvfs_config_is_set_any(void) {
3131
return core_gvfs > 0;
3232
}
3333

@@ -51,4 +51,4 @@ static inline int gvfs_config_load_and_is_set(int mask) {
5151
}
5252

5353

54-
#endif /* GVFS_H */
54+
#endif /* GVFS_H */

name-hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ static int cache_entry_cmp(const struct cache_entry *ce1,
115115
static void lazy_init_name_hash(struct index_state *istate)
116116
{
117117
int nr;
118+
uint64_t start;
118119

119120
if (istate->name_hash_initialized)
120121
return;
121-
uint64_t start = getnanotime();
122+
start = getnanotime();
122123
hashmap_init(&istate->name_hash, (hashmap_cmp_fn) cache_entry_cmp,
123124
istate->cache_nr);
124125
hashmap_init(&istate->dir_hash, (hashmap_cmp_fn) dir_entry_cmp, 0);

read-cache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1650,12 +1650,13 @@ int read_index_from(struct index_state *istate, const char *path)
16501650
{
16511651
struct split_index *split_index;
16521652
int ret;
1653+
uint64_t start;
16531654

16541655
/* istate->initialized covers both .git/index and .git/sharedindex.xxx */
16551656
if (istate->initialized)
16561657
return istate->cache_nr;
16571658

1658-
uint64_t start = getnanotime();
1659+
start = getnanotime();
16591660
ret = do_read_index(istate, path, 0);
16601661

16611662
split_index = istate->split_index;

0 commit comments

Comments
 (0)