[6531] toplevel: remove error handling from qemu_malloc() callers ( Avi Kivity)
Revision: 6531
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6531 Author: aliguori Date: 2009-02-05 22:06:18 +0000 (Thu, 05 Feb 2009)
Log Message:
-----------
toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)
Modified Paths:
--------------
trunk/aio.c
trunk/buffered_file.c
trunk/console.c
trunk/cris-dis.c
trunk/curses.c
trunk/device_tree.c
trunk/exec.c
trunk/gdbstub.c
trunk/keymaps.c
trunk/kvm-all.c
trunk/loader.c
trunk/migration-exec.c
trunk/migration-tcp.c
trunk/monitor.c
trunk/net.c
trunk/qemu-char.c
trunk/qemu-nbd.c
trunk/qemu-tool.c
trunk/readline.c
trunk/savevm.c
trunk/sdl.c
trunk/usb-bsd.c
trunk/usb-linux.c
trunk/vl.c
trunk/vnc.c
Modified: trunk/aio.c
===================================================================
aio.c +0 -2
@@ -79,8 +79,6 @@if (node ==NULL ) {/* Alloc and insert if it's not already there */ node =qemu_mallocz (sizeof (AioHandler)); -if (node ==NULL ) -return -ENOMEM ; node->fd = fd;LIST_INSERT_HEAD (&aio_handlers, node, node); }
Modified: trunk/buffered_file.c
===================================================================
buffered_file.c +0 -2
@@ -228,8 +228,6 @@QEMUFileBuffered *s; s =qemu_mallocz (sizeof (*s)); -if (s ==NULL ) -return NULL ; s->opaque = opaque; s->xfer_limit = bytes_per_sec /10 ;
Modified: trunk/console.c
===================================================================
console.c +0 -23
@@ -1246,9 +1246,6 @@if (nb_consoles >=MAX_CONSOLES )return NULL ; s =qemu_mallocz (sizeof (TextConsole)); -if (!s) { -return NULL ; - }if (!active_console || ((active_console->console_type !=GRAPHIC_CONSOLE ) && (console_type ==GRAPHIC_CONSOLE ))) { active_console = s;
@@ -1280,8 +1277,6 @@DisplayState *ds; ds = (DisplayState *)qemu_mallocz (sizeof (DisplayState)); -if (ds ==NULL ) -return NULL ; ds->surface =qemu_create_displaysurface (640 ,480 ,32 ,640 *4 ); s =new_console (ds,GRAPHIC_CONSOLE );
@@ -1402,8 +1397,6 @@CharDriverState *chr; chr =qemu_mallocz (sizeof (CharDriverState)); -if (!chr) -return NULL ;if (n_text_consoles ==128 ) {fprintf (stderr,"Too many text consoles\n" );
@@ -1562,10 +1555,6 @@DisplaySurface *qemu_create_displaysurface (int width,int height,int bpp,int linesize) {DisplaySurface *surface = (DisplaySurface *)qemu_mallocz (sizeof (DisplaySurface)); -if (surface ==NULL ) { -fprintf (stderr,"qemu_create_displaysurface: malloc failed\n" ); -exit (1 ); - } surface->width = width; surface->height = height;
@@ -1577,10 +1566,6 @@ surface->flags =QEMU_ALLOCATED_FLAG ;#endif surface->data = (uint8_t *)qemu_mallocz (surface->linesize * surface->height); -if (surface->data ==NULL ) { -fprintf (stderr,"qemu_create_displaysurface: malloc failed\n" ); -exit (1 ); - }return surface; }
@@ -1596,10 +1581,6 @@ surface->data = (uint8_t *)qemu_realloc (surface->data, surface->linesize * surface->height); else surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height); -if (surface->data ==NULL ) { -fprintf (stderr,"qemu_resize_displaysurface: malloc failed\n" ); -exit (1 ); - }#ifdef WORDS_BIGENDIAN surface->flags =QEMU_ALLOCATED_FLAG |QEMU_BIG_ENDIAN_FLAG ;#else
@@ -1613,10 +1594,6 @@ int linesize, uint8_t *data) { DisplaySurface *surface = (DisplaySurface*) qemu_mallocz(sizeof(DisplaySurface)); -if (surface ==NULL ) { -fprintf (stderr,"qemu_create_displaysurface_from: malloc failed\n" ); -exit (1 ); - } surface->width = width; surface->height = height;
Modified: trunk/cris-dis.c
===================================================================
cris-dis.c +2 -0
@@ -26,6 +26,8 @@//#include "libiberty.h" +void *qemu_malloc (size_t len);/* can't include qemu-common.h here */ +#define FALSE 0#define TRUE 1
#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
@@ -1401,44 +1403,32 @@
/* Allocate and clear the opcode-table. */
if (opc_table == NULL)
{- opc_table = malloc (65536 * sizeof (opc_table[0]));
- if (opc_table == NULL)
- return NULL;
+ opc_table = qemu_malloc (65536 * sizeof (opc_table[0]));
memset (opc_table, 0, 65536 * sizeof (const struct cris_opcode *));
dip_prefixes- = malloc (65536 * sizeof (const struct cris_opcode **));
- if (dip_prefixes == NULL)
- return NULL;
+ = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
memset (dip_prefixes, 0, 65536 * sizeof (dip_prefixes[0]));
bdapq_m1_prefixes- = malloc (65536 * sizeof (const struct cris_opcode **));
- if (bdapq_m1_prefixes == NULL)
- return NULL;
+ = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
memset (bdapq_m1_prefixes, 0, 65536 * sizeof (bdapq_m1_prefixes[0]));
bdapq_m2_prefixes- = malloc (65536 * sizeof (const struct cris_opcode **));
- if (bdapq_m2_prefixes == NULL)
- return NULL;
+ = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
memset (bdapq_m2_prefixes, 0, 65536 * sizeof (bdapq_m2_prefixes[0]));
bdapq_m4_prefixes- = malloc (65536 * sizeof (const struct cris_opcode **));
- if (bdapq_m4_prefixes == NULL)
- return NULL;
+ = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
memset (bdapq_m4_prefixes, 0, 65536 * sizeof (bdapq_m4_prefixes[0]));
rest_prefixes- = malloc (65536 * sizeof (const struct cris_opcode **));
- if (rest_prefixes == NULL)
- return NULL;
+ = qemu_malloc (65536 * sizeof (const struct cris_opcode **));
memset (rest_prefixes, 0, 65536 * sizeof (rest_prefixes[0]));
}Modified: trunk/curses.c
===================================================================
curses.c +0 -2
@@ -361,8 +361,6 @@#endif dcl = (DisplayChangeListener *)qemu_mallocz (sizeof (DisplayChangeListener)); -if (!dcl) -exit (1 ); dcl->dpy_update = curses_update; dcl->dpy_resize = curses_resize; dcl->dpy_refresh = curses_refresh;
Modified: trunk/device_tree.c
===================================================================
device_tree.c +0 -4
@@ -43,10 +43,6 @@/* First allocate space in qemu for device tree */ dt_file =qemu_mallocz (dt_file_size); -if (dt_file ==NULL ) { -printf ("Unable to allocate memory in qemu for device tree\n" ); - goto fail; - } dt_file_load_size =load_image (filename_path, dt_file);
Modified: trunk/exec.c
===================================================================
exec.c +7 -18
@@ -476,10 +476,6 @@ }#else code_gen_buffer =qemu_malloc (code_gen_buffer_size); -if (!code_gen_buffer) { -fprintf (stderr,"Could not allocate dynamic translator buffer\n" ); -exit (1 ); - }map_exec (code_gen_buffer, code_gen_buffer_size);#endif #endif /* !USE_STATIC_CODE_GEN_BUFFER */
@@ -825,8 +821,6 @@TranslationBlock *tb; p->code_bitmap =qemu_mallocz (TARGET_PAGE_SIZE /8 ); -if (!p->code_bitmap) -return ; tb = p->first_tb;while (tb !=NULL ) {
@@ -1318,8 +1312,6 @@return -EINVAL ; } wp =qemu_malloc (sizeof (*wp)); -if (!wp) -return -ENOMEM ; wp->vaddr = addr; wp->len_mask = len_mask;
@@ -1384,8 +1376,6 @@CPUBreakpoint *bp; bp =qemu_malloc (sizeof (*bp)); -if (!bp) -return -ENOMEM ; bp->pc = pc; bp->flags = flags;
@@ -2795,17 +2785,16 @@int subpage_memory; mmio =qemu_mallocz (sizeof (subpage_t)); -if (mmio !=NULL ) { - mmio->base = base; - subpage_memory =cpu_register_io_memory (0 , subpage_read, subpage_write, mmio); + + mmio->base = base; + subpage_memory =cpu_register_io_memory (0 , subpage_read, subpage_write, mmio);#if defined(DEBUG_SUBPAGE ) -printf ("%s: %p base " TARGET_FMT_plx" len %08x %d\n" , __func__, - mmio, base,TARGET_PAGE_SIZE , subpage_memory); +printf ("%s: %p base " TARGET_FMT_plx" len %08x %d\n" , __func__, + mmio, base,TARGET_PAGE_SIZE , subpage_memory);#endif - *phys = subpage_memory |IO_MEM_SUBPAGE ; -subpage_register (mmio,0 ,TARGET_PAGE_SIZE -1 , orig_memory, + *phys = subpage_memory |IO_MEM_SUBPAGE ; +subpage_register (mmio,0 ,TARGET_PAGE_SIZE -1 , orig_memory, region_offset); - }return mmio; }
Modified: trunk/gdbstub.c
===================================================================
gdbstub.c +0 -8
@@ -2189,11 +2189,6 @@setsockopt (fd,IPPROTO_TCP ,TCP_NODELAY , (char *)&val,sizeof (val)); s =qemu_mallocz (sizeof (GDBState)); -if (!s) { - errno =ENOMEM ; -perror ("accept" ); -return ; - }memset (s,0 ,sizeof (GDBState)); s->c_cpu = first_cpu;
@@ -2311,9 +2306,6 @@return -1 ; s =qemu_mallocz (sizeof (GDBState)); -if (!s) { -return -1 ; - } s->c_cpu = first_cpu; s->g_cpu = first_cpu; s->chr = chr;
Modified: trunk/keymaps.c
===================================================================
keymaps.c +3 -7
@@ -67,11 +67,9 @@ }if (kr ==NULL ) { kr =qemu_mallocz (sizeof (*kr)); -if (kr) { - kr->start = kr->end = code; - kr->next = *krp; - *krp = kr; - } + kr->start = kr->end = code; + kr->next = *krp; + *krp = kr; } }
@@ -88,8 +86,6 @@if (!k) k =qemu_mallocz (sizeof (kbd_layout_t)); -if (!k) -return 0 ;if (!(f =fopen (file_name,"r" ))) {fprintf (stderr,"Could not read keymap file: '%s'\n" , file_name);
Modified: trunk/kvm-all.c
===================================================================
kvm-all.c +0 -7
@@ -220,11 +220,6 @@ alloc_size = mem->memory_size >>TARGET_PAGE_BITS /sizeof (d.dirty_bitmap); d.dirty_bitmap =qemu_mallocz (alloc_size); -if (d.dirty_bitmap ==NULL ) { -dprintf ("Could not allocate dirty bitmap\n" ); -return ; - } - d.slot = mem->slot;dprintf ("slot %d, phys_addr %llx, uaddr: %llx\n" , d.slot, mem->start_addr, mem->phys_offset);
@@ -295,8 +290,6 @@return -EINVAL ; s =qemu_mallocz (sizeof (KVMState)); -if (s ==NULL ) -return -ENOMEM ;for (i =0 ; i <ARRAY_SIZE (s->slots); i++) s->slots[i].slot = i;
Modified: trunk/loader.c
===================================================================
loader.c +0 -4
@@ -266,8 +266,6 @@if (lseek (fd, offset,SEEK_SET ) <0 )return NULL ; ptr =qemu_malloc (size); -if (!ptr) -return NULL ;if (read (fd, ptr, size) != size) {qemu_free (ptr);return NULL ;
@@ -505,8 +503,6 @@ *ep = hdr->ih_ep; data =qemu_malloc (hdr->ih_size); -if (!data) - goto out;if (read (fd, data, hdr->ih_size) != hdr->ih_size) {fprintf (stderr,"Error reading file\n" );
Modified: trunk/migration-exec.c
===================================================================
migration-exec.c +0 -5
@@ -61,10 +61,6 @@FILE *f; s =qemu_mallocz (sizeof (*s)); -if (s ==NULL ) { -dprintf ("Unable to allocate FdMigrationState\n" ); - goto err; - } f =popen (command,"w" );if (f ==NULL ) {
@@ -109,7 +105,6 @@pclose (f); err_after_alloc:qemu_free (s); -err:return NULL ; }
Modified: trunk/migration-tcp.c
===================================================================
migration-tcp.c +0 -2
@@ -89,8 +89,6 @@return NULL ; s =qemu_mallocz (sizeof (*s)); -if (s ==NULL ) -return NULL ; s->get_error = socket_errno; s->write = socket_write;
Modified: trunk/monitor.c
===================================================================
monitor.c +0 -4
@@ -1371,10 +1371,6 @@CaptureState *s; s =qemu_mallocz (sizeof (*s)); -if (!s) { -term_printf ("Not enough memory to add wave capture\n" ); -return ; - } freq = has_freq ? freq :44100 ; bits = has_bits ? bits :16 ;
Modified: trunk/net.c
===================================================================
net.c +0 -14
@@ -333,8 +333,6 @@ {VLANClientState *vc, **pvc; vc =qemu_mallocz (sizeof (VLANClientState)); -if (!vc) -return NULL ; vc->model =strdup (model);if (name) vc->name =strdup (name);
@@ -728,8 +726,6 @@TAPState *s; s =qemu_mallocz (sizeof (TAPState)); -if (!s) -return NULL ; s->fd = fd; s->vc =qemu_new_vlan_client (vlan, model, name, tap_receive,NULL , s);#ifdef HAVE_IOVEC
@@ -1049,8 +1045,6 @@ }; s =qemu_mallocz (sizeof (VDEState)); -if (!s) -return -1 ; s->vde =vde_open (init_sock,"QEMU" , &args);if (!s->vde){free (s);
@@ -1274,8 +1268,6 @@ } s =qemu_mallocz (sizeof (NetSocketState)); -if (!s) -return NULL ; s->fd = fd; s->vc =qemu_new_vlan_client (vlan, model, name, net_socket_receive_dgram,NULL , s);
@@ -1304,8 +1296,6 @@ {NetSocketState *s; s =qemu_mallocz (sizeof (NetSocketState)); -if (!s) -return NULL ; s->fd = fd; s->vc =qemu_new_vlan_client (vlan, model, name, net_socket_receive,NULL , s);
@@ -1383,8 +1373,6 @@return -1 ; s =qemu_mallocz (sizeof (NetSocketListenState)); -if (!s) -return -1 ; fd =socket (PF_INET ,SOCK_STREAM ,0 );if (fd <0 ) {
@@ -1504,8 +1492,6 @@return vlan; } vlan =qemu_mallocz (sizeof (VLANState)); -if (!vlan) -return NULL ; vlan->id = id; vlan->next =NULL ; pvlan = &first_vlan;
Modified: trunk/qemu-char.c
===================================================================
qemu-char.c +0 -59
137 lines not on this page · raw message
Modified: trunk/qemu-nbd.c
===================================================================
qemu-nbd.c +0 -2
@@ -409,8 +409,6 @@ } sharing_fds =qemu_malloc ((shared +1 ) *sizeof (int )); -if (sharing_fds ==NULL ) -errx (ENOMEM ,"Cannot allocate sharing fds" );if (socket) { sharing_fds[0 ] =unix_socket_incoming (socket);
Modified: trunk/qemu-tool.c
===================================================================
qemu-tool.c +2 -4
@@ -43,10 +43,8 @@QEMUBH *bh; bh =qemu_malloc (sizeof (*bh)); -if (bh) { - bh->cb = cb; - bh->opaque = opaque; - } + bh->cb = cb; + bh->opaque = opaque;return bh; }
Modified: trunk/readline.c
===================================================================
readline.c +0 -2
@@ -307,8 +307,6 @@ nb_completions =0 ; cmdline =qemu_malloc (term_cmd_buf_index +1 ); -if (!cmdline) -return ;memcpy (cmdline, term_cmd_buf, term_cmd_buf_index); cmdline[term_cmd_buf_index] ='\0' ;readline_find_completion (cmdline);
Modified: trunk/savevm.c
===================================================================
savevm.c +0 -19
@@ -214,10 +214,6 @@ } s =qemu_mallocz (sizeof (QEMUFilePopen)); -if (!s) { -fprintf (stderr,"qemu_popen: malloc failed\n" ); -return NULL ; - } s->popen_file = popen_file;
@@ -246,9 +242,6 @@ {QEMUFileSocket *s =qemu_mallocz (sizeof (QEMUFileSocket)); -if (s ==NULL ) -return NULL ; - s->fd = fd; s->file =qemu_fopen_ops (s,NULL , socket_get_buffer, socket_close,NULL );return s->file;
@@ -288,8 +281,6 @@QEMUFileStdio *s; s =qemu_mallocz (sizeof (QEMUFileStdio)); -if (!s) -return NULL ; s->outfile =fopen (filename, mode);if (!s->outfile)
@@ -339,8 +330,6 @@QEMUFileBdrv *s; s =qemu_mallocz (sizeof (QEMUFileBdrv)); -if (!s) -return NULL ; s->bs = bs; s->base_offset = offset;
@@ -359,8 +348,6 @@QEMUFile *f; f =qemu_mallocz (sizeof (QEMUFile)); -if (!f) -return NULL ; f->opaque = opaque; f->put_buffer = put_buffer;
@@ -615,8 +602,6 @@static int global_section_id; se =qemu_malloc (sizeof (SaveStateEntry)); -if (!se) -return -1 ;pstrcpy (se->idstr,sizeof (se->idstr), idstr); se->instance_id = (instance_id ==-1 ) ?0 : instance_id; se->version_id = version_id;
@@ -908,10 +893,6 @@/* Add entry */ le =qemu_mallocz (sizeof (*le)); -if (le ==NULL ) { - ret = -ENOMEM ; - goto out; - } le->se = se; le->section_id = section_id;
Modified: trunk/sdl.c
===================================================================
sdl.c +0 -2
@@ -638,8 +638,6 @@ } dcl =qemu_mallocz (sizeof (DisplayChangeListener)); -if (!dcl) -exit (1 ); dcl->dpy_update = sdl_update; dcl->dpy_resize = sdl_resize; dcl->dpy_refresh = sdl_refresh;
Modified: trunk/usb-bsd.c
===================================================================
usb-bsd.c +0 -2
@@ -340,8 +340,6 @@if (dfd >=0 ) { dev =qemu_mallocz (sizeof (USBHostDevice)); -if (!dev) - goto fail; dev->devfd = dfd;if (ioctl (dfd,USB_GET_DEVICEINFO , &dev_info) <0 ) {
Modified: trunk/usb-linux.c
===================================================================
usb-linux.c +2 -22
@@ -441,10 +441,6 @@int ret; aurb =async_alloc (); -if (!aurb) { -dprintf ("husb: async malloc failed\n" ); -return USB_RET_NAK ; - } aurb->hdev = s; aurb->packet = p;
@@ -585,10 +581,6 @@/* The rest are asynchronous */ aurb =async_alloc (); -if (!aurb) { -dprintf ("husb: async malloc failed\n" ); -return USB_RET_NAK ; - } aurb->hdev = s; aurb->packet = p;
@@ -898,8 +890,6 @@char buf[1024 ]; dev =qemu_mallocz (sizeof (USBHostDevice)); -if (!dev) - goto fail; dev->bus_num = bus_num; dev->addr = addr;
@@ -1308,14 +1298,8 @@/* the module setting (used later for opening devices) */ usb_host_device_path =qemu_mallocz (strlen (devpath)+1 ); -if (usb_host_device_path) { -strcpy (usb_host_device_path, devpath); -term_printf ("husb: using %s file-system with %s\n" , fs_type[usb_fs_type], usb_host_device_path); - }else { -/* out of memory? */ -perror ("husb: unable to allocate memory for device path" ); -return -ENOMEM ; - } +strcpy (usb_host_device_path, devpath); +term_printf ("husb: using %s file-system with %s\n" , fs_type[usb_fs_type], usb_host_device_path); }switch (usb_fs_type) {
@@ -1455,10 +1439,6 @@return -1 ; f =qemu_mallocz (sizeof (*f)); -if (!f) { -fprintf (stderr,"husb: failed to allocate auto filter\n" ); -return -1 ; - } *f = filter;
Modified: trunk/vl.c
===================================================================
vl.c +0 -16
@@ -546,8 +546,6 @@QEMUPutMouseEntry *s, *cursor; s =qemu_mallocz (sizeof (QEMUPutMouseEntry)); -if (!s) -return NULL ; s->qemu_put_mouse_event = func; s->qemu_put_mouse_event_opaque = opaque;
@@ -1098,8 +1096,6 @@ {QEMUClock *clock; clock =qemu_mallocz (sizeof (QEMUClock)); -if (!clock) -return NULL ; clock->type = type;return clock; }
@@ -2808,10 +2804,6 @@static void dumb_display_init (void ) {DisplayState *ds =qemu_mallocz (sizeof (DisplayState)); -if (ds ==NULL ) { -fprintf (stderr,"dumb_display_init: DisplayState allocation failed\n" ); -exit (1 ); - } ds->surface =qemu_create_displaysurface (640 ,480 ,32 ,640 *4 );register_displaystate (ds); }
@@ -2863,8 +2855,6 @@ goto found; } ioh =qemu_mallocz (sizeof (IOHandlerRecord)); -if (!ioh) -return -1 ; ioh->next = first_io_handler; first_io_handler = ioh; found:
@@ -2902,8 +2892,6 @@ {PollingEntry **ppe, *pe; pe =qemu_mallocz (sizeof (PollingEntry)); -if (!pe) -return -1 ; pe->func = func; pe->opaque = opaque;for (ppe = &first_polling_entry; *ppe !=NULL ; ppe = &(*ppe)->next);
@@ -3273,8 +3261,6 @@ {QEMUBH *bh; bh =qemu_mallocz (sizeof (QEMUBH )); -if (!bh) -return NULL ; bh->cb = cb; bh->opaque = opaque; bh->next = first_bh;
@@ -3432,8 +3418,6 @@VMChangeStateEntry *e; e =qemu_mallocz (sizeof (*e)); -if (!e) -return NULL ; e->cb = cb; e->opaque = opaque;
Modified: trunk/vnc.c
===================================================================
vnc.c +3 -6
@@ -471,8 +471,8 @@int has_fg, has_bg;uint8_t *last_fg, *last_bg; - last_fg = (uint8_t *)malloc (vs->serverds.pf.bytes_per_pixel); - last_bg = (uint8_t *)malloc (vs->serverds.pf.bytes_per_pixel); + last_fg = (uint8_t *)qemu_malloc (vs->serverds.pf.bytes_per_pixel); + last_bg = (uint8_t *)qemu_malloc (vs->serverds.pf.bytes_per_pixel); has_fg = has_bg =0 ;for (j = y; j < (y + h); j +=16 ) {for (i = x; i < (x + w); i +=16 ) {
@@ -2237,8 +2237,6 @@ vs =qemu_mallocz (sizeof (VncState)); dcl =qemu_mallocz (sizeof (DisplayChangeListener)); -if (!vs || !dcl) -exit (1 ); ds->opaque = vs; dcl->idle =1 ;
@@ -2289,8 +2287,7 @@ *cred =NULL ; } -if (!(*cred =qemu_malloc (strlen (certdir) +strlen (filename) +2 ))) -return -1 ; + *cred =qemu_malloc (strlen (certdir) +strlen (filename) +2 );strcpy (*cred, certdir);strcat (*cred,"/" );
Quoted 22 lines · Anthony Liguori
Revision: 6531
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6531
Author: aliguori
Date: 2009-02-05 22:06:18 +0000 (Thu, 05 Feb 2009)Log Message:
-----------
toplevel: remove error handling fromqemu_malloc()callers (Avi Kivity)Signed-off-by Avi Kivity <[email protected]>Signed-off-by Anthony Liguori <[email protected]>Modified Paths:
--------------trunk/aio.ctrunk/buffered_file.ctrunk/console.ctrunk/cris-dis.ctrunk/curses.ctrunk/device_tree.ctrunk/exec.ctrunk/gdbstub.c
...
Quoted 11 lines
Modified:
trunk/cris-dis.c
===================================================================cris-dis.c 2009-02-05 22:06:18 UTC (rev 6531) renamed from cris-dis.c 2009-02-05 22:06:11 UTC (rev 6530) +0
-0@@ -26,6 +26,8 @@ //#include "libiberty.h"+void *qemu_malloc(size_t len); /* can't include
qemu-common.hhere */
Do you still know the reason for that comment? Is it still valid? i386-dis.c includes qemu-common.h.
I have a patch which needs qemu-common.h forcris-dis.c, too.
Regards,
Stefan
Quoted 13 lines
+
#define FALSE 0
#define TRUE 1
#defineCONST_STRNEQ(STR1,STR2)(strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)cris-dis.c 2009-02-05 22:06:18 UTC (rev 6531) renamed from cris-dis.c 2009-02-05 22:06:11 UTC (rev 6530) +1
-3@@ -1401,44 +1403,32 @@ /* Allocate and clear the opcode-table. */ if (opc_table == NULL) { - opc_table = malloc (65536 * sizeof (opc_table[0])); - if (opc_table == NULL) - return NULL; + opc_table = qemu_malloc (65536 * sizeof (opc_table[0]));
...