summaryrefslogtreecommitdiff
path: root/source/fitz/store.c
diff options
context:
space:
mode:
authorMatt Holgate <matt@emobix.co.uk>2014-06-30 15:49:51 +0100
committerMatt Holgate <matt@emobix.co.uk>2014-06-30 15:49:51 +0100
commit594b619ba795d2ccfa61cf2b1733195457a55044 (patch)
tree1c705d1c2a05c66b869b3e423c58c9d754e83307 /source/fitz/store.c
parent1ce58585a018a5b4d04ef31b7af1d4a754d704cd (diff)
downloadmupdf-594b619ba795d2ccfa61cf2b1733195457a55044.tar.xz
Fix coding style issues and remove C99 mid-block declaration.
Diffstat (limited to 'source/fitz/store.c')
-rw-r--r--source/fitz/store.c13
1 files changed, 7 insertions, 6 deletions
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));