From 594b619ba795d2ccfa61cf2b1733195457a55044 Mon Sep 17 00:00:00 2001 From: Matt Holgate Date: Mon, 30 Jun 2014 15:49:51 +0100 Subject: Fix coding style issues and remove C99 mid-block declaration. --- source/fitz/store.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/fitz') diff --git a/source/fitz/store.c b/source/fitz/store.c index 7afb3751..cf0e3536 100644 --- a/source/fitz/store.c +++ b/source/fitz/store.c @@ -637,13 +637,14 @@ int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase) return 0; } -int +int fz_shrink_store(fz_context *ctx, unsigned int percent) { int success; fz_store *store; + unsigned int new_size; - if (ctx == NULL) + if (ctx == NULL) return 0; if (percent >= 100) @@ -658,11 +659,11 @@ fz_shrink_store(fz_context *ctx, unsigned int percent) #endif fz_lock(ctx, FZ_LOCK_ALLOC); - unsigned int maxSize = (unsigned int)(((uint64_t)store->size * percent) / 100); - if (store->size > maxSize) - scavenge(ctx, store->size - maxSize); + new_size = (unsigned int)(((uint64_t)store->size * percent) / 100); + if (store->size > new_size) + scavenge(ctx, store->size - new_size); - success = (store->size <= maxSize) ? 1 : 0; + success = (store->size <= new_size) ? 1 : 0; fz_unlock(ctx, FZ_LOCK_ALLOC); #ifdef DEBUG_SCAVENGING fprintf(stderr, "fz_shrink_store after: %d\n", store->size/(1024*1024)); -- cgit v1.2.3