From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuSyQ-0001LK-Fa for qemu-devel@nongnu.org; Thu, 26 Jul 2012 14:39:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuSyH-00065y-V4 for qemu-devel@nongnu.org; Thu, 26 Jul 2012 14:39:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuSyH-00065j-Md for qemu-devel@nongnu.org; Thu, 26 Jul 2012 14:39:37 -0400 Date: Thu, 26 Jul 2012 13:52:41 -0300 From: Luiz Capitulino Message-ID: <20120726135241.22fba82c@doriath.home> In-Reply-To: <877gtqv76u.fsf@blackfin.pond.sub.org> References: <1343235256-26310-1-git-send-email-lcapitulino@redhat.com> <1343235256-26310-11-git-send-email-lcapitulino@redhat.com> <87mx2md9db.fsf@blackfin.pond.sub.org> <20120726115027.2ac4eaab@doriath.home> <877gtqv76u.fsf@blackfin.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/11] qerror: switch to qapi generated error macros and table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Thu, 26 Jul 2012 18:05:45 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Thu, 26 Jul 2012 13:56:00 +0200 > > Markus Armbruster wrote: > > > >> Luiz Capitulino writes: > >> > >> > Previous commits added qapi infrastructure to automatically generate > >> > qerror macros and the qerror table from qapi-schema-errors.json. > >> > > >> > This commit drops the current error macros from qerror.h and the error > >> > table from qerror.c and use the generated ones instead. > >> > > >> > Please, note that qapi-error.c is actually _included_ by qerror.c. > >> > This is hacky, but the alternative is to make the table private to > >> > qapi-error.c and generate functions to return table entries. I think that > >> > doesn't pay much off. > >> > >> Functions? Why can't you simply put > >> > >> const QErrorStringTable qerror_table[NUMBER_OF_ERRORS]; > >> > >> into qapi-errors.h? > > > > Because it's included by qerror.h, which is included by several files. > > And what harm does the declaration of qerror_table[] to those files? We want to restrict qerror stuff as much as we can. Having it on a header that's used by several files goes against that. However, we just had a discussion on irc about not having the schema, so this patch is probably going to change. PS: Anthony will send a summary of the discussion to the list later. > > > I don't like much the idea of including a .c file, but on the other hand > > it's only included by qerror.c and qerror.c will probably die in the > > near future. > > > >> > >> With a literal number instead of NUMBER_OF_ERRORS. If you suffer from > >> literal-phobia, you can also #define it instead. >