qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in io


From: Michael Tokarev
Subject: Re: [Qemu-devel] [PATCHv4 09/11] export iov_send_recv() and use it in iov_send() and iov_recv()
Date: Fri, 16 Mar 2012 20:43:08 +0400
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20120216 Icedove/8.0

On 16.03.2012 20:21, Anthony Liguori wrote:
> On 03/15/2012 04:00 PM, Michael Tokarev wrote:
[]
>> +ssize_t iov_send_recv(int sockfd, struct iovec *iov,
>> +                      size_t offset, size_t bytes, bool do_send);
>> +#define iov_recv(sockfd, iov, offset, bytes) \
>> +  iov_send_recv(sockfd, iov, offset, bytes, false)
>> +#define iov_send(sockfd, iov, offset, bytes) \
>> +  iov_send_recv(sockfd, iov, offset, bytes, true)
> 
> Please use a static inline instead of a macro.  Macros make compiler 
> errors/warnings confusing.

Macros are good when used properly, and this is one of examples
of good usage: no confusion in this case.

An example of really confusing macro which were accepted recently
is qemu_recv, which not only makes errors/warning confusing, but
also makes type checking impossible.

I can change these into inline functions, but that just takes
much more lines of "code" and more difficult to see what it
does.

Thanks,

/mjt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]