From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm2Yp-0002Cz-Dm for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:36:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm2Yj-0002BS-Kp for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:36:54 -0400 Received: from [199.232.76.173] (port=46824 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm2Yj-0002BH-BW for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:36:49 -0400 Received: from thoth.sbs.de ([192.35.17.2]:22318) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mm2Yi-0003rT-Sc for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:36:49 -0400 Message-ID: <4AAA1A3E.6080408@siemens.com> Date: Fri, 11 Sep 2009 11:37:02 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4AAA1293.1080408@siemens.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: "qemu-devel@nongnu.org" Juan Quintela wrote: > Jan Kiszka wrote: >> Juan Quintela wrote: >>> Signed-off-by: Juan Quintela >> [...] >> >>> diff --git a/vl.c b/vl.c >>> index 448ec6c..33abef2 100644 >>> --- a/vl.c >>> +++ b/vl.c >>> @@ -186,7 +186,7 @@ enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB; >>> static DisplayState *display_state; >>> DisplayType display_type = DT_DEFAULT; >>> const char* keyboard_layout = NULL; >>> -int64_t ticks_per_sec; >>> +static int64_t ticks_per_sec; >>> ram_addr_t ram_size; >>> int nb_nics; >>> NICInfo nd_table[MAX_NICS]; >>> @@ -1032,6 +1032,11 @@ int64_t qemu_get_clock(QEMUClock *clock) >>> } >>> } >>> >>> +int64_t get_ticks_per_sec(void) >>> +{ >>> + return ticks_per_sec; >>> +} >>> + >> This refactoring would be even more useful if that one became >> >> static inline int64_t get_ticks_per_sec(void) >> { >> return QEMU_CLOCK_BASE; >> } >> >> Right now we don't have a use for the ticks_per_sec /variable/, it's >> always constant. Your interface does not prevent changing this in the >> future, though, which is just like it should be. > > I liked this one on top. Why? Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux