From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philippe Gerum In-Reply-To: <4DCA52E8.80904@domain.hid> References: <1183078C0D064042B3AD2D03E3859EF174E31A@AREXCH02.mra.roland-man.biz> <1303849652.1961.7.camel@domain.hid> <1183078C0D064042B3AD2D03E3859EF174E3E4@domain.hid> <1183078C0D064042B3AD2D03E3859EF174E43D@AREXCH02.mra.roland-man.biz> <1303940558.1932.33.camel@domain.hid> <1183078C0D064042B3AD2D03E3859EF174E5BC@AREXCH02.mra.roland-man.biz> <1183078C0D064042B3AD2D03E3859EF174E826@domain.hid> <4DBFE062.3020902@domain.hid> <1183078C0D064042B3AD2D03E3859EF174E87B@AREXCH02.mra.roland-man.biz> <4DC03CE8.4050608@domain.hid> <1183078C0D064042B3AD2D03E3859EF174E92F@AREXCH02.mra.roland-man.biz> <4DC0F4E0.2070707@domain.hid> <1183078C0D064042B3AD2D03E3859EF174EA21@domain.hid> <4DC25C69.5020001@domain.hid> <1183078C0D064042B3AD2D03E3859EF174ECBA@AREXCH02.mra.roland-man.biz> <4DCA52E8.80904@domain.hid> Content-Type: text/plain; charset="UTF-8" Date: Wed, 11 May 2011 11:20:44 +0200 Message-ID: <1305105644.2098.17.camel@domain.hid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] message pipe message boundaries List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org, dietmar.schindler@domain.hid On Wed, 2011-05-11 at 11:12 +0200, Gilles Chanteperdrix wrote: > On 05/09/2011 09:36 AM, dietmar.schindler@domain.hid wrote: > >> From: Gilles Chanteperdrix > >> [mailto:gilles.chanteperdrix@xenomai.org] Sent: Thursday, May 05, > >> 2011 10:15 AM ... You can provide the readv implementation, and > >> implement read in terms of readv by passing an iovec with just one > >> buffer. Please also try and make the code a bit more readable than > >> in the previous patch, with only one statement and one "if" by > >> line. > > > > Hello, > > > > thank you for your suggestions. I now remade the patch accordingly. > > If you have further improvements to suggest, please let me know. > > I am sorry to ask you to change your patch again, but the loop is quite > hard to understand. It would be nice if you could use a simple loops > which copies the pieces of the iovec. So, maybe use two nested loops. > Also, let's avoid constructs like these: > buf = iovec->iov_base, count = iovec++->iov_len; Disk space is cheap so we can afford a few more characters per line; however, engineering time for tracking down issues introduced by obfuscated code is expensive. In short, one executable statement per line is desired, our code should have nothing to hide. -- Philippe.