2011-01-11 12:57:42

by Joerg

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] iw: Add channel busy time to survey

Johannes Berg <johannes@...> writes:
> because uint64_t isn't guaranteed to be unsigned long long (in fact, it
> is unsigned long on many machines). Please look at the commit and check.

In the commit you did a cast to unsigned long long. While this works, it's
depends on gcc-ism, e.g. long long support. The C99 way would be to use the
PRIu64 macro (see stdint.h).
see http://www.dinkumware.com/manuals/?manual=compleat&page=inttypes.html#PRIu64



2011-01-11 13:00:38

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] iw: Add channel busy time to survey

On Tue, 2011-01-11 at 12:57 +0000, jpo234 wrote:
> Johannes Berg <johannes@...> writes:
> > because uint64_t isn't guaranteed to be unsigned long long (in fact, it
> > is unsigned long on many machines). Please look at the commit and check.
>
> In the commit you did a cast to unsigned long long. While this works, it's
> depends on gcc-ism, e.g. long long support. The C99 way would be to use the
> PRIu64 macro (see stdint.h).
> see http://www.dinkumware.com/manuals/?manual=compleat&page=inttypes.html#PRIu64

Oi, that's complicated. Patch welcome I guess.

johannes