From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6899 invoked by alias); 14 Jan 2014 15:06:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6888 invoked by uid 89); 14 Jan 2014 15:06:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Jan 2014 15:06:27 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0EF6OiJ030868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Jan 2014 10:06:24 -0500 Received: from barimba (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0EF6MDE022839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 14 Jan 2014 10:06:23 -0500 From: Tom Tromey To: Joel Brobecker Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [RFC 03/32] introduce async_callback_ftype References: <1389640367-5571-1-git-send-email-tromey@redhat.com> <1389640367-5571-4-git-send-email-tromey@redhat.com> <52D512FB.7010006@redhat.com> <20140114105012.GF4762@adacore.com> Date: Tue, 14 Jan 2014 15:06:00 -0000 In-Reply-To: <20140114105012.GF4762@adacore.com> (Joel Brobecker's message of "Tue, 14 Jan 2014 14:50:12 +0400") Message-ID: <87a9eyy55d.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-01/txt/msg00445.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> I think it would be nice if the arguments were named, giving us more Joel> tools to better document the intended behavior of this callback. It's Joel> also a way to help implementors to choose consistent names for those Joel> parameters. As for the documentation, unless completely trivial, it Joel> seems reasonable to me to leave that for later, or even someone else! How about this? /* The type of the callback to the to_async method. */ typedef void async_callback_ftype (enum inferior_event_type event_type, void *context); "context" is used in several places related to this. OTOH the only non-NULL function pointer ever passed to to_async is 'inferior_event_handler', which names the second argument "client_data". I found them equally clear; particularly once I noticed that all existing calls pass context==NULL :) As for documentation, I think the docs should be comments before each to_* method. target.h has been laxly maintained in this regard. Tom