From owner-freebsd-arch@FreeBSD.ORG Wed Jan 8 22:33:25 2014 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 628341B4; Wed, 8 Jan 2014 22:33:25 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C94718A3; Wed, 8 Jan 2014 22:33:24 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id i13so2405064qae.10 for ; Wed, 08 Jan 2014 14:33:24 -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=nzaS7v5o5DPdNGE84gP+rB1UnZ91v4naZlCzfBkP9g8=; b=rknExIOjchYm9aQ73N1w56AHytuevrOCNZvEfpLb1nsVQNiQqnBvWTpFICSbrDHc9Q SFr8fmISmkOVFCiasffIyh4Euto4dATPRRlfsQHvWxoVFytNhxJagUpdchG6xPhWYUks XF6cB6Mhl9vk28XdgZ2xVtfy+jBT7tBFjDkWE/LjOyfIBkrWblHZG0TdgFQ/cYm18mou a/D2062uUim3spWeHD2Fb+FYBtdQNuJfdad2wKlT/wbxMfnS4VOW4vMnW0QhiYAURSUl iP3qfZaMD2e7j7MMRJw6Rf3+WCND/83p4iaItaVZQJpl2SUmJxzL+eOw+ylfh8IGwcdg OVEQ== MIME-Version: 1.0 X-Received: by 10.49.34.207 with SMTP id b15mr215096273qej.49.1389220404295; Wed, 08 Jan 2014 14:33:24 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Wed, 8 Jan 2014 14:33:24 -0800 (PST) In-Reply-To: <20140109092602.M957@besplex.bde.org> References: <9C1291B5-215B-440E-B8B0-6308840F755C@bsdimp.com> <5821DA91-E9C7-4D1A-A108-63E74CFF1FC5@bsdimp.com> <20140108152632.L969@besplex.bde.org> <20140109092602.M957@besplex.bde.org> Date: Wed, 8 Jan 2014 14:33:24 -0800 X-Google-Sender-Auth: gxLNyTPVNvtVoVDduQHyEwGXJHI 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: Bruce Evans , "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: Wed, 08 Jan 2014 22:33:25 -0000 On 8 January 2014 14:29, Bruce Evans wrote: > On Wed, 8 Jan 2014, Adrian Chadd wrote: > >> On 7 January 2014 20:48, Bruce Evans 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? -a