summaryrefslogtreecommitdiff
path: root/hints
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2020-12-28 18:04:52 -0800
committerKarl Williamson <khw@cpan.org>2021-01-17 09:18:15 -0700
commit1604cfb0273418ed479719f39def5ee559bffda2 (patch)
tree166a5ab935a029ab86cf6295d6f3cb77da22e559 /hints
parent557ff1b2a4ecd18fe9229e7e0eb8fa123adc5670 (diff)
downloadperl-1604cfb0273418ed479719f39def5ee559bffda2.tar.gz
style: Detabify indentation of the C code maintained by the core.
This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
Diffstat (limited to 'hints')
-rw-r--r--hints/t001.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/hints/t001.c b/hints/t001.c
index 562d7597ff..5edb855384 100644
--- a/hints/t001.c
+++ b/hints/t001.c
@@ -21,70 +21,70 @@
void test(double *result)
{
- float afloat;
- double adouble;
- int checksum = 0;
- unsigned cuv = 0;
- double cdouble = 0.0;
- const int bits_in_uv = 8 * sizeof(cuv);
+ float afloat;
+ double adouble;
+ int checksum = 0;
+ unsigned cuv = 0;
+ double cdouble = 0.0;
+ const int bits_in_uv = 8 * sizeof(cuv);
- checksum = 53;
- cdouble = -1.0;
+ checksum = 53;
+ cdouble = -1.0;
- if (checksum) {
- if (checksum > bits_in_uv) {
- double trouble;
+ if (checksum) {
+ if (checksum > bits_in_uv) {
+ double trouble;
- adouble = (double) (1 << (checksum & 15));
+ adouble = (double) (1 << (checksum & 15));
- while (checksum >= 16) {
- checksum -= 16;
- adouble *= 65536.0;
- }
+ while (checksum >= 16) {
+ checksum -= 16;
+ adouble *= 65536.0;
+ }
- /* At -O1, GCC 2.95.2 compiles the following loop
- into:
+ /* At -O1, GCC 2.95.2 compiles the following loop
+ into:
- L$0014
- fcmp,dbl,>= %fr4,%fr0
- ftest
- b L$0014
- fadd,dbl %fr4,%fr12,%fr4
- fsub,dbl %fr4,%fr12,%fr4
+ L$0014
+ fcmp,dbl,>= %fr4,%fr0
+ ftest
+ b L$0014
+ fadd,dbl %fr4,%fr12,%fr4
+ fsub,dbl %fr4,%fr12,%fr4
- This code depends on the floating-add and
- floating-subtract retaining all of the
- precision present in the operands. There is
- no such guarantee when using floating-point,
- as this test case demonstrates.
+ This code depends on the floating-add and
+ floating-subtract retaining all of the
+ precision present in the operands. There is
+ no such guarantee when using floating-point,
+ as this test case demonstrates.
- The code is okay at -O0. */
+ The code is okay at -O0. */
- while (cdouble < 0.0)
- cdouble += adouble;
+ while (cdouble < 0.0)
+ cdouble += adouble;
- cdouble = modf (cdouble / adouble, &trouble) * adouble;
- }
- }
+ cdouble = modf (cdouble / adouble, &trouble) * adouble;
+ }
+ }
- *result = cdouble;
+ *result = cdouble;
}
int main (int argc, char ** argv)
{
double value;
- test (&value);
+ test (&value);
- if (argc == 2 && !strcmp(argv[1],"-v"))
- printf ("value = %.18e\n", value);
+ if (argc == 2 && !strcmp(argv[1],"-v"))
+ printf ("value = %.18e\n", value);
- if (value != 9.007199254740991e+15) {
- printf ("t001 fails!\n");
- return -1;
- }
- else {
- printf ("t001 works.\n");
- return 0;
- }
+ if (value != 9.007199254740991e+15) {
+ printf ("t001 fails!\n");
+ return -1;
+ }
+ else {
+ printf ("t001 works.\n");
+ return 0;
+ }
}