From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjX9o-00008I-Ol for qemu-devel@nongnu.org; Mon, 03 Jun 2013 11:58:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjX9k-0005Ov-U7 for qemu-devel@nongnu.org; Mon, 03 Jun 2013 11:58:52 -0400 Received: from mail-qc0-x22f.google.com ([2607:f8b0:400d:c01::22f]:64976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjX9k-0005Or-QC for qemu-devel@nongnu.org; Mon, 03 Jun 2013 11:58:48 -0400 Received: by mail-qc0-f175.google.com with SMTP id a1so2276803qcx.34 for ; Mon, 03 Jun 2013 08:58:48 -0700 (PDT) Sender: Richard Henderson Message-ID: <51ACBD31.70100@twiddle.net> Date: Mon, 03 Jun 2013 08:58:41 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1370193044-24535-1-git-send-email-peter.maydell@linaro.org> <51ACB313.60007@twiddle.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: Allow getdents to be provided by getdents64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Riku Voipio , Claudio Fontana , qemu-devel@nongnu.org, patches@linaro.org On 06/03/2013 08:45 AM, Peter Maydell wrote: >>> >> + /* The target_dirent type is in what was formerly a padding >>> >> + * byte at the end of the structure: >>> >> + */ >>> >> + *(((char *)tde) + treclen - 1) = type; >> > >> > Maybe easier to read as >> > >> > ((char *)tde)[treclen - 1] = type >> > >> > ? > Dunno. It's not actually a char array, so I kind of prefer > to use plain pointer arithmetic for this kind of thing. Then drop the unnecessary parenthesis *((char *)tde + trelen - 1) = type; ? r~