On 02/07/2013 07:53 AM, Daniel P. Berrange wrote:
On Wed, Feb 06, 2013 at 10:10:17PM -0700, Eric Blake wrote:
> This makes code easier to read, by avoiding lines longer than
> 80 columns and removing the repetition from the callers.
>
How about putting these helpful APIs in some other src/util/ file
as macros. Either virutil.h, or perhaps virinttypes.h or virendian.h ?
Indeed, that would be nicer, because then it works on both 'char*' and
'unsigned char *' (don't know why virstoragefile uses unsigned, when
most of our other files use plain char).
Probably with a name like "virReadBufInt{32,64}{BE,LE}"
ACK to this patch regardless though.
I'll go ahead and post a v2, with a testsuite addition; it may be a
regression that I'm fixing, but I'd rather get it right than rushed.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org