[warnings] fix -Wunused-function

* delete unused functions that are no longer required
* define guard functions only used while debugging
This commit is contained in:
akallabeth
2025-02-27 10:43:01 +01:00
parent dcebd0cb2b
commit d4f7fb081b
23 changed files with 96 additions and 562 deletions

View File

@@ -628,87 +628,6 @@ static UINT rdpgfx_recv_evict_cache_entry_pdu(GENERIC_CHANNEL_CALLBACK* callback
return error;
}
/**
* Load cache import offer from file (offline replay)
*
* @return 0 on success, otherwise a Win32 error code
*/
static UINT rdpgfx_load_cache_import_offer(RDPGFX_PLUGIN* gfx, RDPGFX_CACHE_IMPORT_OFFER_PDU* offer)
{
int count = 0;
UINT error = CHANNEL_RC_OK;
PERSISTENT_CACHE_ENTRY entry;
rdpPersistentCache* persistent = NULL;
WINPR_ASSERT(gfx);
WINPR_ASSERT(gfx->rdpcontext);
rdpSettings* settings = gfx->rdpcontext->settings;
WINPR_ASSERT(offer);
WINPR_ASSERT(settings);
offer->cacheEntriesCount = 0;
if (!freerdp_settings_get_bool(settings, FreeRDP_BitmapCachePersistEnabled))
return CHANNEL_RC_OK;
const char* BitmapCachePersistFile =
freerdp_settings_get_string(settings, FreeRDP_BitmapCachePersistFile);
if (!BitmapCachePersistFile)
return CHANNEL_RC_OK;
persistent = persistent_cache_new();
if (!persistent)
return CHANNEL_RC_NO_MEMORY;
if (persistent_cache_open(persistent, BitmapCachePersistFile, FALSE, 3) < 1)
{
error = CHANNEL_RC_INITIALIZATION_ERROR;
goto fail;
}
if (persistent_cache_get_version(persistent) != 3)
{
error = ERROR_INVALID_DATA;
goto fail;
}
count = persistent_cache_get_count(persistent);
if (count < 1)
{
error = ERROR_INVALID_DATA;
goto fail;
}
if (count >= RDPGFX_CACHE_ENTRY_MAX_COUNT)
count = RDPGFX_CACHE_ENTRY_MAX_COUNT - 1;
if (count > gfx->MaxCacheSlots)
count = gfx->MaxCacheSlots;
offer->cacheEntriesCount = (UINT16)count;
for (int idx = 0; idx < count; idx++)
{
if (persistent_cache_read_entry(persistent, &entry) < 1)
{
error = ERROR_INVALID_DATA;
goto fail;
}
offer->cacheEntries[idx].cacheKey = entry.key64;
offer->cacheEntries[idx].bitmapLength = entry.size;
}
persistent_cache_free(persistent);
return error;
fail:
persistent_cache_free(persistent);
return error;
}
/**
* Function description
*