aboutsummaryrefslogtreecommitdiffstats
path: root/libparsepcf_parse_int16_from_unsigned__.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-07-02 11:24:35 +0200
committerMattias Andrée <maandree@kth.se>2023-07-02 11:24:35 +0200
commite6ffdd93965a0cd0d10f7b7e302e2947e9b46dd7 (patch)
tree85516a0e527e26bf2c0516facab5c377ccb10ceb /libparsepcf_parse_int16_from_unsigned__.c
parentAdd coverage test (requires `make check` which has not been implemented yet) (diff)
downloadlibparsepcf-e6ffdd93965a0cd0d10f7b7e302e2947e9b46dd7.tar.gz
libparsepcf-e6ffdd93965a0cd0d10f7b7e302e2947e9b46dd7.tar.bz2
libparsepcf-e6ffdd93965a0cd0d10f7b7e302e2947e9b46dd7.tar.xz
m + add some documentation
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libparsepcf_parse_int16_from_unsigned__.c')
-rw-r--r--libparsepcf_parse_int16_from_unsigned__.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libparsepcf_parse_int16_from_unsigned__.c b/libparsepcf_parse_int16_from_unsigned__.c
index 3d61ef8..d4c0167 100644
--- a/libparsepcf_parse_int16_from_unsigned__.c
+++ b/libparsepcf_parse_int16_from_unsigned__.c
@@ -5,9 +5,8 @@
int16_t
libparsepcf_parse_int16_from_unsigned__(uint16_t u)
{
- if (u & UINT16_C(0x8000)) {
+ if (u & UINT16_C(0x8000))
return (int16_t)(uint16_t)~u - 1;
- } else {
+ else
return (int16_t)u;
- }
}