Re: [PATCH 2/4] riscv: Add 'break' statements to fpsetround switch
Kito Cheng <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <CA+yXCZAEoQUAO-oXTpCbxP6zbEU+-Rk5fmaC0pHwLd=7o2zJew@mail.gmail.com> |
Hi Keith: Thanks for fixing this, LGTM. On Tue, Jan 21, 2020 at 2:47 PM Keith Packard <[email protected]> wrote: > > 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 <[email protected]> > --- > newlib/libc/machine/riscv/ieeefp.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/newlib/libc/machine/riscv/ieeefp.c b/newlib/libc/machine/riscv/ieeefp.c > index 68ace0b09..c45832280 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); > -- > 2.25.0.rc1 >