From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S319k-0000nh-KQ for qemu-devel@nongnu.org; Thu, 01 Mar 2012 03:14:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S319M-0003OU-5H for qemu-devel@nongnu.org; Thu, 01 Mar 2012 03:14:32 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51618 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S319L-0003Nv-VD for qemu-devel@nongnu.org; Thu, 01 Mar 2012 03:14:08 -0500 Message-ID: <4F4F2FCB.20605@suse.de> Date: Thu, 01 Mar 2012 09:14:03 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <4F4DBD19.1040501@samsung.com> <4F4DCCEA.4090303@msgid.tls.msk.ru> <20120229090547.GA80051@cs.nctu.edu.tw> In-Reply-To: <20120229090547.GA80051@cs.nctu.edu.tw> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] QOM: why "klass" used instead of "class" ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?6Zmz6Z+L5Lu7?= Cc: Michael Tokarev , qemu-devel@nongnu.org, Evgeny Voevodin , Dmitry Solodkiy Am 29.02.2012 10:05, schrieb =E9=99=B3=E9=9F=8B=E4=BB=BB: > On Wed, Feb 29, 2012 at 10:59:54AM +0400, Michael Tokarev wrote: >> On 29.02.2012 09:52, Evgeny Voevodin wrote: >>> include/qemu/object.h: >> [] >>> * void my_device_class_init(ObjectClass *klass, void *class_data) >>> * { >>> * DeviceClass *dc =3D DEVICE_CLASS(klass); >>> * dc->reset =3D my_device_reset; >>> * } >>> * >>> >>> Why to use "klass", not "class"? >> >> Because in C++, "class" is a reserved word. It is quite typical idiom >> to replace class with klass in (public) headers. >=20 > I thought QEMU is written in C, right? Is there anything related to C= ++? A while back there was a patch that added a C++ audio backend, for instance. I didn't get around to cleaning the patch up yet though. Objective-C is used for the Cocoa frontend. At least our headers should work with such C-derived languages. clazz is another common alternative if you don't like klass. ;) Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg