fix some indentation

This commit is contained in:
josch
2014-12-30 19:12:49 +01:00
parent a1f39e8d4f
commit d1a778ffe5
3 changed files with 7 additions and 9 deletions

View File

@@ -151,7 +151,7 @@ static void folder_tree_remove(folder_tree * tree, const char *key);
static bool folder_tree_is_parent_of(struct h_entry *parent, static bool folder_tree_is_parent_of(struct h_entry *parent,
struct h_entry *child); struct h_entry *child);
static bool is_valid_cache_filename(const char *name, char key[], static bool is_valid_cache_filename(const char *name, char key[],
uint64_t *revision); uint64_t * revision);
static int atime_compare(const void *a, const void *b); static int atime_compare(const void *a, const void *b);
/* functions with remote access */ /* functions with remote access */
@@ -798,7 +798,6 @@ int folder_tree_open_file(folder_tree * tree, mfconn * conn, const char *path,
* was necessary */ * was necessary */
entry->local_revision = entry->remote_revision; entry->local_revision = entry->remote_revision;
} }
// however the file was opened, its access time has to be updated // however the file was opened, its access time has to be updated
entry->atime = time(NULL); entry->atime = time(NULL);
@@ -1762,7 +1761,7 @@ static int atime_compare(const void *a, const void *b)
* (if any) be a number from 0-9 * (if any) be a number from 0-9
*/ */
static bool is_valid_cache_filename(const char *name, char key[], static bool is_valid_cache_filename(const char *name, char key[],
uint64_t *revision) uint64_t * revision)
{ {
int i; int i;
@@ -1784,7 +1783,7 @@ static bool is_valid_cache_filename(const char *name, char key[],
memcpy(key, name, 15); memcpy(key, name, 15);
key[15] = '\0'; key[15] = '\0';
*revision = atoll(name+16); *revision = atoll(name + 16);
return true; return true;
} }
@@ -1803,7 +1802,7 @@ static bool is_valid_cache_filename(const char *name, char key[],
* - once all files in the cache have been processed this way, check if * - once all files in the cache have been processed this way, check if
* the sum of their sizes is greater than X and delete the oldest * the sum of their sizes is greater than X and delete the oldest
*/ */
void folder_tree_cleanup_filecache(folder_tree *tree, uint64_t allowed_size) void folder_tree_cleanup_filecache(folder_tree * tree, uint64_t allowed_size)
{ {
struct dirent *endp; struct dirent *endp;
struct dirent *entryp; struct dirent *entryp;
@@ -1947,7 +1946,6 @@ void folder_tree_cleanup_filecache(folder_tree *tree, uint64_t allowed_size)
free(cachefiles); free(cachefiles);
return; return;
} }
// sort the files in the cache by their access time // sort the files in the cache by their access time
qsort(cachefiles, num_cachefiles, sizeof(struct h_entry *), atime_compare); qsort(cachefiles, num_cachefiles, sizeof(struct h_entry *), atime_compare);

View File

@@ -53,7 +53,7 @@ int folder_tree_store(folder_tree * tree, FILE * stream);
folder_tree *folder_tree_load(FILE * stream, const char *filecache); folder_tree *folder_tree_load(FILE * stream, const char *filecache);
void folder_tree_cleanup_filecache(folder_tree *tree, void folder_tree_cleanup_filecache(folder_tree * tree,
uint64_t allowed_size); uint64_t allowed_size);
bool folder_tree_path_exists(folder_tree * tree, mfconn * conn, bool folder_tree_path_exists(folder_tree * tree, mfconn * conn,