From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoyFq-0007Rl-5V for qemu-devel@nongnu.org; Thu, 13 Nov 2014 12:32:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoyFk-0005RH-3Q for qemu-devel@nongnu.org; Thu, 13 Nov 2014 12:32:22 -0500 Received: from mail-bn1on0132.outbound.protection.outlook.com ([157.56.110.132]:8484 helo=na01-bn1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoyFj-0005Qi-Tv for qemu-devel@nongnu.org; Thu, 13 Nov 2014 12:32:16 -0500 From: Gary Hook Date: Thu, 13 Nov 2014 17:32:12 +0000 Message-ID: References: <5464E44C.4070609@redhat.com> In-Reply-To: <5464E44C.4070609@redhat.com> Content-Language: en-US Content-Type: text/plain; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" On 11/13/14, 11:03 AM, "Eric Blake" wrote: >On 11/13/2014 09:44 AM, Gary Hook wrote: > >[metacomment] > >> On 11/13/14, 6:46 AM, "Markus Armbruster" >>> wrote: >>=20 >> Stefan Hajnoczi > writes: >>=20 >> On Wed, Nov 12, 2014 at 06:48:18PM +0000, Gary Hook wrote: > >Your quoting style leaves a lot to be desired. While you correctly >attributed multiple contributors of the material quoted below... > >> - return qemu_ftell(f) - last_ftell; >> + delta_ftell =3D qemu_ftell(f) - last_ftell; >> + return( (delta_ftell > 0) ? 1 : (delta_ftell < 0) ? -1 : 0 ); >>=20 >> Good find! >>=20 >> Please don't nest the ternary operator, it is hard to read. >>=20 >> if (delta_ftell < 0) { >> return -1; >> } else if (delta_ftell > 0) { >> return 1; >> } else { >> return 0; >> } >>=20 >> Bah, that's for wimps ;) >>=20 >> return (delta_ftell > 0) - (delta_ftell < 0); >>=20 >> Look ma, no branches! >>=20 >> Ha-ha! Very good, but even less readable than the compressed ternary >>version, >> IMO. This function only gets called once per migration; I don't see a >>few branches as performance-critical and worth the sacrifice of clarity >>as to intent. > >...all three sets of contributions were listed with NO differentiation >in indentation or leading '>' or other indication which part was quoted >vs. which part was new material from you. Most people on this list use >a REAL mail agent (such as mutt or Thunderbird), and avoid web mail, >precisely because most web mail implementations are absolutely lousy at >writing decently threaded conversations. > >--=20 >Eric Blake eblake redhat com +1-919-301-3266 >Libvirt virtualization library http://libvirt.org Son of a=8A. You=B9re absolutely right. Outlook is not helping me out here= at all. Mea culpa. I never used to have this problem with xmh. I=B9ll pay more attention going forward.