From: Florian Weimer <fweimer@redhat.com>
To: libc-alpha@sourceware.org
Cc: Siddhesh Poyarekar <siddhesh@redhat.com>,
Joe Simmons-Talbott <josimmon@redhat.com>
Subject: [PATCH] stdlib: Use long long int in stdlib/tst-llabs
Date: Tue, 16 May 2023 22:56:48 +0200 [thread overview]
Message-ID: <87jzx83shb.fsf@oldenburg.str.redhat.com> (raw)
And adjust for GNU style.
---
stdlib/tst-llabs.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/stdlib/tst-llabs.c b/stdlib/tst-llabs.c
index be3cd78ceb..5e4d52def9 100644
--- a/stdlib/tst-llabs.c
+++ b/stdlib/tst-llabs.c
@@ -25,29 +25,29 @@
static int do_test (void)
{
- long i;
+ long long int i;
- TEST_COMPARE(llabs(LLONG_MAX), LLONG_MAX);
- TEST_COMPARE(llabs(LLONG_MIN + 1), LLONG_MAX);
- TEST_COMPARE(llabs(0x00000000ffffffffL), 0x00000000ffffffffL);
- TEST_COMPARE(llabs(0x0000000100000000L), 0x0000000100000000L);
- TEST_COMPARE(llabs(0x80000000ffffffffL), 0x7fffffff00000001L);
- TEST_COMPARE(llabs(0x8000000100000000L), 0x7fffffff00000000L);
- TEST_COMPARE(llabs(-1), 1);
- TEST_COMPARE(llabs(0), 0);
- TEST_COMPARE(llabs(1), 1);
+ TEST_COMPARE (llabs (LLONG_MAX), LLONG_MAX);
+ TEST_COMPARE (llabs (LLONG_MIN + 1), LLONG_MAX);
+ TEST_COMPARE (llabs (0x00000000ffffffffL), 0x00000000ffffffffL);
+ TEST_COMPARE (llabs (0x0000000100000000L), 0x0000000100000000L);
+ TEST_COMPARE (llabs (0x80000000ffffffffL), 0x7fffffff00000001L);
+ TEST_COMPARE (llabs (0x8000000100000000L), 0x7fffffff00000000L);
+ TEST_COMPARE (llabs (-1), 1);
+ TEST_COMPARE (llabs (0), 0);
+ TEST_COMPARE (llabs (1), 1);
for (i = LLONG_MIN + 1; i < LLONG_MIN + INT_MAX; i += LARGE_PRIME)
- TEST_COMPARE(llabs(i), -i);
+ TEST_COMPARE (llabs (i), -i);
for (i = LLONG_MAX - INT_MAX; i < LLONG_MAX - LARGE_PRIME; i += LARGE_PRIME)
- TEST_COMPARE(llabs(i), i);
+ TEST_COMPARE (llabs (i), i);
for (i = INT_MIN + 1; i < 0; i += LARGE_PRIME)
- TEST_COMPARE(llabs(i), -i);
+ TEST_COMPARE (llabs (i), -i);
for (i = 0; i < INT_MAX; i += LARGE_PRIME)
- TEST_COMPARE(llabs(i), i);
+ TEST_COMPARE (llabs (i), i);
return EXIT_SUCCESS;
}
base-commit: 89ade905c51a2488e85a28f9de413d8d9c1af82d
next reply other threads:[~2023-05-16 20:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 20:56 Florian Weimer [this message]
2023-05-17 0:16 ` Siddhesh Poyarekar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jzx83shb.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=josimmon@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).