public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: add biggest_unsigned_int(x) macro
Date: Fri, 25 Nov 2011 09:08:47 +0800	[thread overview]
Message-ID: <201111250908.48180.lindner_marek@yahoo.de> (raw)
In-Reply-To: <1322044544-15153-1-git-send-email-ordex@autistici.org>

On Wednesday, November 23, 2011 18:35:44 Antonio Quartulli wrote:
> in case of dynamic type variable, it could be needed to compute at compile
> time its maximal value. This macro helps in doing that for unsigned
> integer types
> 
> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
> ---
>  main.h |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/main.h b/main.h
> index 464439f..3c58235 100644
> --- a/main.h
> +++ b/main.h
> @@ -210,6 +210,9 @@ static inline int compare_eth(const void *data1, const
> void *data2) /* Returns the smallest signed integer in two's complement
> with the sizeof x */ #define smallest_signed_int(x) (1u << (7u + 8u *
> (sizeof(x) - 1u))) 
> +/* Returns the biggest unsigned integer with the sizeof x */
> +#define biggest_unsigned_int(x) (~(x)0)
> +

The final conclusion of the IRC discussion might have escaped me but wasn't 
there supposed to be a cast somewhere ?

Regards,
Marek

  reply	other threads:[~2011-11-25  1:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 10:35 [B.A.T.M.A.N.] [PATCH] batman-adv: add biggest_unsigned_int(x) macro Antonio Quartulli
2011-11-25  1:08 ` Marek Lindner [this message]
2011-11-25  8:50   ` Sven Eckelmann
2011-11-25 10:53     ` Antonio Quartulli
2012-02-11 11:03 ` Marek Lindner

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=201111250908.48180.lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.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