--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@

 {

+    uint8_t *compressed_data = NULL;
+
+    uint8_t *data = NULL;
+
+    gsize len;

     ssize_t bytes;

int load_image_gzipped(const char *filename, hwaddr addr, uint64_t max_sz)

{

    uint8_t *compressed_data = NULL;

    uint8_t *data = NULL;

    gsize len;

    ssize_t bytes;

    int ret = -1;

    if (!g_file_get_contents(filename, (char **) &compressed_data, &len,

                             NULL)) {

        goto out;

    }

    /* Is it a gzip-compressed file? */

    if (len < 2 ||

        compressed_data[0] != 0x1f ||

        compressed_data[1] != 0x8b) {

        goto out;

    }

    if (max_sz > LOAD_IMAGE_MAX_GUNZIP_BYTES) {

        max_sz = LOAD_IMAGE_MAX_GUNZIP_BYTES;

    }

    data = g_malloc(max_sz);

    bytes = gunzip(data, max_sz, compressed_data, len);

    if (bytes < 0) {

        fprintf(stderr, "%s: unable to decompress gzipped kernel file\n",

                filename);

        goto out;

    }

    rom_add_blob_fixed(filename, data, bytes, addr);

    ret = bytes;

 out:

    g_free(compressed_data);

    g_free(data);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
         return -1;

     s = qemu_mallocz(sizeof(APICState));
+
+    env->apic_state = s;
+
+    s->idx = last_apic_idx++;
+
     s->id = env->cpuid_apic_id;

     s->cpu_env = env;

int apic_init(CPUState *env)

{

    APICState *s;

    if (last_apic_idx >= MAX_APICS)

        return -1;

    s = qemu_mallocz(sizeof(APICState));

    env->apic_state = s;

    s->idx = last_apic_idx++;

    s->id = env->cpuid_apic_id;

    s->cpu_env = env;

    apic_reset(s);

    msix_supported = 1;

    /* XXX: mapping more APICs at the same memory location */

    if (apic_io_memory == 0) {

        /* NOTE: the APIC is directly connected to the CPU - it is not

           on the global memory bus. */

        apic_io_memory = cpu_register_io_memory(apic_mem_read,

                                                apic_mem_write, NULL);

        /* XXX: what if the base changes? */

        cpu_register_physical_memory(MSI_ADDR_BASE, MSI_ADDR_SIZE,

                                     apic_io_memory);

    }

    s->timer = qemu_new_timer(vm_clock, apic_timer, s);

    vmstate_register(s->idx, &vmstate_apic, s);

    qemu_register_reset(apic_reset, s);

    local_apics[s->idx] = s;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -16,11 +16,11 @@

     for (other = first_cpu; other; other = other->next_cpu) {

+        if (other->running) {
+
+            pending_cpus++;
+
+            cpu_interrupt(other, CPU_INTERRUPT_EXIT);

         }

static inline void start_exclusive(void)

{

    CPUState *other;

    pthread_mutex_lock(&exclusive_lock);

    exclusive_idle();

    pending_cpus = 1;

    /* Make all other cpus stop executing.  */

    for (other = first_cpu; other; other = other->next_cpu) {

        if (other->running) {

            pending_cpus++;

            cpu_interrupt(other, CPU_INTERRUPT_EXIT);

        }

    }

    if (pending_cpus > 1) {

        pthread_cond_wait(&exclusive_cond, &exclusive_lock);

    }

}


--- a/source.c
+++ b/source.c
@@ -28,11 +28,11 @@

     av_log(NULL, AV_LOG_DEBUG, ", %d/%d", st->time_base.num/g, st->time_base.den/g);

+    av_log(NULL, AV_LOG_INFO, ": %s", buf);
+
+    if(st->codec->codec_type == CODEC_TYPE_VIDEO){
+
+        if(st->r_frame_rate.den && st->r_frame_rate.num)

             av_log(NULL, AV_LOG_INFO, ", %5.2f fps(r)", av_q2d(st->r_frame_rate));

static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)

{

    char buf[256];

    int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);

    AVStream *st = ic->streams[i];

    int g = ff_gcd(st->time_base.num, st->time_base.den);

    avcodec_string(buf, sizeof(buf), st->codec, is_output);

    av_log(NULL, AV_LOG_INFO, "    Stream #%d.%d", index, i);

    /* the pid is an important information, so we display it */

    /* XXX: add a generic system */

    if (flags & AVFMT_SHOW_IDS)

        av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id);

    if (strlen(st->language) > 0)

        av_log(NULL, AV_LOG_INFO, "(%s)", st->language);

    av_log(NULL, AV_LOG_DEBUG, ", %d/%d", st->time_base.num/g, st->time_base.den/g);

    av_log(NULL, AV_LOG_INFO, ": %s", buf);

    if(st->codec->codec_type == CODEC_TYPE_VIDEO){

        if(st->r_frame_rate.den && st->r_frame_rate.num)

            av_log(NULL, AV_LOG_INFO, ", %5.2f fps(r)", av_q2d(st->r_frame_rate));

/*      else if(st->time_base.den && st->time_base.num)

            av_log(NULL, AV_LOG_INFO, ", %5.2f fps(m)", 1/av_q2d(st->time_base));*/

        else

            av_log(NULL, AV_LOG_INFO, ", %5.2f fps(c)", 1/av_q2d(st->codec->time_base));

    }

    av_log(NULL, AV_LOG_INFO, "\n");

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static uint32_t ecc_mem_readb(void *opaque, target_phys_addr_t addr)

 {
+
+    printf("ECC: Unsupported read 0x" TARGET_FMT_plx " 00\n", addr);

     return 0;

static uint32_t ecc_mem_readb(void *opaque, target_phys_addr_t addr)

{

    printf("ECC: Unsupported read 0x" TARGET_FMT_plx " 00\n", addr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
                               const uint8_t *in_data, int in_len,

                               uint8_t *out_data, int *out_len)
+
 {

     uint32_t ti;

static bool cuda_cmd_set_time(CUDAState *s,

                              const uint8_t *in_data, int in_len,

                              uint8_t *out_data, int *out_len)

{

    uint32_t ti;

    if (in_len != 4) {

        return false;

    }

    ti = (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2]) << 16)

         + (((uint32_t)in_data[3]) << 8) + in_data[4];

    s->tick_offset = ti - (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)

                           / NANOSECONDS_PER_SECOND);

    return true;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 static void gen_tlbivax_booke206(DisasContext *ctx)
+
+{
+
+#if defined(CONFIG_USER_ONLY)

     gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

 #else

     TCGv t0;
+
     if (unlikely(ctx->pr)) {

         gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

static void gen_tlbivax_booke206(DisasContext *ctx)

{

#if defined(CONFIG_USER_ONLY)

    gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

#else

    TCGv t0;

    if (unlikely(ctx->pr)) {

        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);

        return;

    }

    t0 = tcg_temp_new();

    gen_addr_reg_index(ctx, t0);

    gen_helper_booke206_tlbivax(cpu_env, t0);

    tcg_temp_free(t0);

#endif

}


--- a/source.c
+++ b/source.c
@@ -5,8 +5,8 @@
     switch (opsize) {

     case OS_BYTE: return 1;
+
+    case OS_WORD: return 2;

     case OS_LONG: return 4;

static inline int opsize_bytes(int opsize)

{

    switch (opsize) {

    case OS_BYTE: return 1;

    case OS_WORD: return 2;

    case OS_LONG: return 4;

    case OS_SINGLE: return 4;

    case OS_DOUBLE: return 8;

    default:

        qemu_assert(0, "bad operand size");

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     union {

         char buf[QIO_CHANNEL_WEBSOCK_HEADER_LEN_64_BIT];
+
         QIOChannelWebsockHeader ws;

     } header;

static void qio_channel_websock_encode(QIOChannelWebsock *ioc)

{

    size_t header_size;

    union {

        char buf[QIO_CHANNEL_WEBSOCK_HEADER_LEN_64_BIT];

        QIOChannelWebsockHeader ws;

    } header;

    if (!ioc->rawoutput.offset) {

        return;

    }

    header.ws.b0 = (1 << QIO_CHANNEL_WEBSOCK_HEADER_SHIFT_FIN) |

        (QIO_CHANNEL_WEBSOCK_OPCODE_BINARY_FRAME &

         QIO_CHANNEL_WEBSOCK_HEADER_FIELD_OPCODE);

    if (ioc->rawoutput.offset <

        QIO_CHANNEL_WEBSOCK_PAYLOAD_LEN_THRESHOLD_7_BIT) {

        header.ws.b1 = (uint8_t)ioc->rawoutput.offset;

        header_size = QIO_CHANNEL_WEBSOCK_HEADER_LEN_7_BIT;

    } else if (ioc->rawoutput.offset <

               QIO_CHANNEL_WEBSOCK_PAYLOAD_LEN_THRESHOLD_16_BIT) {

        header.ws.b1 = QIO_CHANNEL_WEBSOCK_PAYLOAD_LEN_MAGIC_16_BIT;

        header.ws.u.s16.l16 = cpu_to_be16((uint16_t)ioc->rawoutput.offset);

        header_size = QIO_CHANNEL_WEBSOCK_HEADER_LEN_16_BIT;

    } else {

        header.ws.b1 = QIO_CHANNEL_WEBSOCK_PAYLOAD_LEN_MAGIC_64_BIT;

        header.ws.u.s64.l64 = cpu_to_be64(ioc->rawoutput.offset);

        header_size = QIO_CHANNEL_WEBSOCK_HEADER_LEN_64_BIT;

    }

    header_size -= QIO_CHANNEL_WEBSOCK_HEADER_LEN_MASK;

    buffer_reserve(&ioc->encoutput, header_size + ioc->rawoutput.offset);

    buffer_append(&ioc->encoutput, header.buf, header_size);

    buffer_append(&ioc->encoutput, ioc->rawoutput.buffer,

                  ioc->rawoutput.offset);

    buffer_reset(&ioc->rawoutput);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,

                           int unused, int size)

void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,

                          int unused, int size)

{

    if (is_exec)

        helper_raise_exception(EXCP_IBE);

    else

        helper_raise_exception(EXCP_DBE);

}


--- a/source.c
+++ b/source.c
@@ -2,6 +2,6 @@

 {

+    readline_start("(qemu) ", 0, monitor_handle_command1, NULL);

 }

static void monitor_start_input(void)

{

    readline_start("(qemu) ", 0, monitor_handle_command1, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 void OPPROTO op_POWER_srea (void)

 {
+
+    T1 &= 0x1FUL;

     env->spr[SPR_MQ] = T0 >> T1;

void OPPROTO op_POWER_srea (void)

{

    T1 &= 0x1FUL;

    env->spr[SPR_MQ] = T0 >> T1;

    T0 = Ts0 >> T1;

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     EnumOne i, bad_values[] = { ENUM_ONE__MAX, -1 };

     Error *err;
+
+
+
+    for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) {
+
         err = NULL;

         visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err);

static void test_visitor_out_enum_errors(TestOutputVisitorData *data,

                                         const void *unused)

{

    EnumOne i, bad_values[] = { ENUM_ONE__MAX, -1 };

    Error *err;

    for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) {

        err = NULL;

        visit_type_EnumOne(data->ov, "unused", &bad_values[i], &err);

        g_assert(err);

        error_free(err);

        visitor_reset(data);

    }

}


--- a/source.c
+++ b/source.c
@@ -12,8 +12,8 @@

         func(block->host, block->offset, block->used_length, opaque);

+    }
+
+    rcu_read_unlock();
+
 }

void qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque)

{

    RAMBlock *block;

    rcu_read_lock();

    QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {

        func(block->host, block->offset, block->used_length, opaque);

    }

    rcu_read_unlock();

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@

     AVStream *st = fmt_ctx->streams[pkt->stream_index];

+
+
+    printf("[PACKET]\n");
+
+    printf("codec_type=%s\n", media_type_string(st->codec->codec_type));

     printf("stream_index=%d\n", pkt->stream_index);

static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)

{

    char val_str[128];

    AVStream *st = fmt_ctx->streams[pkt->stream_index];

    printf("[PACKET]\n");

    printf("codec_type=%s\n", media_type_string(st->codec->codec_type));

    printf("stream_index=%d\n", pkt->stream_index);

    printf("pts=%s\n", ts_value_string(val_str, sizeof(val_str), pkt->pts));

    printf("pts_time=%s\n", time_value_string(val_str, sizeof(val_str),

                                              pkt->pts, &st->time_base));

    printf("dts=%s\n", ts_value_string(val_str, sizeof(val_str), pkt->dts));

    printf("dts_time=%s\n", time_value_string(val_str, sizeof(val_str),

                                              pkt->dts, &st->time_base));

    printf("duration=%s\n", ts_value_string(val_str, sizeof(val_str),

                                            pkt->duration));

    printf("duration_time=%s\n", time_value_string(val_str, sizeof(val_str),

                                                   pkt->duration,

                                                   &st->time_base));

    printf("size=%s\n", value_string(val_str, sizeof(val_str),

                                     pkt->size, unit_byte_str));

    printf("pos=%"PRId64"\n", pkt->pos);

    printf("flags=%c\n", pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_');

    printf("[/PACKET]\n");

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 {

     NvmeNamespace *ns;
+
     uint32_t nsid = le32_to_cpu(c->nsid);

     uint64_t prp1 = le64_to_cpu(c->prp1);

static uint16_t nvme_identify_ns(NvmeCtrl *n, NvmeIdentify *c)

{

    NvmeNamespace *ns;

    uint32_t nsid = le32_to_cpu(c->nsid);

    uint64_t prp1 = le64_to_cpu(c->prp1);

    uint64_t prp2 = le64_to_cpu(c->prp2);

    if (nsid == 0 || nsid > n->num_namespaces) {

        return NVME_INVALID_NSID | NVME_DNR;

    }

    ns = &n->namespaces[nsid - 1];

    return nvme_dma_read_prp(n, (uint8_t *)&ns->id_ns, sizeof(ns->id_ns),

        prp1, prp2);

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     uint64_t size = memory_region_size(mr);

     uint32_t nr_lmbs = size / SPAPR_MEMORY_BLOCK_SIZE;
+
     uint32_t avail_lmbs = 0;

     uint64_t addr_start, addr;

static sPAPRDIMMState *spapr_recover_pending_dimm_state(sPAPRMachineState *ms,

                                                        PCDIMMDevice *dimm)

{

    sPAPRDRConnector *drc;

    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);

    MemoryRegion *mr = ddc->get_memory_region(dimm);

    uint64_t size = memory_region_size(mr);

    uint32_t nr_lmbs = size / SPAPR_MEMORY_BLOCK_SIZE;

    uint32_t avail_lmbs = 0;

    uint64_t addr_start, addr;

    int i;

    sPAPRDIMMState *ds;

    addr_start = object_property_get_int(OBJECT(dimm), PC_DIMM_ADDR_PROP,

                                         &error_abort);

    addr = addr_start;

    for (i = 0; i < nr_lmbs; i++) {

        drc = spapr_drc_by_id(TYPE_SPAPR_DRC_LMB,

                              addr / SPAPR_MEMORY_BLOCK_SIZE);

        g_assert(drc);

        if (drc->indicator_state != SPAPR_DR_INDICATOR_STATE_INACTIVE) {

            avail_lmbs++;

        }

        addr += SPAPR_MEMORY_BLOCK_SIZE;

    }

    ds = g_malloc0(sizeof(sPAPRDIMMState));

    ds->nr_lmbs = avail_lmbs;

    ds->dimm = dimm;

    spapr_pending_dimm_unplugs_add(ms, ds);

    return ds;

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@

     pfd.revents = 0;

+    g_poll(&pfd, 1, 0);
+
+    if (pfd.revents & G_IO_HUP) {
+
+        pty_chr_state(chr, 0);

     } else {

static void pty_chr_update_read_handler_locked(CharDriverState *chr)

{

    PtyCharDriver *s = chr->opaque;

    GPollFD pfd;

    pfd.fd = g_io_channel_unix_get_fd(s->fd);

    pfd.events = G_IO_OUT;

    pfd.revents = 0;

    g_poll(&pfd, 1, 0);

    if (pfd.revents & G_IO_HUP) {

        pty_chr_state(chr, 0);

    } else {

        pty_chr_state(chr, 1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)
+
+{
+
+    PCIDevice *pd = PCI_DEVICE(br);

     PCIBus *parent = pd->bus;

static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w)

{

    PCIDevice *pd = PCI_DEVICE(br);

    PCIBus *parent = pd->bus;

    memory_region_del_subregion(parent->address_space_io, &w->alias_io);

    memory_region_del_subregion(parent->address_space_mem, &w->alias_mem);

    memory_region_del_subregion(parent->address_space_mem, &w->alias_pref_mem);

    pci_unregister_vga(pd);

}


--- a/source.c
+++ b/source.c
@@ -26,8 +26,8 @@

+    if (!eval_lpc_coeffs(temp2, ractx->gain_lpc, 10))
+
+        colmult(ractx->gain_lpc, ractx->gain_lpc, gain_bw_tab, 10);
+
+}

static void backward_filter(RA288Context *ractx)

{

    float temp1[37]; // RTMP in the spec

    float temp2[11]; // GPTPMP in the spec

    do_hybrid_window(36, 40, 35, ractx->sp_block, temp1, ractx->sp_hist,

                     ractx->sp_rec, syn_window);

    if (!eval_lpc_coeffs(temp1, ractx->sp_lpc, 36))

        colmult(ractx->sp_lpc, ractx->sp_lpc, syn_bw_tab, 36);

    do_hybrid_window(10, 8, 20, ractx->gain_block, temp2, ractx->gain_hist,

                     ractx->gain_rec, gain_window);

    if (!eval_lpc_coeffs(temp2, ractx->gain_lpc, 10))

        colmult(ractx->gain_lpc, ractx->gain_lpc, gain_bw_tab, 10);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static inline target_phys_addr_t get_pgaddr (target_phys_addr_t sdr1,
+
                                              int sdr_sh,

                                              target_phys_addr_t hash,

static inline target_phys_addr_t get_pgaddr (target_phys_addr_t sdr1,

                                             int sdr_sh,

                                             target_phys_addr_t hash,

                                             target_phys_addr_t mask)

{

    return (sdr1 & ((target_ulong)(-1ULL) << sdr_sh)) | (hash & mask);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     int i;

     uint64_t res;
+
     uint64_t x = *data;

static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data)

{

    int i;

    uint64_t res;

    uint64_t x = *data;

    if (swap_ctl & FIMD_WINCON_SWAP_BITS) {

        res = 0;

        for (i = 0; i < 64; i++) {

            if (x & (1ULL << (64 - i))) {

                res |= (1ULL << i);

            }

        }

        x = res;

    }

    if (swap_ctl & FIMD_WINCON_SWAP_BYTE) {

        x = bswap64(x);

    }

    if (swap_ctl & FIMD_WINCON_SWAP_HWORD) {

        x = ((x & 0x000000000000FFFFULL) << 48) |

            ((x & 0x00000000FFFF0000ULL) << 16) |

            ((x & 0x0000FFFF00000000ULL) >> 16) |

            ((x & 0xFFFF000000000000ULL) >> 48);

    }

    if (swap_ctl & FIMD_WINCON_SWAP_WORD) {

        x = ((x & 0x00000000FFFFFFFFULL) << 32) |

            ((x & 0xFFFFFFFF00000000ULL) >> 32);

    }

    *data = x;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void xhci_check_iso_kick(XHCIState *xhci, XHCITransfer *xfer,

                                 XHCIEPContext *epctx, uint64_t mfindex)

static void xhci_check_iso_kick(XHCIState *xhci, XHCITransfer *xfer,

                                XHCIEPContext *epctx, uint64_t mfindex)

{

    if (xfer->mfindex_kick > mfindex) {

        timer_mod(epctx->kick_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +

                       (xfer->mfindex_kick - mfindex) * 125000);

        xfer->running_retry = 1;

    } else {

        epctx->mfindex_last = xfer->mfindex_kick;

        timer_del(epctx->kick_timer);

        xfer->running_retry = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 void qemu_register_clock_reset_notifier(QEMUClock *clock,
+
+                                        Notifier *notifier)

 {

void qemu_register_clock_reset_notifier(QEMUClock *clock,

                                        Notifier *notifier)

{

    qemu_clock_register_reset_notifier(clock->type, notifier);

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@

     if (mr->ops->old_portio) {
+
+        const MemoryRegionPortio *mrp = find_portio(mr, offset, width, false);
+
+
+
         *data = ((uint64_t)1 << (width * 8)) - 1;

         if (mrp) {

static void memory_region_iorange_read(IORange *iorange,

                                       uint64_t offset,

                                       unsigned width,

                                       uint64_t *data)

{

    MemoryRegion *mr = container_of(iorange, MemoryRegion, iorange);

    if (mr->ops->old_portio) {

        const MemoryRegionPortio *mrp = find_portio(mr, offset, width, false);

        *data = ((uint64_t)1 << (width * 8)) - 1;

        if (mrp) {

            *data = mrp->read(mr->opaque, offset - mrp->offset);

        }

        return;

    }

    *data = mr->ops->read(mr->opaque, offset, width);

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 static inline void RENAME(rgb15ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
+
+{
+
 	int i;
+
+        assert(src1 == src2);
+
+	for(i=0; i<width; i++)
+
+	{
+
+		int d0= ((uint32_t*)src1)[i];
+
+

 		int dl= (d0&0x03E07C1F);

static inline void RENAME(rgb15ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)

{

	int i;

        assert(src1 == src2);

	for(i=0; i<width; i++)

	{

		int d0= ((uint32_t*)src1)[i];

		int dl= (d0&0x03E07C1F);

		int dh= ((d0>>5)&0x03E0F81F);

		int dh2= (dh>>11) + (dh<<21);

		int d= dh2 + dl;

		int g= d&0x7F;

		int r= (d>>10)&0x7F;

		int b= d>>21;

		dstU[i]= ((RU*r + GU*g + BU*b)>>(RGB2YUV_SHIFT+1-3)) + 128;

		dstV[i]= ((RV*r + GV*g + BV*b)>>(RGB2YUV_SHIFT+1-3)) + 128;

	}

}


--- a/source.c
+++ b/source.c
@@ -2,7 +2,7 @@

                               uint32_t value)

+{

     m5206_mbar_state *s = (m5206_mbar_state *)opaque;

static void m5206_mbar_writeb(void *opaque, target_phys_addr_t offset,

                              uint32_t value)

{

    m5206_mbar_state *s = (m5206_mbar_state *)opaque;

    int width;

    offset &= 0x3ff;

    if (offset > 0x200) {

        hw_error("Bad MBAR write offset 0x%x", (int)offset);

    }

    width = m5206_mbar_width[offset >> 2];

    if (width > 1) {

        uint32_t tmp;

        tmp = m5206_mbar_readw(opaque, offset & ~1);

        if (offset & 1) {

            tmp = (tmp & 0xff00) | value;

        } else {

            tmp = (tmp & 0x00ff) | (value << 8);

        }

        m5206_mbar_writew(opaque, offset & ~1, tmp);

        return;

    }

    m5206_mbar_write(s, offset, value, 1);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void *qemu_blockalign(BlockDriverState *bs, size_t size)
+
 {

     return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_alignment : 512, size);

void *qemu_blockalign(BlockDriverState *bs, size_t size)

{

    return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_alignment : 512, size);

}


--- a/source.c
+++ b/source.c
@@ -1,17 +1,17 @@
 static void event_test_emit(test_QAPIEvent event, QDict *d, Error **errp)
+
 {

+    QObject *obj;
+
+    QDict *t;

+    int64_t s, ms;
+
+
+
     /* Verify that we have timestamp, then remove it to compare other fields */
+
     obj = qdict_get(d, "timestamp");

     g_assert(obj);

static void event_test_emit(test_QAPIEvent event, QDict *d, Error **errp)

{

    QObject *obj;

    QDict *t;

    int64_t s, ms;

    /* Verify that we have timestamp, then remove it to compare other fields */

    obj = qdict_get(d, "timestamp");

    g_assert(obj);

    t = qobject_to_qdict(obj);

    g_assert(t);

    obj = qdict_get(t, "seconds");

    g_assert(obj && qobject_type(obj) == QTYPE_QINT);

    s = qint_get_int(qobject_to_qint(obj));

    obj = qdict_get(t, "microseconds");

    g_assert(obj && qobject_type(obj) == QTYPE_QINT);

    ms = qint_get_int(qobject_to_qint(obj));

    if (s == -1) {

        g_assert(ms == -1);

    } else {

        g_assert(ms >= 0 && ms <= 999999);

    }

    g_assert(qdict_size(t) == 2);

    qdict_del(d, "timestamp");

    g_assert(qdict_cmp_simple(d, test_event_data->expect));

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline int IRQ_testbit(IRQ_queue_t *q, int n_IRQ)

 {

static inline int IRQ_testbit(IRQ_queue_t *q, int n_IRQ)

{

    return test_bit(q->queue, n_IRQ);

}


--- a/source.c
+++ b/source.c
@@ -12,11 +12,11 @@

+    if (pb->seekable) {
+
+        avio_seek(pb, 12, SEEK_SET);
+
+        avio_wl32(pb, wc->duration);

         avio_flush(pb);

static int write_trailer(AVFormatContext *s)

{

    WVMuxContext *wc = s->priv_data;

    AVIOContext *pb = s->pb;

    ff_ape_write(s);

    if (pb->seekable) {

        avio_seek(pb, 12, SEEK_SET);

        avio_wl32(pb, wc->duration);

        avio_flush(pb);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void parse_option_number(const char *name, const char *value,
+
                                 uint64_t *ret, Error **errp)
+
+{

     char *postfix;

static void parse_option_number(const char *name, const char *value,

                                uint64_t *ret, Error **errp)

{

    char *postfix;

    uint64_t number;

    number = strtoull(value, &postfix, 0);

    if (*postfix != '\0') {

        error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, "a number");

        return;

    }

    *ret = number;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

     switch (err) {
+
+    case NBD_SUCCESS:
+
+        return 0;
+
     case NBD_EPERM:

         return EPERM;

static int nbd_errno_to_system_errno(int err)

{

    switch (err) {

    case NBD_SUCCESS:

        return 0;

    case NBD_EPERM:

        return EPERM;

    case NBD_EIO:

        return EIO;

    case NBD_ENOMEM:

        return ENOMEM;

    case NBD_ENOSPC:

        return ENOSPC;

    default:

        TRACE("Squashing unexpected error %d to EINVAL", err);

        /* fallthrough */

    case NBD_EINVAL:

        return EINVAL;

    }

}


--- a/source.c
+++ b/source.c
@@ -21,11 +21,11 @@
         /* Only override when we know what the host supports */

         alter_insns(&pcc->insns_flags, PPC_ALTIVEC, vmx > 0);
+
+        alter_insns(&pcc->insns_flags2, PPC2_VSX, vmx > 1);
+
+    }
+
     if (dfp != -1) {

         /* Only override when we know what the host supports */

static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data)

{

    PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);

    uint32_t vmx = kvmppc_get_vmx();

    uint32_t dfp = kvmppc_get_dfp();

    /* Now fix up the class with information we can query from the host */

    if (vmx != -1) {

        /* Only override when we know what the host supports */

        alter_insns(&pcc->insns_flags, PPC_ALTIVEC, vmx > 0);

        alter_insns(&pcc->insns_flags2, PPC2_VSX, vmx > 1);

    }

    if (dfp != -1) {

        /* Only override when we know what the host supports */

        alter_insns(&pcc->insns_flags2, PPC2_DFP, dfp);

    }

    if (dcache_size != -1) {

        pcc->l1_dcache_size = dcache_size;

    }

    if (icache_size != -1) {

        pcc->l1_icache_size = icache_size;

    }

}


static void fft_ref_init(int nbits, int inverse)

{

    int i, n = 1 << nbits;

    exptab = av_malloc((n / 2) * sizeof(*exptab));

    for (i = 0; i < (n/2); i++) {

        double alpha = 2 * M_PI * (float)i / (float)n;

        double c1 = cos(alpha), s1 = sin(alpha);

        if (!inverse)

            s1 = -s1;

        exptab[i].re = c1;

        exptab[i].im = s1;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static void pc_init_pci_1_3(QEMUMachineInitArgs *args)

+{

     enable_compat_apic_id_mode();

static void pc_init_pci_1_3(QEMUMachineInitArgs *args)

{

    enable_compat_apic_id_mode();

    pc_sysfw_flash_vs_rom_bug_compatible = true;

    has_pvpanic = false;

    pc_init_pci(args);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static void default_drive(int enable, int snapshot, int use_scsi,

+                          BlockInterfaceType type, int index,
+
+                          const char *optstr)
+
+{

     QemuOpts *opts;

static void default_drive(int enable, int snapshot, int use_scsi,

                          BlockInterfaceType type, int index,

                          const char *optstr)

{

    QemuOpts *opts;

    if (type == IF_DEFAULT) {

        type = use_scsi ? IF_SCSI : IF_IDE;

    }

    if (!enable || drive_get_by_index(type, index)) {

        return;

    }

    opts = drive_add(type, index, NULL, optstr);

    if (snapshot) {

        drive_enable_snapshot(opts, NULL);

    }

    if (!drive_init(opts, use_scsi)) {

        exit(1);

    }

}


--- a/source.c
+++ b/source.c
@@ -12,16 +12,16 @@

     int64_t ret  = av_index_search_timestamp(st, timestamp, flags);

+    uint32_t header = 0;
+
+
+
+    if (!mp3->xing_toc) {
+
+        st->skip_samples = timestamp <= 0 ? mp3->start_pad + 528 + 1 : 0;

+
         return -1;

     }

static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,

                    int flags)

{

    MP3Context *mp3 = s->priv_data;

    AVIndexEntry *ie;

    AVStream *st = s->streams[0];

    int64_t ret  = av_index_search_timestamp(st, timestamp, flags);

    uint32_t header = 0;

    if (!mp3->xing_toc) {

        st->skip_samples = timestamp <= 0 ? mp3->start_pad + 528 + 1 : 0;

        return -1;

    }

    if (ret < 0)

        return ret;

    ie = &st->index_entries[ret];

    ret = avio_seek(s->pb, ie->pos, SEEK_SET);

    if (ret < 0)

        return ret;

    while (!s->pb->eof_reached) {

        header = (header << 8) + avio_r8(s->pb);

        if (ff_mpa_check_header(header) >= 0) {

            ff_update_cur_dts(s, st, ie->timestamp);

            ret = avio_seek(s->pb, -4, SEEK_CUR);

            st->skip_samples = ie->timestamp <= 0 ? mp3->start_pad + 528 + 1 : 0;

            return (ret >= 0) ? 0 : ret;

        }

    }

    return AVERROR_EOF;

}


--- a/source.c
+++ b/source.c
@@ -32,11 +32,11 @@

         if (mov_read_default(c, pb, atom) < 0)

+            return -1;
+
+    } else
+
+        url_fskip(pb, atom.size);

     return 0;

static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom)

{

    AVStream *st = c->fc->streams[c->fc->nb_streams-1];

    if((uint64_t)atom.size > (1<<30))

        return -1;

    if (st->codec->codec_id == CODEC_ID_QDM2) {

        // pass all frma atom to codec, needed at least for QDM2

        av_free(st->codec->extradata);

        st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);

        if (!st->codec->extradata)

            return AVERROR(ENOMEM);

        st->codec->extradata_size = atom.size;

        get_buffer(pb, st->codec->extradata, atom.size);

    } else if (atom.size > 8) { /* to read frma, esds atoms */

        if (mov_read_default(c, pb, atom) < 0)

            return -1;

    } else

        url_fskip(pb, atom.size);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -32,11 +32,11 @@

+    /* reset dma provider too */
+
+    if (bus->dma->ops->reset) {
+
+        bus->dma->ops->reset(bus->dma);

     }

void ide_bus_reset(IDEBus *bus)

{

    bus->unit = 0;

    bus->cmd = 0;

    ide_reset(&bus->ifs[0]);

    ide_reset(&bus->ifs[1]);

    ide_clear_hob(bus);

    /* pending async DMA */

    if (bus->dma->aiocb) {

#ifdef DEBUG_AIO

        printf("aio_cancel\n");

#endif

        bdrv_aio_cancel(bus->dma->aiocb);

        bus->dma->aiocb = NULL;

    }

    /* reset dma provider too */

    if (bus->dma->ops->reset) {

        bus->dma->ops->reset(bus->dma);

    }

}


--- a/source.c
+++ b/source.c
@@ -61,9 +61,9 @@
         }

     }
+
+
+
+    return 0;
+
 } //FIXME cleanup like ff_h264_check_intra_pred_mode

int ff_h264_check_intra4x4_pred_mode(H264Context *h){

    MpegEncContext * const s = &h->s;

    static const int8_t top [12]= {-1, 0,LEFT_DC_PRED,-1,-1,-1,-1,-1, 0};

    static const int8_t left[12]= { 0,-1, TOP_DC_PRED, 0,-1,-1,-1, 0,-1,DC_128_PRED};

    int i;

    if(!(h->top_samples_available&0x8000)){

        for(i=0; i<4; i++){

            int status= top[ h->intra4x4_pred_mode_cache[scan8[0] + i] ];

            if(status<0){

                av_log(h->s.avctx, AV_LOG_ERROR, "top block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);

                return -1;

            } else if(status){

                h->intra4x4_pred_mode_cache[scan8[0] + i]= status;

            }

        }

    }

    if((h->left_samples_available&0x8888)!=0x8888){

        static const int mask[4]={0x8000,0x2000,0x80,0x20};

        for(i=0; i<4; i++){

            if(!(h->left_samples_available&mask[i])){

                int status= left[ h->intra4x4_pred_mode_cache[scan8[0] + 8*i] ];

                if(status<0){

                    av_log(h->s.avctx, AV_LOG_ERROR, "left block unavailable for requested intra4x4 mode %d at %d %d\n", status, s->mb_x, s->mb_y);

                    return -1;

                } else if(status){

                    h->intra4x4_pred_mode_cache[scan8[0] + 8*i]= status;

                }

            }

        }

    }

    return 0;

} //FIXME cleanup like ff_h264_check_intra_pred_mode


--- a/source.c
+++ b/source.c
@@ -24,11 +24,11 @@

    stbuf->st_blocks = prstat->st_blocks;

+   stbuf->st_atim.tv_sec = prstat->st_atim_sec;
+
+   stbuf->st_atim.tv_nsec = prstat->st_atim_nsec;
+
+   stbuf->st_mtime = prstat->st_mtim_sec;

    stbuf->st_mtim.tv_nsec = prstat->st_mtim_nsec;

static void prstat_to_stat(struct stat *stbuf, ProxyStat *prstat)

{

   memset(stbuf, 0, sizeof(*stbuf));

   stbuf->st_dev = prstat->st_dev;

   stbuf->st_ino = prstat->st_ino;

   stbuf->st_nlink = prstat->st_nlink;

   stbuf->st_mode = prstat->st_mode;

   stbuf->st_uid = prstat->st_uid;

   stbuf->st_gid = prstat->st_gid;

   stbuf->st_rdev = prstat->st_rdev;

   stbuf->st_size = prstat->st_size;

   stbuf->st_blksize = prstat->st_blksize;

   stbuf->st_blocks = prstat->st_blocks;

   stbuf->st_atim.tv_sec = prstat->st_atim_sec;

   stbuf->st_atim.tv_nsec = prstat->st_atim_nsec;

   stbuf->st_mtime = prstat->st_mtim_sec;

   stbuf->st_mtim.tv_nsec = prstat->st_mtim_nsec;

   stbuf->st_ctime = prstat->st_ctim_sec;

   stbuf->st_ctim.tv_nsec = prstat->st_ctim_nsec;

}


--- a/source.c
+++ b/source.c
@@ -4,11 +4,11 @@

                             size_t len) {

+    struct VncState *vs = (struct VncState *)transport;
+
+    int ret;
+
+

  retry:

static ssize_t vnc_tls_pull(gnutls_transport_ptr_t transport,

                            void *data,

                            size_t len) {

    struct VncState *vs = (struct VncState *)transport;

    int ret;

 retry:

    ret = recv(vs->csock, data, len, 0);

    if (ret < 0) {

	if (errno == EINTR)

	    goto retry;

	return -1;

    }

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     if (!sigterm_reported) {

         sigterm_reported = (write(sigterm_wfd, "", 1) == 1);
+
+    }
+
 }

static void termsig_handler(int signum)

{

    static int sigterm_reported;

    if (!sigterm_reported) {

        sigterm_reported = (write(sigterm_wfd, "", 1) == 1);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 int64_t qemu_file_get_rate_limit(QEMUFile *f)

+{

     return f->xfer_limit;

int64_t qemu_file_get_rate_limit(QEMUFile *f)

{

    return f->xfer_limit;

}


--- a/source.c
+++ b/source.c
@@ -9,9 +9,9 @@
     if (bdrv_check_request(bs, sector_num, nb_sectors)) {
         return -EIO;
     /* throttling disk read I/O */
+    if (bs->io_limits_enabled) {
+        bdrv_io_limits_intercept(bs, false, nb_sectors);
+    tracked_request_begin(&req, bs, sector_num, nb_sectors, false);
+    ret = drv->bdrv_co_readv(bs, sector_num, nb_sectors, qiov);
     tracked_request_end(&req);
     return ret;

static int coroutine_fn bdrv_co_do_readv(BlockDriverState *bs,
    int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
{
    BlockDriver *drv = bs->drv;
    BdrvTrackedRequest req;
    int ret;
    if (!drv) {
        return -ENOMEDIUM;
    if (bdrv_check_request(bs, sector_num, nb_sectors)) {
        return -EIO;
    /* throttling disk read I/O */
    if (bs->io_limits_enabled) {
        bdrv_io_limits_intercept(bs, false, nb_sectors);
    tracked_request_begin(&req, bs, sector_num, nb_sectors, false);
    ret = drv->bdrv_co_readv(bs, sector_num, nb_sectors, qiov);
    tracked_request_end(&req);
    return ret;


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
+static void adb_mouse_event(void *opaque,
+
+                            int dx1, int dy1, int dz1, int buttons_state)
+
+{
+
     MouseState *s = opaque;

static void adb_mouse_event(void *opaque,

                            int dx1, int dy1, int dz1, int buttons_state)

{

    MouseState *s = opaque;

    s->dx += dx1;

    s->dy += dy1;

    s->dz += dz1;

    s->buttons_state = buttons_state;

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 {

     vnc_lock_output(vs);
+
     vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);

     vnc_write_u8(vs, 0);

static void send_ext_key_event_ack(VncState *vs)

{

    vnc_lock_output(vs);

    vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);

    vnc_write_u8(vs, 0);

    vnc_write_u16(vs, 1);

    vnc_framebuffer_update(vs, 0, 0,

                           surface_width(vs->vd->ds),

                           surface_height(vs->vd->ds),

                           VNC_ENCODING_EXT_KEY_EVENT);

    vnc_unlock_output(vs);

    vnc_flush(vs);

}


int ff_celp_lp_synthesis_filter(int16_t *out,

                                const int16_t* filter_coeffs,

                                const int16_t* in,

                                int buffer_length,

                                int filter_length,

                                int stop_on_overflow,

                                int rounder)

{

    int i,n;

    // Avoids a +1 in the inner loop.

    filter_length++;

    for (n = 0; n < buffer_length; n++) {

        int sum = rounder;

        for (i = 1; i < filter_length; i++)

            sum -= filter_coeffs[i-1] * out[n-i];

        sum = (sum >> 12) + in[n];

        if (sum + 0x8000 > 0xFFFFU) {

            if (stop_on_overflow)

                return 1;

            sum = (sum >> 31) ^ 32767;

        }

        out[n] = sum;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -16,10 +16,10 @@

     }

+    list->head = NULL;
+
+    list->tail = NULL;
+
+    g_free(list);

 }

vreader_list_delete(VReaderList *list)

{

    VReaderListEntry *current_entry;

    VReaderListEntry *next_entry = NULL;

    for (current_entry = vreader_list_get_first(list); current_entry;

         current_entry = next_entry) {

        next_entry = vreader_list_get_next(current_entry);

        vreader_list_entry_delete(current_entry);

    }

    list->head = NULL;

    list->tail = NULL;

    g_free(list);

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+static int vf_open(vf_instance_t *vf, char *args)
+
+{
+
+        vf->config=config;
+
+        vf->query_format=query_format;
+
+        vf->put_image=put_image;
+
+        vf->uninit=uninit;

static int vf_open(vf_instance_t *vf, char *args)

{

        vf->config=config;

        vf->query_format=query_format;

        vf->put_image=put_image;

        vf->uninit=uninit;

        vf->priv = calloc(1, sizeof (struct vf_priv_s));

        vf->priv->skipline = 0;

        vf->priv->scalew = 1;

        vf->priv->scaleh = 2;

        if (args) sscanf(args, "%d:%d:%d", &vf->priv->skipline, &vf->priv->scalew, &vf->priv->scaleh);

        return 1;

}


--- a/source.c
+++ b/source.c
@@ -5,10 +5,10 @@
 {

     uint64_t reqid = request_id++;
+
+    int ret = bdrv_co_preadv(bs->file->bs, offset, bytes, qiov, flags);
+
+    block_request_create(reqid, bs, qemu_coroutine_self());

     qemu_coroutine_yield();

static int coroutine_fn blkreplay_co_preadv(BlockDriverState *bs,

    uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags)

{

    uint64_t reqid = request_id++;

    int ret = bdrv_co_preadv(bs->file->bs, offset, bytes, qiov, flags);

    block_request_create(reqid, bs, qemu_coroutine_self());

    qemu_coroutine_yield();

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@

     nom = FFABS(nom)/gcd;
+
     den = FFABS(den)/gcd;

     if(nom<=max && den<=max){

int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max){

    AVRational a0={0,1}, a1={1,0};

    int sign= (nom<0) ^ (den<0);

    int64_t gcd= ff_gcd(FFABS(nom), FFABS(den));

    nom = FFABS(nom)/gcd;

    den = FFABS(den)/gcd;

    if(nom<=max && den<=max){

        a1= (AVRational){nom, den};

        den=0;

    }

    while(den){

        int64_t x       = nom / den;

        int64_t next_den= nom - den*x;

        int64_t a2n= x*a1.num + a0.num;

        int64_t a2d= x*a1.den + a0.den;

        if(a2n > max || a2d > max){

            if(a1.num) x= (max - a0.num) / a1.num;

            if(a1.den) x= FFMIN(x, (max - a0.den) / a1.den);

            // Won't overflow, sum == original denominator

            if (den*(2*x*a1.den + a0.den) > nom*a1.den)

                a1 = (AVRational){x*a1.num + a0.num, x*a1.den + a0.den};

            break;

        }

        a0= a1;

        a1= (AVRational){a2n, a2d};

        nom= den;

        den= next_den;

    }

    assert(ff_gcd(a1.num, a1.den) == 1);

    *dst_nom = sign ? -a1.num : a1.num;

    *dst_den = a1.den;

    return den==0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+void rng_backend_open(RngBackend *s, Error **errp)
+
 {

     object_property_set_bool(OBJECT(s), true, "opened", errp);

void rng_backend_open(RngBackend *s, Error **errp)

{

    object_property_set_bool(OBJECT(s), true, "opened", errp);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+int virtio_scsi_common_exit(VirtIOSCSICommon *vs)

 {

+    VirtIODevice *vdev = VIRTIO_DEVICE(vs);

int virtio_scsi_common_exit(VirtIOSCSICommon *vs)

{

    VirtIODevice *vdev = VIRTIO_DEVICE(vs);

    g_free(vs->cmd_vqs);

    virtio_cleanup(vdev);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         dev = s->pbdev[idx];

         if (dev && dev->state != ZPCI_FS_RESERVED) {
+
+            return dev;
+
+        }
+
     }

S390PCIBusDevice *s390_pci_find_next_avail_dev(S390PCIBusDevice *pbdev)

{

    int idx = 0;

    S390PCIBusDevice *dev = NULL;

    S390pciState *s = s390_get_phb();

    if (pbdev) {

        idx = (pbdev->fh & FH_MASK_INDEX) + 1;

    }

    for (; idx < PCI_SLOT_MAX; idx++) {

        dev = s->pbdev[idx];

        if (dev && dev->state != ZPCI_FS_RESERVED) {

            return dev;

        }

    }

    return NULL;

}


static inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) {

    int nza, nzb;

    int ctx = 0;

    if( cat == 0 ) {

        nza = h->left_cbp&0x100;

        nzb = h-> top_cbp&0x100;

    } else if( cat == 1 || cat == 2 ) {

        nza = h->non_zero_count_cache[scan8[idx] - 1];

        nzb = h->non_zero_count_cache[scan8[idx] - 8];

    } else if( cat == 3 ) {

        nza = (h->left_cbp>>(6+idx))&0x01;

        nzb = (h-> top_cbp>>(6+idx))&0x01;

    } else {

        assert(cat == 4);

        nza = h->non_zero_count_cache[scan8[16+idx] - 1];

        nzb = h->non_zero_count_cache[scan8[16+idx] - 8];

    }

    if( nza > 0 )

        ctx++;

    if( nzb > 0 )

        ctx += 2;

    return ctx + 4 * cat;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void test_hbitmap_iter_past(TestHBitmapData *data,
+
+                                    const void *unused)
+
 {

     hbitmap_test_init(data, L3, 0);

static void test_hbitmap_iter_past(TestHBitmapData *data,

                                    const void *unused)

{

    hbitmap_test_init(data, L3, 0);

    hbitmap_test_set(data, 0, L3);

    hbitmap_test_check(data, L3);

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@

         ret = link->dstpad->get_audio_buffer(link, perms, sample_fmt, size, channel_layout, planar);

+
+
+    if (!ret)
+
+        ret = avfilter_default_get_audio_buffer(link, perms, sample_fmt, size, channel_layout, planar);

AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,

                                             enum AVSampleFormat sample_fmt, int size,

                                             int64_t channel_layout, int planar)

{

    AVFilterBufferRef *ret = NULL;

    if (link->dstpad->get_audio_buffer)

        ret = link->dstpad->get_audio_buffer(link, perms, sample_fmt, size, channel_layout, planar);

    if (!ret)

        ret = avfilter_default_get_audio_buffer(link, perms, sample_fmt, size, channel_layout, planar);

    if (ret)

        ret->type = AVMEDIA_TYPE_AUDIO;

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

 #ifdef CONFIG_PPOLL
+
+    if (timeout < 0) {
+
+        return ppoll((struct pollfd *)fds, nfds, NULL, NULL);
+
     } else {

         struct timespec ts;

int qemu_poll_ns(GPollFD *fds, guint nfds, int64_t timeout)

{

#ifdef CONFIG_PPOLL

    if (timeout < 0) {

        return ppoll((struct pollfd *)fds, nfds, NULL, NULL);

    } else {

        struct timespec ts;

        int64_t tvsec = timeout / 1000000000LL;

        /* Avoid possibly overflowing and specifying a negative number of

         * seconds, which would turn a very long timeout into a busy-wait.

         */

        if (tvsec > (int64_t)INT32_MAX) {

            tvsec = INT32_MAX;

        }

        ts.tv_sec = tvsec;

        ts.tv_nsec = timeout % 1000000000LL;

        return ppoll((struct pollfd *)fds, nfds, &ts, NULL);

    }

#else

    return g_poll(fds, nfds, qemu_timeout_ns_to_ms(timeout));

#endif

}


--- a/source.c
+++ b/source.c
@@ -3,10 +3,10 @@
 {

     dp8393xState *s = opaque;
+
+
+
+    if (!(s->regs[SONIC_CR] & SONIC_CR_RXEN))

         return 0;

static int nic_can_receive(void *opaque)

{

    dp8393xState *s = opaque;

    if (!(s->regs[SONIC_CR] & SONIC_CR_RXEN))

        return 0;

    if (s->regs[SONIC_ISR] & SONIC_ISR_RBE)

        return 0;

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int image_probe(AVProbeData *p)
+
 {

     if (av_str2id(img_tags, p->filename)) {

static int image_probe(AVProbeData *p)

{

    if (av_str2id(img_tags, p->filename)) {

        if (av_filename_number_test(p->filename))

            return AVPROBE_SCORE_MAX;

        else

            return AVPROBE_SCORE_MAX/2;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -4,6 +4,6 @@

     aio_set_fd_handler(bdrv_get_aio_context(client->bs), client->sock,

+                       NULL, NULL, NULL);
+
 }

void nbd_client_session_detach_aio_context(NbdClientSession *client)

{

    aio_set_fd_handler(bdrv_get_aio_context(client->bs), client->sock,

                       NULL, NULL, NULL);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void open_eth_cleanup(NetClientState *nc)

+{

 }

static void open_eth_cleanup(NetClientState *nc)

{

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
         /*

          * LINT0 delivery mode on CPU #0 is set to ExtInt at initialization
+
+         * time typically by BIOS, so PIC interrupt can be delivered to the
+
+         * processor when local APIC is enabled.
+
          */

         s->lvt[APIC_LVT_LINT0] = 0x700;

static void apic_reset_common(DeviceState *d)

{

    APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);

    APICCommonClass *info = APIC_COMMON_GET_CLASS(s);

    bool bsp;

    bsp = cpu_is_bsp(s->cpu_env);

    s->apicbase = 0xfee00000 |

        (bsp ? MSR_IA32_APICBASE_BSP : 0) | MSR_IA32_APICBASE_ENABLE;

    s->vapic_paddr = 0;

    info->vapic_base_update(s);

    apic_init_reset(d);

    if (bsp) {

        /*

         * LINT0 delivery mode on CPU #0 is set to ExtInt at initialization

         * time typically by BIOS, so PIC interrupt can be delivered to the

         * processor when local APIC is enabled.

         */

        s->lvt[APIC_LVT_LINT0] = 0x700;

    }

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     /* MSR:POW cannot be set by any form of rfi */

     msr &= ~(1ULL << MSR_POW);
+

 #if defined(TARGET_PPC64)

static inline void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr)

{

    CPUState *cs = CPU(ppc_env_get_cpu(env));

    /* MSR:POW cannot be set by any form of rfi */

    msr &= ~(1ULL << MSR_POW);

#if defined(TARGET_PPC64)

    /* Switching to 32-bit ? Crop the nip */

    if (!msr_is_64bit(env, msr)) {

        nip = (uint32_t)nip;

    }

#else

    nip = (uint32_t)nip;

#endif

    /* XXX: beware: this is false if VLE is supported */

    env->nip = nip & ~((target_ulong)0x00000003);

    hreg_store_msr(env, msr, 1);

#if defined(DEBUG_OP)

    cpu_dump_rfi(env->nip, env->msr);

#endif

    /* No need to raise an exception here,

     * as rfi is always the last insn of a TB

     */

    cs->interrupt_request |= CPU_INTERRUPT_EXITTB;

    /* Context synchronizing: check if TCG TLB needs flush */

    check_tlb_flush(env);

}


--- a/source.c
+++ b/source.c
@@ -14,7 +14,7 @@

     mode = ((mode & 0777) | S_IFDIR) & ~(S_IWUSR | S_IWGRP | S_IWOTH);

+    node = g_malloc0(sizeof(V9fsSynthNode));

     if (attr) {

static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode,

                                        const char *name,

                                        V9fsSynthNodeAttr *attr, int inode)

{

    V9fsSynthNode *node;

    /* Add directory type and remove write bits */

    mode = ((mode & 0777) | S_IFDIR) & ~(S_IWUSR | S_IWGRP | S_IWOTH);

    node = g_malloc0(sizeof(V9fsSynthNode));

    if (attr) {

        /* We are adding .. or . entries */

        node->attr = attr;

        node->attr->nlink++;

    } else {

        node->attr = &node->actual_attr;

        node->attr->inode = inode;

        node->attr->nlink = 1;

        /* We don't allow write to directories */

        node->attr->mode   = mode;

        node->attr->write = NULL;

        node->attr->read  = NULL;

    }

    node->private = node;

    strncpy(node->name, name, sizeof(node->name));

    QLIST_INSERT_HEAD_RCU(&parent->child, node, sibling);

    return node;

}


static inline uint32_t ucf64_stoi(float32 s)

{

    union {

        uint32_t i;

        float32 s;

    } v;

    v.s = s;

    return v.i;

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,

                       void *opaque, Error **errp)
+
 {

     Location loc;

     QemuOpts *opts;
+
     int rc;

+    loc_push_none(&loc);

     QTAILQ_FOREACH(opts, &list->head, next) {

int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,

                      void *opaque, Error **errp)

{

    Location loc;

    QemuOpts *opts;

    int rc;

    loc_push_none(&loc);

    QTAILQ_FOREACH(opts, &list->head, next) {

        loc_restore(&opts->loc);

        rc = func(opaque, opts, errp);

        if (rc) {

            return rc;

        }

        assert(!errp || !*errp);

    }

    loc_pop(&loc);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void piix3_update_irq_levels(PIIX3State *piix3)
+
+{
+
+    int pirq;

static void piix3_update_irq_levels(PIIX3State *piix3)

{

    int pirq;

    piix3->pic_levels = 0;

    for (pirq = 0; pirq < PIIX_NUM_PIRQS; pirq++) {

        piix3_set_irq_level(piix3, pirq,

                            pci_bus_get_irq_level(piix3->dev.bus, pirq));

    }

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static void nbd_teardown_connection(NbdClientSession *client)

 {
+
+    struct nbd_request request = {
+
+        .type = NBD_CMD_DISC,
+
+        .from = 0,

         .len = 0

static void nbd_teardown_connection(NbdClientSession *client)

{

    struct nbd_request request = {

        .type = NBD_CMD_DISC,

        .from = 0,

        .len = 0

    };

    nbd_send_request(client->sock, &request);

    /* finish any pending coroutines */

    shutdown(client->sock, 2);

    nbd_recv_coroutines_enter_all(client);

    qemu_aio_set_fd_handler(client->sock, NULL, NULL, NULL);

    closesocket(client->sock);

    client->sock = -1;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void gen_op_eval_fblg(TCGv dst, TCGv src,
+
+                                    unsigned int fcc_offset)
+
 {

     gen_mov_reg_FCC0(dst, src, fcc_offset);

static inline void gen_op_eval_fblg(TCGv dst, TCGv src,

                                    unsigned int fcc_offset)

{

    gen_mov_reg_FCC0(dst, src, fcc_offset);

    gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset);

    tcg_gen_xor_tl(dst, dst, cpu_tmp0);

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void aio_signal_handler(int signum)
+
+{
+
+#if !defined(QEMU_IMG) && !defined(QEMU_NBD)
+
     CPUState *env = cpu_single_env;
+
     if (env) {

         /* stop the currently executing cpu because a timer occured */

static void aio_signal_handler(int signum)

{

#if !defined(QEMU_IMG) && !defined(QEMU_NBD)

    CPUState *env = cpu_single_env;

    if (env) {

        /* stop the currently executing cpu because a timer occured */

        cpu_interrupt(env, CPU_INTERRUPT_EXIT);

#ifdef USE_KQEMU

        if (env->kqemu_enabled) {

            kqemu_cpu_interrupt(env);

        }

#endif

    }

#endif

}


--- a/source.c
+++ b/source.c
@@ -12,11 +12,11 @@

         RDMALocalBlock *block = &(rdma->local_ram_blocks.block[index]);

+
+
+        if (!test_and_set_bit(chunk, block->unregister_bitmap)) {
+
+            DDPRINTF("Appending unregister chunk %" PRIu64

                     " at position %d\n", chunk, rdma->unregister_next);

static void qemu_rdma_signal_unregister(RDMAContext *rdma, uint64_t index,

                                        uint64_t chunk, uint64_t wr_id)

{

    if (rdma->unregistrations[rdma->unregister_next] != 0) {

        fprintf(stderr, "rdma migration: queue is full!\n");

    } else {

        RDMALocalBlock *block = &(rdma->local_ram_blocks.block[index]);

        if (!test_and_set_bit(chunk, block->unregister_bitmap)) {

            DDPRINTF("Appending unregister chunk %" PRIu64

                    " at position %d\n", chunk, rdma->unregister_next);

            rdma->unregistrations[rdma->unregister_next++] =

                    qemu_rdma_make_wrid(wr_id, index, chunk);

            if (rdma->unregister_next == RDMA_SIGNALED_SEND_MAX) {

                rdma->unregister_next = 0;

            }

        } else {

            DDPRINTF("Unregister chunk %" PRIu64 " already in queue.\n",

                    chunk);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -14,11 +14,11 @@

     TCGv t0 = tcg_temp_new();

+    TCGv t1 = tcg_temp_new();
+
+    tcg_gen_ext32u_tl(t0, cpu_gpr[rB(ctx->opcode)]);
+
+    tcg_gen_andi_tl(t1, cpu_gpr[rA(ctx->opcode)], 0xFFFFFFFF0000000ULL);

     tcg_gen_or_tl(cpu_gpr[rD(ctx->opcode)], t0, t1);

static inline void gen_evmergehilo(DisasContext *ctx)

{

    if (unlikely(!ctx->spe_enabled)) {

        gen_exception(ctx, POWERPC_EXCP_APU);

        return;

    }

#if defined(TARGET_PPC64)

    TCGv t0 = tcg_temp_new();

    TCGv t1 = tcg_temp_new();

    tcg_gen_ext32u_tl(t0, cpu_gpr[rB(ctx->opcode)]);

    tcg_gen_andi_tl(t1, cpu_gpr[rA(ctx->opcode)], 0xFFFFFFFF0000000ULL);

    tcg_gen_or_tl(cpu_gpr[rD(ctx->opcode)], t0, t1);

    tcg_temp_free(t0);

    tcg_temp_free(t1);

#else

    tcg_gen_mov_i32(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]);

    tcg_gen_mov_i32(cpu_gprh[rD(ctx->opcode)], cpu_gprh[rA(ctx->opcode)]);

#endif

}


--- a/source.c
+++ b/source.c
@@ -20,11 +20,11 @@

         res = 0xffffffff;

+        float_raise( float_flag_invalid STATUS_VAR);
+
+    } else {
+
+        res = v;

     }

uint32 float64_to_uint32_round_to_zero( float64 a STATUS_PARAM )

{

    int64_t v;

    uint32 res;

    v = float64_to_int64_round_to_zero(a STATUS_VAR);

    if (v < 0) {

        res = 0;

        float_raise( float_flag_invalid STATUS_VAR);

    } else if (v > 0xffffffff) {

        res = 0xffffffff;

        float_raise( float_flag_invalid STATUS_VAR);

    } else {

        res = v;

    }

    return res;

}


--- a/source.c
+++ b/source.c
@@ -4,7 +4,7 @@

     target_phys_addr_t sr_base;

+    uint64_t tmp64;

     int n, do_invalidate;

void ppc_slb_invalidate_all (CPUPPCState *env)

{

    target_phys_addr_t sr_base;

    uint64_t tmp64;

    int n, do_invalidate;

    do_invalidate = 0;

    sr_base = env->spr[SPR_ASR];

    for (n = 0; n < env->slb_nr; n++) {

        tmp64 = ldq_phys(sr_base);

        if (slb_is_valid(tmp64)) {

            slb_invalidate(&tmp64);

            stq_phys(sr_base, tmp64);

            /* XXX: given the fact that segment size is 256 MB or 1TB,

             *      and we still don't have a tlb_flush_mask(env, n, mask)

             *      in Qemu, we just invalidate all TLBs

             */

            do_invalidate = 1;

        }

        sr_base += 12;

    }

    if (do_invalidate)

        tlb_flush(env, 1);

}


--- a/source.c
+++ b/source.c
@@ -22,9 +22,9 @@
     for (i = 0; i < SUBFRAMES; i++)
         put_subframe(c, i);
     flush_put_bits(&c->pb);
+    avpkt->pts      = frame->pts;
+    avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
+    avpkt->size     = c->frame_size + 1;
+    *got_packet_ptr = 1;
+    return 0;
 }

static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
                        const AVFrame *frame, int *got_packet_ptr)
{
    DCAEncContext *c = avctx->priv_data;
    const int32_t *samples;
    int ret, i;
    if ((ret = ff_alloc_packet2(avctx, avpkt, c->frame_size , 0)) < 0)
        return ret;
    samples = (const int32_t *)frame->data[0];
    subband_transform(c, samples);
    if (c->lfe_channel)
        lfe_downsample(c, samples);
    calc_masking(c, samples);
    find_peaks(c);
    assign_bits(c);
    calc_scales(c);
    quantize_all(c);
    shift_history(c, samples);
    init_put_bits(&c->pb, avpkt->data, avpkt->size);
    put_frame_header(c);
    put_primary_audio_header(c);
    for (i = 0; i < SUBFRAMES; i++)
        put_subframe(c, i);
    flush_put_bits(&c->pb);
    avpkt->pts      = frame->pts;
    avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples);
    avpkt->size     = c->frame_size + 1;
    *got_packet_ptr = 1;
    return 0;
}


--- a/source.c
+++ b/source.c
@@ -56,11 +56,11 @@

                "error initializing filter '%s' with args '%s'\n", name, args);

+        return NULL;
+
+    }
+
+

     return filt;

static AVFilterContext *create_filter(AVFilterGraph *ctx, int index,

                                      const char *name, const char *args,

                                      AVClass *log_ctx)

{

    AVFilterContext *filt;

    AVFilter *filterdef;

    char inst_name[30];

    snprintf(inst_name, sizeof(inst_name), "Parsed filter %d", index);

    if(!(filterdef = avfilter_get_by_name(name))) {

        av_log(log_ctx, AV_LOG_ERROR,

               "no such filter: '%s'\n", name);

        return NULL;

    }

    if(!(filt = avfilter_open(filterdef, inst_name))) {

        av_log(log_ctx, AV_LOG_ERROR,

               "error creating filter '%s'\n", name);

        return NULL;

    }

    if(avfilter_graph_add_filter(ctx, filt) < 0)

        return NULL;

    if(avfilter_init_filter(filt, args, NULL)) {

        av_log(log_ctx, AV_LOG_ERROR,

               "error initializing filter '%s' with args '%s'\n", name, args);

        return NULL;

    }

    return filt;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, int dc){

    int i;

static inline void mcdc(uint16_t *dst, uint16_t *src, int log2w, int h, int stride, int scale, int dc){

   int i;

   dc*= 0x10001;

   switch(log2w){

   case 0:

        for(i=0; i<h; i++){

            dst[0] = scale*src[0] + dc;

            if(scale) src += stride;

            dst += stride;

        }

        break;

    case 1:

        for(i=0; i<h; i++){

            LE_CENTRIC_MUL(dst, src, scale, dc);

            if(scale) src += stride;

            dst += stride;

        }

        break;

    case 2:

        for(i=0; i<h; i++){

            LE_CENTRIC_MUL(dst,     src,     scale, dc);

            LE_CENTRIC_MUL(dst + 2, src + 2, scale, dc);

            if(scale) src += stride;

            dst += stride;

        }

        break;

    case 3:

        for(i=0; i<h; i++){

            LE_CENTRIC_MUL(dst,     src,     scale, dc);

            LE_CENTRIC_MUL(dst + 2, src + 2, scale, dc);

            LE_CENTRIC_MUL(dst + 4, src + 4, scale, dc);

            LE_CENTRIC_MUL(dst + 6, src + 6, scale, dc);

            if(scale) src += stride;

            dst += stride;

        }

        break;

    default: assert(0);

    }

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

+
     k->no_hotplug = 1;

     k->init = piix4_initfn;

static void piix4_class_init(ObjectClass *klass, void *data)

{

    DeviceClass *dc = DEVICE_CLASS(klass);

    PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);

    k->no_hotplug = 1;

    k->init = piix4_initfn;

    k->vendor_id = PCI_VENDOR_ID_INTEL;

    k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0;

    k->class_id = PCI_CLASS_BRIDGE_ISA;

    dc->desc = "ISA bridge";

    dc->no_user = 1;

    dc->vmsd = &vmstate_piix4;

}


--- a/source.c
+++ b/source.c
@@ -37,11 +37,11 @@
     s->rx_read = 0;

+
+    /* Now we can signal we have received something. */
+
+    s->intctl |= MIPSNET_INTCTL_RXDONE;
+
     mipsnet_update_irq(s);

 }

static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size)

{

    MIPSnetState *s = opaque;

#ifdef DEBUG_MIPSNET_RECEIVE

    printf("mipsnet: receiving len=%d\n", size);

#endif

    if (!mipsnet_can_receive(opaque))

        return;

    s->busy = 1;

    /* Just accept everything. */

    /* Write packet data. */

    memcpy(s->rx_buffer, buf, size);

    s->rx_count = size;

    s->rx_read = 0;

    /* Now we can signal we have received something. */

    s->intctl |= MIPSNET_INTCTL_RXDONE;

    mipsnet_update_irq(s);

}


--- a/source.c
+++ b/source.c
@@ -4,10 +4,10 @@

 {

+    if (chipselect < 0 || chipselect > 3) {
+
+        fprintf(stderr, "%s: Bad chipselect %i\n", __FUNCTION__, chipselect);
+
         exit(-1);

     }

void omap_uwire_attach(struct omap_uwire_s *s,

                uWireSlave *slave, int chipselect)

{

    if (chipselect < 0 || chipselect > 3) {

        fprintf(stderr, "%s: Bad chipselect %i\n", __FUNCTION__, chipselect);

        exit(-1);

    }

    s->chip[chipselect] = slave;

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
+static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
+
+{
+
+    vorbis_enc_context *venc = avccontext->priv_data;

+
+
+    if (avccontext->channels != 2) {
+
+        av_log(avccontext, AV_LOG_ERROR, "Current Libav Vorbis encoder only supports 2 channels.\n");
+
+        return -1;
+
+    }

static av_cold int vorbis_encode_init(AVCodecContext *avccontext)

{

    vorbis_enc_context *venc = avccontext->priv_data;

    if (avccontext->channels != 2) {

        av_log(avccontext, AV_LOG_ERROR, "Current Libav Vorbis encoder only supports 2 channels.\n");

        return -1;

    }

    create_vorbis_context(venc, avccontext);

    if (avccontext->flags & CODEC_FLAG_QSCALE)

        venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA / 10.;

    else

        venc->quality = 0.03;

    venc->quality *= venc->quality;

    avccontext->extradata_size = put_main_header(venc, (uint8_t**)&avccontext->extradata);

    avccontext->frame_size     = 1 << (venc->log2_blocksize[0] - 1);

    avccontext->coded_frame            = avcodec_alloc_frame();

    avccontext->coded_frame->key_frame = 1;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void copy_backptr(LZOContext *c, int back, int cnt)
+
 {
+
     register const uint8_t *src = &c->out[-back];

     register uint8_t *dst       = c->out;

static inline void copy_backptr(LZOContext *c, int back, int cnt)

{

    register const uint8_t *src = &c->out[-back];

    register uint8_t *dst       = c->out;

    if (src < c->out_start || src > dst) {

        c->error |= AV_LZO_INVALID_BACKPTR;

        return;

    }

    if (cnt > c->out_end - dst) {

        cnt       = FFMAX(c->out_end - dst, 0);

        c->error |= AV_LZO_OUTPUT_FULL;

    }

    av_memcpy_backptr(dst, back, cnt);

    c->out = dst + cnt;

}


static void rtas_int_off(sPAPREnvironment *spapr, uint32_t token,

                         uint32_t nargs, target_ulong args,

                         uint32_t nret, target_ulong rets)

{

    struct ics_state *ics = spapr->icp->ics;

    uint32_t nr;

    if ((nargs != 1) || (nret != 1)) {

        rtas_st(rets, 0, -3);

        return;

    }

    nr = rtas_ld(args, 0);

    if (!ics_valid_irq(ics, nr)) {

        rtas_st(rets, 0, -3);

        return;

    }

    ics_write_xive(ics, nr, ics->irqs[nr - ics->offset].server, 0xff,

                   ics->irqs[nr - ics->offset].priority);

    rtas_st(rets, 0, 0); /* Success */

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
 {

     IntelIOMMUNotifierNode *node;
+
+    VTDContextEntry ce;
+
+    int ret;
+

     QLIST_FOREACH(node, &(s->notifiers_list), next) {

static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s,

                                           uint16_t domain_id, hwaddr addr,

                                           uint8_t am)

{

    IntelIOMMUNotifierNode *node;

    VTDContextEntry ce;

    int ret;

    QLIST_FOREACH(node, &(s->notifiers_list), next) {

        VTDAddressSpace *vtd_as = node->vtd_as;

        ret = vtd_dev_to_context_entry(s, pci_bus_num(vtd_as->bus),

                                       vtd_as->devfn, &ce);

        if (!ret && domain_id == VTD_CONTEXT_ENTRY_DID(ce.hi)) {

            vtd_page_walk(&ce, addr, addr + (1 << am) * VTD_PAGE_SIZE,

                          vtd_page_invalidate_notify_hook,

                          (void *)&vtd_as->iommu, true);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void show_pix_fmts(void)
+
 {

     list_fmts(avcodec_pix_fmt_string, PIX_FMT_NB);

void show_pix_fmts(void)

{

    list_fmts(avcodec_pix_fmt_string, PIX_FMT_NB);

}


--- a/source.c
+++ b/source.c
@@ -8,11 +8,11 @@

     for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {

+        cpu_physical_memory_rw(addr,(uint8_t *)buf, sizeof(*buf), 0);
+
+        *buf = le32_to_cpu(*buf);
+
+    }

static inline int get_dwords(uint32_t addr, uint32_t *buf, int num)

{

    int i;

    for(i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {

        cpu_physical_memory_rw(addr,(uint8_t *)buf, sizeof(*buf), 0);

        *buf = le32_to_cpu(*buf);

    }

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     AVStream *st;

+
     avio_skip(s->pb, 4);

static int msf_read_header(AVFormatContext *s)

{

    unsigned codec, align, size;

    AVStream *st;

    avio_skip(s->pb, 4);

    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);

    st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;

    codec                  = avio_rb32(s->pb);

    st->codec->channels    = avio_rb32(s->pb);

    if (st->codec->channels <= 0)

        return AVERROR_INVALIDDATA;

    size = avio_rb32(s->pb);

    st->codec->sample_rate = avio_rb32(s->pb);

    if (st->codec->sample_rate <= 0)

        return AVERROR_INVALIDDATA;

    align = avio_rb32(s->pb) ;

    if (align > INT_MAX / st->codec->channels)

        return AVERROR_INVALIDDATA;

    st->codec->block_align = align;

    switch (codec) {

    case 0: st->codec->codec_id = AV_CODEC_ID_PCM_S16BE; break;

    case 3: st->codec->block_align = 16 * st->codec->channels;

            st->codec->codec_id = AV_CODEC_ID_ADPCM_PSX; break;

    case 7: st->need_parsing = AVSTREAM_PARSE_FULL_RAW;

            st->codec->codec_id = AV_CODEC_ID_MP3;       break;

    default:

            avpriv_request_sample(s, "Codec %d", codec);

            return AVERROR_PATCHWELCOME;

    }

    st->duration = av_get_audio_frame_duration(st->codec, size);

    avio_skip(s->pb, 0x40 - avio_tell(s->pb));

    avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
+uint32_t HELPER(sar_cc)(CPUM68KState *env, uint32_t val, uint32_t shift)
+
+{
+
+    uint64_t temp;
+
+    uint32_t result;
+
+
+
+    shift &= 63;
+
     temp = (int64_t)val << 32 >> shift;

     result = temp >> 32;

uint32_t HELPER(sar_cc)(CPUM68KState *env, uint32_t val, uint32_t shift)

{

    uint64_t temp;

    uint32_t result;

    shift &= 63;

    temp = (int64_t)val << 32 >> shift;

    result = temp >> 32;

    env->cc_c = (temp >> 31) & 1;

    env->cc_n = result;

    env->cc_z = result;

    env->cc_v = result ^ val;

    env->cc_x = shift ? env->cc_c : env->cc_x;

    return result;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int copy)

+{
+
+    AVStream *fst;
+
+

     fst = av_mallocz(sizeof(AVStream));

static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int copy)

{

    AVStream *fst;

    fst = av_mallocz(sizeof(AVStream));

    if (!fst)

        return NULL;

    if (copy) {

        fst->codec= avcodec_alloc_context();

        memcpy(fst->codec, codec, sizeof(AVCodecContext));

        if (codec->extradata_size) {

            fst->codec->extradata = av_malloc(codec->extradata_size);

            memcpy(fst->codec->extradata, codec->extradata,

                codec->extradata_size);

        }

    } else {

        /* live streams must use the actual feed's codec since it may be

         * updated later to carry extradata needed by the streams.

         */

        fst->codec = codec;

    }

    fst->priv_data = av_mallocz(sizeof(FeedData));

    fst->index = stream->nb_streams;

    av_set_pts_info(fst, 33, 1, 90000);

    fst->sample_aspect_ratio = (AVRational){0,1};

    stream->streams[stream->nb_streams++] = fst;

    return fst;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
+static void next(DBDMA_channel *ch)
+
+{
+
     uint32_t cp;

static void next(DBDMA_channel *ch)

{

    uint32_t cp;

    ch->regs[DBDMA_STATUS] &= cpu_to_be32(~BT);

    cp = be32_to_cpu(ch->regs[DBDMA_CMDPTR_LO]);

    ch->regs[DBDMA_CMDPTR_LO] = cpu_to_be32(cp + sizeof(dbdma_cmd));

    dbdma_cmdptr_load(ch);

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

     TCGLabel *l = &s->labels[label_index];
+
+    intptr_t value = (intptr_t)ptr;
+
+    TCGRelocation *r;
+

     assert(!l->has_value);

static void tcg_out_label(TCGContext *s, int label_index, tcg_insn_unit *ptr)

{

    TCGLabel *l = &s->labels[label_index];

    intptr_t value = (intptr_t)ptr;

    TCGRelocation *r;

    assert(!l->has_value);

    for (r = l->u.first_reloc; r != NULL; r = r->next) {

        patch_reloc(r->ptr, r->type, value, r->addend);

    }

    l->has_value = 1;

    l->u.value_ptr = ptr;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void gen_neon_trn_u8(TCGv t0, TCGv t1)

+{
+
     TCGv rd, tmp;

@@ -11,8 +11,8 @@
     tmp = new_tmp();

+
+    tcg_gen_shli_i32(rd, t0, 8);

     tcg_gen_andi_i32(rd, rd, 0xff00ff00);

static void gen_neon_trn_u8(TCGv t0, TCGv t1)

{

    TCGv rd, tmp;

    rd = new_tmp();

    tmp = new_tmp();

    tcg_gen_shli_i32(rd, t0, 8);

    tcg_gen_andi_i32(rd, rd, 0xff00ff00);

    tcg_gen_andi_i32(tmp, t1, 0x00ff00ff);

    tcg_gen_or_i32(rd, rd, tmp);

    tcg_gen_shri_i32(t1, t1, 8);

    tcg_gen_andi_i32(t1, t1, 0x00ff00ff);

    tcg_gen_andi_i32(tmp, t0, 0xff00ff00);

    tcg_gen_or_i32(t1, t1, tmp);

    tcg_gen_mov_i32(t0, rd);

    dead_tmp(tmp);

    dead_tmp(rd);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void property_get_bool(Object *obj, Visitor *v, void *opaque,

                               const char *name, Error **errp)
+
 {

     BoolProperty *prop = opaque;

static void property_get_bool(Object *obj, Visitor *v, void *opaque,

                              const char *name, Error **errp)

{

    BoolProperty *prop = opaque;

    bool value;

    value = prop->get(obj, errp);

    visit_type_bool(v, &value, name, errp);

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     qemu_mutex_lock(&flat_view_mutex);

     view = as->current_map;
+
+    flatview_ref(view);
+
+    qemu_mutex_unlock(&flat_view_mutex);

     return view;

static FlatView *address_space_get_flatview(AddressSpace *as)

{

    FlatView *view;

    qemu_mutex_lock(&flat_view_mutex);

    view = as->current_map;

    flatview_ref(view);

    qemu_mutex_unlock(&flat_view_mutex);

    return view;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void vmsvga_check_size(struct vmsvga_state_s *s)

+{
+
     DisplaySurface *surface = qemu_console_surface(s->vga.con);

static inline void vmsvga_check_size(struct vmsvga_state_s *s)

{

    DisplaySurface *surface = qemu_console_surface(s->vga.con);

    if (s->new_width != surface_width(surface) ||

        s->new_height != surface_height(surface)) {

        qemu_console_resize(s->vga.con, s->new_width, s->new_height);

        s->invalidated = 1;

    }

}


--- a/source.c
+++ b/source.c
@@ -27,11 +27,11 @@
             int j;

             for (j = 0; j < of->ctx->nb_streams; j++)
+
+                output_streams[of->ost_index + j]->is_past_recording_time = 1;
+
+            continue;
+
         }

static int need_output(void)

{

    int i;

    for (i = 0; i < nb_output_streams; i++) {

        OutputStream *ost    = output_streams[i];

        OutputFile *of       = output_files[ost->file_index];

        AVFormatContext *os  = output_files[ost->file_index]->ctx;

        if (ost->is_past_recording_time ||

            (os->pb && avio_tell(os->pb) >= of->limit_filesize))

            continue;

        if (ost->frame_number >= ost->max_frames) {

            int j;

            for (j = 0; j < of->ctx->nb_streams; j++)

                output_streams[of->ost_index + j]->is_past_recording_time = 1;

            continue;

        }

        return 1;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -15,11 +15,11 @@
     }

+
+    gen_exception_insn(s, 4, EXCP_UDEF, syn_fp_access_trap(1, 0xe, false),
+
+                       default_exception_el(s));
+
     return false;

 }

static inline bool fp_access_check(DisasContext *s)

{

    assert(!s->fp_access_checked);

    s->fp_access_checked = true;

    if (s->cpacr_fpen) {

        return true;

    }

    gen_exception_insn(s, 4, EXCP_UDEF, syn_fp_access_trap(1, 0xe, false),

                       default_exception_el(s));

    return false;

}


--- a/source.c
+++ b/source.c
@@ -41,8 +41,8 @@
         smv_img_pnt(s->picture[1]->data, mjpeg_data->data, mjpeg_data->linesize,
                     avctx->pix_fmt, avctx->width, avctx->height, cur_frame);
         for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
+            s->picture[1]->linesize[i] = mjpeg_data->linesize[i];
+        ret = av_frame_ref(data, s->picture[1]);
+    }
+    return ret;
+}

static int smvjpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
                            AVPacket *avpkt)
{
    const AVPixFmtDescriptor *desc;
    SMVJpegDecodeContext *s = avctx->priv_data;
    AVFrame* mjpeg_data = s->picture[0];
    int i, cur_frame = 0, ret = 0;
    cur_frame = avpkt->pts % s->frames_per_jpeg;
    /* Are we at the start of a block? */
    if (!cur_frame) {
        av_frame_unref(mjpeg_data);
        ret = avcodec_decode_video2(s->avctx, mjpeg_data, &s->mjpeg_data_size, avpkt);
        if (ret < 0) {
            s->mjpeg_data_size = 0;
            return ret;
        }
    } else if (!s->mjpeg_data_size)
        return AVERROR(EINVAL);
    desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
    av_assert0(desc);
    if (mjpeg_data->height % (s->frames_per_jpeg << desc->log2_chroma_h)) {
        av_log(avctx, AV_LOG_ERROR, "Invalid height\n");
        return AVERROR_INVALIDDATA;
    }
    /*use the last lot... */
    *data_size = s->mjpeg_data_size;
    avctx->pix_fmt = s->avctx->pix_fmt;
    /* We shouldn't get here if frames_per_jpeg <= 0 because this was rejected
       in init */
    ret = ff_set_dimensions(avctx, mjpeg_data->width, mjpeg_data->height / s->frames_per_jpeg);
    if (ret < 0) {
        av_log(s, AV_LOG_ERROR, "Failed to set dimensions\n");
        return ret;
    }
    if (*data_size) {
        s->picture[1]->extended_data = NULL;
        s->picture[1]->width         = avctx->width;
        s->picture[1]->height        = avctx->height;
        s->picture[1]->format        = avctx->pix_fmt;
        /* ff_init_buffer_info(avctx, &s->picture[1]); */
        smv_img_pnt(s->picture[1]->data, mjpeg_data->data, mjpeg_data->linesize,
                    avctx->pix_fmt, avctx->width, avctx->height, cur_frame);
        for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
            s->picture[1]->linesize[i] = mjpeg_data->linesize[i];
        ret = av_frame_ref(data, s->picture[1]);
    }
    return ret;
}


void helper_fcmpu(CPUPPCState *env, uint64_t arg1, uint64_t arg2,

                  uint32_t crfD)

{

    CPU_DoubleU farg1, farg2;

    uint32_t ret = 0;

    farg1.ll = arg1;

    farg2.ll = arg2;

    if (unlikely(float64_is_any_nan(farg1.d) ||

                 float64_is_any_nan(farg2.d))) {

        ret = 0x01UL;

    } else if (float64_lt(farg1.d, farg2.d, &env->fp_status)) {

        ret = 0x08UL;

    } else if (!float64_le(farg1.d, farg2.d, &env->fp_status)) {

        ret = 0x04UL;

    } else {

        ret = 0x02UL;

    }

    env->fpscr &= ~(0x0F << FPSCR_FPRF);

    env->fpscr |= ret << FPSCR_FPRF;

    env->crf[crfD] = ret;

    if (unlikely(ret == 0x01UL

                 && (float64_is_signaling_nan(farg1.d) ||

                     float64_is_signaling_nan(farg2.d)))) {

        /* sNaN comparison */

        fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN);

    }

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@

     int i, idx = 0;

+    for (i = 0; i < BITS_TO_U64S(size); i++) {
+
+        uint64_t w = bmp[idx++];
+
+        if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) {

             w |= ((uint64_t)bmp[idx++]) << 32;

static void put_bitmap(QEMUFile *f, void *pv, size_t size)

{

    unsigned long *bmp = pv;

    int i, idx = 0;

    for (i = 0; i < BITS_TO_U64S(size); i++) {

        uint64_t w = bmp[idx++];

        if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) {

            w |= ((uint64_t)bmp[idx++]) << 32;

        }

        qemu_put_be64(f, w);

    }

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@

     pci_default_write_config(d, address, val, len);
+
+
+
+    if (ranges_overlap(address, len, PCI_COMMAND, 2) ||
+

         /* io base/limit */

void pci_bridge_write_config(PCIDevice *d,

                             uint32_t address, uint32_t val, int len)

{

    PCIBridge *s = PCI_BRIDGE(d);

    uint16_t oldctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL);

    uint16_t newctl;

    pci_default_write_config(d, address, val, len);

    if (ranges_overlap(address, len, PCI_COMMAND, 2) ||

        /* io base/limit */

        ranges_overlap(address, len, PCI_IO_BASE, 2) ||

        /* memory base/limit, prefetchable base/limit and

           io base/limit upper 16 */

        ranges_overlap(address, len, PCI_MEMORY_BASE, 20) ||

        /* vga enable */

        ranges_overlap(address, len, PCI_BRIDGE_CONTROL, 2)) {

        pci_bridge_update_mappings(s);

    }

    newctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL);

    if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) {

        /* Trigger hot reset on 0->1 transition. */

        pci_bus_reset(&s->sec_bus);

    }

}


static int t37(InterplayACMContext *s, unsigned ind, unsigned col)

{

    GetBitContext *gb = &s->gb;

    unsigned i, b;

    int n1, n2;

    for (i = 0; i < s->rows; i++) {

        /* b = (x1) + (x2 * 11) */

        b = get_bits(gb, 7);

        n1 =  (mul_2x11[b] & 0x0F) - 5;

        n2 = ((mul_2x11[b] >> 4) & 0x0F) - 5;

        set_pos(s, i++, col, n1);

        if (i >= s->rows)

            break;

        set_pos(s, i, col, n2);

    return 0;


--- a/source.c
+++ b/source.c
@@ -1,15 +1,15 @@
 static int bt_hci_name_req(struct bt_hci_s *hci, bdaddr_t *bdaddr)

 {
+
     struct bt_device_s *slave;

     evt_remote_name_req_complete params;

     int len;

+
+
     for (slave = hci->device.net->slave; slave; slave = slave->next)

         if (slave->page_scan && !bacmp(&slave->bd_addr, bdaddr))

static int bt_hci_name_req(struct bt_hci_s *hci, bdaddr_t *bdaddr)

{

    struct bt_device_s *slave;

    evt_remote_name_req_complete params;

    int len;

    for (slave = hci->device.net->slave; slave; slave = slave->next)

        if (slave->page_scan && !bacmp(&slave->bd_addr, bdaddr))

            break;

    if (!slave)

        return -ENODEV;

    bt_hci_event_status(hci, HCI_SUCCESS);

    params.status       = HCI_SUCCESS;

    bacpy(&params.bdaddr, &slave->bd_addr);

    len = snprintf(params.name, sizeof(params.name),

                    "%s", slave->lmp_name ?: "");

    memset(params.name + len, 0, sizeof(params.name) - len);

    bt_hci_event(hci, EVT_REMOTE_NAME_REQ_COMPLETE,

                    &params, EVT_REMOTE_NAME_REQ_COMPLETE_SIZE);

    return 0;

}


static uint32_t read_long(const unsigned char *p)

{

	return (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3];

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static void blend_frames_c(BLEND_FUNC_PARAMS)

 {
+
+    int line, pixel;

     for (line = 0; line < height; line++) {

static void blend_frames_c(BLEND_FUNC_PARAMS)

{

    int line, pixel;

    for (line = 0; line < height; line++) {

        for (pixel = 0; pixel < width; pixel++) {

            // integer version of (src1 * factor1) + (src2 * factor2) + 0.5

            // 0.5 is for rounding

            // 128 is the integer representation of 0.5 << 8

            dst[pixel] = ((src1[pixel] * factor1) + (src2[pixel] * factor2) + 128) >> 8;

        }

        src1 += src1_linesize;

        src2 += src2_linesize;

        dst  += dst_linesize;

    }

}


--- a/source.c
+++ b/source.c
@@ -8,10 +8,10 @@

     while ((vma = vma_first(mm)) != NULL) {

+        TAILQ_REMOVE(&mm->mm_mmap, vma, vma_link);
+
+        qemu_free(vma);
+
     }

     qemu_free(mm);

static void vma_delete(struct mm_struct *mm)

{

    struct vm_area_struct *vma;

    while ((vma = vma_first(mm)) != NULL) {

        TAILQ_REMOVE(&mm->mm_mmap, vma, vma_link);

        qemu_free(vma);

    }

    qemu_free(mm);

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@

+    tmp = new_tmp();
+
+    tmp2 = new_tmp();
+
+

     tcg_gen_andi_i32(tmp, t0, 0xffff);

static void gen_neon_zip_u16(TCGv t0, TCGv t1)

{

    TCGv tmp, tmp2;

    tmp = new_tmp();

    tmp2 = new_tmp();

    tcg_gen_andi_i32(tmp, t0, 0xffff);

    tcg_gen_shli_i32(tmp2, t1, 16);

    tcg_gen_or_i32(tmp, tmp, tmp2);

    tcg_gen_andi_i32(t1, t1, 0xffff0000);

    tcg_gen_shri_i32(tmp2, t0, 16);

    tcg_gen_or_i32(t1, t1, tmp2);

    tcg_gen_mov_i32(t0, tmp);

    dead_tmp(tmp2);

    dead_tmp(tmp);

}


--- a/source.c
+++ b/source.c
@@ -7,7 +7,7 @@
     uint64_t buf[RT_ENTRIES_PER_SECTOR];

     int rt_start_index;
+
     int i, ret;

static int write_reftable_entry(BlockDriverState *bs, int rt_index)

{

    BDRVQcowState *s = bs->opaque;

    uint64_t buf[RT_ENTRIES_PER_SECTOR];

    int rt_start_index;

    int i, ret;

    rt_start_index = rt_index & ~(RT_ENTRIES_PER_SECTOR - 1);

    for (i = 0; i < RT_ENTRIES_PER_SECTOR; i++) {

        buf[i] = cpu_to_be64(s->refcount_table[rt_start_index + i]);

    }

    ret = qcow2_pre_write_overlap_check(bs,

            QCOW2_OL_DEFAULT & ~QCOW2_OL_REFCOUNT_TABLE,

            s->refcount_table_offset + rt_start_index * sizeof(uint64_t),

            sizeof(buf));

    if (ret < 0) {

        return ret;

    }

    BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_UPDATE);

    ret = bdrv_pwrite_sync(bs->file, s->refcount_table_offset +

            rt_start_index * sizeof(uint64_t), buf, sizeof(buf));

    if (ret < 0) {

        return ret;

    }

    return 0;

}


static int delta_decode(int8_t *dst, const uint8_t *src, int src_size,

                        int8_t val, const int8_t *table)

{

    int n = src_size;

    int8_t *dst0 = dst;

    while (n--) {

        uint8_t d = *src++;

        val = av_clip(val + table[d & 0x0f], -127, 128);

        *dst++ = val;

        val = av_clip(val + table[d >> 4]  , -127, 128);

        *dst++ = val;

    }

    return dst-dst0;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
+static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,
+
+                               InputEvent *evt)
+
+{

     KBDState *s = (KBDState *)dev;
+
     int qcode, keycode;
+

     qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

     if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {
+
         return;

     }

static void adb_keyboard_event(DeviceState *dev, QemuConsole *src,

                               InputEvent *evt)

{

    KBDState *s = (KBDState *)dev;

    int qcode, keycode;

    qcode = qemu_input_key_value_to_qcode(evt->u.key.data->key);

    if (qcode >= ARRAY_SIZE(qcode_to_adb_keycode)) {

        return;

    }

    /* FIXME: take handler into account when translating qcode */

    keycode = qcode_to_adb_keycode[qcode];

    if (keycode == NO_KEY) {  /* We don't want to send this to the guest */

        ADB_DPRINTF("Ignoring NO_KEY\n");

        return;

    }

    if (evt->u.key.data->down == false) { /* if key release event */

        keycode = keycode | 0x80;   /* create keyboard break code */

    }

    adb_kbd_put_keycode(s, keycode);

}


--- a/source.c
+++ b/source.c
@@ -5,9 +5,9 @@
     c->mlp_filter_channel = mlp_filter_channel;

+
+    if (ARCH_X86)
+
         ff_mlpdsp_init_x86(c);

 }

av_cold void ff_mlpdsp_init(MLPDSPContext *c)

{

    c->mlp_filter_channel = mlp_filter_channel;

    if (ARCH_X86)

        ff_mlpdsp_init_x86(c);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     AVFrame *tmp;

     int ret;
+
+
+
+    av_assert0(avctx->codec_type == AVMEDIA_TYPE_VIDEO);
+

     if (!frame->data[0])

int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)

{

    AVFrame *tmp;

    int ret;

    av_assert0(avctx->codec_type == AVMEDIA_TYPE_VIDEO);

    if (!frame->data[0])

        return ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);

    if (av_frame_is_writable(frame)) {

        frame->pkt_pts = avctx->internal->pkt ? avctx->internal->pkt->pts : AV_NOPTS_VALUE;

        frame->reordered_opaque = avctx->reordered_opaque;

        return 0;

    }

    tmp = av_frame_alloc();

    if (!tmp)

        return AVERROR(ENOMEM);

    av_frame_move_ref(tmp, frame);

    ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);

    if (ret < 0) {

        av_frame_free(&tmp);

        return ret;

    }

    av_frame_copy(frame, tmp);

    av_frame_free(&tmp);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int io_open_default(AVFormatContext *s, AVIOContext **pb,
+
                            const char *url, int flags, AVDictionary **options)

 {

static int io_open_default(AVFormatContext *s, AVIOContext **pb,

                           const char *url, int flags, AVDictionary **options)

{

    return avio_open2(pb, url, flags, &s->interrupt_callback, options);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int pte64_check (mmu_ctx_t *ctx,

                         target_ulong pte0, target_ulong pte1, int h, int rw)
+
+{

     return _pte_check(ctx, 1, pte0, pte1, h, rw);

static int pte64_check (mmu_ctx_t *ctx,

                        target_ulong pte0, target_ulong pte1, int h, int rw)

{

    return _pte_check(ctx, 1, pte0, pte1, h, rw);

}


--- a/source.c
+++ b/source.c
@@ -6,6 +6,6 @@

         vring_set_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY);

+    }
+
 }

void vring_disable_notification(VirtIODevice *vdev, Vring *vring)

{

    if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) {

        vring_set_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY);

    }

}


--- a/source.c
+++ b/source.c
@@ -33,11 +33,11 @@
     case 0x08:	/* READ_TIM */

         return omap_timer_read(s);
+
+    }
+
+
+
     OMAP_BAD_REG(addr);

     return 0;

static uint64_t omap_mpu_timer_read(void *opaque, target_phys_addr_t addr,

                                    unsigned size)

{

    struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque;

    if (size != 4) {

        return omap_badwidth_read32(opaque, addr);

    }

    switch (addr) {

    case 0x00:	/* CNTL_TIMER */

        return (s->enable << 5) | (s->ptv << 2) | (s->ar << 1) | s->st;

    case 0x04:	/* LOAD_TIM */

        break;

    case 0x08:	/* READ_TIM */

        return omap_timer_read(s);

    }

    OMAP_BAD_REG(addr);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -3,11 +3,11 @@
 {

     spapr_hcall_fn *slot;
+
+
+
+    if (opcode <= MAX_HCALL_OPCODE) {
+
         assert((opcode & 0x3) == 0);

void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn)

{

    spapr_hcall_fn *slot;

    if (opcode <= MAX_HCALL_OPCODE) {

        assert((opcode & 0x3) == 0);

        slot = &papr_hypercall_table[opcode / 4];

    } else {

        assert((opcode >= KVMPPC_HCALL_BASE) && (opcode <= KVMPPC_HCALL_MAX));

        slot = &kvmppc_hypercall_table[opcode - KVMPPC_HCALL_BASE];

    }

    assert(!(*slot) || (fn == *slot));

    *slot = fn;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 const TPMDriverOps *tpm_get_backend_driver(const char *type)
+
+{
+
+    int i;

+
     for (i = 0; i < TPM_MAX_DRIVERS && be_drivers[i] != NULL; i++) {

         if (!strcmp(TpmType_lookup[be_drivers[i]->type], type)) {

const TPMDriverOps *tpm_get_backend_driver(const char *type)

{

    int i;

    for (i = 0; i < TPM_MAX_DRIVERS && be_drivers[i] != NULL; i++) {

        if (!strcmp(TpmType_lookup[be_drivers[i]->type], type)) {

            return be_drivers[i];

        }

    }

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@

     TCPCharDriver *s = chr->opaque;

+    uint8_t buf[1024];
+
+    int len, size;
+
+

     if (!s->connected || s->max_size <= 0)

static void tcp_chr_read(void *opaque)

{

    CharDriverState *chr = opaque;

    TCPCharDriver *s = chr->opaque;

    uint8_t buf[1024];

    int len, size;

    if (!s->connected || s->max_size <= 0)

        return;

    len = sizeof(buf);

    if (len > s->max_size)

        len = s->max_size;

    size = tcp_chr_recv(chr, (void *)buf, len);

    if (size == 0) {

        /* connection closed */

        s->connected = 0;

        if (s->listen_fd >= 0) {

            qemu_set_fd_handler(s->listen_fd, tcp_chr_accept, NULL, chr);

        }

        qemu_set_fd_handler(s->fd, NULL, NULL, NULL);

        closesocket(s->fd);

        s->fd = -1;

        qemu_chr_event(chr, CHR_EVENT_CLOSED);

    } else if (size > 0) {

        if (s->do_telnetopt)

            tcp_chr_process_IAC_bytes(chr, s, buf, &size);

        if (size > 0)

            qemu_chr_read(chr, buf, size);

        if (s->msgfd != -1) {

            close(s->msgfd);

            s->msgfd = -1;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 rgb16_32ToUV_c_template(uint8_t *dstU, uint8_t *dstV,
+
                         const uint8_t *src, int width,

                         enum PixelFormat origin,

rgb16_32ToUV_c_template(uint8_t *dstU, uint8_t *dstV,

                        const uint8_t *src, int width,

                        enum PixelFormat origin,

                        int shr,   int shg,   int shb, int shp,

                        int maskr, int maskg, int maskb,

                        int rsh,   int gsh,   int bsh, int S)

{

    const int ru = RU << rsh, gu = GU << gsh, bu = BU << bsh,

              rv = RV << rsh, gv = GV << gsh, bv = BV << bsh,

              rnd = 257 << (S - 1);

    int i;

    for (i = 0; i < width; i++) {

        int px = input_pixel(i) >> shp;

        int b = (px & maskb) >> shb;

        int g = (px & maskg) >> shg;

        int r = (px & maskr) >> shr;

        dstU[i] = (ru * r + gu * g + bu * b + rnd) >> S;

        dstV[i] = (rv * r + gv * g + bv * b + rnd) >> S;

    }

}


--- a/source.c
+++ b/source.c
@@ -3,7 +3,7 @@
 {

     int64_t count = -1;
+

     octx.prefix =

static void probe_group_enter(const char *name, int type)

{

    int64_t count = -1;

    octx.prefix =

        av_realloc(octx.prefix, sizeof(PrintElement) * (octx.level + 1));

    if (!octx.prefix || !name) {

        fprintf(stderr, "Out of memory\n");

        exit(1);

    }

    if (octx.level) {

        PrintElement *parent = octx.prefix + octx.level -1;

        if (parent->type == ARRAY)

            count = parent->nb_elems;

        parent->nb_elems++;

    }

    octx.prefix[octx.level++] = (PrintElement){name, type, count, 0};

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static void pxa2xx_gpio_handler_update(PXA2xxGPIOInfo *s) {
+
+    uint32_t level, diff;
+
+    int i, bit, line;
+
     for (i = 0; i < PXA2XX_GPIO_BANKS; i ++) {

         level = s->olevel[i] & s->dir[i];

static void pxa2xx_gpio_handler_update(PXA2xxGPIOInfo *s) {

    uint32_t level, diff;

    int i, bit, line;

    for (i = 0; i < PXA2XX_GPIO_BANKS; i ++) {

        level = s->olevel[i] & s->dir[i];

        for (diff = s->prev_level[i] ^ level; diff; diff ^= 1 << bit) {

            bit = ffs(diff) - 1;

            line = bit + 32 * i;

            qemu_set_irq(s->handler[line], (level >> bit) & 1);

        }

        s->prev_level[i] = level;

    }

}


--- a/source.c
+++ b/source.c
@@ -19,9 +19,9 @@
         } else {

             tcg_gen_op4ii_i64(INDEX_op_brcond_i64, arg1, arg2, cond, label);
+
+        }
+
+    }
+
 }

void tcg_gen_brcond_i64(TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2, int label)

{

    if (cond == TCG_COND_ALWAYS) {

        tcg_gen_br(label);

    } else if (cond != TCG_COND_NEVER) {

        if (TCG_TARGET_REG_BITS == 32) {

            tcg_gen_op6ii_i32(INDEX_op_brcond2_i32, TCGV_LOW(arg1),

                              TCGV_HIGH(arg1), TCGV_LOW(arg2),

                              TCGV_HIGH(arg2), cond, label);

        } else {

            tcg_gen_op4ii_i64(INDEX_op_brcond_i64, arg1, arg2, cond, label);

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     int mode;

     int i;
+
     int8_t dc[6];

static int tgq_decode_mb(TgqContext *s, AVFrame *frame, int mb_y, int mb_x)

{

    int mode;

    int i;

    int8_t dc[6];

    mode = bytestream2_get_byte(&s->gb);

    if (mode > 12) {

        GetBitContext gb;

        init_get_bits8(&gb, s->gb.buffer, FFMIN(bytestream2_get_bytes_left(&s->gb), mode));

        for (i = 0; i < 6; i++)

            tgq_decode_block(s, s->block[i], &gb);

        tgq_idct_put_mb(s, s->block, frame, mb_x, mb_y);

        bytestream2_skip(&s->gb, mode);

    } else {

        if (mode == 3) {

            memset(dc, bytestream2_get_byte(&s->gb), 4);

            dc[4] = bytestream2_get_byte(&s->gb);

            dc[5] = bytestream2_get_byte(&s->gb);

        } else if (mode == 6) {

            bytestream2_get_buffer(&s->gb, dc, 6);

        } else if (mode == 12) {

            for (i = 0; i < 6; i++) {

                dc[i] = bytestream2_get_byte(&s->gb);

                bytestream2_skip(&s->gb, 1);

            }

        } else {

            av_log(s->avctx, AV_LOG_ERROR, "unsupported mb mode %i\n", mode);

            return -1;

        }

        tgq_idct_put_mb_dconly(s, frame, mb_x, mb_y, dc);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -4,9 +4,9 @@

     QObject *event_data;

+    VirtIONet *n = qemu_get_nic_opaque(nc);

+

     if (nc->rxfilter_notify_enabled) {

static void rxfilter_notify(NetClientState *nc)

{

    QObject *event_data;

    VirtIONet *n = qemu_get_nic_opaque(nc);

    if (nc->rxfilter_notify_enabled) {

        if (n->netclient_name) {

            event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",

                                    n->netclient_name,

                                    object_get_canonical_path(OBJECT(n->qdev)));

        } else {

            event_data = qobject_from_jsonf("{ 'path': %s }",

                                    object_get_canonical_path(OBJECT(n->qdev)));

        }

        monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);

        qobject_decref(event_data);

        /* disable event notification to avoid events flooding */

        nc->rxfilter_notify_enabled = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -61,11 +61,11 @@
     }

     case RTAS_SYSPARM_UUID:
+
+        ret = sysparm_st(buffer, length, qemu_uuid, (qemu_uuid_set ? 16 : 0));
+
+        break;
+
     default:

         ret = RTAS_OUT_NOT_SUPPORTED;

static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,

                                          sPAPRMachineState *spapr,

                                          uint32_t token, uint32_t nargs,

                                          target_ulong args,

                                          uint32_t nret, target_ulong rets)

{

    target_ulong parameter = rtas_ld(args, 0);

    target_ulong buffer = rtas_ld(args, 1);

    target_ulong length = rtas_ld(args, 2);

    target_ulong ret;

    switch (parameter) {

    case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: {

        char *param_val = g_strdup_printf("MaxEntCap=%d,"

                                          "DesMem=%llu,"

                                          "DesProcs=%d,"

                                          "MaxPlatProcs=%d",

                                          max_cpus,

                                          current_machine->ram_size / M_BYTE,

                                          smp_cpus,

                                          max_cpus);

        ret = sysparm_st(buffer, length, param_val, strlen(param_val) + 1);

        g_free(param_val);

        break;

    }

    case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: {

        uint8_t param_val = DIAGNOSTICS_RUN_MODE_DISABLED;

        ret = sysparm_st(buffer, length, &param_val, sizeof(param_val));

        break;

    }

    case RTAS_SYSPARM_UUID:

        ret = sysparm_st(buffer, length, qemu_uuid, (qemu_uuid_set ? 16 : 0));

        break;

    default:

        ret = RTAS_OUT_NOT_SUPPORTED;

    }

    rtas_st(rets, 0, ret);

}


--- a/source.c
+++ b/source.c
@@ -4,7 +4,7 @@

 {

+    const uint32_t broadcast_addr =

         ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;

bool arp_table_search(Slirp *slirp, uint32_t ip_addr,

                      uint8_t out_ethaddr[ETH_ALEN])

{

    const uint32_t broadcast_addr =

        ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;

    ArpTable *arptbl = &slirp->arp_table;

    int i;

    DEBUG_CALL("arp_table_search");

    DEBUG_ARG("ip = 0x%x", ip_addr);

    /* Check 0.0.0.0/8 invalid source-only addresses */

    assert((ip_addr & htonl(~(0xf << 28))) != 0);

    /* If broadcast address */

    if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) {

        /* return Ethernet broadcast address */

        memset(out_ethaddr, 0xff, ETH_ALEN);

        return 1;

    }

    for (i = 0; i < ARP_TABLE_SIZE; i++) {

        if (arptbl->table[i].ar_sip == ip_addr) {

            memcpy(out_ethaddr, arptbl->table[i].ar_sha,  ETH_ALEN);

            DEBUG_ARGS((dfd, " found hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n",

                        out_ethaddr[0], out_ethaddr[1], out_ethaddr[2],

                        out_ethaddr[3], out_ethaddr[4], out_ethaddr[5]));

            return 1;

        }

    }

    return 0;

}