From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVENR-0003vn-6s for qemu-devel@nongnu.org; Thu, 05 Feb 2009 19:15:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVENQ-0003ue-3g for qemu-devel@nongnu.org; Thu, 05 Feb 2009 19:15:24 -0500 Received: from [199.232.76.173] (port=37561 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVENP-0003uY-Vo for qemu-devel@nongnu.org; Thu, 05 Feb 2009 19:15:24 -0500 Received: from savannah.gnu.org ([199.232.41.3]:46164 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 1LVENP-00077A-LN for qemu-devel@nongnu.org; Thu, 05 Feb 2009 19:15:23 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LVENN-0004rQ-I1 for qemu-devel@nongnu.org; Fri, 06 Feb 2009 00:15:21 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LVENM-0004rM-UJ for qemu-devel@nongnu.org; Fri, 06 Feb 2009 00:15:21 +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: Fri, 06 Feb 2009 00:15:21 +0000 Subject: [Qemu-devel] [6541] Revert changes to fmopl.c 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: 6541 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6541 Author: aliguori Date: 2009-02-06 00:15:19 +0000 (Fri, 06 Feb 2009) Log Message: ----------- Revert changes to fmopl.c fmopl.c was taken from MAME and doesn't include QEMU header files so we cannot use qemu_malloc in it. It happens to build because C is a silly language. Unfortunately, it doesn't play nicely with the QEMU headers so lets just revert the changes that were made to it. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/fmopl.c Modified: trunk/hw/fmopl.c =================================================================== --- trunk/hw/fmopl.c 2009-02-05 22:36:32 UTC (rev 6540) +++ trunk/hw/fmopl.c 2009-02-06 00:15:19 UTC (rev 6541) @@ -619,10 +619,26 @@ double pom; /* allocate dynamic tables */ - TL_TABLE = qemu_malloc(TL_MAX*2*sizeof(INT32)); - SIN_TABLE = qemu_malloc(SIN_ENT*4 *sizeof(INT32 *)); - AMS_TABLE = qemu_malloc(AMS_ENT*2 *sizeof(INT32)); - VIB_TABLE = qemu_malloc(VIB_ENT*2 *sizeof(INT32)); + if( (TL_TABLE = malloc(TL_MAX*2*sizeof(INT32))) == NULL) + return 0; + if( (SIN_TABLE = malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL) + { + free(TL_TABLE); + return 0; + } + if( (AMS_TABLE = malloc(AMS_ENT*2 *sizeof(INT32))) == NULL) + { + free(TL_TABLE); + free(SIN_TABLE); + return 0; + } + if( (VIB_TABLE = malloc(VIB_ENT*2 *sizeof(INT32))) == NULL) + { + free(TL_TABLE); + free(SIN_TABLE); + free(AMS_TABLE); + return 0; + } /* make total level table */ for (t = 0;t < EG_ENT-1 ;t++){ rate = ((1< voltage */ @@ -1205,7 +1221,8 @@ if(type&OPL_TYPE_ADPCM) state_size+= sizeof(YM_DELTAT); #endif /* allocate memory block */ - ptr = qemu_malloc(state_size); + ptr = malloc(state_size); + if(ptr==NULL) return NULL; /* clear */ memset(ptr,0,state_size); OPL = (FM_OPL *)ptr; ptr+=sizeof(FM_OPL);