Received: from eggs.gnu.org ([208.118.235.92]:58772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S31Cs-0002JW-EN for qemu-devel@nongnu.org; Thu, 01 Mar 2012 03:18:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S31Cq-0005JS-41 for qemu-devel@nongnu.org; Thu, 01 Mar 2012 03:17:45 -0500 Received: from fe01x03-cgp.akado.ru ([77.232.31.164]:53959 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S31Cp-0005Gn-Sy for qemu-devel@nongnu.org; Thu, 01 Mar 2012 03:17:44 -0500 Date: Thu, 1 Mar 2012 12:17:35 +0400 (MSK) From: malc In-Reply-To: <4F4F2FCB.20605@suse.de> Message-ID: References: <4F4DBD19.1040501@samsung.com> <4F4DCCEA.4090303@msgid.tls.msk.ru> <20120229090547.GA80051@cs.nctu.edu.tw> <4F4F2FCB.20605@suse.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [Qemu-devel] QOM: why "klass" used instead of "class" ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: Evgeny Voevodin , Michael Tokarev , qemu-devel@nongnu.org, =?ISO-2022-JP?Q?=1B$BDDpjG$=1B=28J?= , Dmitry Solodkiy On Thu, 1 Mar 2012, Andreas F?rber wrote: > Am 29.02.2012 10:05, schrieb ???: > > 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 = DEVICE_CLASS(klass); > >>> * dc->reset = 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. > > > > 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. > The real reason, ofcourse, is that germans are taking over the world, nothing new here. > 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. ;) > -- mailto:av1474@comtv.ru