--- a/source.c
+++ b/source.c
@@ -2,11 +2,11 @@
                                                         uint32_t id)
 {
     int i;
+    MatroskaLevel1Element *elem;
+    // Some files link to all clusters; useless.
+    if (id == MATROSKA_ID_CLUSTER)
+    // There can be multiple seekheads.
+    if (id != MATROSKA_ID_SEEKHEAD) {
         for (i = 0; i < matroska->num_level1_elems; i++) {
             if (matroska->level1_elems[i].id == id)
                 return &matroska->level1_elems[i];

static MatroskaLevel1Element *matroska_find_level1_elem(MatroskaDemuxContext *matroska,
                                                        uint32_t id)
{
    int i;
    MatroskaLevel1Element *elem;
    // Some files link to all clusters; useless.
    if (id == MATROSKA_ID_CLUSTER)
    // There can be multiple seekheads.
    if (id != MATROSKA_ID_SEEKHEAD) {
        for (i = 0; i < matroska->num_level1_elems; i++) {
            if (matroska->level1_elems[i].id == id)
                return &matroska->level1_elems[i];
        }
    }
    // Only a completely broken file would have more elements.
    // It also provides a low-effort way to escape from circular seekheads
    // (every iteration will add a level1 entry).
    if (matroska->num_level1_elems >= FF_ARRAY_ELEMS(matroska->level1_elems)) {
        av_log(matroska->ctx, AV_LOG_ERROR, "Too many level1 elements or circular seekheads.\n");
    }
    elem = &matroska->level1_elems[matroska->num_level1_elems++];
    *elem = (MatroskaLevel1Element){.id = id};
    return elem;
}


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

                              gdb_reg_cb get_reg, gdb_reg_cb set_reg,

+                             int num_regs, const char *xml, int g_pos)
+
+{
+
+    GDBRegisterState *s;
+
     GDBRegisterState **p;

     static int last_reg = NUM_CORE_REGS;

void gdb_register_coprocessor(CPUState * env,

                             gdb_reg_cb get_reg, gdb_reg_cb set_reg,

                             int num_regs, const char *xml, int g_pos)

{

    GDBRegisterState *s;

    GDBRegisterState **p;

    static int last_reg = NUM_CORE_REGS;

    s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState));

    s->base_reg = last_reg;

    s->num_regs = num_regs;

    s->get_reg = get_reg;

    s->set_reg = set_reg;

    s->xml = xml;

    p = &env->gdb_regs;

    while (*p) {

        /* Check for duplicates.  */

        if (strcmp((*p)->xml, xml) == 0)

            return;

        p = &(*p)->next;

    }

    /* Add to end of list.  */

    last_reg += num_regs;

    *p = s;

    if (g_pos) {

        if (g_pos != s->base_reg) {

            fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n"

                    "Expected %d got %d\n", xml, g_pos, s->base_reg);

        } else {

            num_g_regs = last_reg;

        }

    }

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void use_normal_update_speed(WmallDecodeCtx *s, int ich)

 {
+
     int ilms, recent, icoef;

     s->update_speed[ich] = 8;

static void use_normal_update_speed(WmallDecodeCtx *s, int ich)

{

    int ilms, recent, icoef;

    s->update_speed[ich] = 8;

    for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) {

        recent = s->cdlms[ich][ilms].recent;

        if (s->bV3RTM) {

            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)

                s->cdlms[ich][ilms].lms_updates[icoef + recent] /= 2;

        } else {

            for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)

                s->cdlms[ich][ilms].lms_updates[icoef] /= 2;

        }

    }

}


static inline void downmix_2f_1r_to_dolby(float *samples)

