[Cake] [PATCH 1/2] cake: print_uint format fixes

Kevin Darbyshire-Bryant kevin at darbyshire-bryant.me.uk
Fri Mar 16 04:02:28 EDT 2018



> On 12 Mar 2018, at 15:11, Stephen Hemminger <stephen at networkplumber.org> wrote:
> 
> On Mon, 12 Mar 2018 10:56:09 +0100
> Toke Høiland-Jørgensen <toke at toke.dk> wrote:
>> 
>> 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)

Submitted a patch to netdev but almost certainly did it wrong/based on wrong tree etc ‘cos I don’t normally inhabit that space. The quite simple attached patch restores corrrect functioning on my BE MIPS box.  Validation that the MANY calls to print_uint are using the correct type is left as an exercise for the reader :-)  But at least there’s no longer a hidden promotion from uint to uint_64t going on.


Cheers,

Kevin D-B

012C ACB2 28C6 C53E 9775  9123 B3A2 389B 9DE2 334A
-------------- next part --------------
An embedded message was scrubbed...
From: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
Subject: [PATCH] json_print: fix print_uint with helper type extensions
Date: Thu, 15 Mar 2018 20:07:20 +0000
Size: 8633
URL: <https://lists.bufferbloat.net/pipermail/cake/attachments/20180316/2f75465c/attachment.eml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://lists.bufferbloat.net/pipermail/cake/attachments/20180316/2f75465c/attachment.sig>


More information about the Cake mailing list