From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42625 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwbXj-0005TT-DR for qemu-devel@nongnu.org; Mon, 07 Mar 2011 09:36:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwbXi-0006eR-Ak for qemu-devel@nongnu.org; Mon, 07 Mar 2011 09:36:15 -0500 Received: from mail-yi0-f45.google.com ([209.85.218.45]:47871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwbXi-0006eD-7P for qemu-devel@nongnu.org; Mon, 07 Mar 2011 09:36:14 -0500 Received: by yib19 with SMTP id 19so2037346yib.4 for ; Mon, 07 Mar 2011 06:36:13 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D74E364.6010301@codemonkey.ws> References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> <1299460984-15849-12-git-send-email-aliguori@us.ibm.com> <4D74E364.6010301@codemonkey.ws> Date: Mon, 7 Mar 2011 14:36:13 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 11/22] qapi: add signal support to core QMP server From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Adam Litke , Anthony Liguori , Markus Armbruster , Luiz Capitulino On Mon, Mar 7, 2011 at 1:53 PM, Anthony Liguori wro= te: > On 03/07/2011 07:21 AM, Stefan Hajnoczi wrote: >> >> On Mon, Mar 7, 2011 at 1:22 AM, Anthony Liguori >> =A0wrote: >> >>> >>> diff --git a/qmp-core.h b/qmp-core.h >>> index e3235ec..5ce02f7 100644 >>> --- a/qmp-core.h >>> +++ b/qmp-core.h >>> @@ -21,10 +21,65 @@ typedef struct QmpState QmpState; >>> =A0typedef void (QmpCommandFunc)(const QDict *, QObject **, Error **); >>> =A0typedef void (QmpStatefulCommandFunc)(QmpState *qmp__sess, const QDi= ct >>> *, QObject **, Error **); >>> >>> +typedef struct QmpSlot >>> +{ >>> + =A0 =A0int handle; >>> + =A0 =A0void *func; >>> >> >> This should be a void (*func)() > > Technically void (*)() is an obsolete type in standard C. > > I can switch to void (*)(void) but it requires casting and requires a > typeof() :-/ You're right, void (*)(void) is the proper form for a general function pointer. I think doing this in a portable way is worthwhile. Stefan