diff options
| author | 2018-08-08 16:17:38 -0400 | |
|---|---|---|
| committer | 2018-08-08 16:17:41 -0400 | |
| commit | 5a9c00ea04c9010ead9790054d6034306ebbdc92 (patch) | |
| tree | 6ccf4cd5b28ab7a24333123feca50d338c84fe6c /src | |
| parent | common/color: Get rid of undefined behavior (diff) | |
| download | yuzu-5a9c00ea04c9010ead9790054d6034306ebbdc92.tar.gz yuzu-5a9c00ea04c9010ead9790054d6034306ebbdc92.tar.xz yuzu-5a9c00ea04c9010ead9790054d6034306ebbdc92.zip | |
common/color: Remove unnecessary const qualifiers on return types
These are just superfluous and not necessesary
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/color.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/common/color.h b/src/common/color.h index 2e56af5a9..0379040be 100644 --- a/src/common/color.h +++ b/src/common/color.h | |||
| @@ -57,7 +57,7 @@ constexpr u8 Convert8To6(u8 value) { | |||
| 57 | * @param bytes Pointer to encoded source color | 57 | * @param bytes Pointer to encoded source color |
| 58 | * @return Result color decoded as Math::Vec4<u8> | 58 | * @return Result color decoded as Math::Vec4<u8> |
| 59 | */ | 59 | */ |
| 60 | inline const Math::Vec4<u8> DecodeRGBA8(const u8* bytes) { | 60 | inline Math::Vec4<u8> DecodeRGBA8(const u8* bytes) { |
| 61 | return {bytes[3], bytes[2], bytes[1], bytes[0]}; | 61 | return {bytes[3], bytes[2], bytes[1], bytes[0]}; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -66,7 +66,7 @@ inline const Math::Vec4<u8> DecodeRGBA8(const u8* bytes) { | |||
| 66 | * @param bytes Pointer to encoded source color | 66 | * @param bytes Pointer to encoded source color |
| 67 | * @return Result color decoded as Math::Vec4<u8> | 67 | * @return Result color decoded as Math::Vec4<u8> |
| 68 | */ | 68 | */ |
| 69 | inline const Math::Vec4<u8> DecodeRGB8(const u8* bytes) { | 69 | inline Math::Vec4<u8> DecodeRGB8(const u8* bytes) { |
| 70 | return {bytes[2], bytes[1], bytes[0], 255}; | 70 | return {bytes[2], bytes[1], bytes[0], 255}; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| @@ -75,7 +75,7 @@ inline const Math::Vec4<u8> DecodeRGB8(const u8* bytes) { | |||
| 75 | * @param bytes Pointer to encoded source color | 75 | * @param bytes Pointer to encoded source color |
| 76 | * @return Result color decoded as Math::Vec4<u8> | 76 | * @return Result color decoded as Math::Vec4<u8> |
| 77 | */ | 77 | */ |
| 78 | inline const Math::Vec4<u8> DecodeRG8(const u8* bytes) { | 78 | inline Math::Vec4<u8> DecodeRG8(const u8* bytes) { |
| 79 | return {bytes[1], bytes[0], 0, 255}; | 79 | return {bytes[1], bytes[0], 0, 255}; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| @@ -84,7 +84,7 @@ inline const Math::Vec4<u8> DecodeRG8(const u8* bytes) { | |||
| 84 | * @param bytes Pointer to encoded source color | 84 | * @param bytes Pointer to encoded source color |
| 85 | * @return Result color decoded as Math::Vec4<u8> | 85 | * @return Result color decoded as Math::Vec4<u8> |
| 86 | */ | 86 | */ |
| 87 | inline const Math::Vec4<u8> DecodeRGB565(const u8* bytes) { | 87 | inline Math::Vec4<u8> DecodeRGB565(const u8* bytes) { |
| 88 | u16_le pixel; | 88 | u16_le pixel; |
| 89 | std::memcpy(&pixel, bytes, sizeof(pixel)); | 89 | std::memcpy(&pixel, bytes, sizeof(pixel)); |
| 90 | return {Convert5To8((pixel >> 11) & 0x1F), Convert6To8((pixel >> 5) & 0x3F), | 90 | return {Convert5To8((pixel >> 11) & 0x1F), Convert6To8((pixel >> 5) & 0x3F), |
| @@ -96,7 +96,7 @@ inline const Math::Vec4<u8> DecodeRGB565(const u8* bytes) { | |||
| 96 | * @param bytes Pointer to encoded source color | 96 | * @param bytes Pointer to encoded source color |
| 97 | * @return Result color decoded as Math::Vec4<u8> | 97 | * @return Result color decoded as Math::Vec4<u8> |
| 98 | */ | 98 | */ |
| 99 | inline const Math::Vec4<u8> DecodeRGB5A1(const u8* bytes) { | 99 | inline Math::Vec4<u8> DecodeRGB5A1(const u8* bytes) { |
| 100 | u16_le pixel; | 100 | u16_le pixel; |
| 101 | std::memcpy(&pixel, bytes, sizeof(pixel)); | 101 | std::memcpy(&pixel, bytes, sizeof(pixel)); |
| 102 | return {Convert5To8((pixel >> 11) & 0x1F), Convert5To8((pixel >> 6) & 0x1F), | 102 | return {Convert5To8((pixel >> 11) & 0x1F), Convert5To8((pixel >> 6) & 0x1F), |
| @@ -108,7 +108,7 @@ inline const Math::Vec4<u8> DecodeRGB5A1(const u8* bytes) { | |||
| 108 | * @param bytes Pointer to encoded source color | 108 | * @param bytes Pointer to encoded source color |
| 109 | * @return Result color decoded as Math::Vec4<u8> | 109 | * @return Result color decoded as Math::Vec4<u8> |
| 110 | */ | 110 | */ |
| 111 | inline const Math::Vec4<u8> DecodeRGBA4(const u8* bytes) { | 111 | inline Math::Vec4<u8> DecodeRGBA4(const u8* bytes) { |
| 112 | u16_le pixel; | 112 | u16_le pixel; |
| 113 | std::memcpy(&pixel, bytes, sizeof(pixel)); | 113 | std::memcpy(&pixel, bytes, sizeof(pixel)); |
| 114 | return {Convert4To8((pixel >> 12) & 0xF), Convert4To8((pixel >> 8) & 0xF), | 114 | return {Convert4To8((pixel >> 12) & 0xF), Convert4To8((pixel >> 8) & 0xF), |
| @@ -140,7 +140,7 @@ inline u32 DecodeD24(const u8* bytes) { | |||
| 140 | * @param bytes Pointer to encoded source values | 140 | * @param bytes Pointer to encoded source values |
| 141 | * @return Resulting values stored as a Math::Vec2 | 141 | * @return Resulting values stored as a Math::Vec2 |
| 142 | */ | 142 | */ |
| 143 | inline const Math::Vec2<u32> DecodeD24S8(const u8* bytes) { | 143 | inline Math::Vec2<u32> DecodeD24S8(const u8* bytes) { |
| 144 | return {static_cast<u32>((bytes[2] << 16) | (bytes[1] << 8) | bytes[0]), bytes[3]}; | 144 | return {static_cast<u32>((bytes[2] << 16) | (bytes[1] << 8) | bytes[0]), bytes[3]}; |
| 145 | } | 145 | } |
| 146 | 146 | ||