diff options
| author | 2020-08-14 09:38:45 -0400 | |
|---|---|---|
| committer | 2020-08-15 17:17:52 -0400 | |
| commit | df7248039553b3ebd338380c3ef0428b0e046e79 (patch) | |
| tree | eca7153300e311ac7954f5c085fdada0c7295699 /src/common/zstd_compression.h | |
| parent | Merge pull request #4526 from lioncash/core-semi (diff) | |
| download | yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.gz yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.xz yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.zip | |
common: Make use of [[nodiscard]] where applicable
Now that clang-format makes [[nodiscard]] attributes format sensibly, we
can apply them to several functions within the common library to allow
the compiler to complain about any misuses of the functions.
Diffstat (limited to '')
| -rw-r--r-- | src/common/zstd_compression.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index b5edf19e7..4bacf8355 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h | |||
| @@ -19,7 +19,7 @@ namespace Common::Compression { | |||
| 19 | * | 19 | * |
| 20 | * @return the compressed data. | 20 | * @return the compressed data. |
| 21 | */ | 21 | */ |
| 22 | std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); | 22 | [[nodiscard]] std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_level); |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * Compresses a source memory region with Zstandard with the default compression level and returns | 25 | * Compresses a source memory region with Zstandard with the default compression level and returns |
| @@ -29,7 +29,7 @@ std::vector<u8> CompressDataZSTD(std::span<const u8> source, s32 compression_lev | |||
| 29 | * | 29 | * |
| 30 | * @return the compressed data. | 30 | * @return the compressed data. |
| 31 | */ | 31 | */ |
| 32 | std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); | 32 | [[nodiscard]] std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. | 35 | * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. |
| @@ -38,6 +38,6 @@ std::vector<u8> CompressDataZSTDDefault(std::span<const u8> source); | |||
| 38 | * | 38 | * |
| 39 | * @return the decompressed data. | 39 | * @return the decompressed data. |
| 40 | */ | 40 | */ |
| 41 | std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed); | 41 | [[nodiscard]] std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed); |
| 42 | 42 | ||
| 43 | } // namespace Common::Compression \ No newline at end of file | 43 | } // namespace Common::Compression \ No newline at end of file |