From: prj@po.cwru.edu (Paul Jarc)
Cc: guile-devel@gnu.org
Subject: Re: OpenBSD does not define INT8_MIN etc.
Date: Sat, 10 Jul 2004 11:57:41 -0400 [thread overview]
Message-ID: <m33c3zlur8.fsf@multivac.cwru.edu> (raw)
In-Reply-To: <873c40xab2.fsf@zagadka.ping.de> (Marius Vollmer's message of "Sat, 10 Jul 2004 15:26:41 +0200")
Marius Vollmer <mvo@zagadka.de> wrote:
> #define SCM_I_UTYPE_MAX(type) (~(type)0)
Maybe just personal preference, but I'd use ((type)-1). That's
guaranteed to work by the C standard.
> #define SCM_I_TYPE_MAX(type,utype) ((type)((~(utype)0)/2))
> #define SCM_I_TYPE_MIN(type,utype) (-((type)((~(utype)0)/2))-1)
Will integer promotions get in the way here for smaller types? I
think (utype)0 will be promoted to int before ~ is applied, etc.
paul
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2004-07-10 15:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-10 8:47 OpenBSD does not define INT8_MIN etc Andreas Vögele
2004-07-10 12:32 ` Andreas Vögele
2004-07-10 13:26 ` Marius Vollmer
2004-07-10 14:43 ` Andreas Vögele
2004-07-11 9:56 ` Andreas Vögele
2004-07-10 15:57 ` Paul Jarc [this message]
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m33c3zlur8.fsf@multivac.cwru.edu \
--to=prj@po.cwru.edu \
--cc=guile-devel@gnu.org \
/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).