Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOx4n-0000Ns-Rk for qemu-devel@nongnu.org; Mon, 19 Jan 2009 11:34:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOx4n-0000NV-9c for qemu-devel@nongnu.org; Mon, 19 Jan 2009 11:34:13 -0500 Received: from [199.232.76.173] (port=47206 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOx4m-0000NL-QP for qemu-devel@nongnu.org; Mon, 19 Jan 2009 11:34:12 -0500 Received: from savannah.gnu.org ([199.232.41.3]:53255 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LOx4m-0004g9-F5 for qemu-devel@nongnu.org; Mon, 19 Jan 2009 11:34:12 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LOx4l-0002Z4-Nq for qemu-devel@nongnu.org; Mon, 19 Jan 2009 16:34:11 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LOx4l-0002Z0-EZ for qemu-devel@nongnu.org; Mon, 19 Jan 2009 16:34:11 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 19 Jan 2009 16:34:11 +0000 Subject: [Qemu-devel] [6369] Remove dumb_display (Stefan Stabellini) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6369 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6369 Author: aliguori Date: 2009-01-19 16:34:10 +0000 (Mon, 19 Jan 2009) Log Message: ----------- Remove dumb_display (Stefan Stabellini) However I think the following fix is cleaner: we do not need a dumb_display_init that creates an empty DisplayChangeListener any more. We do need a dumb_display_init that allocates a zeroed DisplayState structure if none else does it. Tested-by: Shin-ichiro KAWASAKI Signed-off-by: Stefano Stabellini Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/vl.c Modified: trunk/vl.c =================================================================== --- trunk/vl.c 2009-01-18 20:56:30 UTC (rev 6368) +++ trunk/vl.c 2009-01-19 16:34:10 UTC (rev 6369) @@ -2775,27 +2775,12 @@ /* dumb display */ -static void dumb_update(DisplayState *ds, int x, int y, int w, int h) +static void dumb_display_init(void) { + DisplayState *ds = qemu_mallocz(sizeof(DisplayState)); + register_displaystate(ds); } -static void dumb_resize(DisplayState *ds) -{ -} - -static void dumb_display_init(DisplayState *ds) -{ - DisplayChangeListener *dcl = qemu_mallocz(sizeof(DisplayChangeListener)); - if (!dcl) - exit(1); - dcl->dpy_update = dumb_update; - dcl->dpy_resize = dumb_resize; - dcl->dpy_refresh = NULL; - dcl->idle = 1; - dcl->gui_timer_interval = 500; - register_displaychangelistener(ds, dcl); -} - /***********************************************************/ /* I/O handling */ @@ -5535,6 +5520,8 @@ } } + if (!display_state) + dumb_display_init(); /* just use the first displaystate for the moment */ ds = display_state; /* terminal init */ @@ -5543,8 +5530,6 @@ fprintf(stderr, "fatal: -nographic can't be used with -curses\n"); exit(1); } - /* nearly nothing to do */ - dumb_display_init(ds); } else { #if defined(CONFIG_CURSES) if (curses) { @@ -5563,8 +5548,6 @@ sdl_display_init(ds, full_screen, no_frame); #elif defined(CONFIG_COCOA) cocoa_display_init(ds, full_screen); -#else - dumb_display_init(ds); #endif } }