{

    int i;

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

        samples[i] -= samples[i + 512];

        samples[i + 256] += samples[i + 512];

        samples[i + 512] = 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     bool msi = msi_enabled(&d->pci);

     int level;
+
+
+
+    intel_hda_update_int_sts(d);
+
     if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) {

         level = 1;

static void intel_hda_update_irq(IntelHDAState *d)

{

    bool msi = msi_enabled(&d->pci);

    int level;

    intel_hda_update_int_sts(d);

    if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) {

        level = 1;

    } else {

        level = 0;

    }

    dprint(d, 2, "%s: level %d [%s]\n", __FUNCTION__,

           level, msi ? "msi" : "intx");

    if (msi) {

        if (level) {

            msi_notify(&d->pci, 0);

        }

    } else {

        pci_set_irq(&d->pci, level);

    }

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
+static void release_buffer(AVCodecContext *avctx, AVFrame *pic)
+
+{
+
+    int i;
+
+

     CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->data[3];

static void release_buffer(AVCodecContext *avctx, AVFrame *pic)

{

    int i;

    CVPixelBufferRef cv_buffer = (CVPixelBufferRef)pic->data[3];

    CVPixelBufferUnlockBaseAddress(cv_buffer, 0);

    CVPixelBufferRelease(cv_buffer);

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

        pic->data[i] = NULL;

}


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

     case 0x18:	/* EMIFS_CS2_CONFIG */
+
+    case 0x1c:	/* EMIFS_CS3_CONFIG */
+
+    case 0x24:	/* EMIFF_MRS */
+
     case 0x28:	/* TIMEOUT1 */

     case 0x2c:	/* TIMEOUT2 */

static uint64_t omap_tcmi_read(void *opaque, target_phys_addr_t addr,

                               unsigned size)

{

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

    uint32_t ret;

    if (size != 4) {

        return omap_badwidth_read32(opaque, addr);

    }

    switch (addr) {

    case 0x00:	/* IMIF_PRIO */

    case 0x04:	/* EMIFS_PRIO */

    case 0x08:	/* EMIFF_PRIO */

    case 0x0c:	/* EMIFS_CONFIG */

    case 0x10:	/* EMIFS_CS0_CONFIG */

    case 0x14:	/* EMIFS_CS1_CONFIG */

    case 0x18:	/* EMIFS_CS2_CONFIG */

    case 0x1c:	/* EMIFS_CS3_CONFIG */

    case 0x24:	/* EMIFF_MRS */

    case 0x28:	/* TIMEOUT1 */

    case 0x2c:	/* TIMEOUT2 */

    case 0x30:	/* TIMEOUT3 */

    case 0x3c:	/* EMIFF_SDRAM_CONFIG_2 */

    case 0x40:	/* EMIFS_CFG_DYN_WAIT */

        return s->tcmi_regs[addr >> 2];

    case 0x20:	/* EMIFF_SDRAM_CONFIG */

        ret = s->tcmi_regs[addr >> 2];

        s->tcmi_regs[addr >> 2] &= ~1; /* XXX: Clear SLRF on SDRAM access */

        /* XXX: We can try using the VGA_DIRTY flag for this */

        return ret;

    }

    OMAP_BAD_REG(addr);

    return 0;

}


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

     vm_stop(RUN_STATE_PAUSED);

void qmp_stop(Error **errp)

{

    vm_stop(RUN_STATE_PAUSED);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static int coroutine_fn mirror_iteration(MirrorBlockJob *s)

 {

@@ -15,9 +15,9 @@
     struct iovec iov;

+
     end = s->common.len >> BDRV_SECTOR_BITS;
+
     s->sector_num = bdrv_get_next_dirty(source, s->sector_num);

     nb_sectors = MIN(BDRV_SECTORS_PER_DIRTY_CHUNK, end - s->sector_num);

static int coroutine_fn mirror_iteration(MirrorBlockJob *s)

{

    BlockDriverState *source = s->common.bs;

    BlockDriverState *target = s->target;

    QEMUIOVector qiov;

    int ret, nb_sectors;

    int64_t end;

    struct iovec iov;

    end = s->common.len >> BDRV_SECTOR_BITS;

    s->sector_num = bdrv_get_next_dirty(source, s->sector_num);

    nb_sectors = MIN(BDRV_SECTORS_PER_DIRTY_CHUNK, end - s->sector_num);

    bdrv_reset_dirty(source, s->sector_num, nb_sectors);

    /* Copy the dirty cluster.  */

    iov.iov_base = s->buf;

    iov.iov_len  = nb_sectors * 512;

    qemu_iovec_init_external(&qiov, &iov, 1);

    trace_mirror_one_iteration(s, s->sector_num, nb_sectors);

    ret = bdrv_co_readv(source, s->sector_num, nb_sectors, &qiov);

    if (ret < 0) {

        return ret;

    }

    return bdrv_co_writev(target, s->sector_num, nb_sectors, &qiov);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+void qpci_iounmap(QPCIDevice *dev, void *data)

 {

void qpci_iounmap(QPCIDevice *dev, void *data)

{

    /* FIXME */

}


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

     } else {

+        v9fs_path_sprintf(target, "%s", name);
+
+    }
+
     return 0;

 }

static int local_name_to_path(FsContext *ctx, V9fsPath *dir_path,

                              const char *name, V9fsPath *target)

{

    if (dir_path) {

        v9fs_path_sprintf(target, "%s/%s", dir_path->data, name);

    } else {

        v9fs_path_sprintf(target, "%s", name);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -13,11 +13,11 @@
     ff_jpeg2000dsp_init(&h);

+
+    if (check_func(h.mct_decode[FF_DWT53], "jpeg2000_rct_int"))
+
+        check_mct(&ref[BUF_SIZE*0], &ref[BUF_SIZE*1], &ref[BUF_SIZE*2],
+
                   &new[BUF_SIZE*0], &new[BUF_SIZE*1], &new[BUF_SIZE*2]);

void checkasm_check_jpeg2000dsp(void)

{

    LOCAL_ALIGNED_32(uint8_t, ref, [BUF_SIZE*3]);

    LOCAL_ALIGNED_32(uint8_t, new, [BUF_SIZE*3]);

    Jpeg2000DSPContext h;

    ff_jpeg2000dsp_init(&h);

    if (check_func(h.mct_decode[FF_DWT53], "jpeg2000_rct_int"))

        check_mct(&ref[BUF_SIZE*0], &ref[BUF_SIZE*1], &ref[BUF_SIZE*2],

                  &new[BUF_SIZE*0], &new[BUF_SIZE*1], &new[BUF_SIZE*2]);

    report("mct_decode");

}


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

     pci_assign_dev_load_option_rom(&dev->dev, OBJECT(dev), &size,

+                                   dev->host.domain, dev->host.bus,
+
+                                   dev->host.slot, dev->host.function);
+
+

     if (!size) {

type_init(assign_register_types)

static void assigned_dev_load_option_rom(AssignedDevice *dev)

{

    int size = 0;

    pci_assign_dev_load_option_rom(&dev->dev, OBJECT(dev), &size,

                                   dev->host.domain, dev->host.bus,

                                   dev->host.slot, dev->host.function);

    if (!size) {

        error_report("pci-assign: Invalid ROM.");

    }

}


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

     while (!QTAILQ_EMPTY(&s->qdev.requests)) {

+        r = DO_UPCAST(SCSIGenericReq, req, QTAILQ_FIRST(&s->qdev.requests));
+
+        scsi_remove_request(r);
+
+    }

     blockdev_mark_auto_del(s->qdev.conf.dinfo->bdrv);

static void scsi_destroy(SCSIDevice *d)

{

    SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, d);

    SCSIGenericReq *r;

    while (!QTAILQ_EMPTY(&s->qdev.requests)) {

        r = DO_UPCAST(SCSIGenericReq, req, QTAILQ_FIRST(&s->qdev.requests));

        scsi_remove_request(r);

    }

    blockdev_mark_auto_del(s->qdev.conf.dinfo->bdrv);

}


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

                                                     target_phys_addr_t hash,

static always_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);

}


static int vivo_probe(AVProbeData *p)

{

    const unsigned char *buf = p->buf;

    unsigned c, length = 0;

    // stream must start with packet of type 0 and sequence number 0

    if (*buf++ != 0)

        return 0;

    // read at most 2 bytes of coded length

    c = *buf++;

    length = c & 0x7F;

    if (c & 0x80) {

        c = *buf++;

        length = (length << 7) | (c & 0x7F);

    }

    if (c & 0x80 || length > 1024 || length < 21)

        return 0;

    if (memcmp(buf, "\r\nVersion:Vivo/", 15))

        return 0;

    buf += 15;

    if (*buf < '0' && *buf > '2')

        return 0;

    return AVPROBE_SCORE_MAX;

}


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

         return;

+    }
+
+
+
     n->has_vnet_hdr = qemu_peer_has_vnet_hdr(nc);

 }

static void peer_test_vnet_hdr(VirtIONet *n)

{

    NetClientState *nc = qemu_get_queue(n->nic);

    if (!nc->peer) {

        return;

    }

    n->has_vnet_hdr = qemu_peer_has_vnet_hdr(nc);

}


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

         ret = -ENODEV;

+        goto out;
+
+    }
+
+

     if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

int css_do_ssch(SubchDev *sch, ORB *orb)

{

    SCSW *s = &sch->curr_status.scsw;

    PMCW *p = &sch->curr_status.pmcw;

    int ret;

    if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) {

        ret = -ENODEV;

        goto out;

    }

    if (s->ctrl & SCSW_STCTL_STATUS_PEND) {

        ret = -EINPROGRESS;

        goto out;

    }

    if (s->ctrl & (SCSW_FCTL_START_FUNC |

                   SCSW_FCTL_HALT_FUNC |

                   SCSW_FCTL_CLEAR_FUNC)) {

        ret = -EBUSY;

        goto out;

    }

    /* If monitoring is active, update counter. */

    if (channel_subsys.chnmon_active) {

        css_update_chnmon(sch);

    }

    sch->channel_prog = orb->cpa;

    /* Trigger the start function. */

    s->ctrl |= (SCSW_FCTL_START_FUNC | SCSW_ACTL_START_PEND);

    s->flags &= ~SCSW_FLAGS_MASK_PNO;

    do_subchannel_work(sch, orb);

    ret = 0;

out:

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     AVParserStreamState *ss;

+
+    if (!state)
+
+        return;
+

     for (i = 0; i < state->nb_streams; i++) {

void ff_free_parser_state(AVFormatContext *s, AVParserState *state)

{

    int i;

    AVParserStreamState *ss;

    if (!state)

        return;

    for (i = 0; i < state->nb_streams; i++) {

        ss = &state->stream_states[i];

        if (ss->parser)

            av_parser_close(ss->parser);

        av_free_packet(&ss->cur_pkt);

    }

    free_packet_list(state->packet_buffer);

    free_packet_list(state->raw_packet_buffer);

    av_free(state->stream_states);

    av_free(state);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+void rgb32tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size)
+
+{

 	unsigned i;

void rgb32tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size)

{

	unsigned i;

	unsigned num_pixels = src_size >> 2;

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

	{

		dst[3*i + 0] = src[4*i + 2];

		dst[3*i + 1] = src[4*i + 1];

		dst[3*i + 2] = src[4*i + 0];

	}

}


--- a/source.c
+++ b/source.c
@@ -9,7 +9,7 @@
     int scale = AV_RB16(in);

     int i;
+
     int s0, s1, s2, d;

static void adx_decode(ADXContext *c, int16_t *out, const uint8_t *in, int ch)

{

    ADXChannelState *prev = &c->prev[ch];

    GetBitContext gb;

    int scale = AV_RB16(in);

    int i;

    int s0, s1, s2, d;

    init_get_bits(&gb, in + 2, (18 - 2) * 8);

    s1 = prev->s1;

    s2 = prev->s2;

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

        d  = get_sbits(&gb, 4);

        s0 = (BASEVOL * d * scale + SCALE1 * s1 - SCALE2 * s2) >> 14;

        s2 = s1;

        s1 = av_clip_int16(s0);

        *out = s1;

        out += c->channels;

    }

    prev->s1 = s1;

    prev->s2 = s2;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
+
 {

     if(av_log_callback)

void av_vlog(void* avcl, int level, const char *fmt, va_list vl)

{

    if(av_log_callback)

        av_log_callback(avcl, level, fmt, vl);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void writer_print_string(WriterContext *wctx,

+                                       const char *key, const char *val)
+
 {

     wctx->writer->print_string(wctx, key, val);

static inline void writer_print_string(WriterContext *wctx,

                                       const char *key, const char *val)

{

    wctx->writer->print_string(wctx, key, val);

    wctx->nb_item++;

}


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

     uint32_t addr = le32_to_cpu(data->fadt_table.dsdt);

+
+
+    test_dst_table(&dsdt_table, addr);
+
+    ACPI_ASSERT_CMP(dsdt_table.header.signature, "DSDT");

static void test_acpi_dsdt_table(test_data *data)

{

    AcpiSdtTable dsdt_table;

    uint32_t addr = le32_to_cpu(data->fadt_table.dsdt);

    test_dst_table(&dsdt_table, addr);

    ACPI_ASSERT_CMP(dsdt_table.header.signature, "DSDT");

    /* Since DSDT isn't in RSDT, add DSDT to ASL test tables list manually */

    g_array_append_val(data->tables, dsdt_table);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     PCIBus *bus = d->bus;

+
+    while (!pci_bus_is_root(bus)) {
+
+        d = bus->parent_dev;
+
         assert(d != NULL);

PCIBus *pci_device_root_bus(const PCIDevice *d)

{

    PCIBus *bus = d->bus;

    while (!pci_bus_is_root(bus)) {

        d = bus->parent_dev;

        assert(d != NULL);

        bus = d->bus;

    }

    return bus;

}


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

     CPUTimerState *t = &s->cputimer[tc->timer_index];

+
+
+    slavio_timer_get_out(t);
+
+    DPRINTF("callback: count %x%08x\n", t->counthigh, t->count);

     t->reached = TIMER_REACHED;

static void slavio_timer_irq(void *opaque)

{

    TimerContext *tc = opaque;

    SLAVIO_TIMERState *s = tc->s;

    CPUTimerState *t = &s->cputimer[tc->timer_index];

    slavio_timer_get_out(t);

    DPRINTF("callback: count %x%08x\n", t->counthigh, t->count);

    t->reached = TIMER_REACHED;

    /* there is no interrupt if user timer or free-run */

    if (!slavio_timer_is_user(tc) && t->limit != 0) {

        qemu_irq_raise(t->irq);

    }

}


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

     int copy_count;
+
     uint8_t *end_ptr;

static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)

{

    int copy_count;

    uint8_t *end_ptr;

    if (s->cirrus_srccounter > 0) {

        if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {

            cirrus_bitblt_common_patterncopy(s, s->cirrus_bltbuf);

        the_end:

            s->cirrus_srccounter = 0;

            cirrus_bitblt_reset(s);

        } else {

            /* at least one scan line */

            do {

                (*s->cirrus_rop)(s, s->vga.vram_ptr + s->cirrus_blt_dstaddr,

                                  s->cirrus_bltbuf, 0, 0, s->cirrus_blt_width, 1);

                cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, 0,

                                         s->cirrus_blt_width, 1);

                s->cirrus_blt_dstaddr += s->cirrus_blt_dstpitch;

                s->cirrus_srccounter -= s->cirrus_blt_srcpitch;

                if (s->cirrus_srccounter <= 0)

                    goto the_end;

                /* more bytes than needed can be transferred because of

                   word alignment, so we keep them for the next line */

                /* XXX: keep alignment to speed up transfer */

                end_ptr = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

                copy_count = s->cirrus_srcptr_end - end_ptr;

                memmove(s->cirrus_bltbuf, end_ptr, copy_count);

                s->cirrus_srcptr = s->cirrus_bltbuf + copy_count;

                s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;

            } while (s->cirrus_srcptr >= s->cirrus_srcptr_end);

        }

    }

}


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

     if (!job->job_type->set_speed) {
+
+        return -ENOTSUP;
+
+    }
+
     rc = job->job_type->set_speed(job, value);

     if (rc == 0) {

int block_job_set_speed(BlockJob *job, int64_t value)

{

    int rc;

    if (!job->job_type->set_speed) {

        return -ENOTSUP;

    }

    rc = job->job_type->set_speed(job, value);

    if (rc == 0) {

        job->speed = value;

    }

    return rc;

}


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

     return kvm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);
+
 }

int kvm_has_sync_mmu(void)

{

    return kvm_check_extension(kvm_state, KVM_CAP_SYNC_MMU);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static inline void gen_op_eval_bleu(TCGv dst, TCGv_i32 src)

+{
+
     gen_mov_reg_Z(cpu_tmp0, src);

     gen_mov_reg_C(dst, src);

static inline void gen_op_eval_bleu(TCGv dst, TCGv_i32 src)

{

    gen_mov_reg_Z(cpu_tmp0, src);

    gen_mov_reg_C(dst, src);

    tcg_gen_or_tl(dst, dst, cpu_tmp0);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
 static int flac_probe(AVProbeData *p)
+
+{
+
+    uint8_t *bufptr = p->buf;

     uint8_t *end    = p->buf + p->buf_size;

static int flac_probe(AVProbeData *p)

{

    uint8_t *bufptr = p->buf;

    uint8_t *end    = p->buf + p->buf_size;

    if(bufptr > end-4 || memcmp(bufptr, "fLaC", 4)) return 0;

    else                                            return AVPROBE_SCORE_MAX/2;

}


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

+    memset(block, 0, sizeof(block));

static inline int decode_alpha_block(const SHQContext *s, GetBitContext *gb, uint8_t last_alpha[16], uint8_t *dest, int linesize)

{

    uint8_t block[128];

    int i = 0, x, y;

    memset(block, 0, sizeof(block));

    {

        OPEN_READER(re, gb);

        for ( ;; ) {

            int run, level;

            UPDATE_CACHE_LE(re, gb);

            GET_VLC(run, re, gb, ff_dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2);

            if (run == 128) break;

            i += run;

            if (i >= 128)

                return AVERROR_INVALIDDATA;

            UPDATE_CACHE_LE(re, gb);

            GET_VLC(level, re, gb, ff_dc_alpha_level_vlc_le.table, ALPHA_VLC_BITS, 2);

            block[i++] = level;

        }

        CLOSE_READER(re, gb);

    }

    for (y = 0; y < 8; y++) {

        for (x = 0; x < 16; x++) {

            last_alpha[x] -= block[y * 16 + x];

        }

        memcpy(dest, last_alpha, 16);

        dest += linesize;

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
 void hmp_info_memdev(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
+    MemdevList *memdev_list = qmp_query_memdev(&err);
+    MemdevList *m = memdev_list;
+    StringOutputVisitor *ov;
+    char *str;
+    int i = 0;
     while (m) {
         ov = string_output_visitor_new(false);
         visit_type_uint16List(string_output_get_visitor(ov),

void hmp_info_memdev(Monitor *mon, const QDict *qdict)
{
    Error *err = NULL;
    MemdevList *memdev_list = qmp_query_memdev(&err);
    MemdevList *m = memdev_list;
    StringOutputVisitor *ov;
    char *str;
    int i = 0;
    while (m) {
        ov = string_output_visitor_new(false);
        visit_type_uint16List(string_output_get_visitor(ov),
                              &m->value->host_nodes, NULL, NULL);
        monitor_printf(mon, "memory backend: %d\n", i);
        monitor_printf(mon, "  size:  %" PRId64 "\n", m->value->size);
        monitor_printf(mon, "  merge: %s\n",
                       m->value->merge ? "true" : "false");
        monitor_printf(mon, "  dump: %s\n",
                       m->value->dump ? "true" : "false");
        monitor_printf(mon, "  prealloc: %s\n",
                       m->value->prealloc ? "true" : "false");
        monitor_printf(mon, "  policy: %s\n",
                       HostMemPolicy_lookup[m->value->policy]);
        str = string_output_get_string(ov);
        monitor_printf(mon, "  host nodes: %s\n", str);
        g_free(str);
        string_output_visitor_cleanup(ov);
        m = m->next;
        i++;
    }
    monitor_printf(mon, "\n");
}


target_ulong helper_add_suov(CPUTriCoreState *env, target_ulong r1,

                             target_ulong r2)

{

    int64_t t1 = extract64(r1, 0, 32);

    int64_t t2 = extract64(r2, 0, 32);

    int64_t result = t1 + t2;

    return suov32(env, result);

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,

+        int64_t sector_num, int nb_sectors, int *pnum)
+
+{
+
+    /* TODO: Check for too large sector_num (in bdrv_is_allocated or here). */

     BDRVVdiState *s = (BDRVVdiState *)bs->opaque;

static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,

        int64_t sector_num, int nb_sectors, int *pnum)

{

    /* TODO: Check for too large sector_num (in bdrv_is_allocated or here). */

    BDRVVdiState *s = (BDRVVdiState *)bs->opaque;

    size_t bmap_index = sector_num / s->block_sectors;

    size_t sector_in_block = sector_num % s->block_sectors;

    int n_sectors = s->block_sectors - sector_in_block;

    uint32_t bmap_entry = le32_to_cpu(s->bmap[bmap_index]);

    uint64_t offset;

    int result;

    logout("%p, %" PRId64 ", %d, %p\n", bs, sector_num, nb_sectors, pnum);

    if (n_sectors > nb_sectors) {

        n_sectors = nb_sectors;

    }

    *pnum = n_sectors;

    result = VDI_IS_ALLOCATED(bmap_entry);

    if (!result) {

        return 0;

    }

    offset = s->header.offset_data +

                              (uint64_t)bmap_entry * s->block_size +

                              sector_in_block * SECTOR_SIZE;

    return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | offset;

}


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

 {

+    assert(bs->in_use != in_use);
+
     bs->in_use = in_use;

 }

void bdrv_set_in_use(BlockDriverState *bs, int in_use)

{

    assert(bs->in_use != in_use);

    bs->in_use = in_use;

}


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

     if (o->have_children) {
+
         return;

     }

static void usb_mtp_object_readdir(MTPState *s, MTPObject *o)

{

    struct dirent *entry;

    DIR *dir;

    if (o->have_children) {

        return;

    }

    o->have_children = true;

    dir = opendir(o->path);

    if (!dir) {

        return;

    }

#ifdef __linux__

    int watchfd = usb_mtp_add_watch(s->inotifyfd, o->path);

    if (watchfd == -1) {

        fprintf(stderr, "usb-mtp: failed to add watch for %s\n", o->path);

    } else {

        trace_usb_mtp_inotify_event(s->dev.addr, o->path,

                                    0, "Watch Added");

        o->watchfd = watchfd;

    }

#endif

    while ((entry = readdir(dir)) != NULL) {

        usb_mtp_add_child(s, o, entry->d_name);

    }

    closedir(dir);

}


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

     ram_control_after_iterate(f, RAM_CONTROL_FINISH);

+
+
+    rcu_read_unlock();
+
+

     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);

static int ram_save_complete(QEMUFile *f, void *opaque)

{

    rcu_read_lock();

    if (!migration_in_postcopy(migrate_get_current())) {

        migration_bitmap_sync();

    }

    ram_control_before_iterate(f, RAM_CONTROL_FINISH);

    /* try transferring iterative blocks of memory */

    /* flush all remaining blocks regardless of rate limiting */

    while (true) {

        int pages;

        pages = ram_find_and_save_block(f, true, &bytes_transferred);

        /* no more blocks to sent */

        if (pages == 0) {

            break;

        }

    }

    flush_compressed_data(f);

    ram_control_after_iterate(f, RAM_CONTROL_FINISH);

    rcu_read_unlock();

    qemu_put_be64(f, RAM_SAVE_FLAG_EOS);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,10 +1,10 @@
 void qemu_chr_close(CharDriverState *chr)

 {
+
+    TAILQ_REMOVE(&chardevs, chr, next);
+
+    if (chr->chr_close)

         chr->chr_close(chr);

void qemu_chr_close(CharDriverState *chr)

{

    TAILQ_REMOVE(&chardevs, chr, next);

    if (chr->chr_close)

        chr->chr_close(chr);

    qemu_free(chr->filename);

    qemu_free(chr->label);

    qemu_free(chr);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void vorbis_free_extradata(PayloadContext * data)

 {

static void vorbis_free_extradata(PayloadContext * data)

{

    av_free(data);

}


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

                                          src - (stride * 2),

+                                         stride, dst, stride);
+
+}

void ff_avg_h264_qpel8_mc11_msa(uint8_t *dst, const uint8_t *src,

                                ptrdiff_t stride)

{

    avc_luma_hv_qrt_and_aver_dst_8x8_msa(src - 2,

                                         src - (stride * 2),

                                         stride, dst, stride);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void megasas_port_write(void *opaque, target_phys_addr_t addr,

+                               uint64_t val, unsigned size)
+
 {

     megasas_mmio_write(opaque, addr & 0xff, val, size);

static void megasas_port_write(void *opaque, target_phys_addr_t addr,

                               uint64_t val, unsigned size)

{

    megasas_mmio_write(opaque, addr & 0xff, val, size);

}


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

     const char *argv[] = { "/bin/sh", "-c", command, NULL };

+

     trace_migration_exec_outgoing(command);

void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp)

{

    QIOChannel *ioc;

    const char *argv[] = { "/bin/sh", "-c", command, NULL };

    trace_migration_exec_outgoing(command);

    ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv,

                                                    O_WRONLY,

                                                    errp));

    if (!ioc) {

        return;

    }

    migration_set_outgoing_channel(s, ioc);

    object_unref(OBJECT(ioc));

}


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

     PITChannelState *s;

+    s = &pit_state.channels[0];
+
     qemu_del_timer(s->irq_timer);

 }

void hpet_pit_disable(void) {

    PITChannelState *s;

    s = &pit_state.channels[0];

    qemu_del_timer(s->irq_timer);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 char *vnc_display_local_addr(DisplayState *ds)
+
 {

     VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;

char *vnc_display_local_addr(DisplayState *ds)

{

    VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;

    return vnc_socket_local_addr("%s:%s", vs->lsock);

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     VncServerInfo *info;

     Error *err = NULL;
+
+
+
+    info = g_malloc(sizeof(*info));
+
     info->base = g_malloc(sizeof(*info->base));

     vnc_init_basic_info_from_server_addr(vd->lsock, info->base, &err);

static VncServerInfo *vnc_server_info_get(VncDisplay *vd)

{

    VncServerInfo *info;

    Error *err = NULL;

    info = g_malloc(sizeof(*info));

    info->base = g_malloc(sizeof(*info->base));

    vnc_init_basic_info_from_server_addr(vd->lsock, info->base, &err);

    info->has_auth = true;

    info->auth = g_strdup(vnc_auth_name(vd));

    if (err) {

        qapi_free_VncServerInfo(info);

        info = NULL;

        error_free(err);

    }

    return info;

}


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

     DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;

+
+
+        if(stride == width && y+4 < height && 0){
+
             int x;

             for(x=0; x<width/2; x++)
+
+                b5[x] += 64*2;

             for(; x<width; x++)

static void spatial_compose97i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride){

    int y = cs->y;

    DWTELEM *b0= cs->b0;

    DWTELEM *b1= cs->b1;

    DWTELEM *b2= cs->b2;

    DWTELEM *b3= cs->b3;

    DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;

    DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;

        if(stride == width && y+4 < height && 0){

            int x;

            for(x=0; x<width/2; x++)

                b5[x] += 64*2;

            for(; x<width; x++)

                b5[x] += 169*2;

        }

{START_TIMER

        if(b3 <= b5) vertical_compose97iL1(b3, b4, b5, width);

        if(b2 <= b4) vertical_compose97iH1(b2, b3, b4, width);

        if(b1 <= b3) vertical_compose97iL0(b1, b2, b3, width);

        if(b0 <= b2) vertical_compose97iH0(b0, b1, b2, width);

if(width>400){

STOP_TIMER("vertical_compose97i")}}

{START_TIMER

        if(y-1>=  0) horizontal_compose97i(b0, width);

        if(b0 <= b2) horizontal_compose97i(b1, width);

if(width>400 && b0 <= b2){

STOP_TIMER("horizontal_compose97i")}}

    cs->b0=b2;

    cs->b1=b3;

    cs->b2=b4;

    cs->b3=b5;

    cs->y += 2;

}


--- a/source.c
+++ b/source.c
@@ -7,11 +7,11 @@
     CpuDefinitionInfoList **cpu_list = &cpu_list_data->list;

     CpuDefinitionInfoList *entry;
+
+    CpuDefinitionInfo *info;
+
+    char *name = g_strdup(object_class_get_name(klass));
+
     S390CPUClass *scc = S390_CPU_CLASS(klass);

static void create_cpu_model_list(ObjectClass *klass, void *opaque)

{

    struct CpuDefinitionInfoListData *cpu_list_data = opaque;

    CpuDefinitionInfoList **cpu_list = &cpu_list_data->list;

    CpuDefinitionInfoList *entry;

    CpuDefinitionInfo *info;

    char *name = g_strdup(object_class_get_name(klass));

    S390CPUClass *scc = S390_CPU_CLASS(klass);

    /* strip off the -s390-cpu */

    g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;

    info = g_new0(CpuDefinitionInfo, 1);

    info->name = name;

    info->has_migration_safe = true;

    info->migration_safe = scc->is_migration_safe;

    info->q_static = scc->is_static;

    info->q_typename = g_strdup(object_class_get_name(klass));

    /* check for unavailable features */

    if (cpu_list_data->model) {

        Object *obj;

        S390CPU *sc;

        obj = object_new(object_class_get_name(klass));

        sc = S390_CPU(obj);

        if (sc->model) {

            info->has_unavailable_features = true;

            check_unavailable_features(cpu_list_data->model, sc->model,

                                       &info->unavailable_features);

        }

        object_unref(obj);

    }

    entry = g_new0(CpuDefinitionInfoList, 1);

    entry->value = info;

    entry->next = *cpu_list;

    *cpu_list = entry;

}


main (void)

{

  struct timeval t_m = {0, 0};

  struct timezone t_z = {0, 0};

  struct timeval t_m1 = {0, 0};

  int i;

  if (gettimeofday (&t_m, &t_z) != 0)

    err ("gettimeofday");

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

    if (gettimeofday (&t_m1, NULL) != 0)

      err ("gettimeofday 1");

    else

      if (t_m1.tv_sec * 1000000 + t_m1.tv_usec

	  != (t_m.tv_sec * 1000000 + t_m.tv_usec + i * 1000))

	{

	  fprintf (stderr, "t0 (%ld, %ld), i %d, t1 (%ld, %ld)\n",

		   t_m.tv_sec, t_m.tv_usec, i, t_m1.tv_sec, t_m1.tv_usec);

	  abort ();

	}

  if (time (NULL) != t_m1.tv_sec)

    {

      fprintf (stderr, "time != gettod\n");

      abort ();

    }

  printf ("pass\n");

  exit (0);

}


static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)

{

    int32_t width = av_rescale(track->enc->sample_aspect_ratio.num, track->enc->width,

                               track->enc->sample_aspect_ratio.den);

    int64_t pos = avio_tell(pb);

    avio_wb32(pb, 0); /* size */

    ffio_wfourcc(pb, "tapt");

    avio_wb32(pb, 20);

    ffio_wfourcc(pb, "clef");

    avio_wb32(pb, 0);

    avio_wb32(pb, width << 16);

    avio_wb32(pb, track->enc->height << 16);

    avio_wb32(pb, 20);

    ffio_wfourcc(pb, "enof");

    avio_wb32(pb, 0);

    avio_wb32(pb, track->enc->width << 16);

    avio_wb32(pb, track->enc->height << 16);

    return updateSize(pb, pos);

};


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

     int i;

+    ThreadContext *c= avctx->internal->frame_thread_encoder;

void ff_frame_thread_encoder_free(AVCodecContext *avctx){

    int i;

    ThreadContext *c= avctx->internal->frame_thread_encoder;

    pthread_mutex_lock(&c->task_fifo_mutex);

    c->exit = 1;

    pthread_cond_broadcast(&c->task_fifo_cond);

    pthread_mutex_unlock(&c->task_fifo_mutex);

    for (i=0; i<avctx->thread_count; i++) {

         pthread_join(c->worker[i], NULL);

    }

    pthread_mutex_destroy(&c->task_fifo_mutex);

    pthread_mutex_destroy(&c->finished_task_mutex);

    pthread_mutex_destroy(&c->buffer_mutex);

    pthread_cond_destroy(&c->task_fifo_cond);

    pthread_cond_destroy(&c->finished_task_cond);

    av_fifo_freep(&c->task_fifo);

    av_freep(&avctx->internal->frame_thread_encoder);

}


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

 {

+    Vp3DecodeContext *s = avctx->priv_data;
+
+
+
+    av_free(s->all_fragments);

     av_free(s->coded_fragment_list);

static int vp3_decode_end(AVCodecContext *avctx)

{

    Vp3DecodeContext *s = avctx->priv_data;

    av_free(s->all_fragments);

    av_free(s->coded_fragment_list);

    av_free(s->superblock_fragments);

    av_free(s->superblock_macroblocks);

    av_free(s->macroblock_fragments);

    av_free(s->macroblock_coded);

    /* release all frames */

    avctx->release_buffer(avctx, &s->golden_frame);

    avctx->release_buffer(avctx, &s->last_frame);

    avctx->release_buffer(avctx, &s->current_frame);

    return 0;

}


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

         ppc_set_compat(cpu, cpu->max_compat, &local_err);
+
+        if (local_err) {
+
+            error_propagate(errp, local_err);
+
             return;

         }

static void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu,

                           Error **errp)

{

    CPUPPCState *env = &cpu->env;

    CPUState *cs = CPU(cpu);

    int i;

    /* Set time-base frequency to 512 MHz */

    cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ);

    /* Enable PAPR mode in TCG or KVM */

    cpu_ppc_set_papr(cpu);

    if (cpu->max_compat) {

        Error *local_err = NULL;

        ppc_set_compat(cpu, cpu->max_compat, &local_err);

        if (local_err) {

            error_propagate(errp, local_err);

            return;

        }

    }

    /* Set NUMA node for the added CPUs  */

    i = numa_get_node_for_cpu(cs->cpu_index);

    if (i < nb_numa_nodes) {

            cs->numa_node = i;

    }

    xics_cpu_setup(spapr->xics, cpu);

    qemu_register_reset(spapr_cpu_reset, cpu);

    spapr_cpu_reset(cpu);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
 static int adx_decode_init(AVCodecContext * avctx)
+
+{
+
+	ADXContext *c = avctx->priv_data;
+
+
+
+//	printf("adx_decode_init\n"); fflush(stdout);

 	c->prev[0].s1 = 0;

static int adx_decode_init(AVCodecContext * avctx)

{

	ADXContext *c = avctx->priv_data;

//	printf("adx_decode_init\n"); fflush(stdout);

	c->prev[0].s1 = 0;

	c->prev[0].s2 = 0;

	c->prev[1].s1 = 0;

	c->prev[1].s2 = 0;

	c->header_parsed = 0;

	c->in_temp = 0;

	return 0;

}


--- a/source.c
+++ b/source.c
@@ -15,7 +15,7 @@
     qs = pci_test_start();

+
     dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT);

static void pci_config(void)

{

    QVirtioPCIDevice *dev;

    QOSState *qs;

    int n_size = TEST_IMAGE_SIZE / 2;

    uint64_t capacity;

    qs = pci_test_start();

    dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT);

    capacity = qvirtio_config_readq(&dev->vdev, 0);

    g_assert_cmpint(capacity, ==, TEST_IMAGE_SIZE / 512);

    qvirtio_set_driver_ok(&dev->vdev);

    qmp_discard_response("{ 'execute': 'block_resize', "

                         " 'arguments': { 'device': 'drive0', "

                         " 'size': %d } }", n_size);

    qvirtio_wait_config_isr(&dev->vdev, QVIRTIO_BLK_TIMEOUT_US);

    capacity = qvirtio_config_readq(&dev->vdev, 0);

    g_assert_cmpint(capacity, ==, n_size / 512);

    qvirtio_pci_device_disable(dev);

    g_free(dev);

    qtest_shutdown(qs);

}


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

 {

+    const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
+
     int max_step     [4];       /* max pixel step for each plane */

+    int max_step_comp[4];       /* the component for each plane which has the max pixel step */

     int s;

int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane)

{

    const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];

    int max_step     [4];       /* max pixel step for each plane */

    int max_step_comp[4];       /* the component for each plane which has the max pixel step */

    int s;

    if (desc->flags & PIX_FMT_BITSTREAM)

        return (width * (desc->comp[0].step_minus1+1) + 7) >> 3;

    av_image_fill_max_pixsteps(max_step, max_step_comp, desc);

    s = (max_step_comp[plane] == 1 || max_step_comp[plane] == 2) ? desc->log2_chroma_w : 0;

    return max_step[plane] * (((width + (1 << s) - 1)) >> s);

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
+static void put_int16(QEMUFile *f, void *pv, size_t size)
+
 {

     int16_t *v = pv;

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

{

    int16_t *v = pv;

    qemu_put_sbe16s(f, v);

}


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

 {

+    int idx, len, thread_count;
+
+
+
+    if (!migrate_use_compression()) {

         return;

static void flush_compressed_data(QEMUFile *f)

{

    int idx, len, thread_count;

    if (!migrate_use_compression()) {

        return;

    }

    thread_count = migrate_compress_threads();

    for (idx = 0; idx < thread_count; idx++) {

        if (!comp_param[idx].done) {

            qemu_mutex_lock(comp_done_lock);

            while (!comp_param[idx].done && !quit_comp_thread) {

                qemu_cond_wait(comp_done_cond, comp_done_lock);

            }

            qemu_mutex_unlock(comp_done_lock);

        }

        if (!quit_comp_thread) {

            len = qemu_put_qemu_file(f, comp_param[idx].file);

            bytes_transferred += len;

        }

    }

}


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

                  PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);

+    for (i = PCI_CONFIG_HEADER_SIZE; i < config_size; ++i)
+
+        dev->wmask[i] = 0xff;
+
+}

static void pci_init_wmask(PCIDevice *dev)

{

    int i;

    int config_size = pci_config_size(dev);

    dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;

    dev->wmask[PCI_INTERRUPT_LINE] = 0xff;

    pci_set_word(dev->wmask + PCI_COMMAND,

                 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);

    for (i = PCI_CONFIG_HEADER_SIZE; i < config_size; ++i)

        dev->wmask[i] = 0xff;

}


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

     DWTELEM *b2= buffer + mirror(-4+1, height-1)*stride;

+    DWTELEM *b3= buffer + mirror(-4+2, height-1)*stride;
+

     for(y=-4; y<height; y+=2){
+
+        DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;
+
+        DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;

static void spatial_decompose97i(DWTELEM *buffer, int width, int height, int stride){

    int y;

    DWTELEM *b0= buffer + mirror(-4-1, height-1)*stride;

    DWTELEM *b1= buffer + mirror(-4  , height-1)*stride;

    DWTELEM *b2= buffer + mirror(-4+1, height-1)*stride;

    DWTELEM *b3= buffer + mirror(-4+2, height-1)*stride;

    for(y=-4; y<height; y+=2){

        DWTELEM *b4= buffer + mirror(y+3, height-1)*stride;

        DWTELEM *b5= buffer + mirror(y+4, height-1)*stride;

{START_TIMER

        if(b3 <= b5)     horizontal_decompose97i(b4, width);

        if(y+4 < height) horizontal_decompose97i(b5, width);

if(width>400){

STOP_TIMER("horizontal_decompose97i")

}}

{START_TIMER

        if(b3 <= b5) vertical_decompose97iH0(b3, b4, b5, width);

        if(b2 <= b4) vertical_decompose97iL0(b2, b3, b4, width);

        if(b1 <= b3) vertical_decompose97iH1(b1, b2, b3, width);

        if(b0 <= b2) vertical_decompose97iL1(b0, b1, b2, width);

if(width>400){

STOP_TIMER("vertical_decompose97i")

}}

        b0=b2;

        b1=b3;

        b2=b4;

        b3=b5;

    }

}


PPC_OP(set_T1)

{

    T1 = PARAM(1);

    RETURN();

}


--- a/source.c
+++ b/source.c
@@ -1,18 +1,18 @@
 void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable)

 {
+
+    int64_t bitmap_size;
+
+
+
+    if (enable) {

+        if (bs->dirty_tracking == 0) {
+
             int64_t i;

+            uint8_t test;

void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable)

{

    int64_t bitmap_size;

    if (enable) {

        if (bs->dirty_tracking == 0) {

            int64_t i;

            uint8_t test;

            bitmap_size = (bdrv_getlength(bs) >> BDRV_SECTOR_BITS);

            bitmap_size /= BDRV_SECTORS_PER_DIRTY_CHUNK;

            bitmap_size++;

            bs->dirty_bitmap = qemu_mallocz(bitmap_size);

            bs->dirty_tracking = enable;

            for(i = 0; i < bitmap_size; i++) test = bs->dirty_bitmap[i];

        }

    } else {

        if (bs->dirty_tracking != 0) {

            qemu_free(bs->dirty_bitmap);

            bs->dirty_tracking = enable;

        }

    }

}


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

     int ret;

+
+
+    if (!bs->drv)  {

+        return;

     }

+
+    if (!(bs->open_flags & BDRV_O_INACTIVE)) {

         return;

void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)

{

    BdrvChild *child;

    Error *local_err = NULL;

    int ret;

    if (!bs->drv)  {

        return;

    }

    if (!(bs->open_flags & BDRV_O_INACTIVE)) {

        return;

    }

    bs->open_flags &= ~BDRV_O_INACTIVE;

    if (bs->drv->bdrv_invalidate_cache) {

        bs->drv->bdrv_invalidate_cache(bs, &local_err);

        if (local_err) {

            bs->open_flags |= BDRV_O_INACTIVE;

            error_propagate(errp, local_err);

            return;

        }

    }

    QLIST_FOREACH(child, &bs->children, next) {

        bdrv_invalidate_cache(child->bs, &local_err);

        if (local_err) {

            bs->open_flags |= BDRV_O_INACTIVE;

            error_propagate(errp, local_err);

            return;

        }

    }

    ret = refresh_total_sectors(bs, bs->total_sectors);

    if (ret < 0) {

        bs->open_flags |= BDRV_O_INACTIVE;

        error_setg_errno(errp, -ret, "Could not refresh total sector count");

        return;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
+
 {

     /* Flush the whole TB as this will not have race conditions

static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)

{

    /* Flush the whole TB as this will not have race conditions

     * even if we don't have proper locking yet.

     * Ideally we would just invalidate the TBs for the

     * specified PC.

     */

    tb_flush(cpu);

}


PPC_OP(test_ctrz)

{

    T0 = (regs->ctr == 0);

    RETURN();

}


int qemu_create_pidfile(const char *filename)

{

    char buffer[128];

    int len;

    int fd;

    fd = qemu_open(filename, O_RDWR | O_CREAT, 0600);

    if (fd == -1) {

        return -1;

    }

    if (lockf(fd, F_TLOCK, 0) == -1) {

        close(fd);

        return -1;

    }

    len = snprintf(buffer, sizeof(buffer), FMT_pid "\n", getpid());

    if (write(fd, buffer, len) != len) {

        close(fd);

        return -1;

    }

    close(fd);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 uint32_t pci_default_read_config(PCIDevice *d,

+                                 uint32_t address, int len)
+
 {

     uint32_t val = 0;

uint32_t pci_default_read_config(PCIDevice *d,

                                 uint32_t address, int len)

{

    uint32_t val = 0;

    assert(len == 1 || len == 2 || len == 4);

    len = MIN(len, pci_config_size(d) - address);

    memcpy(&val, d->config + address, len);

    return le32_to_cpu(val);

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 AioContext *qemu_get_aio_context(void)

 {
+
     return qemu_aio_context;

 }

AioContext *qemu_get_aio_context(void)

{

    return qemu_aio_context;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 static TargetFdDataFunc fd_trans_host_to_target_data(int fd)

 {
+
+    if (fd < target_fd_max && target_fd_trans[fd]) {
+
         return target_fd_trans[fd]->host_to_target_data;

     }

static TargetFdDataFunc fd_trans_host_to_target_data(int fd)

{

    if (fd < target_fd_max && target_fd_trans[fd]) {

        return target_fd_trans[fd]->host_to_target_data;

    }

    return NULL;

}


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

+{

+    if (no_reboot) {

         shutdown_requested = 1;

void qemu_system_reset_request(void)

{

    if (no_reboot) {

        shutdown_requested = 1;

    } else {

        reset_requested = 1;

    }

    cpu_stop_current();

    qemu_notify_event();

}


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

     s->dpll = clk;
+
+    omap_dpll_reset(s);
+
+
+
     memory_region_add_subregion(memory, base, &s->iomem);

     return s;

static struct dpll_ctl_s  *omap_dpll_init(MemoryRegion *memory,

                           target_phys_addr_t base, omap_clk clk)

{

    struct dpll_ctl_s *s = g_malloc0(sizeof(*s));

    memory_region_init_io(&s->iomem, &omap_dpll_ops, s, "omap-dpll", 0x100);

    s->dpll = clk;

    omap_dpll_reset(s);

    memory_region_add_subregion(memory, base, &s->iomem);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -9,10 +9,10 @@
     BDRVDMGState *s = bs->opaque;

     qemu_co_mutex_lock(&s->lock);
+
+    ret = dmg_read(bs, sector_num, buf, nb_sectors);
+
+    qemu_co_mutex_unlock(&s->lock);

     return ret;

static coroutine_fn int dmg_co_read(BlockDriverState *bs, int64_t sector_num,

                                    uint8_t *buf, int nb_sectors)

{

    int ret;

    BDRVDMGState *s = bs->opaque;

    qemu_co_mutex_lock(&s->lock);

    ret = dmg_read(bs, sector_num, buf, nb_sectors);

    qemu_co_mutex_unlock(&s->lock);

    return ret;

}


--- a/source.c
+++ b/source.c
@@ -1,19 +1,19 @@
 static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,

                                                         hwaddr addr,
+
+                                                        bool resolve_subpage)
+
 {

+    MemoryRegionSection *section = atomic_read(&d->mru_section);

     subpage_t *subpage;

     bool update;

+
+
     if (section && section != &d->map.sections[PHYS_SECTION_UNASSIGNED] &&

         section_covers_addr(section, addr)) {

static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,

                                                        hwaddr addr,

                                                        bool resolve_subpage)

{

    MemoryRegionSection *section = atomic_read(&d->mru_section);

    subpage_t *subpage;

    bool update;

    if (section && section != &d->map.sections[PHYS_SECTION_UNASSIGNED] &&

        section_covers_addr(section, addr)) {

        update = false;

    } else {

        section = phys_page_find(d, addr);

        update = true;

    }

    if (resolve_subpage && section->mr->subpage) {

        subpage = container_of(section->mr, subpage_t, iomem);

        section = &d->map.sections[subpage->sub_section[SUBPAGE_IDX(addr)]];

    }

    if (update) {

        atomic_set(&d->mru_section, section);

    }

    return section;

}


static void kvm_mem_ioeventfd_add(MemoryListener *listener,

                                  MemoryRegionSection *section,

                                  bool match_data, uint64_t data,

                                  EventNotifier *e)

{

    int fd = event_notifier_get_fd(e);

    int r;

    r = kvm_set_ioeventfd_mmio(fd, section->offset_within_address_space,

                               data, true, int128_get64(section->size),

                               match_data);

    if (r < 0) {

        abort();

    }

}


void check_audio_video_inputs(int *has_video_ptr, int *has_audio_ptr)

{

    int has_video, has_audio, i, j;

    AVFormatContext *ic;

    has_video = 0;

    has_audio = 0;

    for(j=0;j<nb_input_files;j++) {

        ic = input_files[j];

        for(i=0;i<ic->nb_streams;i++) {

            AVCodecContext *enc = &ic->streams[i]->codec;

            switch(enc->codec_type) {

            case CODEC_TYPE_AUDIO:

                has_audio = 1;

                break;

            case CODEC_TYPE_VIDEO:

                has_video = 1;

                break;

            default:

                abort();

            }

        }

    }

    *has_video_ptr = has_video;

    *has_audio_ptr = has_audio;

}


--- a/source.c
+++ b/source.c
@@ -5,11 +5,11 @@
     ohci->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,

                     ohci_frame_boundary,
+
+                    ohci);
+
+
+
     if (ohci->eof_timer == NULL) {

         trace_usb_ohci_bus_eof_timer_failed(ohci->name);

static int ohci_bus_start(OHCIState *ohci)

{

    ohci->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,

                    ohci_frame_boundary,

                    ohci);

    if (ohci->eof_timer == NULL) {

        trace_usb_ohci_bus_eof_timer_failed(ohci->name);

        ohci_die(ohci);

        return 0;

    }

    trace_usb_ohci_start(ohci->name);

    ohci_sof(ohci);

    return 1;

}


--- a/source.c
+++ b/source.c
@@ -9,11 +9,11 @@
     fail_unless(opaque == NULL);

+
+    qi = qobject_to_qint(obj);
+
+    fail_unless(qi != NULL);
+
     fail_unless((qint_get_int(qi) >= 0) && (qint_get_int(qi) <= iter_max));

static void iter_func(QObject *obj, void *opaque)

{

    QInt *qi;

    fail_unless(opaque == NULL);

    qi = qobject_to_qint(obj);

    fail_unless(qi != NULL);

    fail_unless((qint_get_int(qi) >= 0) && (qint_get_int(qi) <= iter_max));

    iter_called++;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
+                     const int16_t *ubuf[2], const int16_t *vbuf[2],
+                     const int16_t *abuf0, uint8_t *dest, int dstW,
+                     int uvalpha, int y, enum PixelFormat target)
+{
+    const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
     int i;
     if (uvalpha < 2048) {
         for (i = 0; i < (dstW >> 1); i++) {

yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
                     const int16_t *ubuf[2], const int16_t *vbuf[2],
                     const int16_t *abuf0, uint8_t *dest, int dstW,
                     int uvalpha, int y, enum PixelFormat target)
{
    const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
    int i;
    if (uvalpha < 2048) {
        for (i = 0; i < (dstW >> 1); i++) {
            int Y1 = buf0[i * 2]     >> 7;
            int Y2 = buf0[i * 2 + 1] >> 7;
            int U  = ubuf0[i]        >> 7;
            int V  = vbuf0[i]        >> 7;
            output_pixels(i * 4, Y1, U, Y2, V);
        }
    } else {
        const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
        for (i = 0; i < (dstW >> 1); i++) {
            int Y1 =  buf0[i * 2]          >> 7;
            int Y2 =  buf0[i * 2 + 1]      >> 7;
            int U  = (ubuf0[i] + ubuf1[i]) >> 8;
            int V  = (vbuf0[i] + vbuf1[i]) >> 8;
            output_pixels(i * 4, Y1, U, Y2, V);
        }
    }
}


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

     return (TAILQ_FIRST(&mm->mm_mmap));

+}

static struct vm_area_struct *vma_first(const struct mm_struct *mm)

{

    return (TAILQ_FIRST(&mm->mm_mmap));

}


--- a/source.c
+++ b/source.c
@@ -39,11 +39,11 @@
         if (i == max_cpus) {

             hw_error("Fatal error while trying to get io event!\n");
+
+        }
+
+
+
         /* unmask the wanted port again */

         xc_evtchn_unmask(state->xce_handle, port);

static ioreq_t *cpu_get_ioreq(XenIOState *state)

{

    int i;

    evtchn_port_t port;

    port = xc_evtchn_pending(state->xce_handle);

    if (port == state->bufioreq_local_port) {

        timer_mod(state->buffered_io_timer,

                BUFFER_IO_MAX_DELAY + qemu_clock_get_ms(QEMU_CLOCK_REALTIME));

        return NULL;

    }

    if (port != -1) {

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

            if (state->ioreq_local_port[i] == port) {

                break;

            }

        }

        if (i == max_cpus) {

            hw_error("Fatal error while trying to get io event!\n");

        }

        /* unmask the wanted port again */

        xc_evtchn_unmask(state->xce_handle, port);

        /* get the io packet from shared memory */

        state->send_vcpu = i;

        return cpu_get_ioreq_from_shared_memory(state, i);

    }

    /* read error or read nothing */

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -1,14 +1,14 @@
+void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,

     size_t num_sg, int is_write)
+
+{
+
     unsigned int i;
+
     hwaddr len;

+

     if (num_sg > VIRTQUEUE_MAX_SIZE) {

void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,

    size_t num_sg, int is_write)

{

    unsigned int i;

    hwaddr len;

    if (num_sg > VIRTQUEUE_MAX_SIZE) {

        error_report("virtio: map attempt out of bounds: %zd > %d",

                     num_sg, VIRTQUEUE_MAX_SIZE);

        exit(1);

    }

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

        len = sg[i].iov_len;

        sg[i].iov_base = cpu_physical_memory_map(addr[i], &len, is_write);

        if (sg[i].iov_base == NULL || len != sg[i].iov_len) {

            error_report("virtio: error trying to map MMIO memory");

            exit(1);

        }

    }

}


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

 {

+    QmpOutputVisitor *qov = to_qov(v);
+
     qmp_output_pop(qov);

 }

static void qmp_output_end_struct(Visitor *v, Error **errp)

{

    QmpOutputVisitor *qov = to_qov(v);

    qmp_output_pop(qov);

}


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

      * 00 is added here to make this format compatible with

+     * domain:Bus:Slot.Func for systems without nested PCI bridges.
+
+     * Slot.Function list specifies the slot and function numbers for all
+
+     * devices on the path from root to the specific device. */

     int domain_len = strlen("DDDD:00");

static char *pcibus_get_dev_path(DeviceState *dev)

{

    PCIDevice *d = container_of(dev, PCIDevice, qdev);

    PCIDevice *t;

    int slot_depth;

    /* Path format: Domain:00:Slot.Function:Slot.Function....:Slot.Function.

     * 00 is added here to make this format compatible with

     * domain:Bus:Slot.Func for systems without nested PCI bridges.

     * Slot.Function list specifies the slot and function numbers for all

     * devices on the path from root to the specific device. */

    int domain_len = strlen("DDDD:00");

    int slot_len = strlen(":SS.F");

    int path_len;

    char *path, *p;

    /* Calculate # of slots on path between device and root. */;

    slot_depth = 0;

    for (t = d; t; t = t->bus->parent_dev) {

        ++slot_depth;

    }

    path_len = domain_len + slot_len * slot_depth;

    /* Allocate memory, fill in the terminating null byte. */

    path = malloc(path_len + 1 /* For '\0' */);

    path[path_len] = '\0';

    /* First field is the domain. */

    snprintf(path, domain_len, "%04x:00", pci_find_domain(d->bus));

    /* Fill in slot numbers. We walk up from device to root, so need to print

     * them in the reverse order, last to first. */

    p = path + path_len;

    for (t = d; t; t = t->bus->parent_dev) {

        p -= slot_len;

        snprintf(p, slot_len, ":%02x.%x", PCI_SLOT(t->devfn), PCI_FUNC(d->devfn));

    }

    return path;

}


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

     env->insns_flags &= PPC_TCG_INSNS;

+    env->insns_flags2 &= PPC_TCG_INSNS2;
+
+    return 0;
+
+}

static int ppc_fixup_cpu(PowerPCCPU *cpu)

{

    CPUPPCState *env = &cpu->env;

    /* TCG doesn't (yet) emulate some groups of instructions that

     * are implemented on some otherwise supported CPUs (e.g. VSX

     * and decimal floating point instructions on POWER7).  We

     * remove unsupported instruction groups from the cpu state's

     * instruction masks and hope the guest can cope.  For at

     * least the pseries machine, the unavailability of these

     * instructions can be advertised to the guest via the device

     * tree. */

    if ((env->insns_flags & ~PPC_TCG_INSNS)

        || (env->insns_flags2 & ~PPC_TCG_INSNS2)) {

        fprintf(stderr, "Warning: Disabling some instructions which are not "

                "emulated by TCG (0x%" PRIx64 ", 0x%" PRIx64 ")\n",

                env->insns_flags & ~PPC_TCG_INSNS,

                env->insns_flags2 & ~PPC_TCG_INSNS2);

    }

    env->insns_flags &= PPC_TCG_INSNS;

    env->insns_flags2 &= PPC_TCG_INSNS2;

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -31,11 +31,11 @@
     if(ts->size_stat_count > SIZE_STAT_THRESHOLD) {

         int newsize = 0;
+
+        if (ts->size_stat[0] > SIZE_STAT_THRESHOLD) {
+
+            newsize = TS_PACKET_SIZE;
+
         } else if (ts->size_stat[1] > SIZE_STAT_THRESHOLD) {

             newsize = TS_DVHS_PACKET_SIZE;

static void reanalyze(MpegTSContext *ts) {

    AVIOContext *pb = ts->stream->pb;

    int64_t pos = avio_tell(pb);

    if(pos < 0)

        return;

    pos += ts->raw_packet_size - ts->pos47_full;

    if (pos == TS_PACKET_SIZE) {

        ts->size_stat[0] ++;

    } else if (pos == TS_DVHS_PACKET_SIZE) {

        ts->size_stat[1] ++;

    } else if (pos == TS_FEC_PACKET_SIZE) {

        ts->size_stat[2] ++;

    }

    ts->size_stat_count ++;

    if(ts->size_stat_count > SIZE_STAT_THRESHOLD) {

        int newsize = 0;

        if (ts->size_stat[0] > SIZE_STAT_THRESHOLD) {

            newsize = TS_PACKET_SIZE;

        } else if (ts->size_stat[1] > SIZE_STAT_THRESHOLD) {

            newsize = TS_DVHS_PACKET_SIZE;

        } else if (ts->size_stat[2] > SIZE_STAT_THRESHOLD) {

            newsize = TS_FEC_PACKET_SIZE;

        }

        if (newsize) {

            av_log(ts->stream, AV_LOG_WARNING, "changing packet size to %d\n", newsize);

            ts->raw_packet_size = newsize;

        }

        ts->size_stat_count = 0;

        memset(ts->size_stat, 0, sizeof(ts->size_stat));

    }

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+static void watch_mem_write(void *opaque, hwaddr addr,
+
                             uint64_t val, unsigned size)
+
 {
+
     check_watchpoint(addr & ~TARGET_PAGE_MASK, size, BP_MEM_WRITE);
+
     switch (size) {

     case 1:

static void watch_mem_write(void *opaque, hwaddr addr,

                            uint64_t val, unsigned size)

{

    check_watchpoint(addr & ~TARGET_PAGE_MASK, size, BP_MEM_WRITE);

    switch (size) {

    case 1:

        stb_phys(&address_space_memory, addr, val);

        break;

    case 2:

        stw_phys(&address_space_memory, addr, val);

        break;

    case 4:

        stl_phys(&address_space_memory, addr, val);

        break;

    default: abort();

    }

}


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

     }

+
+
+    /* Don't overwrite ids assigned on the command line */
+
+    if (!dev->qdev.id) {

         id = vio_format_dev_name(dev);

static int spapr_vio_busdev_init(DeviceState *qdev, DeviceInfo *qinfo)

{

    VIOsPAPRDeviceInfo *info = (VIOsPAPRDeviceInfo *)qinfo;

    VIOsPAPRDevice *dev = (VIOsPAPRDevice *)qdev;

    char *id;

    int ret;

    ret = spapr_vio_check_reg(dev, info);

    if (ret) {

        return ret;

    }

    /* Don't overwrite ids assigned on the command line */

    if (!dev->qdev.id) {

        id = vio_format_dev_name(dev);

        if (!id) {

            return -1;

        }

        dev->qdev.id = id;

    }

    dev->qirq = spapr_allocate_irq(dev->vio_irq_num, &dev->vio_irq_num);

    if (!dev->qirq) {

        return -1;

    }

    rtce_init(dev);

    return info->init(dev);

}


--- a/source.c
+++ b/source.c
@@ -65,11 +65,11 @@
     for(i=0;i<5;i++)

         asm volatile ("fldl %0" : : "m" (dtab[i]));
+
+    asm volatile("ffree %st(2)");
+
+    asm volatile ("fnstenv %0\n" : : "m" (float_env32));
+
     asm volatile ("fninit");

     printf("fptag=%04x\n", float_env32.fptag);

void test_fenv(void)

{

    struct __attribute__((packed)) {

        uint16_t fpuc;

        uint16_t dummy1;

        uint16_t fpus;

        uint16_t dummy2;

        uint16_t fptag;

        uint16_t dummy3;

        uint32_t ignored[4];

        long double fpregs[8];

    } float_env32;

    struct __attribute__((packed)) {

        uint16_t fpuc;

        uint16_t fpus;

        uint16_t fptag;

        uint16_t ignored[4];

        long double fpregs[8];

    } float_env16;

    double dtab[8];

    double rtab[8];

    int i;

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

        dtab[i] = i + 1;

    TEST_ENV(&float_env16, "data16 fnstenv", "data16 fldenv");

    TEST_ENV(&float_env16, "data16 fnsave", "data16 frstor");

    TEST_ENV(&float_env32, "fnstenv", "fldenv");

    TEST_ENV(&float_env32, "fnsave", "frstor");

    /* test for ffree */

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

        asm volatile ("fldl %0" : : "m" (dtab[i]));

    asm volatile("ffree %st(2)");

    asm volatile ("fnstenv %0\n" : : "m" (float_env32));

    asm volatile ("fninit");

    printf("fptag=%04x\n", float_env32.fptag);

}


--- a/source.c
+++ b/source.c
@@ -1,12 +1,12 @@
+static av_cold int libschroedinger_decode_init(AVCodecContext *avctx)
+
+{
+
+
+
+    SchroDecoderParams *p_schro_params = avctx->priv_data;
+
+    /* First of all, initialize our supporting libraries. */

     schro_init();

static av_cold int libschroedinger_decode_init(AVCodecContext *avctx)

{

    SchroDecoderParams *p_schro_params = avctx->priv_data;

    /* First of all, initialize our supporting libraries. */

    schro_init();

    schro_debug_set_level(avctx->debug);

    p_schro_params->decoder = schro_decoder_new();

    schro_decoder_set_skip_ratio(p_schro_params->decoder, 1);

    if (!p_schro_params->decoder)

        return -1;

    /* Initialize the decoded frame queue. */

    ff_schro_queue_init(&p_schro_params->dec_frame_queue);

    return 0;

}


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

     chr = g_malloc0(sizeof(CharDriverState));
+
+    s = g_malloc0(sizeof(WinCharState));
+
+    chr->opaque = s;
+
     chr->chr_write = win_chr_write;

     chr->chr_close = win_chr_close;

static CharDriverState *qemu_chr_open_win_path(const char *filename)

{

    CharDriverState *chr;

    WinCharState *s;

    chr = g_malloc0(sizeof(CharDriverState));

    s = g_malloc0(sizeof(WinCharState));

    chr->opaque = s;

    chr->chr_write = win_chr_write;

    chr->chr_close = win_chr_close;

    if (win_chr_init(chr, filename) < 0) {

        g_free(s);

        g_free(chr);

        return NULL;

    }

    qemu_chr_be_generic_open(chr);

    return chr;

}


static int decode_pulses(Pulse *pulse, GetBitContext *gb,

                         const uint16_t *swb_offset, int num_swb)

{

    int i, pulse_swb;

    pulse->num_pulse = get_bits(gb, 2) + 1;

    pulse_swb        = get_bits(gb, 6);

    if (pulse_swb >= num_swb)

        return -1;

    pulse->pos[0]    = swb_offset[pulse_swb];

    pulse->pos[0]   += get_bits(gb, 5);

    if (pulse->pos[0] > 1023)

        return -1;

    pulse->amp[0]    = get_bits(gb, 4);

    for (i = 1; i < pulse->num_pulse; i++) {

        pulse->pos[i] = get_bits(gb, 5) + pulse->pos[i - 1];

        if (pulse->pos[i] > 1023)

            return -1;

        pulse->amp[i] = get_bits(gb, 4);

    }

    return 0;

}


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

     if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'

static int smacker_probe(AVProbeData *p)

{

    if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'

        && (p->buf[3] == '2' || p->buf[3] == '4'))

        return AVPROBE_SCORE_MAX;

    else

        return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,11 +1,11 @@
+uint64_t HELPER(neon_sub_saturate_s64)(uint64_t src1, uint64_t src2)
+
+{
+
+    uint64_t res;
+

+
     res = src1 - src2;

     if (((res ^ src1) & SIGNBIT64) && ((src1 ^ src2) & SIGNBIT64)) {

uint64_t HELPER(neon_sub_saturate_s64)(uint64_t src1, uint64_t src2)

{

    uint64_t res;

    res = src1 - src2;

    if (((res ^ src1) & SIGNBIT64) && ((src1 ^ src2) & SIGNBIT64)) {

        env->QF = 1;

        res = ((int64_t)src1 >> 63) ^ ~SIGNBIT64;

    }

    return res;

}


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

     /* does this io must wait */

+    bool must_wait = throttle_schedule_timer(&bs->throttle_state, is_write);
+
+
+
+    /* if must wait or any request of this type throttled queue the IO */

     if (must_wait ||

static void bdrv_io_limits_intercept(BlockDriverState *bs,

                                     unsigned int bytes,

                                     bool is_write)

{

    /* does this io must wait */

    bool must_wait = throttle_schedule_timer(&bs->throttle_state, is_write);

    /* if must wait or any request of this type throttled queue the IO */

    if (must_wait ||

        !qemu_co_queue_empty(&bs->throttled_reqs[is_write])) {

        qemu_co_queue_wait(&bs->throttled_reqs[is_write]);

    }

    /* the IO will be executed, do the accounting */

    throttle_account(&bs->throttle_state, is_write, bytes);

    /* if the next request must wait -> do nothing */

    if (throttle_schedule_timer(&bs->throttle_state, is_write)) {

        return;

    }

    /* else queue next request for execution */

    qemu_co_queue_next(&bs->throttled_reqs[is_write]);

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void parse_header_digest(struct iscsi_context *iscsi, const char *target)

 {

@@ -26,7 +26,7 @@

         opts = QTAILQ_FIRST(&list->head);

+        if (!opts) {

             return;

static void parse_header_digest(struct iscsi_context *iscsi, const char *target)

{

    QemuOptsList *list;

    QemuOpts *opts;

    const char *digest = NULL;

    list = qemu_find_opts("iscsi");

    if (!list) {

        return;

    }

    opts = qemu_opts_find(list, target);

    if (opts == NULL) {

        opts = QTAILQ_FIRST(&list->head);

        if (!opts) {

            return;

        }

    }

    digest = qemu_opt_get(opts, "header-digest");

    if (!digest) {

        return;

    }

    if (!strcmp(digest, "CRC32C")) {

        iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C);

    } else if (!strcmp(digest, "NONE")) {

        iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE);

    } else if (!strcmp(digest, "CRC32C-NONE")) {

        iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_CRC32C_NONE);

    } else if (!strcmp(digest, "NONE-CRC32C")) {

        iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C);

    } else {

        error_report("Invalid header-digest setting : %s", digest);

    }

}


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

     if (qdev_hotplug) {
+
         assert(bus->allow_hotplug);

     }

static void bus_add_child(BusState *bus, DeviceState *child)

{

    char name[32];

    BusChild *kid = g_malloc0(sizeof(*kid));

    if (qdev_hotplug) {

        assert(bus->allow_hotplug);

    }

    kid->index = bus->max_index++;

    kid->child = child;

    object_ref(OBJECT(kid->child));

    QTAILQ_INSERT_HEAD(&bus->children, kid, sibling);

    /* This transfers ownership of kid->child to the property.  */

    snprintf(name, sizeof(name), "child[%d]", kid->index);

    object_property_add_link(OBJECT(bus), name,

                             object_get_typename(OBJECT(child)),

                             (Object **)&kid->child,

                             NULL);

}


--- a/source.c
+++ b/source.c
@@ -4,5 +4,5 @@
     MOVFragmentIndexItem * item = &frag_index->item[frag_index->current];
     if (item->current >= 0 && item->current < item->nb_stream_info)
         return &item->stream_info[item->current];
+    // This shouldn't happen
+}

static MOVFragmentStreamInfo * get_current_frag_stream_info(
    MOVFragmentIndex *frag_index)
{
    MOVFragmentIndexItem * item = &frag_index->item[frag_index->current];
    if (item->current >= 0 && item->current < item->nb_stream_info)
        return &item->stream_info[item->current];
    // This shouldn't happen
}


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

     uint32_t tmp;

+

     switch (reg) {

static inline void write_IRQreg (openpic_t *opp, int n_IRQ,

                                 uint32_t reg, uint32_t val)

{

    uint32_t tmp;

    switch (reg) {

    case IRQ_IPVP:

        /* NOTE: not fully accurate for special IRQs, but simple and

           sufficient */

        /* ACTIVITY bit is read-only */

        opp->src[n_IRQ].ipvp =

            (opp->src[n_IRQ].ipvp & 0x40000000) |

            (val & 0x800F00FF);

        openpic_update_irq(opp, n_IRQ);

        DPRINTF("Set IPVP %d to 0x%08x -> 0x%08x\n",

                n_IRQ, val, opp->src[n_IRQ].ipvp);

        break;

    case IRQ_IDE:

        tmp = val & 0xC0000000;

        tmp |= val & ((1 << MAX_CPU) - 1);

        opp->src[n_IRQ].ide = tmp;

        DPRINTF("Set IDE %d to 0x%08x\n", n_IRQ, opp->src[n_IRQ].ide);

        break;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,27 +1,27 @@
 void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)
+
+{
+
+  union {

   	signed short tmp[8] __attribute__ ((aligned(16)));

 	vector signed short vec;

 	} buf;
+
+
+
+  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			//cy
+
+  buf.tmp[1] =  -256*brightness;					//oy
+
   buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	//crv
+
+  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	//cbu
+
+  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	//cgu
+
   buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	//cgv

void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation)

{

  union {

  	signed short tmp[8] __attribute__ ((aligned(16)));

	vector signed short vec;

	} buf;

  buf.tmp[0] =  ( (0xffffLL) * contrast>>8 )>>9;			//cy

  buf.tmp[1] =  -256*brightness;					//oy

  buf.tmp[2] =  (inv_table[0]>>3) *(contrast>>16)*(saturation>>16);	//crv

  buf.tmp[3] =  (inv_table[1]>>3) *(contrast>>16)*(saturation>>16);	//cbu

  buf.tmp[4] = -((inv_table[2]>>1)*(contrast>>16)*(saturation>>16));	//cgu

  buf.tmp[5] = -((inv_table[3]>>1)*(contrast>>16)*(saturation>>16));	//cgv

  c->CSHIFT = (vector unsigned short)vec_splat_u16(2);

  c->CY  = vec_splat ((vector signed short)buf.vec, 0);

  c->OY  = vec_splat ((vector signed short)buf.vec, 1);

  c->CRV  = vec_splat ((vector signed short)buf.vec, 2);

  c->CBU  = vec_splat ((vector signed short)buf.vec, 3);

  c->CGU  = vec_splat ((vector signed short)buf.vec, 4);

  c->CGV  = vec_splat ((vector signed short)buf.vec, 5);

#if 0

{

int i;

char *v[6]={"cy","oy","crv","cbu","cgu","cgv"};

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

  printf("%s %d ", v[i],buf.tmp[i] );

  printf("\n");

}

#endif

 return;

}


--- a/source.c
+++ b/source.c
@@ -1,4 +1,4 @@
+static void ib700_pc_init(PCIBus *unused)

 {

static void ib700_pc_init(PCIBus *unused)

{

    register_savevm("ib700_wdt", -1, 0, ib700_save, ib700_load, NULL);

    register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, NULL);

    register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, NULL);

}


--- a/source.c
+++ b/source.c
@@ -23,11 +23,11 @@
         f = &f1;

         if (url_fopen(f, filename, URL_RDONLY) < 0)
+
+            return -EIO;
+
+    } else {
+
         f = &s1->pb;

         if (url_feof(f))

static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)

{

    VideoData *s = s1->priv_data;

    char filename[1024];

    int ret;

    ByteIOContext f1, *f;

    if (!s->is_pipe) {

        if (get_frame_filename(filename, sizeof(filename),

                               s->path, s->img_number) < 0)

            return -EIO;

        f = &f1;

        if (url_fopen(f, filename, URL_RDONLY) < 0)

            return -EIO;

    } else {

        f = &s1->pb;

        if (url_feof(f))

            return -EIO;

    }

    av_new_packet(pkt, s->img_size);

    pkt->stream_index = 0;

    s->ptr = pkt->data;

    ret = av_read_image(f, filename, s->img_fmt, read_packet_alloc_cb, s);

    if (!s->is_pipe) {

        url_fclose(f);

    }

    if (ret < 0) {

        av_free_packet(pkt);

        return -EIO; /* signal EOF */

    } else {

        pkt->pts = av_rescale((int64_t)s->img_number * s1->streams[0]->codec.frame_rate_base, s1->pts_den, s1->streams[0]->codec.frame_rate) / s1->pts_num;

        s->img_number++;

        return 0;

    }

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static int configure_filtergraph(FilterGraph *fg)
+
 {

     return fg->graph_desc ? configure_complex_filter(fg) : configure_video_filters(fg);

static int configure_filtergraph(FilterGraph *fg)

{

    return fg->graph_desc ? configure_complex_filter(fg) : configure_video_filters(fg);

}


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

     dolog ("U nam writel %#x <- %#x\n", addr, val);

+    s->cas = 0;
+
+}

static void nam_writel (void *opaque, uint32_t addr, uint32_t val)

{

    PCIAC97LinkState *d = opaque;

    AC97LinkState *s = &d->ac97;

    dolog ("U nam writel %#x <- %#x\n", addr, val);

    s->cas = 0;

}


--- a/source.c
+++ b/source.c
@@ -11,11 +11,11 @@
     qemu_chr_fe_deinit(&s->chr_sec_in, false);

     qemu_chr_fe_deinit(&s->chr_out, false);
+
+
+
+    g_main_loop_quit(s->compare_loop);
+
     qemu_thread_join(&s->thread);

static void colo_compare_finalize(Object *obj)

{

    CompareState *s = COLO_COMPARE(obj);

    qemu_chr_fe_deinit(&s->chr_pri_in, false);

    qemu_chr_fe_deinit(&s->chr_sec_in, false);

    qemu_chr_fe_deinit(&s->chr_out, false);

    g_main_loop_quit(s->compare_loop);

    qemu_thread_join(&s->thread);

    /* Release all unhandled packets after compare thead exited */

    g_queue_foreach(&s->conn_list, colo_flush_packets, s);

    g_queue_clear(&s->conn_list);

    g_hash_table_destroy(s->connection_track_table);

    g_free(s->pri_indev);

    g_free(s->sec_indev);

    g_free(s->outdev);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
+static void read_sbr_single_channel_element(AACContext *ac,

+                                            SpectralBandReplication *sbr,

                                             GetBitContext *gb)

static void read_sbr_single_channel_element(AACContext *ac,

                                            SpectralBandReplication *sbr,

                                            GetBitContext *gb)

{

    if (get_bits1(gb)) // bs_data_extra

        skip_bits(gb, 4); // bs_reserved

    read_sbr_grid(ac, sbr, gb, &sbr->data[0]);

    read_sbr_dtdf(sbr, gb, &sbr->data[0]);

    read_sbr_invf(sbr, gb, &sbr->data[0]);

    read_sbr_envelope(sbr, gb, &sbr->data[0], 0);

    read_sbr_noise(sbr, gb, &sbr->data[0], 0);

    if ((sbr->data[0].bs_add_harmonic_flag = get_bits1(gb)))

        get_bits1_vector(gb, sbr->data[0].bs_add_harmonic, sbr->n[1]);

}


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

     char command[CONTROL_BUFFER_SIZE];
+
+    const int retr_codes[] = {150, 550, 0}; /* 550 is incorrect code */
+
+
+
     snprintf(command, sizeof(command), "RETR %s\r\n", s->path);

     if (ftp_send_command(s, command, retr_codes, NULL) != 150)

static int ftp_retrieve(FTPContext *s)

{

    char command[CONTROL_BUFFER_SIZE];

    const int retr_codes[] = {150, 550, 0}; /* 550 is incorrect code */

    snprintf(command, sizeof(command), "RETR %s\r\n", s->path);

    if (ftp_send_command(s, command, retr_codes, NULL) != 150)

        return AVERROR(EIO);

    s->state = DOWNLOADING;

    return 0;

}


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

             temp_load(s, ts->mem_base,

+                      tcg_target_available_regs[TCG_TYPE_PTR],
+
+                      allocated_regs);
+
+        }

         tcg_out_st(s, ts->type, reg, ts->mem_base->reg, ts->mem_offset);

static void tcg_reg_sync(TCGContext *s, TCGReg reg, TCGRegSet allocated_regs)

{

    TCGTemp *ts = s->reg_to_temp[reg];

    assert(ts->val_type == TEMP_VAL_REG);

    if (!ts->mem_coherent && !ts->fixed_reg) {

        if (!ts->mem_allocated) {

            temp_allocate_frame(s, temp_idx(s, ts));

        } else if (ts->indirect_reg) {

            tcg_regset_set_reg(allocated_regs, ts->reg);

            temp_load(s, ts->mem_base,

                      tcg_target_available_regs[TCG_TYPE_PTR],

                      allocated_regs);

        }

        tcg_out_st(s, ts->type, reg, ts->mem_base->reg, ts->mem_offset);

    }

    ts->mem_coherent = 1;

}


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

     BlockBackend *blk = child->opaque;
+

     if (blk->disable_perm) {

static int blk_root_inactivate(BdrvChild *child)

{

    BlockBackend *blk = child->opaque;

    if (blk->disable_perm) {

        return 0;

    }

    /* Only inactivate BlockBackends for guest devices (which are inactive at

     * this point because the VM is stopped) and unattached monitor-owned

     * BlockBackends. If there is still any other user like a block job, then

     * we simply can't inactivate the image. */

    if (!blk->dev && !blk->name[0]) {

        return -EPERM;

    }

    blk->disable_perm = true;

    if (blk->root) {

        bdrv_child_try_set_perm(blk->root, 0, BLK_PERM_ALL, &error_abort);

    }

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,9 +1,9 @@
 av_cold int vp56_free(AVCodecContext *avctx)
 {
     VP56Context *s = avctx->priv_data;
+    int pt;
+    av_freep(&s->qscale_table);
+    av_freep(&s->above_blocks);
     av_freep(&s->macroblocks);
     av_freep(&s->edge_emu_buffer_alloc);
     if (s->framep[VP56_FRAME_GOLDEN]->data[0])

av_cold int vp56_free(AVCodecContext *avctx)
{
    VP56Context *s = avctx->priv_data;
    int pt;
    av_freep(&s->qscale_table);
    av_freep(&s->above_blocks);
    av_freep(&s->macroblocks);
    av_freep(&s->edge_emu_buffer_alloc);
    if (s->framep[VP56_FRAME_GOLDEN]->data[0])
        avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN]);
    if (s->framep[VP56_FRAME_GOLDEN2]->data[0])
        avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN2]);
    if (s->framep[VP56_FRAME_PREVIOUS]->data[0])
        avctx->release_buffer(avctx, s->framep[VP56_FRAME_PREVIOUS]);
    return 0;


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

     memcpy(s->enabled_capabilities, enabled_capabilities,

+           sizeof(enabled_capabilities));
+
+    s->xbzrle_cache_size = xbzrle_cache_size;
+
+

     s->bandwidth_limit = bandwidth_limit;

static MigrationState *migrate_init(const MigrationParams *params)

{

    MigrationState *s = migrate_get_current();

    int64_t bandwidth_limit = s->bandwidth_limit;

    bool enabled_capabilities[MIGRATION_CAPABILITY_MAX];

    int64_t xbzrle_cache_size = s->xbzrle_cache_size;

    memcpy(enabled_capabilities, s->enabled_capabilities,

           sizeof(enabled_capabilities));

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

    s->params = *params;

    memcpy(s->enabled_capabilities, enabled_capabilities,

           sizeof(enabled_capabilities));

    s->xbzrle_cache_size = xbzrle_cache_size;

    s->bandwidth_limit = bandwidth_limit;

    s->state = MIG_STATE_SETUP;

    trace_migrate_set_state(MIG_STATE_SETUP);

    s->total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);

    return s;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void init_excp_4xx_real (CPUPPCState *env)
+
 {

 #if !defined(CONFIG_USER_ONLY)
@@ -9,11 +9,11 @@
     env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;

     env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
+
+    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
+
     env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
+
     env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;

     env->excp_vectors[POWERPC_EXCP_PIT]      = 0x00001000;

static void init_excp_4xx_real (CPUPPCState *env)

{

#if !defined(CONFIG_USER_ONLY)

    env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100;

    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;

    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;

    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;

    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;

    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;

    env->excp_vectors[POWERPC_EXCP_PIT]      = 0x00001000;

    env->excp_vectors[POWERPC_EXCP_FIT]      = 0x00001010;

    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001020;

    env->excp_vectors[POWERPC_EXCP_DEBUG]    = 0x00002000;

    env->excp_prefix = 0x00000000;

    env->ivor_mask = 0x0000FFF0;

    env->ivpr_mask = 0xFFFF0000;

    /* Hardware reset vector */

    env->hreset_vector = 0xFFFFFFFCUL;

#endif

}


--- a/source.c
+++ b/source.c
@@ -13,10 +13,10 @@
      * value into the RTC device */
     if (version_id < 3) {
         err = spapr_rtc_import_offset(&spapr->rtc, spapr->rtc_offset);
+    if (kvm_enabled() && spapr->patb_entry) {
+        PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
+        bool radix = !!(spapr->patb_entry & PATBE1_GR);
+        bool gtse = !!(cpu->env.spr[SPR_LPCR] & LPCR_GTSE);
+        err = kvmppc_configure_v3_mmu(cpu, radix, gtse, spapr->patb_entry);
             error_report("Process table config unsupported by the host");
             return -EINVAL;

static int spapr_post_load(void *opaque, int version_id)
{
    sPAPRMachineState *spapr = (sPAPRMachineState *)opaque;
    int err = 0;
    if (!object_dynamic_cast(OBJECT(spapr->ics), TYPE_ICS_KVM)) {
        CPUState *cs;
        CPU_FOREACH(cs) {
            PowerPCCPU *cpu = POWERPC_CPU(cs);
            icp_resend(ICP(cpu->intc));
    /* In earlier versions, there was no separate qdev for the PAPR
     * RTC, so the RTC offset was stored directly in sPAPREnvironment.
     * So when migrating from those versions, poke the incoming offset
     * value into the RTC device */
    if (version_id < 3) {
        err = spapr_rtc_import_offset(&spapr->rtc, spapr->rtc_offset);
    if (kvm_enabled() && spapr->patb_entry) {
        PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
        bool radix = !!(spapr->patb_entry & PATBE1_GR);
        bool gtse = !!(cpu->env.spr[SPR_LPCR] & LPCR_GTSE);
        err = kvmppc_configure_v3_mmu(cpu, radix, gtse, spapr->patb_entry);
            error_report("Process table config unsupported by the host");
            return -EINVAL;


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
+
+                                         const uint16_t *buf1, const uint16_t *ubuf0,

                                          const uint16_t *ubuf1, const uint16_t *vbuf0,

static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,

                                         const uint16_t *buf1, const uint16_t *ubuf0,

                                         const uint16_t *ubuf1, const uint16_t *vbuf0,

                                         const uint16_t *vbuf1, const uint16_t *abuf0,

                                         const uint16_t *abuf1, uint8_t *dest,

                                         int dstW, int yalpha, int uvalpha, int y)

{

    x86_reg uv_off = c->uv_off << 1;

    //Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(

    __asm__ volatile(

        "mov %%"REG_b", "ESP_OFFSET"(%5)        \n\t"

        "mov %4, %%"REG_b"                        \n\t"

        "push %%"REG_BP"                        \n\t"

        YSCALEYUV2PACKED(%%REGBP, %5, %6)

        WRITEYUY2(%%REGb, 8280(%5), %%REGBP)

        "pop %%"REG_BP"                         \n\t"

        "mov "ESP_OFFSET"(%5), %%"REG_b"        \n\t"

        :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),

           "a" (&c->redDither), "m"(uv_off)

    );

}


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

     BlkMigDevState *bmds;
+
+    BlkMigBlock *blk;
+
+
+
     bdrv_drain_all();

static void blk_mig_cleanup(void)

{

    BlkMigDevState *bmds;

    BlkMigBlock *blk;

    bdrv_drain_all();

    unset_dirty_tracking();

    blk_mig_lock();

    while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {

        QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry);

        bdrv_set_in_use(bmds->bs, 0);

        bdrv_unref(bmds->bs);

        g_free(bmds->aio_bitmap);

        g_free(bmds);

    }

    while ((blk = QSIMPLEQ_FIRST(&block_mig_state.blk_list)) != NULL) {

        QSIMPLEQ_REMOVE_HEAD(&block_mig_state.blk_list, entry);

        g_free(blk->buf);

        g_free(blk);

    }

    blk_mig_unlock();

}


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

+    if (mm_flags & AV_CPU_FLAG_MMX)
+
+        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_mmx;
+
+    if (mm_flags & AV_CPU_FLAG_MMXEXT) {

         c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmx2;

av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp)

{

#if HAVE_YASM

    int mm_flags = av_get_cpu_flags();

    if (mm_flags & AV_CPU_FLAG_MMX)

        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_mmx;

    if (mm_flags & AV_CPU_FLAG_MMXEXT) {

        c->rv34_inv_transform_dc = ff_rv34_idct_dc_noround_mmx2;

        c->rv34_idct_add         = ff_rv34_idct_add_mmx2;

    }

    if (mm_flags & AV_CPU_FLAG_SSE4)

        c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;

#endif /* HAVE_YASM */

}


static inline void mix_2f_2r_to_stereo(AC3DecodeContext *ctx)

{

    int i;

    float (*output)[256] = ctx->audio_block.block_output;

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

        output[1][i] += output[3][i];

        output[2][i] += output[4][i];

    }

    memset(output[3], 0, sizeof(output[3]));

    memset(output[4], 0, sizeof(output[4]));

}


--- a/source.c
+++ b/source.c
@@ -1,16 +1,16 @@
+static void test_qga_fstrim(gconstpointer fix)
+
+{
+
+    const TestFixture *fixture = fix;
+
+    QDict *ret;
+
+    QList *list;
+
+    const QListEntry *entry;
+
+

     ret = qmp_fd(fixture->fd, "{'execute': 'guest-fstrim',"

static void test_qga_fstrim(gconstpointer fix)

{

    const TestFixture *fixture = fix;

    QDict *ret;

    QList *list;

    const QListEntry *entry;

    ret = qmp_fd(fixture->fd, "{'execute': 'guest-fstrim',"

                 " arguments: { minimum: 4194304 } }");

    g_assert_nonnull(ret);

    qmp_assert_no_error(ret);

    list = qdict_get_qlist(ret, "return");

    entry = qlist_first(list);

    g_assert(qdict_haskey(qobject_to_qdict(entry->value), "paths"));

    QDECREF(ret);

}


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

+
+    //DPRINTF("Readw reg 0x%02x, val 0x%x\n", (int)offset, val);
+
+    return val;
+
 }

static uint32_t lan9118_readw(void *opaque, target_phys_addr_t offset)

{

    lan9118_state *s = (lan9118_state *)opaque;

    uint32_t val;

    if (s->read_word_prev_offset != (offset & ~0x3)) {

        /* New offset, reset word counter */

        s->read_word_n = 0;

        s->read_word_prev_offset = offset & ~0x3;

    }

    s->read_word_n++;

    if (s->read_word_n == 1) {

        s->read_long = lan9118_readl(s, offset & ~3, 4);

    } else {

        s->read_word_n = 0;

    }

    if (offset & 2) {

        val = s->read_long >> 16;

    } else {

        val = s->read_long & 0xFFFF;

    }

    //DPRINTF("Readw reg 0x%02x, val 0x%x\n", (int)offset, val);

    return val;

}


--- a/source.c
+++ b/source.c
@@ -13,7 +13,7 @@
     qemu_put_be32(f, 0);

+
     if (!spapr->htab) {

         int rc;

static int htab_save_complete(QEMUFile *f, void *opaque)

{

    sPAPRMachineState *spapr = opaque;

    int fd;

    /* Iteration header */

    qemu_put_be32(f, 0);

    if (!spapr->htab) {

        int rc;

        assert(kvm_enabled());

        fd = get_htab_fd(spapr);

        if (fd < 0) {

            return fd;

        }

        rc = kvmppc_save_htab(f, fd, MAX_KVM_BUF_SIZE, -1);

        if (rc < 0) {

            return rc;

        }

        close_htab_fd(spapr);

    } else {

        if (spapr->htab_first_pass) {

            htab_save_first_pass(f, spapr, -1);

        }

        htab_save_later_pass(f, spapr, -1);

    }

    /* End marker */

    qemu_put_be32(f, 0);

    qemu_put_be16(f, 0);

    qemu_put_be16(f, 0);

    return 0;

}


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

 {

+    return section->address_space == get_system_memory()
+
         && memory_region_is_ram(section->mr);

 }

static bool vhost_section(MemoryRegionSection *section)

{

    return section->address_space == get_system_memory()

        && memory_region_is_ram(section->mr);

}


--- a/source.c
+++ b/source.c
@@ -1,6 +1,6 @@
 static int parse_meter(DBEContext *s)
+
+{

     if (s->meter_size)

static int parse_meter(DBEContext *s)

{

    if (s->meter_size)

        skip_input(s, s->key_present + s->meter_size + 1);

    return 0;

}


--- a/source.c
+++ b/source.c
@@ -1,7 +1,7 @@
 static void ppc405_ocm_init(CPUPPCState *env)

 {
+
     ppc405_ocm_t *ocm;

static void ppc405_ocm_init(CPUPPCState *env)

{

    ppc405_ocm_t *ocm;

    ocm = g_malloc0(sizeof(ppc405_ocm_t));

    /* XXX: Size is 4096 or 0x04000000 */

    memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4096,

                           &error_abort);

    vmstate_register_ram_global(&ocm->isarc_ram);

    memory_region_init_alias(&ocm->dsarc_ram, NULL, "ppc405.dsarc", &ocm->isarc_ram,

                             0, 4096);

    qemu_register_reset(&ocm_reset, ocm);

    ppc_dcr_register(env, OCM0_ISARC,

                     ocm, &dcr_read_ocm, &dcr_write_ocm);

    ppc_dcr_register(env, OCM0_ISACNTL,

                     ocm, &dcr_read_ocm, &dcr_write_ocm);

    ppc_dcr_register(env, OCM0_DSARC,

                     ocm, &dcr_read_ocm, &dcr_write_ocm);

    ppc_dcr_register(env, OCM0_DSACNTL,

                     ocm, &dcr_read_ocm, &dcr_write_ocm);

}


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

     if (last && last[1].name)

+        return ++last;
+
+    return NULL;
+
 }

const AVOption *av_opt_next(void *obj, const AVOption *last)

{

    AVClass *class = *(AVClass**)obj;

    if (!last && class->option && class->option[0].name)

        return class->option;

    if (last && last[1].name)

        return ++last;

    return NULL;

}


--- a/source.c
+++ b/source.c
@@ -6,11 +6,11 @@
     /* merge list of formats */
     ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count,
                                                            b->format_count));
+    for(i = 0; i < a->format_count; i ++)
+        for(j = 0; j < b->format_count; j ++)
+            if(a->formats[i] == b->formats[j])
+                ret->formats[k++] = a->formats[i];
+    ret->format_count = k;
     /* check that there was at least one common format */
     if(!ret->format_count) {
         av_free(ret->formats);

AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
{
    AVFilterFormats *ret;
    unsigned i, j, k = 0;
    ret = av_mallocz(sizeof(AVFilterFormats));
    /* merge list of formats */
    ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count,
                                                           b->format_count));
    for(i = 0; i < a->format_count; i ++)
        for(j = 0; j < b->format_count; j ++)
            if(a->formats[i] == b->formats[j])
                ret->formats[k++] = a->formats[i];
    ret->format_count = k;
    /* check that there was at least one common format */
    if(!ret->format_count) {
        av_free(ret->formats);
        av_free(ret);
        return NULL;
    }
    ret->refs = av_malloc(sizeof(AVFilterFormats**)*(a->refcount+b->refcount));
    merge_ref(ret, a);
    merge_ref(ret, b);
    return ret;
}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     OMAPI2C *s = g_malloc0(sizeof(*s));

     I2CAdapter *i2c = (I2CAdapter *)s;
+
     uint16_t data;

I2CAdapter *omap_i2c_create(uint64_t addr)

{

    OMAPI2C *s = g_malloc0(sizeof(*s));

    I2CAdapter *i2c = (I2CAdapter *)s;

    uint16_t data;

    s->addr = addr;

    i2c->send = omap_i2c_send;

    i2c->recv = omap_i2c_recv;

    /* verify the mmio address by looking for a known signature */

    memread(addr + OMAP_I2C_REV, &data, 2);

    g_assert_cmphex(data, ==, 0x34);

    return i2c;

}


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

     const float *swindow      = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;

+    const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;

     const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;

+
     if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {

         ac->dsp.vector_fmul(in, in, lwindow_prev, 1024);

static void windowing_and_mdct_ltp(AACContext *ac, float *out,

                                   float *in, IndividualChannelStream *ics)

{

    const float *lwindow      = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;

    const float *swindow      = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;

    const float *lwindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_long_1024 : ff_sine_1024;

    const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;

    if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {

        ac->dsp.vector_fmul(in, in, lwindow_prev, 1024);

    } else {

        memset(in, 0, 448 * sizeof(float));

        ac->dsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);

        memcpy(in + 576, in + 576, 448 * sizeof(float));

    }

    if (ics->window_sequence[0] != LONG_START_SEQUENCE) {

        ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);

    } else {

        memcpy(in + 1024, in + 1024, 448 * sizeof(float));

        ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);

        memset(in + 1024 + 576, 0, 448 * sizeof(float));

    }

    ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);

}


--- a/source.c
+++ b/source.c
@@ -5,7 +5,7 @@
     ICH9LPCState *lpc = arg;

+
     /* ACPI specs 3.0, 4.7.2.5 */

     acpi_pm1_cnt_update(&lpc->pm.acpi_regs,

static void ich9_apm_ctrl_changed(uint32_t val, void *arg)

{

    ICH9LPCState *lpc = arg;

    /* ACPI specs 3.0, 4.7.2.5 */

    acpi_pm1_cnt_update(&lpc->pm.acpi_regs,

                        val == ICH9_APM_ACPI_ENABLE,

                        val == ICH9_APM_ACPI_DISABLE);

    if (val == ICH9_APM_ACPI_ENABLE || val == ICH9_APM_ACPI_DISABLE) {

        return;

    }

    /* SMI_EN = PMBASE + 30. SMI control and enable register */

    if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {

        cpu_interrupt(current_cpu, CPU_INTERRUPT_SMI);

    }

}


PPC_OP(subfme)

{

    T0 = ~T0 + xer_ca - 1;

    if (T0 != -1)

        xer_ca = 1;

    RETURN();

}


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

 	/* Load and decode. FIXME: handle endianness.  */

+	cpu_physical_memory_read (addr,
+
+				  (void *) &ctrl->channels[c].current_c,
+
+				  sizeof ctrl->channels[c].current_c);

static void channel_load_c(struct fs_dma_ctrl *ctrl, int c)

{

	target_phys_addr_t addr = channel_reg(ctrl, c, RW_GROUP_DOWN);

	/* Load and decode. FIXME: handle endianness.  */

	cpu_physical_memory_read (addr,

				  (void *) &ctrl->channels[c].current_c,

				  sizeof ctrl->channels[c].current_c);

	D(dump_c(c, &ctrl->channels[c].current_c));

	/* I guess this should update the current pos.  */

	ctrl->channels[c].regs[RW_SAVED_DATA] =

		(uint32_t)(unsigned long)ctrl->channels[c].current_c.saved_data;

	ctrl->channels[c].regs[RW_SAVED_DATA_BUF] =

		(uint32_t)(unsigned long)ctrl->channels[c].current_c.saved_data_buf;

}


--- a/source.c
+++ b/source.c
@@ -1,5 +1,5 @@
 static void hmp_info_cpustats(Monitor *mon, const QDict *qdict)
+
 {

     cpu_dump_statistics(mon_get_cpu(), (FILE *)mon, &monitor_fprintf, 0);

static void hmp_info_cpustats(Monitor *mon, const QDict *qdict)

{

    cpu_dump_statistics(mon_get_cpu(), (FILE *)mon, &monitor_fprintf, 0);

}


--- a/source.c
+++ b/source.c
@@ -1,8 +1,8 @@
+static int get_int32_le(QEMUFile *f, void *pv, size_t size)
+
+{
+
+    int32_t *cur = pv;

     int32_t loaded;

static int get_int32_le(QEMUFile *f, void *pv, size_t size)

{

    int32_t *cur = pv;

    int32_t loaded;

    qemu_get_sbe32s(f, &loaded);

    if (loaded >= 0 && loaded <= *cur) {

        *cur = loaded;

        return 0;

    }

    return -EINVAL;

}