diff options
author | Keith Packard <keithp@keithp.com> | 2020-01-20 22:46:35 -0800 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2020-01-21 10:28:35 +0100 |
commit | 8e74c7119fb7f95662bb4986570a98496f259400 (patch) | |
tree | 1ede7bf26214e2ec7cc64eeb3bac2ba082b3361e | |
parent | 954504ea1424069c7c8d34fe771a505df8b8e3e1 (diff) | |
download | newlib-8e74c7119fb7f95662bb4986570a98496f259400.zip newlib-8e74c7119fb7f95662bb4986570a98496f259400.tar.gz newlib-8e74c7119fb7f95662bb4986570a98496f259400.tar.bz2 |
riscv: Add 'break' statements to fpsetround switch
This makes the fpsetround function actually do something rather than
just return -1 due to the default 'fall-through' behavior of the switch
statement.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | newlib/libc/machine/riscv/ieeefp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/newlib/libc/machine/riscv/ieeefp.c b/newlib/libc/machine/riscv/ieeefp.c index 68ace0b..c458322 100644 --- a/newlib/libc/machine/riscv/ieeefp.c +++ b/newlib/libc/machine/riscv/ieeefp.c @@ -84,10 +84,10 @@ fpsetround(fp_rnd rnd_dir) unsigned new_rm; switch (rnd_dir) { - case FP_RN: new_rm = 0; - case FP_RZ: new_rm = 1; - case FP_RM: new_rm = 2; - case FP_RP: new_rm = 3; + case FP_RN: new_rm = 0; break; + case FP_RZ: new_rm = 1; break; + case FP_RM: new_rm = 2; break; + case FP_RP: new_rm = 3; break; default: return -1; } fssr (new_rm << 5 | fsr & 0x1f); |