summaryrefslogtreecommitdiff
path: root/float.c
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2019-06-11 22:30:10 +0200
committerJiri Gaisler <jiri@gaisler.se>2019-06-11 22:30:10 +0200
commit313c2c1643889a5b84dd0cff3886b22e821a5f34 (patch)
treedba621bdc66d231581eb4d34ba504c0847df3ff9 /float.c
parentda44b0fa23e3a48ce1f98f7dc2b16fd91af608a9 (diff)
Fix C formatting with indent
Diffstat (limited to 'float.c')
-rw-r--r--float.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/float.c b/float.c
index f0a912c..58c307e 100644
--- a/float.c
+++ b/float.c
@@ -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);
}