]> git.proxmox.com Git - qemu.git/blobdiff - cris-dis.c
dma: Fix stupid typo/thinko
[qemu.git] / cris-dis.c
index 5b8e90b2cdec4e64779782b8addb9c11fab703de..1d174ba8ccf34cbb8098b70f88410a9233e6963e 100644 (file)
@@ -1396,34 +1396,12 @@ get_opcode_entry (unsigned int insn,
   /* Allocate and clear the opcode-table.  */
   if (opc_table == NULL)
     {
-      opc_table = g_malloc (65536 * sizeof (opc_table[0]));
-
-      memset (opc_table, 0, 65536 * sizeof (const struct cris_opcode *));
-
-      dip_prefixes
-       = g_malloc (65536 * sizeof (const struct cris_opcode **));
-
-      memset (dip_prefixes, 0, 65536 * sizeof (dip_prefixes[0]));
-
-      bdapq_m1_prefixes
-       = g_malloc (65536 * sizeof (const struct cris_opcode **));
-
-      memset (bdapq_m1_prefixes, 0, 65536 * sizeof (bdapq_m1_prefixes[0]));
-
-      bdapq_m2_prefixes
-       = g_malloc (65536 * sizeof (const struct cris_opcode **));
-
-      memset (bdapq_m2_prefixes, 0, 65536 * sizeof (bdapq_m2_prefixes[0]));
-
-      bdapq_m4_prefixes
-       = g_malloc (65536 * sizeof (const struct cris_opcode **));
-
-      memset (bdapq_m4_prefixes, 0, 65536 * sizeof (bdapq_m4_prefixes[0]));
-
-      rest_prefixes
-       = g_malloc (65536 * sizeof (const struct cris_opcode **));
-
-      memset (rest_prefixes, 0, 65536 * sizeof (rest_prefixes[0]));
+      opc_table = g_new0(const struct cris_opcode *, 65536);
+      dip_prefixes = g_new0(const struct cris_opcode *, 65536);
+      bdapq_m1_prefixes = g_new0(const struct cris_opcode *, 65536);
+      bdapq_m2_prefixes = g_new0(const struct cris_opcode *, 65536);
+      bdapq_m4_prefixes = g_new0(const struct cris_opcode *, 65536);
+      rest_prefixes = g_new0(const struct cris_opcode *, 65536);
     }
 
   /* Get the right table if this is a prefix.