Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2013 12:13:22 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Using sys/types.h types in sys/socket.h
Message-ID:  <CAJ-VmonALyNFQx1MH2CpjPz7gcTp3fpAqxi-T%2BZFPN=tbXYMxg@mail.gmail.com>
In-Reply-To: <20131219154839.T23018@besplex.bde.org>
References:  <CAJ-Vmo=MWPQWfP9duWPPwaKee5Zp9Gemj3GKqE8=bxkjn_1YYA@mail.gmail.com> <9C1291B5-215B-440E-B8B0-6308840F755C@bsdimp.com> <CAJ-Vmokb-gcO%2BrEOn-uc42%2BPHzMMQsqBe0NcVtuNRKk7vuM5Qw@mail.gmail.com> <CAJ-Vmom%2BXMZgdKds88id9vhQar=P-bF3UpUFzk4E3KWUw%2BQacQ@mail.gmail.com> <20131219154839.T23018@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 18 December 2013 21:20, Bruce Evans <brde@optusnet.com.au> wrote:
> On Wed, 18 Dec 2013, Adrian Chadd wrote:
>
>> Ok, how about this:
>>
>> Index: sys/sys/socket.h
>> ===================================================================
>> --- sys/sys/socket.h    (revision 259475)
>> +++ sys/sys/socket.h    (working copy)
>> @@ -84,6 +84,16 @@
>> #endif
>> #endif
>>
>> +#ifndef _UINT32_T_DECLARED
>> +#define        _UINT32_T_DECLARED
>> +typedef __uint32_t     uint32_t;
>> +#endif
>> +
>> +#ifndef _UINTPTR_T_DECLARED
>> +#define _UINTPTR_T_DECLARED
>> +typedef __uintptr_t    uintptr_t;
>> +#endif
>> +
>> /*
>>  * Types
>>  */
>
>
> This seems to be correct, except the tab after the second #define is
> corrupt.  Actually, all the tabs are corrupt, but the first #define
> apparently started with a tab whose corruption made a larger mess.

I can tidy them up in a follow-up commit.

> imp@ said, in a message that should have been killfiled due to top posting,
> that this should be under __BSD_VISIBLE.  That isn't strictly necessary,
> since POSIX allows names ending with _t, and it isn't very important for
> avoiding pollution since there aren't very many of them.

Ok, so just to be clear - uintptr_t and uint32_t should both be within
__BSD_VISIBLE blocks?

Just for my own personal information - why are these and not others
within blocks?

>
>> @@ -577,11 +587,27 @@
>> };
>>
>> /*
>> + * sendfile(2) kqueue information
>> + */
>> +struct sf_hdtr_kq {
>> +       int kq_fd;              /* kq fd to post completion events on */
>> +       int kq_fd;              /* kq fd to post completion events on */
>> +       uint32_t kq_flags;      /* extra flags to pass in */
>> +       void *kq_udata;         /* user data pointer */
>> +       uintptr_t kq_ident;     /* ident (from userland?) */
>> +};
>
>
> kq_fd is duplicated.

Mis-merge; I'll fix this later.

> All of the indentation is wrong and has corrupt tabs, except the first
> level only has corrupt tabs.
>
> This should be:
>
> struct sf_hdtr_kq {
>
>         int     kq_fd;          /* kq fd to post completion events on */
>         uint32_t kq_flags;      /* extra flags to pass in */
>         void    *kq_udata;      /* user data pointer */
>         uintptr_t kq_ident;     /* ident (from userland?) */
> };
>
> I strongly disagree with indenting everything N extra levels (where N > 1;
> N = 2 here for the name fields) to line up the fields.  I disagree with
> indenting the name fields by 1 space extra to line them up after adding
> a '*' before a few fields.  It's hard enough to keep the style consistent
> without following this fancy style.

Ok, I'll attempt to correct all this stuff in a follow-up email.

Thanks!



-a



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmonALyNFQx1MH2CpjPz7gcTp3fpAqxi-T%2BZFPN=tbXYMxg>