From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mm2W1-0000zo-8d for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:34:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mm2Vw-0000vB-Ae for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:34:00 -0400 Received: from [199.232.76.173] (port=58321 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm2Vw-0000up-2q for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:33:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7856) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mm2Vv-0003UZ-73 for qemu-devel@nongnu.org; Fri, 11 Sep 2009 05:33:55 -0400 From: Juan Quintela In-Reply-To: <4AAA1293.1080408@siemens.com> (Jan Kiszka's message of "Fri, 11 Sep 2009 11:04:19 +0200") References: <4AAA1293.1080408@siemens.com> Date: Fri, 11 Sep 2009 11:31:12 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Jan Kiszka Cc: qemu-devel@nongnu.org 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. Thanks, Juan.