From owner-freebsd-arch@FreeBSD.ORG Thu Dec 19 20:13:23 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72AF78F3 for ; Thu, 19 Dec 2013 20:13:23 +0000 (UTC) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2E55114FD for ; Thu, 19 Dec 2013 20:13:23 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id i8so1430689qcq.10 for ; Thu, 19 Dec 2013 12:13:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=hvpG9POKCXRXXNsoLgs3fvgRtC1xEcNRJapF+0gVDXs=; b=D+5+cB3rqSDHT5wDNuOw0Nk+ga9UOrzZh8mvU8FwKfgWMOO5MvKU7QOefwp4VG4yVG unmsqFJHJwDR/rlHocnqFIqLb/L6CK/mgQZ4mCQm631nBWzb+B/6qS/ld3oeXLJGbRBu RpLpJyoGX7JbWo+yxGtMNhvoPE6tpUVdCcBvV+EPI6r0KJLqifAD9H5pUDbZbGEvRnq+ 0tdc4H3E6l7hK9ZFDpaRPZc4b/DSaFTlZET5VysLlzoNvN2JEIFn2dZxf2rWIc9DbZgs i19A6e/7/ZiY5Ebc2KjUvKWEcdvS4ugemKqbYjiRhgGVonk0D8o3qonmliPYZvuJYuzE Fo/w== MIME-Version: 1.0 X-Received: by 10.49.34.207 with SMTP id b15mr6605384qej.49.1387484002341; Thu, 19 Dec 2013 12:13:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Thu, 19 Dec 2013 12:13:22 -0800 (PST) In-Reply-To: <20131219154839.T23018@besplex.bde.org> References: <9C1291B5-215B-440E-B8B0-6308840F755C@bsdimp.com> <20131219154839.T23018@besplex.bde.org> Date: Thu, 19 Dec 2013 12:13:22 -0800 X-Google-Sender-Auth: K2Byp-VTHFx_0PuVgrTUVwCxw5g Message-ID: Subject: Re: Using sys/types.h types in sys/socket.h From: Adrian Chadd To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 20:13:23 -0000 On 18 December 2013 21:20, Bruce Evans 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