diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-07 15:57:00 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-07 15:52:18 +0000 |
commit | cf3fa437fc5d003632afb68b8322e326a66665b1 (patch) | |
tree | 7cc0eb2870695668292703d5b0619b104bef5060 | |
parent | 39fff5cb5330c1b65ad49b094b54d60078e8a31e (diff) |
Remove unhelpful unsigned casting trick
Change-Id: Ice86f060974c51bbaf051ed8c5a369ce80ecfe15
-rw-r--r-- | apps/plugins/imageviewer/jpeg/jpeg_decoder.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c index b014fa0ed1..ef7d5ddb3d 100644 --- a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c +++ b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c @@ -61,14 +61,9 @@ INLINE unsigned range_limit(int value) return value; #else value += 128; - - if ((unsigned)value <= 255) - return value; - - if (value < 0) - return 0; - - return 255; + if(value < 0) return 0; + if(value > 255) return 255; + return value; #endif } |