From 228e94f93570b580da388069900c56b813c91953 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 1 Apr 2007 18:14:06 -0700 Subject: Move index-related variables into a structure. This defines a index_state structure and moves index-related global variables into it. Currently there is one instance of it, the_index, and everybody accesses it, so there is no code change. Signed-off-by: Junio C Hamano --- read-cache.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'read-cache.c') diff --git a/read-cache.c b/read-cache.c index d2f332a622..9b4385ea5c 100644 --- a/read-cache.c +++ b/read-cache.c @@ -19,14 +19,10 @@ #define CACHE_EXT(s) ( (s[0]<<24)|(s[1]<<16)|(s[2]<<8)|(s[3]) ) #define CACHE_EXT_TREE 0x54524545 /* "TREE" */ -struct cache_entry **active_cache; -static time_t index_file_timestamp; -unsigned int active_nr, active_alloc, active_cache_changed; - -struct cache_tree *active_cache_tree; - -static void *cache_mmap; -static size_t cache_mmap_size; +struct index_state the_index; +#define index_file_timestamp (the_index.timestamp) +#define cache_mmap (the_index.mmap) +#define cache_mmap_size (the_index.mmap_size) /* * This only updates the "non-critical" parts of the directory -- cgit v1.2.3