From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0051.outbound.protection.outlook.com [104.47.2.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 1B65C3CB61 for ; Mon, 12 Mar 2018 17:44:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=darbyshire-bryant.me.uk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Ejdjq1idOpAEiENj9TcMEClA8sCT0sM4M1ecC2NhO1Q=; b=vVHoAu7s3dAMdTYtJLQ/T23UsTzyrD3eUudW3fYd1mtl0kkthqfFrnbpZr8/SjTCiD/kcvryzns1R6bIcmLVD8Oy4bNmjT/J8OwFrx1qkSoBtihMhus0mU71ozvPhZjrYv+6jsPv9lG8r4hnuefQN7ZK76R/zYWUiSwTRWjEIME= Received: from AM0PR0702MB3730.eurprd07.prod.outlook.com (52.133.51.23) by AM0PR0702MB3668.eurprd07.prod.outlook.com (52.133.50.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.7; Mon, 12 Mar 2018 21:44:12 +0000 Received: from AM0PR0702MB3730.eurprd07.prod.outlook.com ([fe80::a95a:1cfd:7299:5172]) by AM0PR0702MB3730.eurprd07.prod.outlook.com ([fe80::a95a:1cfd:7299:5172%3]) with mapi id 15.20.0588.013; Mon, 12 Mar 2018 21:44:12 +0000 From: Kevin Darbyshire-Bryant To: =?utf-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= CC: Stephen Hemminger , "cake@lists.bufferbloat.net" Thread-Topic: [Cake] [PATCH 1/2] cake: print_uint format fixes Thread-Index: AQHTuRokH3ZxhvG1+E+9XF/3TwBMk6PLgtCAgAAWnYCAABdXgIAApg6AgAAHqoCAAFgqAIAAB24AgABmOoA= Date: Mon, 12 Mar 2018 21:44:12 +0000 Message-ID: References: <20180311091930.86264-1-ldir@darbyshire-bryant.me.uk> <20180311091930.86264-2-ldir@darbyshire-bryant.me.uk> <87bmfujq18.fsf@toke.dk> <5DD63A68-EE32-4A5C-B08E-019FB8CBC9B1@darbyshire-bryant.me.uk> <20180311163423.2e8d63b6@xeon-e3> <874lllk47a.fsf@toke.dk> <20180312081142.0a9da85c@xeon-e3> <87sh95b8yd.fsf@toke.dk> In-Reply-To: <87sh95b8yd.fsf@toke.dk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=kevin@darbyshire-bryant.me.uk; x-originating-ip: [2a02:c7f:1232:22b::dc83] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0702MB3668; 7:Vjn0Zz4GNNwq1O0f2QxLqN0Duhi4bkYVlR4+lxv+l/q3s43+twt8CtgSmQ+QGBpE1PR4ElFHd2GVD/JbXNB+VYzL6F202zmyOhIRyf5vzPryPPyYNm5khIvZIWusJIHz4+KhIjrmWaJ0iUlzKfhf4Mgx5ysfgU1Q1XD8w7+mO/Fns1L3h0UTtIFJ2I+Zv51O1wLRVyBCslu4r34X47Df0LgcE6G8cvcvA+TBf1RTE9GeDTeNqghiId7wXErlPrdO x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 6ea40895-6fd6-4801-b63f-08d5886264c2 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4604075)(3008032)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(49563074)(7193020); SRVR:AM0PR0702MB3668; x-ms-traffictypediagnostic: AM0PR0702MB3668: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(102415395)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501244)(52105095)(10201501046)(93006095)(93001095)(3002001)(6041310)(2016111802025)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6043046)(6072148)(201708071742011); SRVR:AM0PR0702MB3668; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0702MB3668; x-forefront-prvs: 06098A2863 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(39830400003)(376002)(346002)(396003)(189003)(199004)(105586002)(36756003)(102836004)(74482002)(33656002)(54906003)(68736007)(7736002)(6486002)(6436002)(186003)(305945005)(8676002)(53546011)(478600001)(81156014)(6506007)(81166006)(2950100002)(76176011)(106356001)(6916009)(2900100001)(3660700001)(8936002)(99286004)(14454004)(97736004)(229853002)(2906002)(25786009)(86362001)(99936001)(316002)(5250100002)(6512007)(6246003)(5660300001)(83716003)(46003)(3280700002)(53936002)(82746002)(93886005)(6116002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0702MB3668; H:AM0PR0702MB3730.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: darbyshire-bryant.me.uk does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6rjlTRt+K4YmEDBiNAFG5ejULmpS+ppGr3On/Lidr8xEM+1aJ5LI9Wlx19Daa+rO9JA/+S86hbW6LUTaWint1XBhhsLe+uM6cBiio5RiTOi3ZutFbPO/X39nqY2aMSta+SbwdU0nqE5XNAiv6r6kX73e/govrEqeWWRvFP1faXYKgtVjyobsSCcz99tEK4RzRWz1cOpT0lxruTV7LMULHmH63oH4fFOYtJ7qqjaujneh4nqQVNEqyDay3r5eBeo4QcZ5/mXh6mmSVddlMFMiBUros3yTfCq1QI+HkCyqvHo/kLXoo3s84Oac/tBkdyyy53bKOIUjkW67/sHwkQsCPw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/signed; boundary="Apple-Mail=_88C7F083-C571-48AD-B775-3F86DC01F09B"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 X-OriginatorOrg: darbyshire-bryant.me.uk X-MS-Exchange-CrossTenant-Network-Message-Id: 6ea40895-6fd6-4801-b63f-08d5886264c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2018 21:44:12.0822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9151708b-c553-406f-8e56-694f435154a4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0702MB3668 Subject: Re: [Cake] [PATCH 1/2] cake: print_uint format fixes X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 21:44:14 -0000 --Apple-Mail=_88C7F083-C571-48AD-B775-3F86DC01F09B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 12 Mar 2018, at 15:38, Toke H=C3=B8iland-J=C3=B8rgensen = wrote: >=20 > Stephen Hemminger writes: >=20 >>>> Using the =E2=80=98PRId64=E2=80=99 macro won=E2=80=99t work because = print_int is using =E2=80=98int=E2=80=99 >>>> type internally whereas print_uint uses =E2=80=98uint64_t=E2=80=99 = internally. So the >>>> format string has to have knowledge of the internal format, *but* >>>> there=E2=80=99s no clue of the difference in internal format = offered by the >>>> function name i.e. print_int vs print_uint. >>>>=20 >>>> I=E2=80=99d 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. >>>=20 >>> Yes, this was basically what I meant by "grating"; I really do agree >>> that this API is confusing. >>>=20 >>> 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? :) >>>=20 >>> -Toke >>=20 >> I agree print_int should take int, print_uint should take unsigned >> int, and there should be print_u64 (and print_u32, print_u8) >=20 > Cool. Kevin, do you feel like submitting a patch? :) >=20 > -Toke I=E2=80=99m in full on $paidwork broadcast sound supervisor mode for the = next 4 days, so it won=E2=80=99t 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 --Apple-Mail=_88C7F083-C571-48AD-B775-3F86DC01F09B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEASyssijGxT6XdZEjs6I4m53iM0oFAlqm9KsACgkQs6I4m53i M0qwPg//fZuoxNcZORpssuhcHkh2fzd+SFFrbdw4R4zHH53UTqYZhsiHIPhfDNO8 emqERhXMOTQaKBxigiB0uIRVXTwbHteiGsUXYGGjn0VM0wklHRvGCS2S4+gCblnh b1MmQAVVQsqWJ53SSW1pgcbOAma4Yw2nFhinex8zyNu0SYvNW4MJ7vrkuq3h3AC+ xWHgE2wzULFNR2COw8i2f1/ny/JTR6mh7UlUTV7MrGm6S8yNQn6l+KluXHcmcnP7 qEgRISy7L8F635iq8C7Yb8K/pd8gcTufx2hsNsg8VsHtSjaxNLLdbxz5mpgjmEdY IQE4I2knTsREcIJdylrGieYBIUm8k6t1TDCBM3LuFc7C7bG26UY7Bmivx7FCG55M eMIhrO0FjBg42FVp/SDK5/PnsVhcmGsEhnEkb3CALsusf6p5k7EAZcyVmeH9Kwp0 70xxiYExUMF1P5f9Ng7QRN8ZW1hmEX8d4dCaYJyNbIAZQ69YSQGak5yrZAuk7Bmb qU0aHi6WzyvP9gFeLX+OUhlsmbCttgLwmQJJ2AFZ6NQa8/eQeI3T5X+UvlbYsVu1 3lo78X3+uadaWBeFi/a3qXYS08JqEnuGrqfA1tk7GMhtnj2rLOZKuaBeN+4jBDRE /maU/q9hautt7yXhupbDKy+c01D2PVYhUo0EtsS64fg0oZviwvI= =yvr+ -----END PGP SIGNATURE----- --Apple-Mail=_88C7F083-C571-48AD-B775-3F86DC01F09B--