summaryrefslogtreecommitdiff
path: root/src/common/zstd_compression.h
diff options
context:
space:
mode:
authorGravatar Lioncash2020-08-15 05:25:28 -0400
committerGravatar Lioncash2020-08-15 17:17:56 -0400
commit1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f (patch)
tree23126ca46fa87e73445002adb9422d7c6295a1da /src/common/zstd_compression.h
parentcommon: Make use of [[nodiscard]] where applicable (diff)
downloadyuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.gz
yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.tar.xz
yuzu-1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f.zip
common/compression: Roll back std::span changes
Seems like all compilers don't support std::span yet.
Diffstat (limited to 'src/common/zstd_compression.h')
-rw-r--r--src/common/zstd_compression.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h
index 4bacf8355..c26a30ab9 100644
--- a/src/common/zstd_compression.h
+++ b/src/common/zstd_compression.h
@@ -4,7 +4,6 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <span>
8#include <vector> 7#include <vector>
9 8
10#include "common/common_types.h" 9#include "common/common_types.h"
@@ -14,22 +13,25 @@ namespace Common::Compression {
14/** 13/**
15 * Compresses a source memory region with Zstandard and returns the compressed data in a vector. 14 * Compresses a source memory region with Zstandard and returns the compressed data in a vector.
16 * 15 *
17 * @param source the uncompressed source memory region. 16 * @param source The uncompressed source memory region.
18 * @param compression_level the used compression level. Should be between 1 and 22. 17 * @param source_size The size of the uncompressed source memory region.
18 * @param compression_level The used compression level. Should be between 1 and 22.
19 * 19 *
20 * @return the compressed data. 20 * @return the compressed data.
21 */ 21 */
22[[nodiscard]] std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); 22[[nodiscard]] std::vector<u8> CompressDataZSTD(const u8* source, std::size_t source_size,
23 s32 compression_level);
23 24
24/** 25/**
25 * Compresses a source memory region with Zstandard with the default compression level and returns 26 * Compresses a source memory region with Zstandard with the default compression level and returns
26 * the compressed data in a vector. 27 * the compressed data in a vector.
27 * 28 *
28 * @param source the uncompressed source memory region. 29 * @param source The uncompressed source memory region.
30 * @param source_size The size of the uncompressed source memory region.
29 * 31 *
30 * @return the compressed data. 32 * @return the compressed data.
31 */ 33 */
32[[nodiscard]] std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); 34[[nodiscard]] std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_size);
33 35
34/** 36/**
35 * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. 37 * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector.