Date: Fri, 10 Jan 2014 22:38:20 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Adrian Chadd <adrian@FreeBSD.org> Cc: "freebsd-arch@freebsd.org" <freebsd-arch@FreeBSD.org> Subject: Re: Using sys/types.h types in sys/socket.h Message-ID: <20140110222640.F2338@besplex.bde.org> In-Reply-To: <CAJ-VmoncQm2KWjhhAHhArkSGR-wQOxhYeNxzp15R0h5UffQhzA@mail.gmail.com> References: <CAJ-Vmo=MWPQWfP9duWPPwaKee5Zp9Gemj3GKqE8=bxkjn_1YYA@mail.gmail.com> <9C1291B5-215B-440E-B8B0-6308840F755C@bsdimp.com> <CAJ-Vmom3FQOb1ZQTwbmbSiT90N6tmKOoPg8JPQAapkJg2TXqFA@mail.gmail.com> <5821DA91-E9C7-4D1A-A108-63E74CFF1FC5@bsdimp.com> <20140108152632.L969@besplex.bde.org> <CAJ-VmonemTxS6zvdGU_SvOtnV3bzJ-rKtJcrTEfJ_NY3u7kndA@mail.gmail.com> <20140109092602.M957@besplex.bde.org> <CAJ-VmoncQm2KWjhhAHhArkSGR-wQOxhYeNxzp15R0h5UffQhzA@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
On Wed, 8 Jan 2014, Adrian Chadd wrote:
> On 8 January 2014 14:29, Bruce Evans <brde@optusnet.com.au> wrote:
>> On Wed, 8 Jan 2014, Adrian Chadd wrote:
>>
>>> On 7 January 2014 20:48, Bruce Evans <brde@optusnet.com.au> wrote:
>>>>
>>>> Style(9) specifies sorting by size first (it actually mean by alignment
>>>> first). That is not very easy since the size^Walignment of typedefed
>>>> types should be opaque. In practice, assuming what it is mostly gives
>>>> correct results. It gives exactly the opposite of the above:
>>>>
>>>> N-bit u_int holding ptr
>>>> M-bit pointer /* assume M <= N and alignment == size */
>>>> 32-bit u_int (can spell it u_int, not uint32_t, to pack better with
>>>> int)
>>>> 32-bit int /* assume plain int gives this */
>>>
>>>
>>> So:
>>>
>>> /*
>>> * sendfile(2) kqueue information
>>> */
>>> struct sf_hdtr_kq {
>>> uintptr_t kq_ident; /* ident (from userland?) */
>>> void *kq_udata; /* user data pointer */
>>> uint32_t kq_flags; /* extra flags to pass in */
>>> int kq_fd; /* kq fd to post completion events on */
>>> };
>>>
>>> ?
>>
>>
>> Also fix the indentation (use 1 tab after 'void' and 'int' and not the
>> allowed ugliness of 2 tabs after all type names).
>>
>> Bruce
>
> /*
> * sendfile(2) kqueue information
> */
> struct sf_hdtr_kq {
> __uintptr_t kq_ident; /* ident (from userland?) */
> void *kq_udata; /* user data pointer */
> __uint32_t kq_flags; /* extra flags to pass in */
> int kq_fd; /* kq fd to post completion events on */
> };
>
> Ok, so I've removed one tab from the comments and added a tab after void/int.
>
> How's that?
Now the last comment is misindented.
This also has the unrelated change of using __ufoo instead of ufoo. I
think that is only correct if the types are supposed to be almost opaque,
with the details not part of the API.
Bruce
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140110222640.F2338>
