From 0c63cad638d2633ce1eeb24a9f75816b6fda44ec Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Wed, 4 Dec 2019 05:53:54 -0500 Subject: [PATCH] make COM_LoadCacheFile not useless --- source/common.c | 8 ++++++-- source/common.h | 4 ++-- source/pr_comp.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/common.c b/source/common.c index 19f0f1b..555a801 100644 --- a/source/common.c +++ b/source/common.c @@ -1591,10 +1591,14 @@ byte *COM_LoadTempFile(const char *path, uint32_t *path_id) return COM_LoadFile(path, LOADFILE_TEMPHUNK, path_id); } -void COM_LoadCacheFile(const char *path, struct cache_user_s *cu, uint32_t *path_id) +byte *COM_LoadCacheFile(const char *path, struct cache_user_s *cu, uint32_t *path_id) { + byte *buf; + loadcache = cu; - COM_LoadFile(path, LOADFILE_CACHE, path_id); + buf = COM_LoadFile(path, LOADFILE_CACHE, path_id); + + return buf; } // uses temp hunk if larger than bufsize diff --git a/source/common.h b/source/common.h index d94f8ed..687a4c6 100644 --- a/source/common.h +++ b/source/common.h @@ -288,8 +288,8 @@ byte *COM_LoadHunkFile(const char *path, uint32_t *path_id); // allocates the buffer on the hunk. byte *COM_LoadZoneFile(const char *path, uint32_t *path_id); // allocates the buffer on the zone. -void COM_LoadCacheFile(const char *path, struct cache_user_s *cu, - uint32_t *path_id); +byte *COM_LoadCacheFile(const char *path, struct cache_user_s *cu, + uint32_t *path_id); // uses cache mem for allocating the buffer. byte *COM_LoadMallocFile(const char *path, uint32_t *path_id); // allocates the buffer on the system mem (malloc). diff --git a/source/pr_comp.h b/source/pr_comp.h index 7cd8fff..e22651d 100644 --- a/source/pr_comp.h +++ b/source/pr_comp.h @@ -132,7 +132,7 @@ enum OP_BITOR }; -typedef struct statement_s +typedef struct { uint16_t op; int16_t a, b, c;