diff options
author | Jiri Gaisler <jiri@gaisler.se> | 2019-06-11 22:30:10 +0200 |
---|---|---|
committer | Jiri Gaisler <jiri@gaisler.se> | 2019-06-11 22:30:10 +0200 |
commit | 313c2c1643889a5b84dd0cff3886b22e821a5f34 (patch) | |
tree | dba621bdc66d231581eb4d34ba504c0847df3ff9 /float.c | |
parent | Avoid array out of bounds warning on RISC-V (diff) | |
download | sis-313c2c1643889a5b84dd0cff3886b22e821a5f34.tar.bz2 |
Fix C formatting with indent
Diffstat (limited to 'float.c')
-rw-r--r-- | float.c | 73 |
1 files changed, 37 insertions, 36 deletions
@@ -32,53 +32,54 @@ /* This routine should return the accrued exceptions */ int -get_accex() +get_accex () { - int fexc, accx; + int fexc, accx; - fexc = fetestexcept (FE_ALL_EXCEPT); - accx = 0; - if (fexc & FE_INEXACT) - accx |= 1; - if (fexc & FE_DIVBYZERO) - accx |= 2; - if (fexc & FE_UNDERFLOW) - accx |= 4; - if (fexc & FE_OVERFLOW) - accx |= 8; - if (fexc & FE_INVALID) - accx |= 0x10; - return accx; + fexc = fetestexcept (FE_ALL_EXCEPT); + accx = 0; + if (fexc & FE_INEXACT) + accx |= 1; + if (fexc & FE_DIVBYZERO) + accx |= 2; + if (fexc & FE_UNDERFLOW) + accx |= 4; + if (fexc & FE_OVERFLOW) + accx |= 8; + if (fexc & FE_INVALID) + accx |= 0x10; + return accx; } /* How to clear the accrued exceptions */ void -clear_accex() +clear_accex () { - feclearexcept (FE_ALL_EXCEPT); + feclearexcept (FE_ALL_EXCEPT); } /* How to map SPARC FSR onto the host */ void -set_fsr(fsr) -uint32 fsr; +set_fsr (fsr) + uint32 fsr; { - int fround; + int fround; - fsr >>= 30; - switch (fsr) { - case 0: - fround = FE_TONEAREST; - break; - case 1: - fround = FE_TOWARDZERO; - break; - case 2: - fround = FE_UPWARD; - break; - case 3: - fround = FE_DOWNWARD; - break; - } - fesetround (fround); + fsr >>= 30; + switch (fsr) + { + case 0: + fround = FE_TONEAREST; + break; + case 1: + fround = FE_TOWARDZERO; + break; + case 2: + fround = FE_UPWARD; + break; + case 3: + fround = FE_DOWNWARD; + break; + } + fesetround (fround); } |