From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
"cake@lists.bufferbloat.net" <cake@lists.bufferbloat.net>
Subject: Re: [Cake] [PATCH 1/2] cake: print_uint format fixes
Date: Mon, 12 Mar 2018 21:44:12 +0000 [thread overview]
Message-ID: <CA852957-9B24-461C-90EC-AC920580B347@darbyshire-bryant.me.uk> (raw)
In-Reply-To: <87sh95b8yd.fsf@toke.dk>
[-- Attachment #1: Type: text/plain, Size: 1580 bytes --]
> On 12 Mar 2018, at 15:38, Toke Høiland-Jørgensen <toke@toke.dk> wrote:
>
> Stephen Hemminger <stephen@networkplumber.org> writes:
>
>>>> Using the ‘PRId64’ macro won’t work because print_int is using ‘int’
>>>> type internally whereas print_uint uses ‘uint64_t’ internally. So the
>>>> format string has to have knowledge of the internal format, *but*
>>>> there’s no clue of the difference in internal format offered by the
>>>> function name i.e. print_int vs print_uint.
>>>>
>>>> I’d argue it makes more sense to have: print_int/print_uint as the
>>>> native int length, that hopefully match up with %u & %d and then have
>>>> print_int64/print_uint64 where use of formats PRId64 & PRIu64 is
>>>> advised.
>>>
>>> Yes, this was basically what I meant by "grating"; I really do agree
>>> that this API is confusing.
>>>
>>> Stephen, would you accept patches to fix the API (to add
>>> print_{u,}int64() variants and turn print_uint() into native-int size)?
>>> Or should we stick with the API currently there and live with the
>>> inconsistency? :)
>>>
>>> -Toke
>>
>> I agree print_int should take int, print_uint should take unsigned
>> int, and there should be print_u64 (and print_u32, print_u8)
>
> Cool. Kevin, do you feel like submitting a patch? :)
>
> -Toke
I’m in full on $paidwork broadcast sound supervisor mode for the next 4 days, so it won’t be done in a screaming rush.
Talk about patch feature creep ;-)
Cheers,
Kevin D-B
012C ACB2 28C6 C53E 9775 9123 B3A2 389B 9DE2 334A
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-03-12 21:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-11 9:19 [Cake] fixing tc cake output since json-ification Kevin Darbyshire-Bryant
2018-03-11 9:19 ` [Cake] [PATCH 1/2] cake: print_uint format fixes Kevin Darbyshire-Bryant
2018-03-11 20:49 ` Toke Høiland-Jørgensen
2018-03-11 22:10 ` Kevin Darbyshire-Bryant
2018-03-11 23:34 ` Stephen Hemminger
2018-03-12 9:28 ` Kevin Darbyshire-Bryant
2018-03-12 9:56 ` Toke Høiland-Jørgensen
2018-03-12 15:11 ` Stephen Hemminger
2018-03-12 15:38 ` Toke Høiland-Jørgensen
2018-03-12 21:44 ` Kevin Darbyshire-Bryant [this message]
2018-03-16 8:02 ` Kevin Darbyshire-Bryant
2018-03-17 14:33 ` Toke Høiland-Jørgensen
2018-03-11 9:19 ` [Cake] [PATCH 2/2] tc " Kevin Darbyshire-Bryant
2018-03-11 20:50 ` Toke Høiland-Jørgensen
2018-03-11 20:57 ` Kevin Darbyshire-Bryant
2018-03-11 21:22 ` Toke Høiland-Jørgensen
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://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA852957-9B24-461C-90EC-AC920580B347@darbyshire-bryant.me.uk \
--to=kevin@darbyshire-bryant.me.uk \
--cc=cake@lists.bufferbloat.net \
--cc=stephen@networkplumber.org \
--cc=toke@toke.dk \
/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