From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm239-0002yx-25 for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:04:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm233-0002sD-Gm for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:04:10 -0400 Received: from [199.232.76.173] (port=43866 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm233-0002s6-AI for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:04:05 -0400 Received: from goliath.siemens.de ([192.35.17.28]:19019) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mm232-0006RY-5S for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:04:04 -0400 Message-ID: <4AAA1293.1080408@siemens.com> Date: Fri, 11 Sep 2009 11:04:19 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 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: > 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. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux