qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 1/2] slirp: remove duplicate definition
Date: Thu, 16 Feb 2012 00:02:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120129 Thunderbird/10.0

Am 15.02.2012 10:38, schrieb Michael S. Tsirkin:
> why does slirp have all these
> defines in the first place?
> 
> slirp/mbuf.h:#define m_nextpkt  m_hdr.mh_nextpkt
> slirp/mbuf.h:#define ifs_next m_nextpkt
> 
> Seriously, #define for a field name?

We have some such #defines in ibm8514 graphics card code, too (not yet
upstream). It is handy to make code match the datasheet while hiding
some of the implementation details, like two levels of array accesses
into implementation-defined-or-whatever registers.

Doesn't seem to apply here obviously. Maybe historically
m_hdr.mh_nextpkt was m_nextpkt and someone tried to avoid a full
refactoring.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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